diff --git a/CHANGELOG.md b/CHANGELOG.md index a9e5ed15..0e3eee29 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -45,7 +45,13 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). - cli/tray: removed some unneeded API calls when listing updates [#234](https://github.com/vinifmor/bauh/issues/234) - UI - - search: sorting packages by closest match instead of considering installed first + - search: + - sorting packages by closest match instead of considering installed first + - new "Installed" filter +

+ +

+ - upgrade summary dialog size - displaying tips for some custom actions (on mouse hover) - screenshots: displaying the current image index as a label in the button bar (e.g: 1/3) diff --git a/bauh/view/qt/commons.py b/bauh/view/qt/commons.py index 69662db2..aebc1cf5 100644 --- a/bauh/view/qt/commons.py +++ b/bauh/view/qt/commons.py @@ -61,7 +61,10 @@ def sum_updates_displayed(info: dict) -> int: def is_package_hidden(pkg: PackageView, filters: dict) -> bool: - hidden = filters['only_apps'] and pkg.model.installed and not pkg.model.is_application() + hidden = filters['only_installed'] and not pkg.model.installed + + if not hidden and filters['only_apps']: + hidden = pkg.model.installed and not pkg.model.is_application() if not hidden and filters['updates']: hidden = not pkg.model.update or pkg.model.is_update_ignored() diff --git a/bauh/view/qt/window.py b/bauh/view/qt/window.py index da1fff3d..c69a9f46 100755 --- a/bauh/view/qt/window.py +++ b/bauh/view/qt/window.py @@ -69,16 +69,17 @@ BT_INSTALLED = 2 BT_REFRESH = 3 BT_SUGGESTIONS = 4 BT_UPGRADE = 5 -CHECK_UPDATES = 6 -CHECK_APPS = 7 -COMBO_TYPES = 8 -COMBO_CATEGORIES = 9 -INP_NAME = 10 -CHECK_DETAILS = 11 -BT_SETTINGS = 12 -BT_CUSTOM_ACTIONS = 13 -BT_ABOUT = 14 -BT_THEMES = 15 +CHECK_INSTALLED = 6 +CHECK_UPDATES = 7 +CHECK_APPS = 8 +COMBO_TYPES = 9 +COMBO_CATEGORIES = 10 +INP_NAME = 11 +CHECK_DETAILS = 12 +BT_SETTINGS = 13 +BT_CUSTOM_ACTIONS = 14 +BT_ABOUT = 15 +BT_THEMES = 16 # component groups ids GROUP_FILTERS = 1 @@ -153,6 +154,16 @@ class ManageWindow(QWidget): self.toolbar_filters.layout().addWidget(self.check_updates) self.comp_manager.register_component(CHECK_UPDATES, self.check_updates) + self.check_installed = QCheckBox() + self.check_installed.setObjectName('check_installed') + self.check_installed.setCursor(QCursor(Qt.PointingHandCursor)) + self.check_installed.setText(self.i18n['manage_window.checkbox.only_installed']) + self.check_installed.setChecked(False) + self.check_installed.stateChanged.connect(self._handle_filter_only_installed) + self.check_installed.sizePolicy().setRetainSizeWhenHidden(True) + self.toolbar_filters.layout().addWidget(self.check_installed) + self.comp_manager.register_component(CHECK_INSTALLED, self.check_installed) + self.check_apps = QCheckBox() self.check_apps.setObjectName('check_apps') self.check_apps.setCursor(QCursor(Qt.PointingHandCursor)) @@ -421,6 +432,7 @@ class ManageWindow(QWidget): self.type_filter = self.any_type_filter self.category_filter = self.any_category_filter self.filter_updates = False + self.filter_installed = False self._maximized = False self.progress_controll_enabled = True self.recent_uninstall = False @@ -445,16 +457,16 @@ class ManageWindow(QWidget): self._register_groups() def _register_groups(self): - filters = (CHECK_APPS, CHECK_UPDATES, COMBO_CATEGORIES, COMBO_TYPES, INP_NAME) - self.comp_manager.register_group(GROUP_FILTERS, False, *filters) + common_filters = (CHECK_APPS, CHECK_UPDATES, COMBO_CATEGORIES, COMBO_TYPES, INP_NAME) + self.comp_manager.register_group(GROUP_FILTERS, False, CHECK_INSTALLED, *common_filters) self.comp_manager.register_group(GROUP_VIEW_SEARCH, False, COMBO_CATEGORIES, COMBO_TYPES, INP_NAME, # filters - BT_INSTALLED, BT_SUGGESTIONS) # buttons + BT_INSTALLED, BT_SUGGESTIONS, CHECK_INSTALLED) # buttons self.comp_manager.register_group(GROUP_VIEW_INSTALLED, False, BT_REFRESH, BT_UPGRADE, # buttons - *filters) + *common_filters) self.comp_manager.register_group(GROUP_UPPER_BAR, False, CHECK_APPS, CHECK_UPDATES, COMBO_CATEGORIES, COMBO_TYPES, INP_NAME, @@ -626,6 +638,10 @@ class ManageWindow(QWidget): self.filter_only_apps = status == 2 self.begin_apply_filters() + def _handle_filter_only_installed(self, status: int): + self.filter_installed = status == 2 + self.begin_apply_filters() + def _handle_type_filter(self, idx: int): self.type_filter = self.combo_filter_type.itemData(idx) self.combo_filter_type.adjustSize() @@ -906,7 +922,8 @@ class ManageWindow(QWidget): 'category': self.category_filter, 'updates': False if ignore_updates else self.filter_updates, 'name': self.input_name.text().lower() if self.input_name.text() else None, - 'display_limit': None if self.filter_updates else self.display_limit + 'display_limit': None if self.filter_updates else self.display_limit, + 'only_installed': self.filter_installed } 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: @@ -914,6 +931,9 @@ class ManageWindow(QWidget): pkgs_info = commons.new_pkgs_info() filters = self._gen_filters(ignore_updates=ignore_updates) + if not keep_filters: + self._change_checkbox(self.check_installed, False, 'filter_installed', trigger=False) + if new_pkgs is not None: old_installed = None @@ -949,6 +969,7 @@ class ManageWindow(QWidget): if not keep_filters: self._change_checkbox(self.check_apps, False, 'filter_only_apps', trigger=False) self.check_apps.setCheckable(False) + else: if not keep_filters: self.check_apps.setCheckable(True) @@ -1287,6 +1308,7 @@ class ManageWindow(QWidget): def _begin_search(self, word, action_id: int = None): self.filter_updates = False + self.filter_installed = False self._begin_action('{} {}'.format(self.i18n['manage_window.status.searching'], word if word else ''), action_id=action_id) def search(self): diff --git a/bauh/view/resources/locale/ca b/bauh/view/resources/locale/ca index a6705553..87b6267e 100644 --- a/bauh/view/resources/locale/ca +++ b/bauh/view/resources/locale/ca @@ -335,6 +335,7 @@ manage_window.bt_settings.tooltip=Feu clic aquí per mostrar la configuració manage_window.bt_themes.tip=Click here to choose a theme manage_window.bt_themes.option.invalid=Invalid manage_window.checkbox.only_apps=Aplicacions +manage_window.checkbox.only_installed=Instal·lats manage_window.checkbox.show_details=Mostra detalls manage_window.columns.installed=Installed manage_window.columns.latest_version=Versió més recent diff --git a/bauh/view/resources/locale/de b/bauh/view/resources/locale/de index b1f09a84..aac43a58 100644 --- a/bauh/view/resources/locale/de +++ b/bauh/view/resources/locale/de @@ -334,6 +334,7 @@ manage_window.bt_settings.tooltip=Einstellungen anpassen manage_window.bt_themes.tip=Click here to choose a theme manage_window.bt_themes.option.invalid=Invalid manage_window.checkbox.only_apps=Apps +manage_window.checkbox.only_installed=Installierten manage_window.checkbox.show_details=Details anzeigen manage_window.columns.installed=Installed manage_window.columns.latest_version=Neueste Version diff --git a/bauh/view/resources/locale/en b/bauh/view/resources/locale/en index 5dfcc963..bb4e9893 100644 --- a/bauh/view/resources/locale/en +++ b/bauh/view/resources/locale/en @@ -337,6 +337,7 @@ manage_window.bt_settings.tooltip=Click here to display the settings manage_window.bt_themes.tip=Click here to choose a theme manage_window.bt_themes.option.invalid=Invalid manage_window.checkbox.only_apps=Apps +manage_window.checkbox.only_installed=Installed manage_window.checkbox.show_details=Show details manage_window.columns.installed=Installed manage_window.columns.latest_version=Latest Version diff --git a/bauh/view/resources/locale/es b/bauh/view/resources/locale/es index 53cb55f9..6278a542 100644 --- a/bauh/view/resources/locale/es +++ b/bauh/view/resources/locale/es @@ -336,6 +336,7 @@ manage_window.bt_settings.tooltip=Pulse aquí para exhibir las configuraciones manage_window.bt_themes.tip=Pulse aquí para elegir un tema manage_window.bt_themes.option.invalid=Inválido manage_window.checkbox.only_apps=Aplicaciones +manage_window.checkbox.only_installed=Instalados manage_window.checkbox.show_details=Mostrar detalles manage_window.columns.installed=Instaladas manage_window.columns.latest_version=Versión más reciente diff --git a/bauh/view/resources/locale/fr b/bauh/view/resources/locale/fr index 3e59d1da..1aa701fe 100644 --- a/bauh/view/resources/locale/fr +++ b/bauh/view/resources/locale/fr @@ -333,6 +333,7 @@ manage_window.bt_settings.tooltip=Cliquez ici pour afficher les paramètres manage_window.bt_themes.tip=Click here to choose a theme manage_window.bt_themes.option.invalid=Invalid manage_window.checkbox.only_apps=Apps +manage_window.checkbox.only_installed=Installées manage_window.checkbox.show_details=Détails manage_window.columns.installed=Installé manage_window.columns.latest_version=Dernière Version diff --git a/bauh/view/resources/locale/it b/bauh/view/resources/locale/it index 9480b5db..be84a0d1 100644 --- a/bauh/view/resources/locale/it +++ b/bauh/view/resources/locale/it @@ -336,6 +336,7 @@ manage_window.bt_settings.tooltip=Fai clic qui per visualizzare le impostazioni manage_window.bt_themes.tip=Click here to choose a theme manage_window.bt_themes.option.invalid=Invalid manage_window.checkbox.only_apps=Apps +manage_window.checkbox.only_installed=Installate manage_window.checkbox.show_details=Mostra dettagli manage_window.columns.installed=Installed manage_window.columns.latest_version=Ultima Versione diff --git a/bauh/view/resources/locale/pt b/bauh/view/resources/locale/pt index 5e156621..2ff8566a 100644 --- a/bauh/view/resources/locale/pt +++ b/bauh/view/resources/locale/pt @@ -335,6 +335,7 @@ manage_window.bt_settings.tooltip=Clique aqui para exibir as configurações manage_window.bt_themes.tip=Clique aqui para escolher um tema manage_window.bt_themes.option.invalid=Inválido manage_window.checkbox.only_apps=Aplicativos +manage_window.checkbox.only_installed=Instalados manage_window.checkbox.show_details=Mostrar detalhes manage_window.columns.installed=Instalado manage_window.columns.latest_version=Última Versão diff --git a/bauh/view/resources/locale/ru b/bauh/view/resources/locale/ru index d429a3dc..d9a834e7 100644 --- a/bauh/view/resources/locale/ru +++ b/bauh/view/resources/locale/ru @@ -334,6 +334,7 @@ manage_window.bt_settings.tooltip=Нажмите здесь, чтобы отоб manage_window.bt_themes.tip=Click here to choose a theme manage_window.bt_themes.option.invalid=Invalid manage_window.checkbox.only_apps=Приложения +manage_window.checkbox.only_installed=Установленные manage_window.checkbox.show_details=Показать детали manage_window.columns.installed=Installed manage_window.columns.latest_version=Последняя версия diff --git a/bauh/view/resources/locale/tr b/bauh/view/resources/locale/tr index 1c74f674..f8e92e3a 100644 --- a/bauh/view/resources/locale/tr +++ b/bauh/view/resources/locale/tr @@ -334,6 +334,7 @@ manage_window.bt_settings.tooltip=Görünüm ayarları için burayı tıkla manage_window.bt_themes.tip=Click here to choose a theme manage_window.bt_themes.option.invalid=Invalid manage_window.checkbox.only_apps=Uygulamalar +manage_window.checkbox.only_installed=Yüklü manage_window.checkbox.show_details=Detayları göster manage_window.columns.installed=Yüklü manage_window.columns.latest_version=Son sürüm