1
0
Fork 0
mirror of synced 2024-06-02 02:34:40 +12:00

GameDlcWidget: Respond to update signal

Using the update signal we can enable and disable the install/uninstall
button by querying the state of the RareGame
This commit is contained in:
loathingKernel 2023-05-29 14:32:30 +03:00
parent d4c763296e
commit eaed611c5f
No known key found for this signature in database
GPG key ID: CE0C72D0B53821FD
2 changed files with 11 additions and 1 deletions

View file

@ -31,6 +31,13 @@ class GameDlcWidget(QFrame):
self.image.setPixmap(rdlc.pixmap)
self.__update()
rdlc.signals.widget.update.connect(self.__update)
@pyqtSlot()
def __update(self):
self.ui.action_button.setEnabled(self.rdlc.is_idle)
class InstalledGameDlcWidget(GameDlcWidget):
uninstalled = pyqtSignal(RareGame)

View file

@ -530,12 +530,15 @@ class RareGame(RareGameSlim):
self.signals.game.uninstalled.emit(self.app_name)
self.set_pixmap()
def repair(self, repair_and_update):
def repair(self, repair_and_update) -> bool:
if not self.is_idle:
return False
self.signals.game.install.emit(
InstallOptionsModel(
app_name=self.app_name, repair_mode=True, repair_and_update=repair_and_update, update=repair_and_update
)
)
return True
def uninstall(self) -> bool:
if not self.is_idle: