1
0
Fork 0
mirror of synced 2024-06-26 10:11:19 +12:00

Fix uninstall bug from game_info; disable update widget on auto update

This commit is contained in:
Dummerle 2021-04-15 11:08:06 +02:00
parent 4653e519f9
commit 4f71a9f436
3 changed files with 12 additions and 3 deletions

View file

@ -28,7 +28,6 @@ def main():
if args.subparser == "launch":
file.write("launch " + args.app_name)
else:
print("write start")
file.write("start")
file.close()

View file

@ -77,6 +77,7 @@ class DownloadTab(QWidget):
widget.update.connect(self.update_game)
if QSettings().value("auto_update", False, bool):
self.update_game(igame.app_name, True)
widget.update_button.setDisabled(True)
self.updates.setLayout(self.update_layout)
self.layout.addWidget(self.updates)

View file

@ -5,8 +5,10 @@ from PyQt5.QtGui import QPixmap, QKeyEvent
from PyQt5.QtWidgets import QWidget, QPushButton, QVBoxLayout, QLabel, QHBoxLayout, QTabWidget, QMessageBox, \
QProgressBar, QStackedWidget, QGroupBox, QScrollArea
from qtawesome import icon
from rare.utils import legendary_utils
from rare import utils
from rare.components.dialogs.uninstall_dialog import UninstallDialog
from rare.components.tabs.games.game_info.game_settings import GameSettings
from rare.utils.legendary_utils import VerifyThread
from rare.utils.extra_widgets import SideTabBar
@ -47,7 +49,6 @@ class GameInfo(QScrollArea):
update_list = pyqtSignal()
verify_game = pyqtSignal(str)
verify_threads = {}
action = pyqtSignal(str)
def __init__(self, core: LegendaryCore):
super(GameInfo, self).__init__()
@ -90,7 +91,7 @@ class GameInfo(QScrollArea):
top_layout.addStretch()
self.game_actions = GameActions()
self.game_actions.uninstall_button.clicked.connect(lambda: self.action.emit("uninstall"))
self.game_actions.uninstall_button.clicked.connect(self.uninstall)
self.game_actions.verify_button.clicked.connect(self.verify)
self.game_actions.repair_button.clicked.connect(self.repair)
@ -100,6 +101,14 @@ class GameInfo(QScrollArea):
self.widget.setLayout(self.layout)
self.setWidget(self.widget)
def uninstall(self):
infos = UninstallDialog(self.game).get_information()
if infos == 0:
print("Cancel Uninstall")
return
legendary_utils.uninstall(self.game.app_name, self.core, infos)
self.update_list.emit()
def repair(self):
repair_file = os.path.join(self.core.lgd.get_tmp_path(), f'{self.game.app_name}.repair')
if not os.path.exists(repair_file):