mirror of
https://github.com/spalencsar/bearhub.git
synced 2026-07-06 21:44:16 +02:00
fix: show_error for install and downgrade threads
This commit is contained in:
@@ -81,4 +81,5 @@ manage_window.upgrade_all.popup.title=Upgrade
|
||||
manage_window.upgrade_all.popup.body=Upgrade all selected applications ?
|
||||
manage_window.bt_about.tooltip=About
|
||||
warning.no_managers=There are no installed extensions. It will not be possible to intall and manage applications.
|
||||
confirmation=confirmation
|
||||
confirmation=confirmation
|
||||
and=and
|
||||
@@ -83,4 +83,5 @@ manage_window.upgrade_all.popup.title=Actualizar
|
||||
manage_window.upgrade_all.popup.body=¿Actualizar todos los aplicativos seleccionados?
|
||||
manage_window.bt_about.tooltip=Sobre
|
||||
warning.no_managers=No hay extensiones instaladas. No será posible instalar y administrar aplicaciones.
|
||||
confirmation=confirmación
|
||||
confirmation=confirmación
|
||||
and=y
|
||||
@@ -83,4 +83,5 @@ manage_window.upgrade_all.popup.title=Atualizar
|
||||
manage_window.upgrade_all.popup.body=Atualizar todos os aplicativos selecionados ?
|
||||
manage_window.bt_about.tooltip=Sobre
|
||||
warning.no_managers=Não há nenhuma extensão instalada. Não será possível instalar e gerenciar aplicações.
|
||||
confirmation=confirmação
|
||||
confirmation=confirmação
|
||||
and=e
|
||||
@@ -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):
|
||||
|
||||
|
||||
@@ -154,6 +154,7 @@ class ManageWindow(QWidget):
|
||||
self.thread_downgrade = DowngradeApp(self.manager, self.locale_keys)
|
||||
self.thread_downgrade.signal_output.connect(self._update_action_output)
|
||||
self.thread_downgrade.signal_finished.connect(self._finish_downgrade)
|
||||
self.thread_downgrade.signal_error.connect(self._show_error)
|
||||
|
||||
self.thread_get_info = GetAppInfo(self.manager)
|
||||
self.thread_get_info.signal_finished.connect(self._finish_get_info)
|
||||
@@ -166,6 +167,7 @@ class ManageWindow(QWidget):
|
||||
|
||||
self.thread_install = InstallApp(manager=self.manager, disk_cache=self.disk_cache, icon_cache=self.icon_cache, locale_keys=self.locale_keys)
|
||||
self.thread_install.signal_output.connect(self._update_action_output)
|
||||
self.thread_install.signal_error.connect(self._show_error)
|
||||
self.thread_install.signal_finished.connect(self._finish_install)
|
||||
|
||||
self.thread_animate_progress = AnimateProgress()
|
||||
@@ -217,6 +219,9 @@ class ManageWindow(QWidget):
|
||||
self.thread_warnings = ListWarnings(man=manager, locale_keys=locale_keys)
|
||||
self.thread_warnings.signal_warnings.connect(self._show_warnings)
|
||||
|
||||
def _show_error(self, msg: dict):
|
||||
dialog.show_error(title=msg['title'], body=msg['body'])
|
||||
|
||||
def _show_warnings(self, warnings: List[str]):
|
||||
if warnings:
|
||||
for warning in warnings:
|
||||
|
||||
Reference in New Issue
Block a user