File tree Expand file tree Collapse file tree 2 files changed +8
-8
lines changed
Expand file tree Collapse file tree 2 files changed +8
-8
lines changed Original file line number Diff line number Diff 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 ()
Original file line number Diff line number Diff line change 2121
2222
2323class 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 )
You can’t perform that action at this time.
0 commit comments