diff --git a/CHANGELOG.md b/CHANGELOG.md index 2cf07167..958a5f20 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -38,6 +38,12 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). - the index is now stored at **~/.cache/bauh/arch/aur/index.txt**. - info window - date fields format changed to numbers (e.g: Thu Dec 17 17:19:55 2020 -> 2020-12-17 17:19:55) +- Core + - new settings property **boot.load_apps** (General -> Load apps after startup) that allows the user to choose if the installed packages/suggestions should be loaded on the management panel after the initialization process. Default: true. +

+ +

+ - Web - now the environment settings are cached for 24 hours. This period can be controlled through the new settings property **environment.update_interval** (in minutes -> default: 1440 = 24 hours. Use **0** so that they are always updated).

diff --git a/README.md b/README.md index fe2da841..694d96a8 100644 --- a/README.md +++ b/README.md @@ -342,6 +342,8 @@ backup: upgrade: null # defines if the backup should be performed before upgrading a package. Allowed values: null (a dialog will be displayed asking if a snapshot should be generated), true: generates the backup without asking. false: disables the backup for this operation downgrade: null # defines if the backup should be performed before downgrading a package. Allowed values: null (a dialog will be displayed asking if a snapshot should be generated), true: generates the backup without asking. false: disables the backup for this operation type: rsync # defines the Timeshift backup mode -> 'rsync' (default) or 'btrfs' +boot: + load_apps: true # if the installed applications or suggestions should be loaded on the management panel after the initialization process. Default: true. ``` #### Tray icons Priority: diff --git a/bauh/manage.py b/bauh/manage.py index 2e6a8f37..2e7f3370 100644 --- a/bauh/manage.py +++ b/bauh/manage.py @@ -71,7 +71,8 @@ def new_manage_panel(app_args: Namespace, app_config: dict, logger: logging.Logg context=context, manager=manager, i18n=i18n, - manage_window=manage_window) + manage_window=manage_window, + app_config=app_config) cache_cleaner.start() return app, prepare diff --git a/bauh/view/core/config.py b/bauh/view/core/config.py index a93a8fce..ce6fe43f 100644 --- a/bauh/view/core/config.py +++ b/bauh/view/core/config.py @@ -64,6 +64,9 @@ def read_config(update_file: bool = False) -> dict: 'upgrade': None, 'mode': 'incremental', 'type': 'rsync' + }, + 'boot': { + 'load_apps': True } } diff --git a/bauh/view/core/settings.py b/bauh/view/core/settings.py index 24558c45..99a196fd 100644 --- a/bauh/view/core/settings.py +++ b/bauh/view/core/settings.py @@ -291,6 +291,12 @@ class GenericSettingsManager: max_width=default_width, id_="sys_notify") + select_load_apps = self._gen_bool_component(label=self.i18n['core.config.boot.load_apps'], + tooltip=self.i18n['core.config.boot.load_apps.tip'], + value=bool(core_config['boot']['load_apps']), + id_='boot.load_apps', + max_width=default_width) + select_sugs = self._gen_bool_component(label=self.i18n['core.config.suggestions.activated'].capitalize(), tooltip=self.i18n['core.config.suggestions.activated.tip'].capitalize(), id_="sugs_enabled", @@ -312,7 +318,7 @@ class GenericSettingsManager: opts=[(self.i18n['ask'].capitalize(), True, None), (self.i18n['no'].capitalize(), False, None)]) - sub_comps = [FormComponent([select_locale, select_store_pwd, select_sysnotify, select_sugs, inp_sugs, inp_reboot], spaces=False)] + sub_comps = [FormComponent([select_locale, select_store_pwd, select_sysnotify, select_load_apps, select_sugs, inp_sugs, inp_reboot], spaces=False)] return TabComponent(self.i18n['core.config.tab.general'].capitalize(), PanelComponent(sub_comps), None, 'core.gen') def _gen_bool_component(self, label: str, tooltip: str, value: bool, id_: str, max_width: int = 200) -> SingleSelectComponent: @@ -352,6 +358,7 @@ class GenericSettingsManager: core_config['suggestions']['by_type'] = sugs_by_type core_config['updates']['ask_for_reboot'] = general_form.get_component('ask_for_reboot').get_selected() + core_config['boot']['load_apps'] = general_form.get_component('boot.load_apps').get_selected() # advanced adv_form = advanced.components[0] diff --git a/bauh/view/qt/prepare.py b/bauh/view/qt/prepare.py index 752bcd46..9df7d1fa 100644 --- a/bauh/view/qt/prepare.py +++ b/bauh/view/qt/prepare.py @@ -116,10 +116,12 @@ class PreparePanel(QWidget, TaskManager): signal_status = pyqtSignal(int) signal_password_response = pyqtSignal(bool, str) - def __init__(self, context: ApplicationContext, manager: SoftwareManager, screen_size: QSize, i18n: I18n, manage_window: QWidget): + def __init__(self, context: ApplicationContext, manager: SoftwareManager, screen_size: QSize, + i18n: I18n, manage_window: QWidget, app_config: dict): super(PreparePanel, self).__init__(flags=Qt.CustomizeWindowHint | Qt.WindowTitleHint) self.i18n = i18n self.context = context + self.app_config = app_config self.manage_window = manage_window self.setWindowTitle('{} ({})'.format(__app_name__, self.i18n['prepare_panel.title.start'].lower())) self.setMinimumWidth(screen_size.width() * 0.5) @@ -406,6 +408,11 @@ class PreparePanel(QWidget, TaskManager): def finish(self): if self.isVisible(): self.manage_window.show() - self.manage_window.begin_refresh_packages() + + if self.app_config['boot']['load_apps']: + self.manage_window.begin_refresh_packages() + else: + self.manage_window.load_without_packages() + self.self_close = True self.close() diff --git a/bauh/view/qt/window.py b/bauh/view/qt/window.py index 6bd7bdc1..bbad74e2 100755 --- a/bauh/view/qt/window.py +++ b/bauh/view/qt/window.py @@ -103,6 +103,7 @@ class ManageWindow(QWidget): self.logger = logger self.manager = manager self.working = False # restrict the number of threaded actions + self.installed_loaded = False # used to control the state when the interface is set to not load the apps on startup self.pkgs = [] # packages current loaded in the table self.pkgs_available = [] # all packages loaded in memory self.pkgs_installed = [] # cached installed packages @@ -572,14 +573,18 @@ class ManageWindow(QWidget): self.thread_warnings.start() def _begin_loading_installed(self): - self.search_bar.clear() - self.input_name.set_text('') - self._begin_action(self.i18n['manage_window.status.installed']) - self._handle_console_option(False) - self.comp_manager.set_components_visible(False) - self.suggestions_requested = False - self.search_performed = False - self.thread_load_installed.start() + if self.installed_loaded: + self.search_bar.clear() + self.input_name.set_text('') + self._begin_action(self.i18n['manage_window.status.installed']) + self._handle_console_option(False) + self.comp_manager.set_components_visible(False) + self.suggestions_requested = False + self.search_performed = False + self.thread_load_installed.start() + else: + self.load_suggestions = False + self.begin_refresh_packages() def _finish_loading_installed(self): self._finish_action() @@ -668,7 +673,7 @@ class ManageWindow(QWidget): self.check_details.setChecked(False) self.textarea_details.hide() - def begin_refresh_packages(self, pkg_types: Set[Type[SoftwarePackage]] = None): + def begin_refresh_packages(self, pkg_types: Optional[Set[Type[SoftwarePackage]]] = None): self.search_bar.clear() self._begin_action(self.i18n['manage_window.status.refreshing']) @@ -699,6 +704,11 @@ class ManageWindow(QWidget): self.load_suggestions = False self.types_changed = False + def load_without_packages(self): + self.load_suggestions = False + self._handle_console_option(False) + self._finish_refresh_packages({'installed': None, 'types': None}, as_installed=False) + def _begin_load_suggestions(self, filter_installed: bool): self.search_bar.clear() self._begin_action(self.i18n['manage_window.status.suggestions']) @@ -887,7 +897,7 @@ class ManageWindow(QWidget): 'display_limit': None if self.filter_updates else self.display_limit } - def update_pkgs(self, new_pkgs: List[SoftwarePackage], as_installed: bool, types: Set[type] = None, ignore_updates: bool = False, keep_filters: bool = False) -> bool: + def update_pkgs(self, new_pkgs: Optional[List[SoftwarePackage]], as_installed: bool, types: Optional[Set[type]] = None, ignore_updates: bool = False, keep_filters: bool = False) -> bool: self.input_name.set_text('') pkgs_info = commons.new_pkgs_info() filters = self._gen_filters(ignore_updates=ignore_updates) @@ -958,6 +968,9 @@ class ManageWindow(QWidget): qt_utils.centralize(self) self.first_refresh = False + if not self.installed_loaded and as_installed: + self.installed_loaded = True + return True def _apply_filters(self, pkgs_info: dict, ignore_updates: bool): diff --git a/bauh/view/resources/locale/ca b/bauh/view/resources/locale/ca index 95cedbf2..58036e65 100644 --- a/bauh/view/resources/locale/ca +++ b/bauh/view/resources/locale/ca @@ -192,6 +192,8 @@ core.config.backup.mode.only_one=Single core.config.backup.mode.only_one.tip=Only one system backup will be kept. Pre-existing backups will be erased. core.config.backup.uninstall=Before uninstalling core.config.backup.upgrade=Before upgrading +core.config.boot.load_apps=Load apps after startup +core.config.boot.load_apps.tip=If the installed applications or suggestions should be loaded on the management panel after the initialization process core.config.download.icons=Download icons core.config.download.icons.tip=If the application icons should be downloaded and displayed on the table core.config.download.multithreaded=Multithreaded download diff --git a/bauh/view/resources/locale/de b/bauh/view/resources/locale/de index e2ab4873..f442b008 100644 --- a/bauh/view/resources/locale/de +++ b/bauh/view/resources/locale/de @@ -191,6 +191,8 @@ core.config.backup.mode.only_one=Single core.config.backup.mode.only_one.tip=Only one system backup will be kept. Pre-existing backups will be erased. core.config.backup.uninstall=Before uninstalling core.config.backup.upgrade=Before upgrading +core.config.boot.load_apps=Load apps after startup +core.config.boot.load_apps.tip=If the installed applications or suggestions should be loaded on the management panel after the initialization process core.config.download.icons=Download Icons core.config.download.icons.tip=Falls aktiviert werden die Anwendungs-Icons in der Tabelle angezeigt core.config.download.multithreaded=Paralleler Download diff --git a/bauh/view/resources/locale/en b/bauh/view/resources/locale/en index 62d01c3d..e394c0ab 100644 --- a/bauh/view/resources/locale/en +++ b/bauh/view/resources/locale/en @@ -191,6 +191,8 @@ core.config.backup.mode=Mode core.config.backup.uninstall=Before uninstalling core.config.backup.upgrade=Before upgrading core.config.backup=Enabled +core.config.boot.load_apps=Load apps after startup +core.config.boot.load_apps.tip=If the installed applications or suggestions should be loaded on the management panel after the initialization process core.config.download.icons.tip=If the application icons should be downloaded and displayed on the table core.config.download.icons=Download icons core.config.download.multithreaded=Multi-threaded download diff --git a/bauh/view/resources/locale/es b/bauh/view/resources/locale/es index 242d5a9c..9373f9b2 100644 --- a/bauh/view/resources/locale/es +++ b/bauh/view/resources/locale/es @@ -192,6 +192,8 @@ core.config.backup.mode.only_one=Única core.config.backup.mode.only_one.tip=Solo se guardará una copia de seguridad del sistema. Las copias preexistentes serán borradas. core.config.backup.uninstall=Antes de desinstalar core.config.backup.upgrade=Antes de actualizar +core.config.boot.load_apps=Cargar aplicaciones al inicio +core.config.boot.load_apps.tip= Si las aplicaciones instaladas o sugerencias deben ser cargadas en el panel de administración después del proceso de inicialización core.config.download.icons=Descargar iconos core.config.download.icons.tip=Si los íconos de las aplicaciones se deben descargar y mostrar en la tabla core.config.download.multithreaded=Descarga segmentada diff --git a/bauh/view/resources/locale/fr b/bauh/view/resources/locale/fr index 696ccd27..c0804139 100644 --- a/bauh/view/resources/locale/fr +++ b/bauh/view/resources/locale/fr @@ -191,6 +191,8 @@ core.config.backup.mode=Mode core.config.backup.uninstall=Avant de désinstaller core.config.backup.upgrade=Avant de mettre à jour core.config.backup=Activé +core.config.boot.load_apps=Load apps after startup +core.config.boot.load_apps.tip=If the installed applications or suggestions should be loaded on the management panel after the initialization process core.config.download.icons.tip=Si les icônes de l'application devraient être téléchargées et affichées sur le tableau core.config.download.icons=Télécharger les icônes core.config.download.multithreaded=Téléchargement parallèles diff --git a/bauh/view/resources/locale/it b/bauh/view/resources/locale/it index 915ba01e..f0f7c67f 100644 --- a/bauh/view/resources/locale/it +++ b/bauh/view/resources/locale/it @@ -191,6 +191,8 @@ core.config.backup.mode.only_one=Single core.config.backup.mode.only_one.tip=Only one system backup will be kept. Pre-existing backups will be erased. core.config.backup.uninstall=Before uninstalling core.config.backup.upgrade=Before upgrading +core.config.boot.load_apps=Load apps after startup +core.config.boot.load_apps.tip=If the installed applications or suggestions should be loaded on the management panel after the initialization process core.config.download.icons=Download icons core.config.download.icons.tip=If the application icons should be downloaded and displayed on the table core.config.download.multithreaded=Multithreaded download diff --git a/bauh/view/resources/locale/pt b/bauh/view/resources/locale/pt index 20d85e8b..d0678e90 100644 --- a/bauh/view/resources/locale/pt +++ b/bauh/view/resources/locale/pt @@ -191,6 +191,8 @@ core.config.backup.mode=Modo core.config.backup.uninstall=Antes de desinstalar core.config.backup.upgrade=Antes de atualizar core.config.backup=Habilitada +core.config.boot.load_apps=Carregar aplicativos após iniciar +core.config.boot.load_apps.tip=Se os aplicativos instalados ou sugestões devem ser carregados no painel de gerenciamento após a inicialização. core.config.download.icons.tip=Se os ícones dos aplicativos devem ser baixados e exibidos na tabela core.config.download.icons=Baixar ícones core.config.download.multithreaded.tip=Se os aplicativos, pacotes e arquivos devem ser baixados através de uma ferramenta que trabalha com segmentação / threads (pode ser mais rápido). diff --git a/bauh/view/resources/locale/ru b/bauh/view/resources/locale/ru index 7d52e122..5b12090b 100644 --- a/bauh/view/resources/locale/ru +++ b/bauh/view/resources/locale/ru @@ -191,6 +191,8 @@ core.config.backup.mode.only_one=Single core.config.backup.mode.only_one.tip=Only one system backup will be kept. Pre-existing backups will be erased. core.config.backup.uninstall=Before uninstalling core.config.backup.upgrade=Before upgrading +core.config.boot.load_apps=Load apps after startup +core.config.boot.load_apps.tip=If the installed applications or suggestions should be loaded on the management panel after the initialization process core.config.download.icons=Скачать иконки core.config.download.icons.tip=Загружать иконки приложения для отображаения на рабочем столе core.config.download.multithreaded=Многопоточная загрузка diff --git a/bauh/view/resources/locale/tr b/bauh/view/resources/locale/tr index 606dab71..22f5471b 100644 --- a/bauh/view/resources/locale/tr +++ b/bauh/view/resources/locale/tr @@ -191,6 +191,8 @@ core.config.backup.mode=Mod core.config.backup.uninstall=Önce kaldırılıyor core.config.backup.upgrade=Önce yükseltiliyor core.config.backup=Etkin +core.config.boot.load_apps=Load apps after startup +core.config.boot.load_apps.tip=If the installed applications or suggestions should be loaded on the management panel after the initialization process core.config.download.icons.tip=Tabloda görüntüleniyorsa uygulama simgeleri indirilmeli core.config.download.icons=Simgeleri indir core.config.download.multithreaded.tip=Uygulamaların, paketlerin ve dosyaların iş parçacıklarıyla (daha hızlı) çalışan bir araçla indirilip indirilmeyeceği.