mirror of
https://github.com/spalencsar/bearhub.git
synced 2026-07-08 15:34:15 +02:00
improvement -> reloading the manage panel in a separate thread after saving the settings
This commit is contained in:
@@ -104,10 +104,8 @@ class SettingsWindow(QWidget):
|
|||||||
self.manager.prepare(task_manager=None, root_password=None, internet_available=None)
|
self.manager.prepare(task_manager=None, root_password=None, internet_available=None)
|
||||||
|
|
||||||
if self.window and self.window.isVisible():
|
if self.window and self.window.isVisible():
|
||||||
self.window.update_custom_actions()
|
self.window.reload()
|
||||||
self.window.verify_warnings()
|
|
||||||
self.window.types_changed = True
|
|
||||||
self.window.begin_refresh_packages()
|
|
||||||
self.close()
|
self.close()
|
||||||
else:
|
else:
|
||||||
msg = StringIO()
|
msg = StringIO()
|
||||||
|
|||||||
@@ -1094,3 +1094,11 @@ class SaveTheme(QThread):
|
|||||||
configman.save_config(core_config)
|
configman.save_config(core_config)
|
||||||
except:
|
except:
|
||||||
traceback.print_exc()
|
traceback.print_exc()
|
||||||
|
|
||||||
|
|
||||||
|
class StartAsyncAction(QThread):
|
||||||
|
|
||||||
|
signal_start = pyqtSignal()
|
||||||
|
|
||||||
|
def run(self):
|
||||||
|
self.signal_start.emit()
|
||||||
|
|||||||
@@ -41,7 +41,7 @@ from bauh.view.qt.thread import UpgradeSelected, RefreshApps, UninstallPackage,
|
|||||||
ListWarnings, \
|
ListWarnings, \
|
||||||
AsyncAction, LaunchPackage, ApplyFilters, CustomSoftwareAction, ShowScreenshots, CustomAction, \
|
AsyncAction, LaunchPackage, ApplyFilters, CustomSoftwareAction, ShowScreenshots, CustomAction, \
|
||||||
NotifyInstalledLoaded, \
|
NotifyInstalledLoaded, \
|
||||||
IgnorePackageUpdates, SaveTheme
|
IgnorePackageUpdates, SaveTheme, StartAsyncAction
|
||||||
from bauh.view.qt.view_model import PackageView, PackageViewStatus
|
from bauh.view.qt.view_model import PackageView, PackageViewStatus
|
||||||
from bauh.view.util import util, resource
|
from bauh.view.util import util, resource
|
||||||
from bauh.view.util.translation import I18n
|
from bauh.view.util.translation import I18n
|
||||||
@@ -347,6 +347,9 @@ class ManageWindow(QWidget):
|
|||||||
self.thread_ignore_updates = IgnorePackageUpdates(manager=self.manager)
|
self.thread_ignore_updates = IgnorePackageUpdates(manager=self.manager)
|
||||||
self._bind_async_action(self.thread_ignore_updates, finished_call=self.finish_ignore_updates)
|
self._bind_async_action(self.thread_ignore_updates, finished_call=self.finish_ignore_updates)
|
||||||
|
|
||||||
|
self.thread_reload = StartAsyncAction()
|
||||||
|
self.thread_reload.signal_start.connect(self._reload)
|
||||||
|
|
||||||
self.container_bottom = QWidget()
|
self.container_bottom = QWidget()
|
||||||
self.container_bottom.setObjectName('container_bottom')
|
self.container_bottom.setObjectName('container_bottom')
|
||||||
self.container_bottom.setSizePolicy(QSizePolicy.Minimum, QSizePolicy.Fixed)
|
self.container_bottom.setSizePolicy(QSizePolicy.Minimum, QSizePolicy.Fixed)
|
||||||
@@ -1617,3 +1620,12 @@ class ManageWindow(QWidget):
|
|||||||
actions.sort(key=lambda a: a.get_label())
|
actions.sort(key=lambda a: a.get_label())
|
||||||
actions.insert(0, current_action)
|
actions.insert(0, current_action)
|
||||||
return actions
|
return actions
|
||||||
|
|
||||||
|
def reload(self):
|
||||||
|
self.thread_reload.start()
|
||||||
|
|
||||||
|
def _reload(self):
|
||||||
|
self.update_custom_actions()
|
||||||
|
self.verify_warnings()
|
||||||
|
self.types_changed = True
|
||||||
|
self.begin_refresh_packages()
|
||||||
|
|||||||
Reference in New Issue
Block a user