GUI: Show config key errors, didn't work since FreeSimpleGUI switch

This commit is contained in:
deajan 2025-02-12 16:40:33 +01:00
parent c380d6d1e5
commit 11dd20a4d4
3 changed files with 10 additions and 1 deletions

View file

@ -312,8 +312,13 @@ def config_gui(full_config: dict, config_file: str):
"prometheus.http_password",
"prometheus.no_cert_verify",
"update_manager_password",
"permissions",
"manager_password",
) or key.startswith("prometheus.additional_labels"):
return
# Since FreeSimpleGUI does not allow to suppress the debugger anymore in v5.1.0, we need to handle KeyError
if key not in window.AllKeysDict:
raise KeyError
if key == "permissions":
window["current_permissions"].Update(combo_boxes["permissions"][value])
return
@ -480,7 +485,9 @@ def config_gui(full_config: dict, config_file: str):
window[inheritance_key].update(NON_INHERITED_ICON)
except KeyError:
logger.error(f"Key {key} has no GUI equivalent")
msg = f"{_t('config_gui.key_error')}: {key}"
sg.PopupError(msg)
logger.error(msg)
logger.debug("Trace:", exc_info=True)
except TypeError as exc:
logger.error(

View file

@ -61,6 +61,7 @@ en:
no_runner: Cannot connect to backend. Please see logs
runner_not_configured: Backend not configured properly. Please see logs
no_binary: Cannot find backup backend. Please install restic binary from restic.net
key_error: Key from configuration has no match in GUI
configuration_saved: Configuration saved
cannot_save_configuration: Could not save configuration. See logs for further info

View file

@ -62,6 +62,7 @@ fr:
no_runner: Impossible de se connecter au backend. Verifier les logs
runner_not_configured: Backend non configuré proprement. Verifier les logs
no_binary: Impossible de trouver le coeur de sauvegarde. Merci d'installer le binaire restic depuis restic.net
key_error: Un entrée de la configuration n'a pas d'équivalent dans l'interface
configuration_saved: Configuration sauvegardée
cannot_save_configuration: Impossible d'enregistrer la configuration. Veuillez consulter les journaux pour plus de détails