mirror of
https://github.com/spalencsar/bearhub.git
synced 2026-07-09 02:54:16 +02:00
auto-showing the details when history or downgrading fails
This commit is contained in:
@@ -81,7 +81,7 @@ class UninstallApp(QThread):
|
|||||||
|
|
||||||
|
|
||||||
class DowngradeApp(QThread):
|
class DowngradeApp(QThread):
|
||||||
signal_finished = pyqtSignal()
|
signal_finished = pyqtSignal(bool)
|
||||||
signal_output = pyqtSignal(str)
|
signal_output = pyqtSignal(str)
|
||||||
|
|
||||||
def __init__(self, manager: ApplicationManager, locale_keys: dict, app: ApplicationView = None):
|
def __init__(self, manager: ApplicationManager, locale_keys: dict, app: ApplicationView = None):
|
||||||
@@ -94,6 +94,7 @@ class DowngradeApp(QThread):
|
|||||||
def run(self):
|
def run(self):
|
||||||
if self.app:
|
if self.app:
|
||||||
|
|
||||||
|
success = True
|
||||||
try:
|
try:
|
||||||
stream = self.manager.downgrade_app(self.app.model, self.root_password)
|
stream = self.manager.downgrade_app(self.app.model, self.root_password)
|
||||||
|
|
||||||
@@ -106,11 +107,12 @@ class DowngradeApp(QThread):
|
|||||||
if line:
|
if line:
|
||||||
self.signal_output.emit(line)
|
self.signal_output.emit(line)
|
||||||
except (requests.exceptions.ConnectionError, NoInternetException):
|
except (requests.exceptions.ConnectionError, NoInternetException):
|
||||||
|
success = False
|
||||||
self.signal_output.emit(self.locale_keys['internet.required'])
|
self.signal_output.emit(self.locale_keys['internet.required'])
|
||||||
finally:
|
finally:
|
||||||
self.app = None
|
self.app = None
|
||||||
self.root_password = None
|
self.root_password = None
|
||||||
self.signal_finished.emit()
|
self.signal_finished.emit(success)
|
||||||
|
|
||||||
|
|
||||||
class GetAppInfo(QThread):
|
class GetAppInfo(QThread):
|
||||||
|
|||||||
@@ -260,10 +260,14 @@ class ManageWindow(QWidget):
|
|||||||
self._release_lock()
|
self._release_lock()
|
||||||
self.refresh()
|
self.refresh()
|
||||||
|
|
||||||
def _finish_downgrade(self):
|
def _finish_downgrade(self, success: bool):
|
||||||
self.finish_action()
|
self.finish_action()
|
||||||
self._release_lock()
|
self._release_lock()
|
||||||
self.refresh()
|
|
||||||
|
if success:
|
||||||
|
self.refresh()
|
||||||
|
else:
|
||||||
|
self.checkbox_console.setChecked(True)
|
||||||
|
|
||||||
def filter_only_apps(self, only_apps: int):
|
def filter_only_apps(self, only_apps: int):
|
||||||
|
|
||||||
@@ -454,6 +458,7 @@ class ManageWindow(QWidget):
|
|||||||
if app.get('error'):
|
if app.get('error'):
|
||||||
self._handle_console_option(True)
|
self._handle_console_option(True)
|
||||||
self.textarea_output.appendPlainText(app['error'])
|
self.textarea_output.appendPlainText(app['error'])
|
||||||
|
self.checkbox_console.setChecked(True)
|
||||||
else:
|
else:
|
||||||
dialog_history = HistoryDialog(app, self.table_apps.get_selected_app_icon(), self.locale_keys)
|
dialog_history = HistoryDialog(app, self.table_apps.get_selected_app_icon(), self.locale_keys)
|
||||||
dialog_history.exec_()
|
dialog_history.exec_()
|
||||||
|
|||||||
Reference in New Issue
Block a user