Skip to content

Commit

Permalink
move volume controller init to error handling
Browse files Browse the repository at this point in the history
  • Loading branch information
gogodr committed Aug 3, 2023
1 parent f9ed706 commit 3b5f38b
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions index.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,20 +12,17 @@
from PySide6.QtCore import Signal
from modules.app_version import get_app_version
from modules.config import Config
from modules.sound import VolumeController, playDownloadComplete, playError, playSuccess, playUpdateDetected
from modules.sound import playDownloadComplete, playError, playSuccess, playUpdateDetected
from ui.download.download import LostArkMarketLauncherDownload
from ui.login_form.login_form import LostArkMarketLoginForm


class LostArkMarketOnlineLauncher(QApplication):
message_box_handler: MessageBoxHandler
volume_controller: VolumeController
message_box = Signal(dict)

def __init__(self, *args, **kwargs):
QApplication.__init__(self, *args, **kwargs)

self.volume_controller = VolumeController()
self.message_box_handler = MessageBoxHandler(self.message_box)

self.launcher_check_config()
Expand Down Expand Up @@ -112,14 +109,16 @@ def launch_watcher(self):
if os.path.exists(f"{Config().watcher_file}.exe.new") == True:
if os.path.exists(f"{Config().watcher_file}.exe") == True:
os.system(f"del /f {Config().watcher_file}.exe")
os.system(f"rename {Config().watcher_file}.exe.new {Config().watcher_file}.exe")
os.system(
f"rename {Config().watcher_file}.exe.new {Config().watcher_file}.exe")
sleep(2)
playSuccess()
si = subprocess.STARTUPINFO()
si.dwFlags |= subprocess.STARTF_USESHOWWINDOW
subprocess.call(f"{Config().watcher_file}.exe")
sys.exit()


if __name__ == "__main__":
try:
Config()
Expand Down

0 comments on commit 3b5f38b

Please sign in to comment.