From 398e75e7fe5dc51a99df2117825895f26c896359 Mon Sep 17 00:00:00 2001 From: Ivan Yarcev Date: Wed, 25 Dec 2024 17:33:14 +0600 Subject: [PATCH] System update mode default value render edits --- source/ubl-settings-update.c | 19 +++++++++++++++++++ source/ubl-strings.h | 8 +++++--- 2 files changed, 24 insertions(+), 3 deletions(-) diff --git a/source/ubl-settings-update.c b/source/ubl-settings-update.c index 10c61bc..546da07 100644 --- a/source/ubl-settings-update.c +++ b/source/ubl-settings-update.c @@ -1866,6 +1866,25 @@ void yon_main_window_complete(main_window *widgets){ yon_window_config_add_listener((GtkWidget*)g_list_nth_data(list,i),yon_char_append("UpdateColumn",yon_char_from_int(i)),"fixed-width",YON_TYPE_INT); } g_list_free(list); + { + int size; + config_str parsed = yon_config_load(yon_config_parameter_prepare_command(AUTOUPDATE_mode_command,"default",NULL,NULL),&size); + if (size){ + yon_char_remove_last_symbol(parsed[0],'\n'); + free(yon_char_divide_search(parsed[0],"=",-1)); + char *mode = gtk_combo_box_text_get_active_text(GTK_COMBO_BOX_TEXT(widgets->UpdateModeCombo)); + if (!strcmp(parsed[0],"modsys")){ + mode = yon_char_unite(mode," (",MODSYS_UPDATE_MODE_LABEL,")",NULL); + } else if (!strcmp(parsed[0],"modules")){ + mode = yon_char_unite(mode," (",MODULES_UPDATE_MODE_LABEL,")",NULL); + } else if (!strcmp(parsed[0],"system")){ + mode = yon_char_unite(mode," (",SYSTEM_UPDATE_MODE_LABEL,")",NULL); + } + gtk_combo_box_text_remove(GTK_COMBO_BOX_TEXT(widgets->UpdateModeCombo),0); + gtk_combo_box_text_prepend_text(GTK_COMBO_BOX_TEXT(widgets->UpdateModeCombo),mode); + gtk_combo_box_set_active(GTK_COMBO_BOX(widgets->UpdateModeCombo),0); + } + } yon_interface_update(widgets); g_signal_connect(G_OBJECT(widgets->BootCheck),"toggled",G_CALLBACK(on_toggle_button_toggled),widgets); diff --git a/source/ubl-strings.h b/source/ubl-strings.h index 92ac93a..9a63636 100644 --- a/source/ubl-strings.h +++ b/source/ubl-strings.h @@ -17,6 +17,11 @@ #define PASSWORD_RESTRICTED_SYMBOL_LABEL _("Password contains restricted symbols") #define ENTRY_RESTRICTED_SYMBOL_LABEL _("Entry contains restricted symbols") + + #define MODSYS_UPDATE_MODE_LABEL _("First update all modules and then the system") + #define MODULES_UPDATE_MODE_LABEL _("Update only modules") + #define SYSTEM_UPDATE_MODE_LABEL _("Update everything in the order of the specified repositories") + #define REPO_TOOLTIP_LABEL _("file://\t\t- Directory URL prefix for repository\n\ ftp://\t\t- FTP URL prefix for repository\n\ http://\t\t- HTTP URL prefix for repository\n\ @@ -52,9 +57,6 @@ mirrorlist - mirrors file, make sure server URL is NOT included in this file! Si #define _LABEL _("Date of last automatic update:") #define _LABEL _("Date of last automatic update") #define _LABEL _("Automatic update") - #define _LABEL _("First update all modules and then the system") - #define _LABEL _("Update only modules") - #define _LABEL _("Update everything in the order of the specified repositories") #define _LABEL _("Update mode:") #define _LABEL _("Update interval:")