diff --git a/CHANGELOG.md b/CHANGELOG.md index 0faea0e7..38673191 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,8 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). ## [0.8.3] ### Improvements +- New update lifecycle: + - now every package manager must provide the best upgrade order for all the selected packages ( can be disabled through the settings file **~/.config/bauh/config.yml** or the UI ) - AUR - allowing the user to bypass checksum errors when installing / upgrading / downgrading packages diff --git a/README.md b/README.md index 197b7b07..e1c84d14 100644 --- a/README.md +++ b/README.md @@ -247,6 +247,7 @@ ui: auto_scale: false # activates Qt auto screen scale factor (QT_AUTO_SCREEN_SCALE_FACTOR). It fixes scaling issues for some desktop environments ( like Gnome ) updates: check_interval: 30 # the updates checking interval in SECONDS + sort_packages: True # if the selected applications / packages to upgrade must be sorted to avoid possible issues ``` #### Tray icons diff --git a/bauh/view/core/config.py b/bauh/view/core/config.py index c8c1e8e1..7bfe8471 100644 --- a/bauh/view/core/config.py +++ b/bauh/view/core/config.py @@ -22,7 +22,8 @@ def read_config(update_file: bool = False) -> dict: }, 'locale': None, 'updates': { - 'check_interval': 30 + 'check_interval': 30, + 'sort_packages': True }, 'system': { 'notifications': True, diff --git a/bauh/view/core/settings.py b/bauh/view/core/settings.py index 97ab51c5..42f924df 100644 --- a/bauh/view/core/settings.py +++ b/bauh/view/core/settings.py @@ -96,6 +96,12 @@ class GenericSettingsManager: max_width=default_width, id_="icon_exp") + select_update_sort = self._gen_bool_component(label=self.i18n['core.config.updates.sort_pkgs'], + tooltip=self.i18n['core.config.updates.sort_pkgs.tip'], + value=core_config['updates']['sort_packages'], + max_width=default_width, + id_="up_sort") + select_dep_check = self._gen_bool_component(label=self.i18n['core.config.system.dep_checking'], tooltip=self.i18n['core.config.system.dep_checking.tip'], value=core_config['system']['single_dependency_checking'], @@ -108,7 +114,7 @@ class GenericSettingsManager: max_width=default_width, value=core_config['download']['multithreaded']) - sub_comps = [FormComponent([select_dcache, select_dmthread, select_dep_check, input_data_exp, input_icon_exp], spaces=False)] + sub_comps = [FormComponent([select_dcache, select_dmthread, select_update_sort, select_dep_check, input_data_exp, input_icon_exp], spaces=False)] return TabComponent(self.i18n['core.config.tab.advanced'].capitalize(), PanelComponent(sub_comps), None, 'core.adv') def _gen_tray_settings(self, core_config: dict, screen_width: int, screen_height: int) -> TabComponent: @@ -264,6 +270,8 @@ class GenericSettingsManager: download_mthreaded = adv_form.get_component('down_mthread').get_selected() core_config['download']['multithreaded'] = download_mthreaded + core_config['updates']['sort_packages'] = adv_form.get_component('up_sort').get_selected() + single_dep_check = adv_form.get_component('dep_check').get_selected() core_config['system']['single_dependency_checking'] = single_dep_check diff --git a/bauh/view/qt/thread.py b/bauh/view/qt/thread.py index 343ec842..616ca247 100644 --- a/bauh/view/qt/thread.py +++ b/bauh/view/qt/thread.py @@ -12,6 +12,7 @@ from bauh.api.abstract.handler import ProcessWatcher from bauh.api.abstract.model import PackageStatus, SoftwarePackage, PackageAction from bauh.api.abstract.view import InputViewComponent, MessageType from bauh.api.exception import NoInternetException +from bauh.view.core import config from bauh.view.qt import commons from bauh.view.qt.view_model import PackageView from bauh.view.util.translation import I18n @@ -90,9 +91,9 @@ class AsyncAction(QThread, ProcessWatcher): class UpdateSelectedApps(AsyncAction): - def __init__(self, manager: SoftwareManager, i18n: I18n, apps_to_update: List[PackageView] = None): + def __init__(self, manager: SoftwareManager, i18n: I18n, pkgs: List[PackageView] = None): super(UpdateSelectedApps, self).__init__() - self.apps_to_update = apps_to_update + self.pkgs = pkgs self.manager = manager self.root_password = None self.i18n = i18n @@ -101,11 +102,16 @@ class UpdateSelectedApps(AsyncAction): success = False - if self.apps_to_update: + if self.pkgs: updated, updated_types = 0, set() - self.change_substatus(self.i18n['action.update.status.sorting']) - sorted_pkgs = self.manager.sort_update_order([view.model for view in self.apps_to_update]) + app_config = config.read_config() + + if bool(app_config['updates']['sort_packages']): + self.change_substatus(self.i18n['action.update.status.sorting']) + sorted_pkgs = self.manager.sort_update_order([view.model for view in self.pkgs]) + else: + sorted_pkgs = [view.model for view in self.pkgs] for pkg in sorted_pkgs: self.change_substatus('') @@ -124,7 +130,7 @@ class UpdateSelectedApps(AsyncAction): self.notify_finished({'success': success, 'updated': updated, 'types': updated_types}) - self.apps_to_update = None + self.pkgs = None class RefreshApps(AsyncAction): diff --git a/bauh/view/qt/window.py b/bauh/view/qt/window.py index a4a5bf9c..ba529114 100755 --- a/bauh/view/qt/window.py +++ b/bauh/view/qt/window.py @@ -890,7 +890,7 @@ class ManageWindow(QWidget): self._handle_console_option(True) self.progress_controll_enabled = len(to_update) == 1 self._begin_action(self.i18n['manage_window.status.upgrading']) - self.thread_update.apps_to_update = to_update + self.thread_update.pkgs = to_update self.thread_update.root_password = pwd self.thread_update.start() diff --git a/bauh/view/resources/locale/ca b/bauh/view/resources/locale/ca index bb61659e..e5720ee3 100644 --- a/bauh/view/resources/locale/ca +++ b/bauh/view/resources/locale/ca @@ -253,6 +253,8 @@ core.config.suggestions.by_type.tip=Maximum number of suggestions that should be core.config.types.tip=Check the application types you want to manage core.config.ui.auto_scale=Auto scale core.config.ui.auto_scale.tip=It activates the auto screen scale factor ( {} ). It fixes scaling issues for some desktop environments. +core.config.updates.sort_pkgs=Sort updates +core.config.updates.sort_pkgs.tip=Defines the best update order for the selected applications / packages to avoid issues settings.changed.success.warning=Settings successfully changed. Some of them will only take effect after a restart. settings.changed.success.reboot=Restart now ? settings.error=It was not possible to properly change all the settings diff --git a/bauh/view/resources/locale/de b/bauh/view/resources/locale/de index 0a67504c..455a83b4 100644 --- a/bauh/view/resources/locale/de +++ b/bauh/view/resources/locale/de @@ -208,6 +208,8 @@ core.config.suggestions.by_type.tip=Maximum number of suggestions that should be core.config.types.tip=Check the application types you want to manage core.config.ui.auto_scale=Auto scale core.config.ui.auto_scale.tip=It activates the auto screen scale factor ( {} ). It fixes scaling issues for some desktop environments. +core.config.updates.sort_pkgs=Sort updates +core.config.updates.sort_pkgs.tip=Defines the best update order for the selected applications / packages to avoid issues settings.changed.success.warning=Settings successfully changed. Some of them will only take effect after a restart. settings.changed.success.reboot=Restart now ? settings.error=It was not possible to properly change all the settings diff --git a/bauh/view/resources/locale/en b/bauh/view/resources/locale/en index 556d35d8..b4cb87f0 100644 --- a/bauh/view/resources/locale/en +++ b/bauh/view/resources/locale/en @@ -215,6 +215,8 @@ core.config.suggestions.by_type.tip=Maximum number of suggestions that should be core.config.types.tip=Check the application types you want to manage core.config.ui.auto_scale=Auto scale core.config.ui.auto_scale.tip=It activates the auto screen scale factor ( {} ). It fixes scaling issues for some desktop environments. +core.config.updates.sort_pkgs=Sort updates +core.config.updates.sort_pkgs.tip=Defines the best update order for the selected applications / packages to avoid issues settings.changed.success.warning=Settings successfully changed. Some of them will only take effect after a restart. settings.changed.success.reboot=Restart now ? settings.error=It was not possible to properly change all the settings diff --git a/bauh/view/resources/locale/es b/bauh/view/resources/locale/es index 4872cb2e..a8280fb2 100644 --- a/bauh/view/resources/locale/es +++ b/bauh/view/resources/locale/es @@ -256,6 +256,8 @@ core.config.suggestions.by_type.tip=Número máximo de sugerencias que deberían core.config.types.tip=Marque los tipos de aplicaciones que desea administrar core.config.ui.auto_scale=Escala automática core.config.ui.auto_scale.tip=Activa el factor de escala de pantalla automática ( {} ). Soluciona problemas de escala para algunos ambientes desktop. +core.config.updates.sort_pkgs=Ordenar actualizaciones +core.config.updates.sort_pkgs.tip=Define el mejor orden de actualización para las aplicaciones / paquetes seleccionados para evitar problemas settings.changed.success.warning=Las configuraciones se cambiaron con éxito. Algunas solo tendrán efecto después del reinicio. settings.changed.success.reboot=¿Reiniciar ahora? settings.error=No fue posible cambiar correctamente todas las configuraciones diff --git a/bauh/view/resources/locale/it b/bauh/view/resources/locale/it index dfa2e970..5a8e619c 100644 --- a/bauh/view/resources/locale/it +++ b/bauh/view/resources/locale/it @@ -208,6 +208,8 @@ core.config.suggestions.by_type.tip=Maximum number of suggestions that should be core.config.types.tip=Check the application types you want to manage core.config.ui.auto_scale=Auto scale core.config.ui.auto_scale.tip=It activates the auto screen scale factor ( {} ). It fixes scaling issues for some desktop environments. +core.config.updates.sort_pkgs=Sort updates +core.config.updates.sort_pkgs.tip=Defines the best update order for the selected applications / packages to avoid issues settings.changed.success.warning=Settings successfully changed. Some of them will only take effect after a restart. settings.changed.success.reboot=Restart now ? settings.error=It was not possible to properly change all the settings diff --git a/bauh/view/resources/locale/pt b/bauh/view/resources/locale/pt index 6e61a5d9..f815c23f 100644 --- a/bauh/view/resources/locale/pt +++ b/bauh/view/resources/locale/pt @@ -259,6 +259,8 @@ core.config.suggestions.by_type.tip=Número máximo de sugestões que devem ser core.config.types.tip=Marque os tipos de aplicativo que você quer gerenciar core.config.ui.auto_scale=Escala automática core.config.ui.auto_scale.tip=Ativa o fator de escala automático ( {} ). Corrige problemas de escala para alguns ambientes desktop. +core.config.updates.sort_pkgs=Organizar atualizações +core.config.updates.sort_pkgs.tip=Define a melhor ordem de atualização para os aplicativos / pacotes selecionados para evitar problemas settings.changed.success.warning=Configurações alteradas com sucesso ! Algumas delas só surtirão após a reinicialização. settings.changed.success.reboot=Reiniciar agora ? settings.error=Não foi possível alterar todas as configurações adequadamente