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:
parent
d4c763296e
commit
eaed611c5f
|
@ -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)
|
||||
|
|
|
@ -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:
|
||||
|
|
Loading…
Reference in a new issue