1
0
Fork 0
mirror of synced 2024-06-29 11:40:37 +12:00
Rare/rare/models/signals.py
loathingKernel 4063195b4d DownloadsTab: Refactor downloads tab
When updates are queued, they are removed from the update's list. An exceptions is made
when the queued item comes from repairing (without updating), in which case the update is
disabled for the runtime.

A queued item can be either removed (if it is an update it will be added back to the
updates groups) or forced to be updated now. If a queued item is forced, the currently
running item will be added to the front of the queue. Downloads will be queued if
there is no active download but there is a queue already.

The download thread is now responsible for emitting the progress to `RareGame`

InstallDialog: Pass `RareGame` and `InstallOptionsModel` only as arguments.
The `update`, `repair` and `silent` arguments are already part of `InstallOptionsModel`
`RareGame` is used to query information about the game.

InstallInfoWorker: Pass only `InstallOptionsModel` as argument
Emit `InstallQueueItemModel` as result, to re-use the worker when queuing stopped games

RareGame: Query and store metadata property about entitlement grant date
RareGame: Add `RareEosOverlay` class that imitates `RareGame` to handle the overlay

LibraryWidgetController: Remove dead signal routing code, these signals are handled by `RareGame`
Directly parent library widgets instead of reparenting them

GameWidgets: Remove unused signals

EOSGroup: Set install location based on preferences and use EOSOverlayApp from legendary

GamesTab: Connect the `progress` signals of dlcs to the base game's signals
GamesTab: Remove dead code

GlobalSignals: Remove `ProgresSignals`

RareCore: Mangle internal signleton's names

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

56 lines
1.5 KiB
Python

from PyQt5.QtCore import QObject, pyqtSignal
from .install import InstallOptionsModel
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)
# 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