diff --git a/CHANGELOG.md b/CHANGELOG.md index ffcf2416..999924dd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -21,6 +21,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). - UI - not limiting the name filter size - rendering package icons with no full paths declared + - refreshing custom actions (**+**) after installing/uninstalling/downgrading/upgrading packages - minor improvements - download clients parameters diff --git a/bauh/view/core/controller.py b/bauh/view/core/controller.py index 5f1a275a..a7b88d71 100755 --- a/bauh/view/core/controller.py +++ b/bauh/view/core/controller.py @@ -12,7 +12,7 @@ from bauh.api.abstract.disk import DiskCacheLoader from bauh.api.abstract.handler import ProcessWatcher, TaskManager from bauh.api.abstract.model import SoftwarePackage, PackageUpdate, PackageHistory, PackageSuggestion, \ CustomSoftwareAction -from bauh.api.abstract.view import ViewComponent, TabGroupComponent +from bauh.api.abstract.view import ViewComponent, TabGroupComponent, MessageType from bauh.api.exception import NoInternetException from bauh.commons import internet from bauh.commons.html import bold @@ -80,11 +80,20 @@ class GenericSoftwareManager(SoftwareManager): self.working_managers.clear() def launch_timeshift(self, root_password: str, watcher: ProcessWatcher): - try: - Popen(['timeshift-launcher'], stderr=STDOUT) - return True - except: - traceback.print_exc() + if self._is_timeshift_launcher_available(): + try: + Popen(['timeshift-launcher'], stderr=STDOUT) + return True + except: + traceback.print_exc() + watcher.show_message(title=self.i18n["error"].capitalize(), + body=self.i18n['action.backups.tool_error'].format(bold('Timeshift')), + type_=MessageType.ERROR) + return False + else: + watcher.show_message(title=self.i18n["error"].capitalize(), + body=self.i18n['action.backups.tool_error'].format(bold('Timeshift')), + type_=MessageType.ERROR) return False def _sort(self, apps: List[SoftwarePackage], word: str) -> List[SoftwarePackage]: diff --git a/bauh/view/qt/window.py b/bauh/view/qt/window.py index f6248ed5..0b11f176 100755 --- a/bauh/view/qt/window.py +++ b/bauh/view/qt/window.py @@ -653,6 +653,7 @@ class ManageWindow(QWidget): self.recent_uninstall = True self.refresh_packages(pkg_types={pkgv.model.__class__} if only_pkg_type else None) + self.update_custom_actions() notify_tray() else: @@ -672,7 +673,7 @@ class ManageWindow(QWidget): util.notify_user('{} {}'.format(res['app'], self.i18n['downgraded'])) self.refresh_packages(pkg_types={res['app'].model.__class__} if len(self.pkgs) > 1 else None) - + self.update_custom_actions() notify_tray() else: if self._can_notify_user(): @@ -964,6 +965,8 @@ class ManageWindow(QWidget): self.ref_bt_upgrade.setVisible(True) self.checkbox_console.setChecked(True) + self.update_custom_actions() + def _update_action_output(self, output: str): self.textarea_output.appendPlainText(output) @@ -1195,6 +1198,7 @@ class ManageWindow(QWidget): self._finish_refresh_apps({'installed': [res['pkg'].model], 'total': 1, 'types': None}) self.ref_bt_installed.setVisible(False) self.ref_checkbox_only_apps.setVisible(False) + self.update_custom_actions() else: if self._can_notify_user(): util.notify_user('{}: {}'.format(res['pkg'].model.name, self.i18n['notification.install.failed'])) diff --git a/bauh/view/resources/locale/ca b/bauh/view/resources/locale/ca index 1b61a70a..775ccdb8 100644 --- a/bauh/view/resources/locale/ca +++ b/bauh/view/resources/locale/ca @@ -53,6 +53,7 @@ action.backup.substatus.create=Generating a new system backup action.backup.substatus.delete=Removing old system backups action.backups=Backups action.backups.status=Opening backups tool +action.backups.tool_error=It was not possible to open the backups tool ({}). action.cancelled=l’usuari ha cancel·lat l’operació action.disk_trim=Optimizing disc ( TRIM ) action.disk_trim.error=There was a problem while optimizing the disk diff --git a/bauh/view/resources/locale/de b/bauh/view/resources/locale/de index ada44efb..a6828238 100644 --- a/bauh/view/resources/locale/de +++ b/bauh/view/resources/locale/de @@ -53,6 +53,7 @@ action.backup.substatus.create=Generating a new system backup action.backup.substatus.delete=Removing old system backups action.backups=Backups action.backups.status=Opening backups tool +action.backups.tool_error=It was not possible to open the backups tool ({}). action.cancelled=Aktion vom Nutzer abgebrochen action.disk_trim=Optimizing disc ( TRIM ) action.disk_trim.error=There was a problem while optimizing the disk diff --git a/bauh/view/resources/locale/en b/bauh/view/resources/locale/en index cb471a1e..98a018b2 100644 --- a/bauh/view/resources/locale/en +++ b/bauh/view/resources/locale/en @@ -53,6 +53,7 @@ action.backup.substatus.create=Generating a new system backup action.backup.substatus.delete=Removing old system backups action.backups=Backups action.backups.status=Opening backups tool +action.backups.tool_error=It was not possible to open the backups tool ({}). action.cancelled=operation cancelled by the user action.disk_trim.error=There was a problem while optimizing the disk action.disk_trim=Optimizing disc ( TRIM ) diff --git a/bauh/view/resources/locale/es b/bauh/view/resources/locale/es index c5e4eb5e..0e8461b2 100644 --- a/bauh/view/resources/locale/es +++ b/bauh/view/resources/locale/es @@ -53,6 +53,7 @@ action.backup.substatus.create=Generando una nueva copia de seguridad action.backup.substatus.delete=Eliminando copias de seguridad antiguas action.backups=Copias de seguridad action.backups.status=Abriendo herramienta de copias de seguridad +action.backups.tool_error=No fue posible abrir la herramienta de copias de seguridad ({}). action.cancelled=operación cancelada por el usuario action.disk_trim=Optimizando el disco ( TRIM ) action.disk_trim.error=Hubo un problema al optimizar el disco diff --git a/bauh/view/resources/locale/it b/bauh/view/resources/locale/it index b700cc30..5549fa14 100644 --- a/bauh/view/resources/locale/it +++ b/bauh/view/resources/locale/it @@ -53,6 +53,7 @@ action.backup.substatus.create=Generating a new system backup action.backup.substatus.delete=Removing old system backups action.backups=Backups action.backups.status=Opening backups tool +action.backups.tool_error=It was not possible to open the backups tool ({}). action.cancelled=operazione annullata dall'utente action.disk_trim=Optimizing disc ( TRIM ) action.disk_trim.error=There was a problem while optimizing the disk diff --git a/bauh/view/resources/locale/pt b/bauh/view/resources/locale/pt index ee9c24a2..fbd2b894 100644 --- a/bauh/view/resources/locale/pt +++ b/bauh/view/resources/locale/pt @@ -53,6 +53,7 @@ action.backup.substatus.create=Gerando uma nova cópia de segurança action.backup.substatus.delete=Removendo cópias de segurança antigas action.backups=Cópias de segurança action.backups.status=Abrindo ferramenta de cópias de segurança +action.backups.tool_error=Não foi possível abrir a ferramenta para backups ({}). action.cancelled=operação cancelada pelo usuário action.disk_trim.error=Ocorreu um problema ao otimizar o disco action.disk_trim=Otimizando disco ( TRIM ) diff --git a/bauh/view/resources/locale/ru b/bauh/view/resources/locale/ru index d7206f4e..bb81f40f 100644 --- a/bauh/view/resources/locale/ru +++ b/bauh/view/resources/locale/ru @@ -53,6 +53,7 @@ action.backup.substatus.create=Generating a new system backup action.backup.substatus.delete=Removing old system backups action.backups=Backups action.backups.status=Opening backups tool +action.backups.tool_error=It was not possible to open the backups tool ({}). action.cancelled=Операция отменена пользователем action.disk_trim=Optimizing disc ( TRIM ) action.disk_trim.error=There was a problem while optimizing the disk diff --git a/bauh/view/resources/locale/tr b/bauh/view/resources/locale/tr index 27523355..510bfb70 100644 --- a/bauh/view/resources/locale/tr +++ b/bauh/view/resources/locale/tr @@ -53,6 +53,7 @@ action.backup.substatus.create=Yeni bir sistem yedeklemesi oluştur action.backup.substatus.delete=Eski sistem yedeklemelerini kaldır action.backups=Backups action.backups.status=Opening backups tool +action.backups.timeshift_not_installed=It was not possible to open the backups tool ({}). action.cancelled=işlem kullanıcı tarafından iptal edildi action.disk_trim.error=Diski optimize ederken bir sorun oluştu action.disk_trim=Diski optimize etme ( TRIM )