From 1a8d37dfe6d5a7f6b73148363bde8c4f90c3b2b0 Mon Sep 17 00:00:00 2001 From: Vinicius Moreira Date: Tue, 29 Oct 2019 11:19:25 -0300 Subject: [PATCH 01/17] [snap] The application crashes due to Snap API checking when snap is not installed | improved snapd not enabled warning --- CHANGELOG.md | 4 ++++ bauh/gems/snap/controller.py | 19 ++++++++++--------- bauh/gems/snap/resources/locale/en | 2 +- bauh/gems/snap/resources/locale/es | 2 +- bauh/gems/snap/resources/locale/pt | 2 +- 5 files changed, 17 insertions(+), 12 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 266c6266..39ead74c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,10 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). +## [0.7.2] +### Fixes: + - The application crashes due to Snap API checking when snap is not installed + ## [0.7.1] 2019-10-25 ### Features - Snap: diff --git a/bauh/gems/snap/controller.py b/bauh/gems/snap/controller.py index 7ce13691..fb453a3f 100644 --- a/bauh/gems/snap/controller.py +++ b/bauh/gems/snap/controller.py @@ -197,17 +197,18 @@ class SnapManager(SoftwareManager): pass def list_warnings(self, internet_available: bool) -> List[str]: - if snap.is_installed() and not snap.is_snapd_running(): - snap_bold = bold('Snap') - return [self.i18n['snap.notification.snapd_unavailable'].format(bold('snapd'), snap_bold), - self.i18n['snap.notification.snap.disable'].format(snap_bold, bold(self.i18n['manage_window.settings.gems']))] + if snap.is_installed(): + if not snap.is_snapd_running(): + snap_bold = bold('Snap') + return [self.i18n['snap.notification.snapd_unavailable'].format(bold('snapd'), snap_bold), + self.i18n['snap.notification.snap.disable'].format(snap_bold, bold(self.i18n['manage_window.settings.gems']))] - if internet_available: - available, output = snap.is_api_available() + elif internet_available: + available, output = snap.is_api_available() - if not available: - self.logger.warning('It seems Snap API is not available. Search output: {}'.format(output)) - return [self.i18n['snap.notifications.api.unavailable'].format(bold('Snaps'), bold('Snap'))] + if not available: + self.logger.warning('It seems Snap API is not available. Search output: {}'.format(output)) + return [self.i18n['snap.notifications.api.unavailable'].format(bold('Snaps'), bold('Snap'))] def _fill_suggestion(self, pkg_name: str, priority: SuggestionPriority, out: List[PackageSuggestion]): res = self.http_client.get_json(SNAP_API_URL + '/search?q=package_name:{}'.format(pkg_name)) diff --git a/bauh/gems/snap/resources/locale/en b/bauh/gems/snap/resources/locale/en index cfe914b8..36f39134 100644 --- a/bauh/gems/snap/resources/locale/en +++ b/bauh/gems/snap/resources/locale/en @@ -1,5 +1,5 @@ gem.snap.info=Applications published at https://snapcraft.io/store -snap.notification.snapd_unavailable={} seems not to be installed or enabled. {} packages will not be available. +snap.notification.snapd_unavailable={} seems not to be started or enabled. {} packages will not be available. snap.notification.snap.disable=If you do not want to use Snap applications, uncheck {} in {} snap.notifications.api.unavailable=It seems the {} API is unavailable at the moment. It will not be possible to search for new {} applications. snap.action.refresh.status=Refreshing diff --git a/bauh/gems/snap/resources/locale/es b/bauh/gems/snap/resources/locale/es index 030edd69..4b17ee5a 100644 --- a/bauh/gems/snap/resources/locale/es +++ b/bauh/gems/snap/resources/locale/es @@ -10,7 +10,7 @@ snap.info.installed=instalado snap.info.publisher=publicador snap.info.version=versión snap.info.size=tamaño -snap.notification.snapd_unavailable={} no parece estar instalado o habilitado. Los paquetes {} estarán indisponibles. +snap.notification.snapd_unavailable={} parece no estar inicializado o habilitado. Los paquetes {} estarán indisponibles. snap.notification.snap.disable=Si no desea usar aplicativos Snap, desmarque {} en {} snap.notifications.api.unavailable=Parece que la API de {} no está disponible en este momento. No será posible buscar nuevos aplicativos {}. snap.action.refresh.status=Actualizando diff --git a/bauh/gems/snap/resources/locale/pt b/bauh/gems/snap/resources/locale/pt index d705e1f3..1d72fe63 100644 --- a/bauh/gems/snap/resources/locale/pt +++ b/bauh/gems/snap/resources/locale/pt @@ -10,7 +10,7 @@ snap.info.installed=instalado snap.info.publisher=publicador snap.info.version=versão snap.info.size=tamanho -snap.notification.snapd_unavailable={} não parece estar instalado ou habilitado. Os pacotes {} estarão indisponíveis. +snap.notification.snapd_unavailable={} parece não estar inicializado ou habilitado. Os pacotes {} estarão indisponíveis. snap.notification.snap.disable=Se não deseja usar aplicativos Snap, desmarque {} em {} snap.notifications.api.unavailable=Parece que a API de {} está indisponível no momento. Não será possível buscar novos aplicativos {}. snap.action.refresh.status=Atualizando From ce358e615dba8950ea2968ba7648de8f4a7d74b8 Mon Sep 17 00:00:00 2001 From: Vinicius Moreira Date: Tue, 29 Oct 2019 11:20:21 -0300 Subject: [PATCH 02/17] [version] changed to 0.7.2 --- bauh/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bauh/__init__.py b/bauh/__init__.py index 3fdb7b7e..85695271 100644 --- a/bauh/__init__.py +++ b/bauh/__init__.py @@ -1,4 +1,4 @@ -__version__ = '0.7.1' +__version__ = '0.7.2' __app_name__ = 'bauh' import os From 76249338889cff4f98fc5fcee13b763205e6caab Mon Sep 17 00:00:00 2001 From: Vinicius Moreira Date: Tue, 29 Oct 2019 11:42:16 -0300 Subject: [PATCH 03/17] [snap] not showing 'License' in the info window if it defined as 'unset' --- CHANGELOG.md | 7 ++++++- bauh/gems/snap/controller.py | 3 +++ bauh/gems/snap/resources/locale/es | 1 - bauh/gems/snap/resources/locale/pt | 1 - 4 files changed, 9 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 39ead74c..fdf26649 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,8 +5,13 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). ## [0.7.2] +### Improvements + - Snap + - not showing **License** in the info window if it defined as **unset** + ### Fixes: - - The application crashes due to Snap API checking when snap is not installed + - Snap + - The application crashes due to Snap API checking when snap is not installed ## [0.7.1] 2019-10-25 ### Features diff --git a/bauh/gems/snap/controller.py b/bauh/gems/snap/controller.py index fb453a3f..be96afa5 100644 --- a/bauh/gems/snap/controller.py +++ b/bauh/gems/snap/controller.py @@ -140,6 +140,9 @@ class SnapManager(SoftwareManager): if info.get('commands'): info['commands'] = ' '.join(info['commands']) + if info.get('license') and info['license'] == 'unset': + del info['license'] + return info def get_history(self, pkg: SnapApplication) -> PackageHistory: diff --git a/bauh/gems/snap/resources/locale/es b/bauh/gems/snap/resources/locale/es index 4b17ee5a..07e0501d 100644 --- a/bauh/gems/snap/resources/locale/es +++ b/bauh/gems/snap/resources/locale/es @@ -3,7 +3,6 @@ snap.info.commands=comandos snap.info.contact=contacto snap.info.description=descripción snap.info.license=licencia -snap.info.license.unset=no está definida snap.info.revision=revisión snap.info.tracking=tracking snap.info.installed=instalado diff --git a/bauh/gems/snap/resources/locale/pt b/bauh/gems/snap/resources/locale/pt index 1d72fe63..4960ddc5 100644 --- a/bauh/gems/snap/resources/locale/pt +++ b/bauh/gems/snap/resources/locale/pt @@ -3,7 +3,6 @@ snap.info.commands=comandos snap.info.contact=contato snap.info.description=descrição snap.info.license=licença -snap.info.license.unset=não definida snap.info.revision=revisão snap.info.tracking=tracking snap.info.installed=instalado From b0f09a1be641d3664e95ba0c7be615d2f23b454f Mon Sep 17 00:00:00 2001 From: Vinicius Moreira Date: Tue, 29 Oct 2019 11:47:12 -0300 Subject: [PATCH 04/17] [i18n] application types selector panel --- bauh/view/qt/gem_selector.py | 2 +- bauh/view/resources/locale/en | 3 ++- bauh/view/resources/locale/es | 1 + bauh/view/resources/locale/pt | 3 ++- 4 files changed, 6 insertions(+), 3 deletions(-) diff --git a/bauh/view/qt/gem_selector.py b/bauh/view/qt/gem_selector.py index 54cced57..6dda234e 100644 --- a/bauh/view/qt/gem_selector.py +++ b/bauh/view/qt/gem_selector.py @@ -32,7 +32,7 @@ class GemSelectorPanel(QWidget): self.bt_proceed.setStyleSheet(css.OK_BUTTON) self.bt_proceed.clicked.connect(self.save) - self.bt_exit = QPushButton(i18n['exit'].capitalize()) + self.bt_exit = QPushButton(i18n['close'].capitalize()) self.bt_exit.clicked.connect(self.exit) self.gem_map = {} diff --git a/bauh/view/resources/locale/en b/bauh/view/resources/locale/en index 9e34ffbe..fa38c609 100644 --- a/bauh/view/resources/locale/en +++ b/bauh/view/resources/locale/en @@ -146,4 +146,5 @@ screenshots,download.running=downloading image screenshots.download.no_content=No content to display screenshots.download.no_response=Image not found continue=continue -stable=stable \ No newline at end of file +stable=stable +close=close \ No newline at end of file diff --git a/bauh/view/resources/locale/es b/bauh/view/resources/locale/es index 2474c832..0b63510d 100644 --- a/bauh/view/resources/locale/es +++ b/bauh/view/resources/locale/es @@ -191,3 +191,4 @@ screenshots.download.no_content=No hay contenido para mostrar screenshots.download.no_response=No se encontró la imagen continue=continuar stable=estable +close=cerrar diff --git a/bauh/view/resources/locale/pt b/bauh/view/resources/locale/pt index eeb3c40e..71399ae7 100644 --- a/bauh/view/resources/locale/pt +++ b/bauh/view/resources/locale/pt @@ -193,4 +193,5 @@ screenshots,download.running=baixando imagem screenshots.download.no_content=Sem conteúdo para exibir screenshots.download.no_response=Imagem não encontrada continue=continuar -stable=estável \ No newline at end of file +stable=estável +close=fechar \ No newline at end of file From d20cae64a9dbde784ab658cb3dfe0d4094c5dede Mon Sep 17 00:00:00 2001 From: Vinicius Moreira Date: Tue, 29 Oct 2019 11:49:42 -0300 Subject: [PATCH 05/17] [CHANGELOG] --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index fdf26649..171f6c8d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). ### Improvements - Snap - not showing **License** in the info window if it defined as **unset** + - i18n ( spanish contributions by @fitojb ) ### Fixes: - Snap From 6b4f3d98247364e6ad2afd56bd4e9c3aa47f222e Mon Sep 17 00:00:00 2001 From: Vinicius Moreira Date: Tue, 29 Oct 2019 11:51:36 -0300 Subject: [PATCH 06/17] [CHANGELOG] --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 171f6c8d..5864a666 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,7 +8,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). ### Improvements - Snap - not showing **License** in the info window if it defined as **unset** - - i18n ( spanish contributions by @fitojb ) + - i18n ( spanish contributions by [fitojb](https://github.com/fitojb) ) ### Fixes: - Snap From 10d9eb75751f01dcf98f05182eec625dfe6e73dc Mon Sep 17 00:00:00 2001 From: Vinicius Moreira Date: Tue, 29 Oct 2019 11:57:12 -0300 Subject: [PATCH 07/17] [CHANGELOG] --- CHANGELOG.md | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5864a666..4fd4f9bc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,13 +6,14 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). ## [0.7.2] ### Improvements - - Snap - - not showing **License** in the info window if it defined as **unset** - - i18n ( spanish contributions by [fitojb](https://github.com/fitojb) ) +- Snap + - not showing **License** in the info window if it defined as **unset** +- i18n: spanish contributions by [fitojb](https://github.com/fitojb) +- minor labels improvements ### Fixes: - - Snap - - The application crashes due to Snap API checking when snap is not installed +- Snap + - The application crashes due to Snap API checking when snap is not installed ## [0.7.1] 2019-10-25 ### Features From ec514b99d9b3d34bf34c97b36d949bd10b089fd7 Mon Sep 17 00:00:00 2001 From: Vinicius Moreira Date: Tue, 29 Oct 2019 12:08:58 -0300 Subject: [PATCH 08/17] [suggestions] showing suggestions if the user changes the available types and there are no applications installed --- CHANGELOG.md | 1 + bauh/view/qt/gem_selector.py | 1 + bauh/view/qt/window.py | 4 +++- 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4fd4f9bc..2642cbb3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). ### Improvements - Snap - not showing **License** in the info window if it defined as **unset** +- showing suggestions if the user changes the application types available and there are no applications installed - i18n: spanish contributions by [fitojb](https://github.com/fitojb) - minor labels improvements diff --git a/bauh/view/qt/gem_selector.py b/bauh/view/qt/gem_selector.py index 6dda234e..be810f7f 100644 --- a/bauh/view/qt/gem_selector.py +++ b/bauh/view/qt/gem_selector.py @@ -91,6 +91,7 @@ class GemSelectorPanel(QWidget): self.manager.reset_cache() self.manager.prepare() self.window.verify_warnings() + self.window.types_changed = True self.window.refresh_apps() self.close() diff --git a/bauh/view/qt/window.py b/bauh/view/qt/window.py index a4272147..16da819d 100755 --- a/bauh/view/qt/window.py +++ b/bauh/view/qt/window.py @@ -284,6 +284,7 @@ class ManageWindow(QWidget): self.progress_controll_enabled = True self.recent_installation = False self.recent_uninstall = False + self.types_changed = False self.dialog_about = None self.first_refresh = suggestions @@ -474,6 +475,7 @@ class ManageWindow(QWidget): self.update_pkgs(res['installed'], as_installed=as_installed, types=res['types'], keep_filters=self.recent_uninstall and res['types']) self.first_refresh = False self.recent_uninstall = False + self.types_changed = False self._hide_fields_after_recent_installation() def uninstall_app(self, app: PackageView): @@ -640,7 +642,7 @@ class ManageWindow(QWidget): commons.apply_filters(pkgv, filters, pkgs_info) if pkgs_info['apps_count'] == 0: - if self.first_refresh: + if self.first_refresh or self.types_changed: self._begin_search('') self.thread_suggestions.start() return From 7c4095b1fb2cd6a7cea2685dbfb13c0bb602ea9c Mon Sep 17 00:00:00 2001 From: Vinicius Moreira Date: Tue, 29 Oct 2019 14:57:47 -0300 Subject: [PATCH 09/17] [table] displaying a 'verified' green icon next to a verified publisher's name --- CHANGELOG.md | 3 ++ bauh/gems/snap/model.py | 3 ++ bauh/view/qt/apps_table.py | 28 ++++++++++--- bauh/view/resources/img/verified.svg | 62 ++++++++++++++++++++++++++++ bauh/view/resources/locale/en | 3 +- bauh/view/resources/locale/es | 1 + bauh/view/resources/locale/pt | 3 +- 7 files changed, 95 insertions(+), 8 deletions(-) create mode 100644 bauh/view/resources/img/verified.svg diff --git a/CHANGELOG.md b/CHANGELOG.md index 2642cbb3..6194ee26 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -15,6 +15,9 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). ### Fixes: - Snap - The application crashes due to Snap API checking when snap is not installed + +### UI: +- Displaying a **verified** green icon next to a verified publisher's name ## [0.7.1] 2019-10-25 ### Features diff --git a/bauh/gems/snap/model.py b/bauh/gems/snap/model.py index 6a48928d..0dd7441c 100644 --- a/bauh/gems/snap/model.py +++ b/bauh/gems/snap/model.py @@ -56,6 +56,9 @@ class SnapApplication(SoftwarePackage): def get_disk_cache_path(self): return super(SnapApplication, self).get_disk_cache_path() + '/installed/' + self.name + def is_trustable(self) -> bool: + return self.verified_publisher + def get_data_to_cache(self): return { "icon_url": self.icon_url, diff --git a/bauh/view/qt/apps_table.py b/bauh/view/qt/apps_table.py index c4c39a4a..7d354065 100644 --- a/bauh/view/qt/apps_table.py +++ b/bauh/view/qt/apps_table.py @@ -76,6 +76,7 @@ class AppsTable(QTableWidget): self.setHorizontalHeaderLabels(['' for _ in range(self.columnCount())]) self.setHorizontalScrollBarPolicy(Qt.ScrollBarAlwaysOff) self.icon_logo = QIcon(resource.get_path('img/logo.svg')) + self.pixmap_verified = QPixmap(resource.get_path('img/verified.svg')) self.network_man = QNetworkAccessManager() self.network_man.finished.connect(self._load_icon_and_cache) @@ -372,7 +373,9 @@ class AppsTable(QTableWidget): self.setItem(pkg.table_index, col, item) def _set_col_publisher(self, col: int, pkg: PackageView): - item = QLabel() + item = QWidget() + item.setLayout(QHBoxLayout()) + item.layout().setContentsMargins(1, 1, 1, 1) publisher = pkg.model.get_publisher() full_publisher = None @@ -384,22 +387,35 @@ class AppsTable(QTableWidget): if len(publisher) > PUBLISHER_MAX_SIZE: publisher = full_publisher[0: PUBLISHER_MAX_SIZE - 3] + '...' - if len(publisher) < PUBLISHER_MAX_SIZE: - publisher = publisher + ' ' * (PUBLISHER_MAX_SIZE - len(publisher)) - if not publisher: if not pkg.model.installed: item.setStyleSheet('QLabel { color: red; }') publisher = self.i18n['unknown'] - item.setText(' {} '.format(publisher)) + lb_name = QLabel(' {}'.format(publisher)) + lb_name.setStyleSheet('QLabel { margin-right: 0px}') + item.layout().addWidget(lb_name) if publisher and full_publisher: - item.setToolTip(self.i18n['publisher'].capitalize() + ((': ' + full_publisher) if full_publisher else '')) + lb_name.setToolTip(self.i18n['publisher'].capitalize() + ((': ' + full_publisher) if full_publisher else '')) + + if pkg.model.is_trustable(): + lb_verified = QLabel() + lb_verified.setPixmap(self.pixmap_verified) + lb_verified.setToolTip(self.i18n['publisher.verified'].capitalize()) + item.layout().addWidget(lb_verified) + else: + lb_name.setText(lb_name.text() + " ") self.setCellWidget(pkg.table_index, col, item) + def _set_col_verified(self, col: int, pkg: PackageView): + item = QTableWidgetItem() + + if pkg.model.is_trustable(): + item.setIcon() + def _set_col_settings(self, col: int, pkg: PackageView): item = QToolBar() diff --git a/bauh/view/resources/img/verified.svg b/bauh/view/resources/img/verified.svg new file mode 100644 index 00000000..4ad34e26 --- /dev/null +++ b/bauh/view/resources/img/verified.svg @@ -0,0 +1,62 @@ + + + + + + image/svg+xml + + + + + + + + + diff --git a/bauh/view/resources/locale/en b/bauh/view/resources/locale/en index fa38c609..0fde7161 100644 --- a/bauh/view/resources/locale/en +++ b/bauh/view/resources/locale/en @@ -147,4 +147,5 @@ screenshots.download.no_content=No content to display screenshots.download.no_response=Image not found continue=continue stable=stable -close=close \ No newline at end of file +close=close +publisher.verified=verified publisher \ No newline at end of file diff --git a/bauh/view/resources/locale/es b/bauh/view/resources/locale/es index 0b63510d..1c003847 100644 --- a/bauh/view/resources/locale/es +++ b/bauh/view/resources/locale/es @@ -192,3 +192,4 @@ screenshots.download.no_response=No se encontró la imagen continue=continuar stable=estable close=cerrar +publisher.verified=publicador verificado diff --git a/bauh/view/resources/locale/pt b/bauh/view/resources/locale/pt index 71399ae7..e15cb4b7 100644 --- a/bauh/view/resources/locale/pt +++ b/bauh/view/resources/locale/pt @@ -194,4 +194,5 @@ screenshots.download.no_content=Sem conteúdo para exibir screenshots.download.no_response=Imagem não encontrada continue=continuar stable=estável -close=fechar \ No newline at end of file +close=fechar +publisher.verified=publicador verificado \ No newline at end of file From df61ecffc6c271251bce3806499ef14d3f528e54 Mon Sep 17 00:00:00 2001 From: Vinicius Moreira Date: Tue, 29 Oct 2019 15:15:14 -0300 Subject: [PATCH 10/17] [snap] mapping verified status for suggestions --- bauh/gems/snap/controller.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/bauh/gems/snap/controller.py b/bauh/gems/snap/controller.py index be96afa5..24a5f42e 100644 --- a/bauh/gems/snap/controller.py +++ b/bauh/gems/snap/controller.py @@ -45,7 +45,8 @@ class SnapManager(SoftwareManager): name=app_json.get('name'), version=app_json.get('version'), latest_version=app_json.get('version'), - description=app_json.get('description', app_json.get('summary'))) + description=app_json.get('description', app_json.get('summary')), + verified_publisher=app_json.get('developer_validation', '') == 'verified') if app.publisher and app.publisher.endswith('*'): app.verified_publisher = True From 7ded45064479061973e41eff06b8f46f77ef1a95 Mon Sep 17 00:00:00 2001 From: Vinicius Moreira Date: Tue, 29 Oct 2019 16:04:33 -0300 Subject: [PATCH 11/17] [table] improved 'verified' icon spacing --- bauh/view/qt/apps_table.py | 17 ++++------------- 1 file changed, 4 insertions(+), 13 deletions(-) diff --git a/bauh/view/qt/apps_table.py b/bauh/view/qt/apps_table.py index 7d354065..c9ea76c4 100644 --- a/bauh/view/qt/apps_table.py +++ b/bauh/view/qt/apps_table.py @@ -11,10 +11,10 @@ from PyQt5.QtWidgets import QTableWidget, QTableView, QMenu, QAction, QTableWidg from bauh.api.abstract.cache import MemoryCache from bauh.api.abstract.model import PackageStatus from bauh.commons.html import strip_html -from bauh.view.util import resource from bauh.view.qt import dialog from bauh.view.qt.components import IconButton from bauh.view.qt.view_model import PackageView, PackageViewStatus +from bauh.view.util import resource INSTALL_BT_STYLE = 'background: {back}; color: white; font-size: 10px; font-weight: bold' @@ -373,9 +373,7 @@ class AppsTable(QTableWidget): self.setItem(pkg.table_index, col, item) def _set_col_publisher(self, col: int, pkg: PackageView): - item = QWidget() - item.setLayout(QHBoxLayout()) - item.layout().setContentsMargins(1, 1, 1, 1) + item = QToolBar() publisher = pkg.model.get_publisher() full_publisher = None @@ -394,8 +392,7 @@ class AppsTable(QTableWidget): publisher = self.i18n['unknown'] lb_name = QLabel(' {}'.format(publisher)) - lb_name.setStyleSheet('QLabel { margin-right: 0px}') - item.layout().addWidget(lb_name) + item.addWidget(lb_name) if publisher and full_publisher: lb_name.setToolTip(self.i18n['publisher'].capitalize() + ((': ' + full_publisher) if full_publisher else '')) @@ -404,18 +401,12 @@ class AppsTable(QTableWidget): lb_verified = QLabel() lb_verified.setPixmap(self.pixmap_verified) lb_verified.setToolTip(self.i18n['publisher.verified'].capitalize()) - item.layout().addWidget(lb_verified) + item.addWidget(lb_verified) else: lb_name.setText(lb_name.text() + " ") self.setCellWidget(pkg.table_index, col, item) - def _set_col_verified(self, col: int, pkg: PackageView): - item = QTableWidgetItem() - - if pkg.model.is_trustable(): - item.setIcon() - def _set_col_settings(self, col: int, pkg: PackageView): item = QToolBar() From 33cf5bbd328b3196a3b4c30bab66423c0e655347 Mon Sep 17 00:00:00 2001 From: Vinicius Moreira Date: Thu, 31 Oct 2019 12:09:13 -0300 Subject: [PATCH 12/17] [flatpak] 'Remotes not set' warning informing to the user that Flatpak support can be disabled --- CHANGELOG.md | 2 ++ bauh/gems/flatpak/controller.py | 5 +++-- bauh/gems/flatpak/resources/locale/en | 1 + bauh/gems/flatpak/resources/locale/es | 1 + bauh/gems/flatpak/resources/locale/pt | 1 + 5 files changed, 8 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6194ee26..2e6c17fd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,8 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). ### Improvements - Snap - not showing **License** in the info window if it defined as **unset** +- Flatpak: + - "Remotes not set" warning informing to the user that Flatpak support can be disabled - showing suggestions if the user changes the application types available and there are no applications installed - i18n: spanish contributions by [fitojb](https://github.com/fitojb) - minor labels improvements diff --git a/bauh/gems/flatpak/controller.py b/bauh/gems/flatpak/controller.py index 0da44b1c..2f6a688b 100644 --- a/bauh/gems/flatpak/controller.py +++ b/bauh/gems/flatpak/controller.py @@ -9,7 +9,7 @@ from bauh.api.abstract.disk import DiskCacheLoader from bauh.api.abstract.handler import ProcessWatcher from bauh.api.abstract.model import PackageHistory, PackageUpdate, SoftwarePackage, PackageSuggestion from bauh.api.abstract.view import MessageType -from bauh.commons.html import strip_html +from bauh.commons.html import strip_html, bold from bauh.commons.system import SystemProcess, ProcessHandler from bauh.gems.flatpak import flatpak, suggestions from bauh.gems.flatpak.constants import FLATHUB_API_URL @@ -253,7 +253,8 @@ class FlatpakManager(SoftwareManager): def list_warnings(self, internet_available: bool) -> List[str]: if flatpak.is_installed(): if not flatpak.has_remotes_set(): - return [self.i18n['flatpak.notification.no_remotes']] + return [self.i18n['flatpak.notification.no_remotes'], + self.i18n['flatpak.notification.disable'].format(bold('Flatpak'), bold(self.i18n['manage_window.settings.gems']))] def list_suggestions(self, limit: int) -> List[PackageSuggestion]: cli_version = flatpak.get_version() diff --git a/bauh/gems/flatpak/resources/locale/en b/bauh/gems/flatpak/resources/locale/en index b538dd9d..b0415238 100644 --- a/bauh/gems/flatpak/resources/locale/en +++ b/bauh/gems/flatpak/resources/locale/en @@ -1,5 +1,6 @@ gem.flatpak.info=Applications available in the repositories configured on your system flatpak.notification.no_remotes=No Flatpak remotes set. It will not be possible to search for Flatpak apps. +flatpak.notification.disable=If you do not want to use Flatpak applications, uncheck {} in {} flatpak.downgrade.impossible.title=Error flatpak.downgrade.impossible.body=Impossible to downgrade: the app is in its first version flatpak.downgrade.commits=Reading package commits diff --git a/bauh/gems/flatpak/resources/locale/es b/bauh/gems/flatpak/resources/locale/es index 9840c5a1..9a276d5a 100644 --- a/bauh/gems/flatpak/resources/locale/es +++ b/bauh/gems/flatpak/resources/locale/es @@ -19,6 +19,7 @@ flatpak.info.subject=tema flatpak.info.type=tipo flatpak.info.version=versión flatpak.notification.no_remotes=No hay repositorios (remotes) Flatpak configurados. No será posible buscar aplicativos Flatpak. +flatpak.notification.disable=Si no desea usar aplicativos Flatpak, desmarque {} en {} flatpak.downgrade.impossible.title=Error flatpak.downgrade.impossible.body=Imposible revertir la versión: el aplicativo está en su primera versión flatpak.history.date=fecha diff --git a/bauh/gems/flatpak/resources/locale/pt b/bauh/gems/flatpak/resources/locale/pt index c811fe16..986bfdd3 100644 --- a/bauh/gems/flatpak/resources/locale/pt +++ b/bauh/gems/flatpak/resources/locale/pt @@ -19,6 +19,7 @@ flatpak.info.subject=assunto flatpak.info.type=tipo flatpak.info.version=versão flatpak.notification.no_remotes=Não há repositórios (remotes) Flatpak configurados. Não será possível buscar aplicativos Flatpak. +flatpak.notification.disable=Se não deseja usar aplicativos Flatpak, desmarque {} em {} flatpak.downgrade.impossible.title=Erro flatpak.downgrade.impossible.body=Impossível reverter a versão: o aplicativo está na sua primeira versão flatpak.history.date=data From 3a7019175243b19e188e8cbe5773f052f72ec103 Mon Sep 17 00:00:00 2001 From: Vinicius Moreira Date: Thu, 31 Oct 2019 13:19:14 -0300 Subject: [PATCH 13/17] reducing the verified publisher icon size --- bauh/view/resources/img/verified.svg | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/bauh/view/resources/img/verified.svg b/bauh/view/resources/img/verified.svg index 4ad34e26..5cf6c99d 100644 --- a/bauh/view/resources/img/verified.svg +++ b/bauh/view/resources/img/verified.svg @@ -8,12 +8,12 @@ xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" version="1.1" - viewBox="0 0 12.000003 12" + viewBox="0 0 8.0000001 8" enable-background="new 0 0 26 26" id="svg817" sodipodi:docname="verified.svg" - width="12.000003" - height="12" + width="8" + height="8" inkscape:version="0.92.4 5da689c313, 2019-01-14"> @@ -23,7 +23,7 @@ image/svg+xml - + @@ -55,8 +55,8 @@ inkscape:window-maximized="1" inkscape:current-layer="svg817" /> + style="fill:#00aa00;stroke-width:0.35082322" /> From c9f7707b85c77e8256b2d448bd55dbe2fb6fadcd Mon Sep 17 00:00:00 2001 From: Vinicius Moreira Date: Fri, 1 Nov 2019 11:35:57 -0300 Subject: [PATCH 14/17] [CHANGELOG] release date --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2e6c17fd..b5abd0f7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,7 +4,7 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). -## [0.7.2] +## [0.7.2] 2019-11-01 ### Improvements - Snap - not showing **License** in the info window if it defined as **unset** From c84ddf562a0e94b2112359594b3ea98cc27cadfa Mon Sep 17 00:00:00 2001 From: Vinicius Moreira Date: Fri, 1 Nov 2019 11:37:25 -0300 Subject: [PATCH 15/17] [CHANGELOG] --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index b5abd0f7..5fd55e23 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -16,7 +16,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). ### Fixes: - Snap - - The application crashes due to Snap API checking when snap is not installed + - The application crashes due to Snap API checking when snap is not installed ( introduced in **0.7.1** ) ### UI: - Displaying a **verified** green icon next to a verified publisher's name From 794b992602cecdba9c0286fb7224d3641720c2d4 Mon Sep 17 00:00:00 2001 From: Vinicius Moreira Date: Fri, 1 Nov 2019 11:38:11 -0300 Subject: [PATCH 16/17] [CHANGELOG] --- CHANGELOG.md | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5fd55e23..6a5d77ab 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -14,12 +14,13 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). - i18n: spanish contributions by [fitojb](https://github.com/fitojb) - minor labels improvements -### Fixes: +### UI +- Displaying a **verified** green icon next to a verified publisher's name + +### Fixes - Snap - The application crashes due to Snap API checking when snap is not installed ( introduced in **0.7.1** ) -### UI: -- Displaying a **verified** green icon next to a verified publisher's name ## [0.7.1] 2019-10-25 ### Features From 2c39fe4d22cbba0c933b19d4478204c7071834ef Mon Sep 17 00:00:00 2001 From: Vinicius Moreira Date: Fri, 1 Nov 2019 11:42:49 -0300 Subject: [PATCH 17/17] [i18n] verified publisher --- bauh/view/resources/locale/en | 2 +- bauh/view/resources/locale/es | 2 +- bauh/view/resources/locale/pt | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/bauh/view/resources/locale/en b/bauh/view/resources/locale/en index 0fde7161..b876f5f8 100644 --- a/bauh/view/resources/locale/en +++ b/bauh/view/resources/locale/en @@ -148,4 +148,4 @@ screenshots.download.no_response=Image not found continue=continue stable=stable close=close -publisher.verified=verified publisher \ No newline at end of file +publisher.verified=verified \ No newline at end of file diff --git a/bauh/view/resources/locale/es b/bauh/view/resources/locale/es index 1c003847..323c8e16 100644 --- a/bauh/view/resources/locale/es +++ b/bauh/view/resources/locale/es @@ -192,4 +192,4 @@ screenshots.download.no_response=No se encontró la imagen continue=continuar stable=estable close=cerrar -publisher.verified=publicador verificado +publisher.verified=verificado diff --git a/bauh/view/resources/locale/pt b/bauh/view/resources/locale/pt index e15cb4b7..b3f9a166 100644 --- a/bauh/view/resources/locale/pt +++ b/bauh/view/resources/locale/pt @@ -195,4 +195,4 @@ screenshots.download.no_response=Imagem não encontrada continue=continuar stable=estável close=fechar -publisher.verified=publicador verificado \ No newline at end of file +publisher.verified=verificado \ No newline at end of file