GameInfo: Add 'Modify Game' button to adjust selective downloads
This commit is contained in:
parent
d11faa5263
commit
eb48a506d2
|
@ -66,6 +66,8 @@ class InstallDialog(QDialog):
|
|||
header = self.tr("Repair and update")
|
||||
elif options.update:
|
||||
header = self.tr("Update")
|
||||
elif options.reset_sdl:
|
||||
header = self.tr("Modify")
|
||||
else:
|
||||
header = self.tr("Install")
|
||||
self.ui.install_dialog_label.setText(f'<h3>{header} "{self.rgame.app_title}"</h3>')
|
||||
|
|
|
@ -38,6 +38,7 @@ class GameInfo(QWidget, SideTabContents):
|
|||
self.ui.setupUi(self)
|
||||
# lk: set object names for CSS properties
|
||||
self.ui.install_button.setObjectName("InstallButton")
|
||||
self.ui.modify_button.setObjectName("InstallButton")
|
||||
self.ui.uninstall_button.setObjectName("UninstallButton")
|
||||
|
||||
self.rcore = RareCore.instance()
|
||||
|
@ -53,6 +54,7 @@ class GameInfo(QWidget, SideTabContents):
|
|||
|
||||
self.ui.install_button.clicked.connect(self.__on_install)
|
||||
self.ui.import_button.clicked.connect(self.__on_import)
|
||||
self.ui.modify_button.clicked.connect(self.__on_modify)
|
||||
self.ui.verify_button.clicked.connect(self.__on_verify)
|
||||
self.ui.repair_button.clicked.connect(self.__on_repair)
|
||||
self.ui.uninstall_button.clicked.connect(self.__on_uninstall)
|
||||
|
@ -97,6 +99,11 @@ class GameInfo(QWidget, SideTabContents):
|
|||
""" This method is to be called from the button only """
|
||||
self.rgame.uninstall()
|
||||
|
||||
@pyqtSlot()
|
||||
def __on_modify(self):
|
||||
""" This method is to be called from the button only """
|
||||
self.rgame.modify()
|
||||
|
||||
@pyqtSlot()
|
||||
def __on_repair(self):
|
||||
""" This method is to be called from the button only """
|
||||
|
@ -286,6 +293,10 @@ class GameInfo(QWidget, SideTabContents):
|
|||
(not self.rgame.is_installed or self.rgame.is_non_asset) and self.rgame.is_idle
|
||||
)
|
||||
|
||||
self.ui.modify_button.setEnabled(
|
||||
self.rgame.is_installed and (not self.rgame.is_non_asset) and self.rgame.is_idle
|
||||
)
|
||||
|
||||
self.ui.verify_button.setEnabled(
|
||||
self.rgame.is_installed and (not self.rgame.is_non_asset) and self.rgame.is_idle
|
||||
)
|
||||
|
|
|
@ -495,6 +495,15 @@ class RareGame(RareGameSlim):
|
|||
self.__save_metadata()
|
||||
return self.metadata.grant_date
|
||||
|
||||
def set_origin_attributes(self, path: str, size: int = 0) -> None:
|
||||
self.__origin_install_path = path
|
||||
self.__origin_install_size = size
|
||||
if self.install_path and self.install_size:
|
||||
self.signals.game.installed.emit(self.app_name)
|
||||
else:
|
||||
self.signals.game.uninstalled.emit(self.app_name)
|
||||
self.set_pixmap()
|
||||
|
||||
@property
|
||||
def can_launch(self) -> bool:
|
||||
if self.is_idle and self.is_origin:
|
||||
|
@ -528,14 +537,15 @@ class RareGame(RareGameSlim):
|
|||
)
|
||||
return True
|
||||
|
||||
def set_origin_attributes(self, path: str, size: int = 0) -> None:
|
||||
self.__origin_install_path = path
|
||||
self.__origin_install_size = size
|
||||
if self.install_path and self.install_size:
|
||||
self.signals.game.installed.emit(self.app_name)
|
||||
else:
|
||||
self.signals.game.uninstalled.emit(self.app_name)
|
||||
self.set_pixmap()
|
||||
def modify(self) -> bool:
|
||||
if not self.is_idle:
|
||||
return False
|
||||
self.signals.game.install.emit(
|
||||
InstallOptionsModel(
|
||||
app_name=self.app_name, reset_sdl=True
|
||||
)
|
||||
)
|
||||
return True
|
||||
|
||||
def repair(self, repair_and_update) -> bool:
|
||||
if not self.is_idle:
|
||||
|
|
|
@ -24,6 +24,7 @@ class InstallOptionsModel:
|
|||
repair_and_update: bool = False
|
||||
no_install: bool = False
|
||||
ignore_space: bool = False
|
||||
reset_sdl: bool = False
|
||||
skip_dlcs: bool = False
|
||||
with_dlcs: bool = False
|
||||
# Rare's internal arguments
|
||||
|
|
|
@ -14,7 +14,7 @@ from PyQt5 import QtCore, QtGui, QtWidgets
|
|||
class Ui_GameInfo(object):
|
||||
def setupUi(self, GameInfo):
|
||||
GameInfo.setObjectName("GameInfo")
|
||||
GameInfo.resize(408, 340)
|
||||
GameInfo.resize(419, 404)
|
||||
self.main_layout = QtWidgets.QHBoxLayout(GameInfo)
|
||||
self.main_layout.setObjectName("main_layout")
|
||||
self.left_layout = QtWidgets.QVBoxLayout()
|
||||
|
@ -180,6 +180,9 @@ class Ui_GameInfo(object):
|
|||
self.installed_layout = QtWidgets.QVBoxLayout(self.installed_page)
|
||||
self.installed_layout.setContentsMargins(0, 0, 0, 0)
|
||||
self.installed_layout.setObjectName("installed_layout")
|
||||
self.modify_button = QtWidgets.QPushButton(self.installed_page)
|
||||
self.modify_button.setObjectName("modify_button")
|
||||
self.installed_layout.addWidget(self.modify_button)
|
||||
self.verify_stack = QtWidgets.QStackedWidget(self.installed_page)
|
||||
self.verify_stack.setObjectName("verify_stack")
|
||||
self.verify_button_page = QtWidgets.QWidget()
|
||||
|
@ -276,7 +279,7 @@ class Ui_GameInfo(object):
|
|||
self.main_layout.setStretch(1, 1)
|
||||
|
||||
self.retranslateUi(GameInfo)
|
||||
self.game_actions_stack.setCurrentIndex(1)
|
||||
self.game_actions_stack.setCurrentIndex(0)
|
||||
self.verify_stack.setCurrentIndex(0)
|
||||
self.move_stack.setCurrentIndex(0)
|
||||
|
||||
|
@ -291,6 +294,7 @@ class Ui_GameInfo(object):
|
|||
self.lbl_install_path.setText(_translate("GameInfo", "Installation Path"))
|
||||
self.lbl_platform.setText(_translate("GameInfo", "Platform"))
|
||||
self.lbl_game_actions.setText(_translate("GameInfo", "Actions"))
|
||||
self.modify_button.setText(_translate("GameInfo", "Modify Installation"))
|
||||
self.verify_button.setText(_translate("GameInfo", "Verify Installation"))
|
||||
self.repair_button.setText(_translate("GameInfo", "Repair Installation"))
|
||||
self.move_button.setText(_translate("GameInfo", "Move Installation"))
|
||||
|
|
|
@ -6,8 +6,8 @@
|
|||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>408</width>
|
||||
<height>340</height>
|
||||
<width>419</width>
|
||||
<height>404</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
|
@ -309,7 +309,7 @@
|
|||
</size>
|
||||
</property>
|
||||
<property name="currentIndex">
|
||||
<number>1</number>
|
||||
<number>0</number>
|
||||
</property>
|
||||
<widget class="QWidget" name="installed_page">
|
||||
<layout class="QVBoxLayout" name="installed_layout">
|
||||
|
@ -325,6 +325,13 @@
|
|||
<property name="bottomMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<item>
|
||||
<widget class="QPushButton" name="modify_button">
|
||||
<property name="text">
|
||||
<string>Modify Installation</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QStackedWidget" name="verify_stack">
|
||||
<property name="currentIndex">
|
||||
|
|
Loading…
Reference in a new issue