mirror of
https://github.com/LorenEteval/Furious.git
synced 2026-09-22 23:08:08 +03:00
Add administrator restart support on macOS
Note: 1. some shortcuts are not working 2. copy & paste not working, clipboard may not be useable Signed-off-by: Loren Eteval <loren.eteval@proton.me>
This commit is contained in:
@@ -232,7 +232,11 @@ class GuiTUNSettings(GuiEditorWidgetQDialog):
|
||||
super().__init__(*args, tabTranslatable=tabTranslatable, style=style, **kwargs)
|
||||
|
||||
self.setTabText(_('Customize TUN Settings'))
|
||||
self.setFixedSize(int(480 * GOLDEN_RATIO), int(480))
|
||||
|
||||
if PLATFORM == 'Darwin':
|
||||
self.setFixedSize(int(550 * GOLDEN_RATIO), int(550))
|
||||
else:
|
||||
self.setFixedSize(int(480 * GOLDEN_RATIO), int(480))
|
||||
|
||||
# Shallow copy
|
||||
config = Storage.UserTUNSettings()
|
||||
|
||||
@@ -238,19 +238,6 @@ class AppMainWindow(AppQMainWindow):
|
||||
),
|
||||
]
|
||||
|
||||
if PLATFORM == 'Darwin':
|
||||
openAppFolderAction = []
|
||||
else:
|
||||
openAppFolderAction = [
|
||||
AppQAction(
|
||||
_('Open Application Folder'),
|
||||
icon=bootstrapIcon('folder2.svg'),
|
||||
checkable=False,
|
||||
callback=lambda: self.openApplicationFolder(),
|
||||
),
|
||||
AppQSeperator(),
|
||||
]
|
||||
|
||||
if PLATFORM == 'Windows' or PLATFORM == 'Darwin':
|
||||
customizeTUNSettingsAction = [
|
||||
AppQAction(
|
||||
@@ -281,6 +268,21 @@ class AppMainWindow(AppQMainWindow):
|
||||
else:
|
||||
restartAsAdminAction = []
|
||||
|
||||
if PLATFORM == 'Darwin':
|
||||
openAppFolderAction = [
|
||||
AppQSeperator(),
|
||||
]
|
||||
else:
|
||||
openAppFolderAction = [
|
||||
AppQAction(
|
||||
_('Open Application Folder'),
|
||||
icon=bootstrapIcon('folder2.svg'),
|
||||
checkable=False,
|
||||
callback=lambda: self.openApplicationFolder(),
|
||||
),
|
||||
AppQSeperator(),
|
||||
]
|
||||
|
||||
toolsActions = [
|
||||
*customizeTUNSettingsAction,
|
||||
*restartAsAdminAction,
|
||||
@@ -503,6 +505,15 @@ class AppMainWindow(AppQMainWindow):
|
||||
f'\'{AppCommands.RunAs.value}\' -Verb runAs',
|
||||
],
|
||||
)
|
||||
elif PLATFORM == 'Darwin':
|
||||
process.startDetached(
|
||||
'osascript',
|
||||
arguments=[
|
||||
'-e',
|
||||
f'do shell script \"{APP().applicationFilePath()} '
|
||||
f'{AppCommands.RunAs.value}\" with administrator privileges',
|
||||
],
|
||||
)
|
||||
else:
|
||||
mbox = AppQMessageBox(icon=AppQMessageBox.Icon.Information)
|
||||
mbox.setWindowTitle(_(APPLICATION_NAME))
|
||||
|
||||
Reference in New Issue
Block a user