fix: show_error for install and downgrade threads

This commit is contained in:
Vinicius Moreira
2019-08-15 12:39:55 -03:00
parent 72bcf22969
commit 4749a02e19
5 changed files with 19 additions and 6 deletions

View File

@@ -52,9 +52,6 @@ class AsyncAction(QThread, ProcessHandler):
proc.subproc.communicate()
return proc.subproc.returncode is None or proc.subproc.returncode == 0
def show_error(self, title: str, body: str):
dialog.show_error(title, body)
class UpdateSelectedApps(AsyncAction):
@@ -137,6 +134,7 @@ class UninstallApp(AsyncAction):
class DowngradeApp(AsyncAction):
signal_finished = pyqtSignal(bool)
signal_error = pyqtSignal(dict)
signal_output = pyqtSignal(str)
def __init__(self, manager: ApplicationManager, locale_keys: dict, app: ApplicationView = None):
@@ -166,6 +164,9 @@ class DowngradeApp(AsyncAction):
if msg:
self.signal_output.emit(msg)
def show_error(self, title: str, body: str):
self.signal_error.emit({'title': title, 'body': body})
class GetAppInfo(QThread):
signal_finished = pyqtSignal(dict)
@@ -226,6 +227,7 @@ class SearchApps(QThread):
class InstallApp(AsyncAction):
signal_finished = pyqtSignal(object)
signal_error = pyqtSignal(dict)
signal_output = pyqtSignal(str)
def __init__(self, manager: ApplicationManager, disk_cache: bool, icon_cache: Cache, locale_keys: dict, app: ApplicationView = None):
@@ -267,6 +269,9 @@ class InstallApp(AsyncAction):
if msg:
self.signal_output.emit(msg)
def show_error(self, title: str, body: str):
self.signal_error.emit({'title': title, 'body': body})
class AnimateProgress(QThread):