mirror of
https://github.com/spalencsar/bearhub.git
synced 2026-07-07 02:24:16 +02:00
[ui][improvement] refreshing custom actions after installing/uninstalling/downgrading/upgrading packages
This commit is contained in:
@@ -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]:
|
||||
|
||||
@@ -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']))
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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 )
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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 )
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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 )
|
||||
|
||||
Reference in New Issue
Block a user