1
0
Fork 0
mirror of synced 2024-06-29 11:40:37 +12:00
Rare/rare/models/signals.py
loathingKernel fc7e45a43a UninstallDialog: Implement it to work similarly to InstallDialog
Similarly to the installation procedure, when an uninstall is
requested, an `UninstallOptionsModel` is emitted by the `RareGame`.
`DownloadsTab` handles the signal and spawns the `UninstallDialog`.
After the `UninstallDialog` is closed, a worker thread handles
uninstalling the application to avoid UI lock-ups when a large
number of files is deleted.

Allows for uninstall actions to be spawned from anything having
access to the `RareGame` instance.

LaunchDialog: Don't check health on DLCs, they always will require
verification if they don't specify an executable.

Signed-off-by: loathingKernel <142770+loathingKernel@users.noreply.github.com>
2023-02-04 17:38:07 +02:00

57 lines
1.6 KiB
Python

from PyQt5.QtCore import QObject, pyqtSignal
from .install import InstallOptionsModel, UninstallOptionsModel
class GlobalSignals:
# 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()
# none
update_tray = pyqtSignal()
class GameSignals(QObject):
install = pyqtSignal(InstallOptionsModel)
uninstall = pyqtSignal(UninstallOptionsModel)
# str: app_name
installed = pyqtSignal(str)
# str: app_name
uninstalled = pyqtSignal(str)
class DownloadSignals(QObject):
# str: app_name
enqueue = pyqtSignal(str)
# str: app_name
dequeue = pyqtSignal(str)
class DiscordRPCSignals(QObject):
# str: app_title
set_title = pyqtSignal(str)
# none
apply_settings = pyqtSignal()
def __init__(self):
self.application = GlobalSignals.ApplicationSignals()
self.game = GlobalSignals.GameSignals()
self.download = GlobalSignals.DownloadSignals()
self.discord_rpc = GlobalSignals.DiscordRPCSignals()
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