mirror of
https://github.com/spalencsar/bearhub.git
synced 2026-07-07 17:34:14 +02:00
Merge branch 'staging' into modules
# Conflicts: # fpakman/core/controller.py # fpakman/util/memory.py
This commit is contained in:
@@ -346,4 +346,18 @@ class FindSuggestions(AsyncAction):
|
||||
|
||||
def run(self):
|
||||
self.signal_finished.emit(self.man.list_suggestions(limit=-1))
|
||||
|
||||
|
||||
|
||||
class ListWarnings(QThread):
|
||||
|
||||
signal_warnings = pyqtSignal(list)
|
||||
|
||||
def __init__(self, man: ApplicationManager, locale_keys: dict):
|
||||
super(QThread, self).__init__()
|
||||
self.locale_keys = locale_keys
|
||||
self.man = man
|
||||
|
||||
def run(self):
|
||||
warnings = self.man.list_warnings()
|
||||
if warnings:
|
||||
self.signal_warnings.emit(warnings)
|
||||
|
||||
@@ -19,7 +19,7 @@ from fpakman.view.qt.history import HistoryDialog
|
||||
from fpakman.view.qt.info import InfoDialog
|
||||
from fpakman.view.qt.root import is_root, ask_root_password
|
||||
from fpakman.view.qt.thread import UpdateSelectedApps, RefreshApps, UninstallApp, DowngradeApp, GetAppInfo, \
|
||||
GetAppHistory, SearchApps, InstallApp, AnimateProgress, VerifyModels, RefreshApp, FindSuggestions
|
||||
GetAppHistory, SearchApps, InstallApp, AnimateProgress, VerifyModels, RefreshApp, FindSuggestions, ListWarnings
|
||||
from fpakman.view.qt.view_model import ApplicationView
|
||||
|
||||
DARK_ORANGE = '#FF4500'
|
||||
@@ -214,6 +214,19 @@ class ManageWindow(QWidget):
|
||||
self.dialog_about = None
|
||||
self.first_refresh = suggestions
|
||||
|
||||
self.thread_warnings = ListWarnings(man=manager, locale_keys=locale_keys)
|
||||
self.thread_warnings.signal_warnings.connect(self._show_warnings)
|
||||
|
||||
def _show_warnings(self, warnings: List[str]):
|
||||
if warnings:
|
||||
for warning in warnings:
|
||||
dialog.show_warning(title=self.locale_keys['warning'].capitalize(), body=warning)
|
||||
|
||||
def show(self):
|
||||
super(ManageWindow, self).show()
|
||||
if not self.thread_warnings.isFinished():
|
||||
self.thread_warnings.start()
|
||||
|
||||
def _show_about(self):
|
||||
if self.dialog_about is None:
|
||||
self.dialog_about = AboutDialog(self.locale_keys)
|
||||
|
||||
Reference in New Issue
Block a user