Downloads: Code clarity
This commit is contained in:
parent
f2c575e082
commit
083094bcfc
|
@ -102,7 +102,7 @@ class DownloadsTab(QWidget):
|
||||||
|
|
||||||
@pyqtSlot(str)
|
@pyqtSlot(str)
|
||||||
@pyqtSlot(RareGame)
|
@pyqtSlot(RareGame)
|
||||||
def __add_update(self, update: Union[str,RareGame]):
|
def __add_update(self, update: Union[str, RareGame]):
|
||||||
if isinstance(update, str):
|
if isinstance(update, str):
|
||||||
update = self.rcore.get_game(update)
|
update = self.rcore.get_game(update)
|
||||||
if update.metadata.auto_update or QSettings().value("auto_update", False, bool):
|
if update.metadata.auto_update or QSettings().value("auto_update", False, bool):
|
||||||
|
@ -192,12 +192,12 @@ class DownloadsTab(QWidget):
|
||||||
if item.expired:
|
if item.expired:
|
||||||
self.__refresh_download(item)
|
self.__refresh_download(item)
|
||||||
return
|
return
|
||||||
thread = DlThread(item, self.rcore.get_game(item.options.app_name), self.core, self.args.debug)
|
dl_thread = DlThread(item, self.rcore.get_game(item.options.app_name), self.core, self.args.debug)
|
||||||
thread.result.connect(self.__on_download_result)
|
dl_thread.result.connect(self.__on_download_result)
|
||||||
thread.progress.connect(self.__on_download_progress)
|
dl_thread.progress.connect(self.__on_download_progress)
|
||||||
thread.finished.connect(thread.deleteLater)
|
dl_thread.finished.connect(dl_thread.deleteLater)
|
||||||
thread.start()
|
dl_thread.start()
|
||||||
self.__thread = thread
|
self.__thread = dl_thread
|
||||||
self.download_widget.ui.kill_button.setDisabled(False)
|
self.download_widget.ui.kill_button.setDisabled(False)
|
||||||
self.download_widget.ui.dl_name.setText(item.download.game.app_title)
|
self.download_widget.ui.dl_name.setText(item.download.game.app_title)
|
||||||
self.download_widget.setPixmap(
|
self.download_widget.setPixmap(
|
||||||
|
|
|
@ -5,8 +5,8 @@ from typing import Optional
|
||||||
@dataclass
|
@dataclass
|
||||||
class UIUpdate:
|
class UIUpdate:
|
||||||
"""
|
"""
|
||||||
Status update object sent from the manager to the CLI/GUI to update status indicators
|
Status update object sent from the manager to the CLI/GUI to update status indicators
|
||||||
Inheritance doesn't work due to optional arguments in UIUpdate proper
|
Inheritance doesn't work due to optional arguments in UIUpdate proper
|
||||||
"""
|
"""
|
||||||
progress: float
|
progress: float
|
||||||
download_speed: float
|
download_speed: float
|
||||||
|
|
Loading…
Reference in a new issue