mirror of
https://github.com/relativemodder/aegnux.git
synced 2025-12-10 21:49:39 +05:00
file and protocol handling made more safe
This commit is contained in:
11
src/app.py
11
src/app.py
@@ -12,6 +12,15 @@ def main():
|
|||||||
app.setWindowIcon(QIcon(AE_ICON_PATH))
|
app.setWindowIcon(QIcon(AE_ICON_PATH))
|
||||||
|
|
||||||
mainWindow = MainWindow()
|
mainWindow = MainWindow()
|
||||||
mainWindow.show()
|
|
||||||
|
show_window = True
|
||||||
|
|
||||||
|
for arg in sys.argv:
|
||||||
|
if 'misterhorsepm://' in arg or '.aep' in arg:
|
||||||
|
show_window = False
|
||||||
|
break
|
||||||
|
|
||||||
|
if show_window:
|
||||||
|
mainWindow.show()
|
||||||
|
|
||||||
return app.exec()
|
return app.exec()
|
||||||
@@ -106,7 +106,6 @@ class MainWindow(MainWindowUI):
|
|||||||
self.run_mhtb_thread.finished_signal.connect(self._finished)
|
self.run_mhtb_thread.finished_signal.connect(self._finished)
|
||||||
|
|
||||||
self.run_mhtb_thread.start()
|
self.run_mhtb_thread.start()
|
||||||
exit(0)
|
|
||||||
|
|
||||||
def try_autoopen_aep(self):
|
def try_autoopen_aep(self):
|
||||||
self.run_ae_thread.clear_aep_file_arg()
|
self.run_ae_thread.clear_aep_file_arg()
|
||||||
@@ -127,7 +126,6 @@ class MainWindow(MainWindowUI):
|
|||||||
|
|
||||||
self.run_ae_thread.add_aep_file_arg(aep_file)
|
self.run_ae_thread.add_aep_file_arg(aep_file)
|
||||||
self.run_ae_button_clicked()
|
self.run_ae_button_clicked()
|
||||||
exit(0)
|
|
||||||
|
|
||||||
def init_installation(self):
|
def init_installation(self):
|
||||||
if check_aegnux_installed():
|
if check_aegnux_installed():
|
||||||
@@ -189,6 +187,12 @@ class MainWindow(MainWindowUI):
|
|||||||
|
|
||||||
@Slot(bool)
|
@Slot(bool)
|
||||||
def _finished(self, success: bool):
|
def _finished(self, success: bool):
|
||||||
|
if self.ran_from_mhtb_link:
|
||||||
|
exit(0)
|
||||||
|
|
||||||
|
if self.ran_from_aep_file:
|
||||||
|
exit(0)
|
||||||
|
|
||||||
self.lock_ui(False)
|
self.lock_ui(False)
|
||||||
self.progress_bar.hide()
|
self.progress_bar.hide()
|
||||||
self.init_installation()
|
self.init_installation()
|
||||||
|
|||||||
Reference in New Issue
Block a user