[ui][settings] new property to disable updates sorting

This commit is contained in:
Vinícius Moreira
2020-02-07 11:45:45 -03:00
parent ecd936c6fd
commit 0fd85fe10f
12 changed files with 39 additions and 9 deletions

View File

@@ -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

View File

@@ -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

View File

@@ -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,

View File

@@ -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

View File

@@ -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):

View File

@@ -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()

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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