2022-06-19 06:45:36 +12:00
|
|
|
from PyQt5.QtCore import QObject, pyqtSignal
|
|
|
|
|
2023-01-25 23:59:00 +13:00
|
|
|
from .install import InstallOptionsModel, UninstallOptionsModel
|
2022-06-19 06:45:36 +12:00
|
|
|
|
|
|
|
|
2022-12-29 06:55:15 +13:00
|
|
|
class GlobalSignals:
|
2022-06-19 06:45:36 +12:00
|
|
|
|
2022-12-29 06:55:15 +13:00
|
|
|
# set_main_tab_index = pyqtSignal(int) # tab index
|
|
|
|
# update_gamelist = pyqtSignal(list)
|
|
|
|
|
|
|
|
class ApplicationSignals(QObject):
|
|
|
|
# int: exit code
|
|
|
|
quit = pyqtSignal(int)
|
|
|
|
# str: app_title
|
|
|
|
notify = pyqtSignal(str)
|
|
|
|
# none
|
|
|
|
prefix_updated = pyqtSignal()
|
|
|
|
# none
|
|
|
|
overlay_installed = pyqtSignal()
|
2023-01-11 09:31:10 +13:00
|
|
|
# none
|
|
|
|
update_tray = pyqtSignal()
|
2023-02-01 02:43:26 +13:00
|
|
|
# none
|
|
|
|
update_statusbar = pyqtSignal()
|
2022-06-19 06:45:36 +12:00
|
|
|
|
2022-12-25 15:21:23 +13:00
|
|
|
class GameSignals(QObject):
|
2023-01-27 15:11:10 +13:00
|
|
|
# model
|
2022-12-25 15:21:23 +13:00
|
|
|
install = pyqtSignal(InstallOptionsModel)
|
|
|
|
# str: app_name
|
2023-01-21 13:15:06 +13:00
|
|
|
installed = pyqtSignal(str)
|
2023-01-27 15:11:10 +13:00
|
|
|
# model
|
|
|
|
uninstall = pyqtSignal(UninstallOptionsModel)
|
2022-12-25 15:21:23 +13:00
|
|
|
# str: app_name
|
2023-01-21 13:15:06 +13:00
|
|
|
uninstalled = pyqtSignal(str)
|
2022-12-25 15:21:23 +13:00
|
|
|
|
|
|
|
class DownloadSignals(QObject):
|
|
|
|
# str: app_name
|
2023-01-21 13:15:06 +13:00
|
|
|
enqueue = pyqtSignal(str)
|
|
|
|
# str: app_name
|
|
|
|
dequeue = pyqtSignal(str)
|
2022-06-19 06:45:36 +12:00
|
|
|
|
2022-12-29 06:55:15 +13:00
|
|
|
class DiscordRPCSignals(QObject):
|
|
|
|
# str: app_title
|
|
|
|
set_title = pyqtSignal(str)
|
|
|
|
# none
|
|
|
|
apply_settings = pyqtSignal()
|
2022-06-19 06:45:36 +12:00
|
|
|
|
2022-12-29 06:55:15 +13:00
|
|
|
def __init__(self):
|
|
|
|
self.application = GlobalSignals.ApplicationSignals()
|
|
|
|
self.game = GlobalSignals.GameSignals()
|
|
|
|
self.download = GlobalSignals.DownloadSignals()
|
|
|
|
self.discord_rpc = GlobalSignals.DiscordRPCSignals()
|
2022-06-19 06:45:36 +12:00
|
|
|
|
2022-12-29 06:55:15 +13:00
|
|
|
def deleteLater(self):
|
|
|
|
self.application.deleteLater()
|
|
|
|
del self.application
|
|
|
|
self.game.deleteLater()
|
|
|
|
del self.game
|
|
|
|
self.download.deleteLater()
|
|
|
|
del self.download
|
|
|
|
self.discord_rpc.deleteLater()
|
|
|
|
del self.discord_rpc
|