1
0
Fork 0
mirror of synced 2024-06-02 18:54:41 +12:00

Fix wrong connected signal in sync_widget.py

This commit is contained in:
Dummerle 2021-10-18 00:20:41 +02:00
parent 803347b935
commit e994100182
No known key found for this signature in database
GPG key ID: AB68CC59CA39F2F1
3 changed files with 8 additions and 10 deletions

View file

@ -83,7 +83,7 @@ class SyncSaves(QScrollArea):
if not game.supports_cloud_saves:
continue
if latest_save.get(igame.app_name):
sync_widget = SyncWidget(igame, latest_save[igame.app_name], self.core)
sync_widget = SyncWidget(igame, latest_save[igame.app_name])
else:
continue
sync_widget.reload.connect(self.reload)

View file

@ -6,6 +6,7 @@ from PyQt5.QtWidgets import QVBoxLayout, QPushButton, QHBoxLayout, QLabel, QGrou
from legendary.core import LegendaryCore
from legendary.models.game import InstalledGame, SaveGameStatus
from rare import shared
from rare.components.dialogs.path_input_dialog import PathInputDialog
logger = getLogger("Sync")
@ -58,13 +59,13 @@ class _DownloadThread(QThread):
class SyncWidget(QGroupBox):
reload = pyqtSignal(str)
def __init__(self, igame: InstalledGame, save, core: LegendaryCore):
def __init__(self, igame: InstalledGame, save):
super(SyncWidget, self).__init__(igame.title)
self.setObjectName("group")
self.layout = QVBoxLayout()
self.setContentsMargins(10, 20, 10, 20)
self.thr = None
self.core = core
self.core = shared.core
self.save = save
self.logger = getLogger("Sync " + igame.app_name)
self.game = self.core.get_game(igame.app_name)
@ -195,10 +196,10 @@ class SyncWidget(QGroupBox):
self.upload_button.setDisabled(True)
self.download_button.setDisabled(True)
self.thr = _UploadThread(self.igame.app_name, self.dt_local, self.igame.save_path, self.core)
self.thr.finished.connect(self.uploaded)
self.thr.signal.connect(self.uploaded)
self.thr.start()
def uploaded(self, success):
def uploaded(self, success: bool):
if success:
self.info_text.setText(self.tr("Upload finished"))
@ -218,7 +219,7 @@ class SyncWidget(QGroupBox):
self.thr.signal.connect(self.downloaded)
self.thr.start()
def downloaded(self, success):
def downloaded(self, success: bool):
if success:
self.info_text.setText(self.tr("Download finished"))
self.upload_button.setDisabled(True)

View file

@ -121,11 +121,8 @@ class DownloadTab(QWidget):
self.signals.installation_started.emit(self.active_game)
def status(self, text):
if text == "dl_finished":
pass
elif text == "finish":
if text == "finish":
self.installing_game.setText(self.tr("Download finished. Reload library"))
# QMessageBox.information(self, "Info", "Download finished")
logger.info("Download finished: " + self.active_game.app_title)
game = self.active_game