[improvement][settings] new option to disable the reboot dialog after a successful upgrade

This commit is contained in:
Vinicius Moreira
2020-04-29 15:51:38 -03:00
parent 9995a9d010
commit a03b853336
13 changed files with 36 additions and 6 deletions

View File

@@ -10,6 +10,8 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
- new **type** field on settings to specify the Timeshift backup mode: **RSYNC** or **BTRFS**
- Trim
- the dialog is now displayed before the upgrading process (but the operation is only executed after a successful upgrade)
- Settings
- new option to disable the reboot dialog after a successful upgrade (`updates.ask_for_reboot`)
### UI
- icons, buttons and colors changes

View File

@@ -277,6 +277,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
ask_for_reboot: true # if a dialog asking for a system reboot should be displayed after a successful upgrade
disk:
trim:
after_upgrade: false # it trims the hard disk after a successfull packages upgrade ( `fstrim -a -v` ). 'true' will automatically perform the trim and 'null' will display a confirmation dialog

View File

@@ -18,7 +18,8 @@ def read_config(update_file: bool = False) -> dict:
},
'locale': None,
'updates': {
'check_interval': 30
'check_interval': 30,
'ask_for_reboot': True
},
'system': {
'notifications': True,

View File

@@ -240,7 +240,14 @@ class GenericSettingsManager:
max_width=default_width,
id_="sugs_by_type")
sub_comps = [FormComponent([select_locale, select_store_pwd, select_sysnotify, select_sugs, inp_sugs], spaces=False)]
inp_reboot = self._gen_select(label=self.i18n['core.config.updates.reboot'],
tip=self.i18n['core.config.updates.reboot.tip'],
id_='ask_for_reboot',
max_width=default_width,
value=bool(core_config['updates']['ask_for_reboot']),
opts=[(self.i18n['ask'].capitalize(), True, None), (self.i18n['no'].capitalize(), False, None)])
sub_comps = [FormComponent([select_locale, select_store_pwd, select_sysnotify, select_sugs, inp_sugs, inp_reboot], spaces=False)]
return TabComponent(self.i18n['core.config.tab.general'].capitalize(), PanelComponent(sub_comps), None, 'core.gen')
def _gen_bool_component(self, label: str, tooltip: str, value: bool, id_: str, max_width: int = 200) -> SingleSelectComponent:
@@ -279,6 +286,8 @@ class GenericSettingsManager:
sugs_by_type = general_form.get_component('sugs_by_type').get_int_value()
core_config['suggestions']['by_type'] = sugs_by_type
core_config['updates']['ask_for_reboot'] = general_form.get_component('ask_for_reboot').get_selected()
# advanced
adv_form = advanced.components[0]

View File

@@ -458,10 +458,11 @@ class UpgradeSelected(AsyncAction):
if should_trim:
self._trim_disk(root_password)
msg = '<p>{}</p>{}</p><br/><p>{}</p>'.format(self.i18n['action.update.success.reboot.line1'],
self.i18n['action.update.success.reboot.line2'],
self.i18n['action.update.success.reboot.line3'])
self.request_reboot(msg)
if bool(app_config['updates']['ask_for_reboot']):
msg = '<p>{}</p>{}</p><br/><p>{}</p>'.format(self.i18n['action.update.success.reboot.line1'],
self.i18n['action.update.success.reboot.line2'],
self.i18n['action.update.success.reboot.line3'])
self.request_reboot(msg)
self.notify_finished({'success': success, 'updated': updated, 'types': updated_types, 'id': upgrade_id})
self.pkgs = None

View File

@@ -222,6 +222,8 @@ core.config.ui.tray.updates_icon=Update icon
core.config.ui.tray.updates_icon.tip=The displayed icon when there are updates available
core.config.updates.interval=Updates interval
core.config.updates.interval.tip=Defines the time interval in which the update-checking for the installed applications will happen ( in SECONDS )
core.config.updates.reboot=Reboot after upgrading
core.config.updates.reboot.tip=A message asking for a system reboot will be displayed after a successful upgrade
custom_action.proceed_with=Proceed with {} ?
description=descripció
details=detalls

View File

@@ -221,6 +221,8 @@ core.config.ui.tray.updates_icon=Icon bei Updates
core.config.ui.tray.updates_icon.tip=The displayed icon when there are updates available
core.config.updates.interval=Update-Intervall
core.config.updates.interval.tip=Das Intervall (in Sekunden), in dem nach Updates für die installierten Anwendungen gesucht wird.
core.config.updates.reboot=Reboot after upgrading
core.config.updates.reboot.tip=A message asking for a system reboot will be displayed after a successful upgrade
custom_action.proceed_with=Proceed with {} ?
description=Beschreibung
details=Details

View File

@@ -221,6 +221,8 @@ core.config.ui.tray.updates_icon.tip=The displayed icon when there are updates a
core.config.ui.tray.updates_icon=Update icon
core.config.updates.interval.tip=Defines the time interval in which the update-checking for the installed applications will happen ( in SECONDS )
core.config.updates.interval=Updates interval
core.config.updates.reboot=Reboot after upgrading
core.config.updates.reboot.tip=A message asking for a system reboot will be displayed after a successful upgrade
custom_action.proceed_with=Proceed with {} ?
description=description
details=details

View File

@@ -222,6 +222,8 @@ core.config.ui.tray.updates_icon=Icono de actualización
core.config.ui.tray.updates_icon.tip=El icono que se muestra cuando hay actualizaciones disponibles
core.config.updates.interval=Intervalo de actualizaciones
core.config.updates.interval.tip=Define el intervalo de tiempo en el que se realizará la verificación de actualizaciones para las aplicaciones instaladas ( en SEGUNDOS )
core.config.updates.reboot=Reiniciar después de actualizar
core.config.updates.reboot.tip=Se mostrará un mensaje solicitando el reinicio del sistema después de una actualización exitosa
custom_action.proceed_with=¿Continuar con {}?
description=descripción
details=detalles

View File

@@ -222,6 +222,8 @@ core.config.ui.tray.updates_icon=Update icon
core.config.ui.tray.updates_icon.tip=The displayed icon when there are updates available
core.config.updates.interval=Updates interval
core.config.updates.interval.tip=Defines the time interval in which the update-checking for the installed applications will happen ( in SECONDS )
core.config.updates.reboot=Reboot after upgrading
core.config.updates.reboot.tip=A message asking for a system reboot will be displayed after a successful upgrade
custom_action.proceed_with=Proceed with {} ?
description=descrizione
details=dettagli

View File

@@ -221,6 +221,8 @@ core.config.ui.tray.updates_icon.tip=O ícone exibido quando há atualizações
core.config.ui.tray.updates_icon=Ícone de atualização
core.config.updates.interval.tip=Define o intervalo de tempo em que ocorrerá a verificação de atualizações para os aplicativos instalados ( em SEGUNDOS )
core.config.updates.interval=Intervalo de atualizações
core.config.updates.reboot=Reinicializar após atualizar
core.config.updates.reboot.tip=Uma mensagem perguntando se o sistema deve ser reinicializado será exibida após uma atualização bem sucedida
custom_action.proceed_with=Continuar com {} ?
description=descrição
details=detalhes

View File

@@ -221,6 +221,8 @@ core.config.ui.tray.updates_icon=Значок обновления
core.config.ui.tray.updates_icon.tip=Значок, отображаемый при наличии доступных обновлений
core.config.updates.interval=Интервал обновления
core.config.updates.interval.tip=Определяет интервал времени, в течение которого будет происходить проверка обновлений для установленных приложений ( в секундах )
core.config.updates.reboot=Reboot after upgrading
core.config.updates.reboot.tip=A message asking for a system reboot will be displayed after a successful upgrade
custom_action.proceed_with=Proceed with {} ?
description=Описание
details=Детали

View File

@@ -221,6 +221,8 @@ core.config.ui.tray.updates_icon.tip=Güncelleme mevcut olduğunda görüntülen
core.config.ui.tray.updates_icon=Simge değiştir
core.config.updates.interval.tip=Yüklü uygulamalar için güncelleme denetiminin gerçekleşeceği zaman aralığını tanımlar (SANİYE)
core.config.updates.interval=Güncelleme aralığı
core.config.updates.reboot=Reboot after upgrading
core.config.updates.reboot.tip=A message asking for a system reboot will be displayed after a successful upgrade
custom_action.proceed_with={} ile devam et ?
description=açıklama
details=detaylar