[view] feature: new parameter '--suggestions' to force loading software suggestions after the initialization process

This commit is contained in:
Vinicius Moreira
2022-05-20 11:36:47 -03:00
parent cefab90052
commit 62a1c4fa3b
8 changed files with 36 additions and 14 deletions

View File

@@ -146,7 +146,7 @@ class PreparePanel(QWidget, TaskManager):
signal_password_response = pyqtSignal(bool, str)
def __init__(self, context: ApplicationContext, manager: SoftwareManager, screen_size: QSize,
i18n: I18n, manage_window: QWidget, app_config: dict):
i18n: I18n, manage_window: QWidget, app_config: dict, force_suggestions: bool = False):
super(PreparePanel, self).__init__(flags=Qt.CustomizeWindowHint | Qt.WindowTitleHint)
self.i18n = i18n
self.context = context
@@ -165,6 +165,7 @@ class PreparePanel(QWidget, TaskManager):
self.ftasks = 0
self.started_at = None
self.self_close = False
self.force_suggestions = force_suggestions
self.prepare_thread = Prepare(self.context, manager, self.i18n)
self.prepare_thread.signal_register.connect(self.register_task)
@@ -438,7 +439,9 @@ class PreparePanel(QWidget, TaskManager):
if self.isVisible():
self.manage_window.show()
if self.app_config['boot']['load_apps']:
if self.force_suggestions:
self.manage_window.begin_load_suggestions(filter_installed=True)
elif self.app_config['boot']['load_apps']:
self.manage_window.begin_refresh_packages()
else:
self.manage_window.load_without_packages()