Skip to content

Commit aed4143

Browse files
bugfix
1 parent e05e9e5 commit aed4143

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

src/app.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,16 @@ def main():
1111
app.setDesktopFileName(DESKTOP_FILE_NAME)
1212
app.setWindowIcon(QIcon(AE_ICON_PATH))
1313

14-
mainWindow = MainWindow()
15-
1614
show_window = True
15+
quit_after_handling_args = False
1716

1817
for arg in sys.argv:
1918
if 'misterhorsepm://' in arg or '.aep' in arg:
2019
show_window = False
20+
quit_after_handling_args = True
2121
break
22+
23+
mainWindow = MainWindow(quit_after_handling_args)
2224

2325
if show_window:
2426
mainWindow.show()

src/mainwindow.py

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,12 @@
2121

2222

2323
class MainWindow(MainWindowUI):
24-
def __init__(self):
24+
def __init__(self, quit_after_handling_args: bool = False):
2525
super().__init__()
2626

2727
self.ran_from_aep_file = False
2828
self.ran_from_mhtb_link = False
29+
self.quit_after_handling_args = quit_after_handling_args
2930

3031
self.setWindowTitle(gls('welcome_win_title'))
3132
self.install_button.clicked.connect(self.install_button_clicked)
@@ -99,7 +100,7 @@ def try_autoopen_mhtb(self):
99100
gls('mhtb_not_found_title'),
100101
gls('mhtb_not_found_text')
101102
)
102-
return
103+
exit(0)
103104

104105
self.run_mhtb_thread = RunExeThread([f'{mhtb_dir.as_posix()}/ProductManager.exe', mhtb_link])
105106
self.run_mhtb_thread.log_signal.connect(self._log)
@@ -187,10 +188,7 @@ def toggle_logs(self):
187188

188189
@Slot(bool)
189190
def _finished(self, success: bool):
190-
if self.ran_from_mhtb_link:
191-
exit(0)
192-
193-
if self.ran_from_aep_file:
191+
if self.quit_after_handling_args:
194192
exit(0)
195193

196194
self.lock_ui(False)

0 commit comments

Comments
 (0)