diff --git a/source/ubl-settings-update.c b/source/ubl-settings-update.c index 7ed1736..ea829c6 100644 --- a/source/ubl-settings-update.c +++ b/source/ubl-settings-update.c @@ -363,18 +363,27 @@ void yon_interface_update(main_window *widgets){ autoupdate_config = config(AUTOUPDATE_interval); if (!yon_char_is_empty(autoupdate_config)){ gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(widgets->UpdateIntervalDefaultCheck),0); - if (strstr(autoupdate_config,"min")){ + int parsed_size; + config_str parsed = yon_char_parse(autoupdate_config,&parsed_size,","); + if (yon_char_parsed_check_exist(parsed,parsed_size,"boot")!=-1){ + gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(widgets->BootCheck),1); + } + if (strstr(parsed[parsed_size-1],"min")){ gtk_combo_box_set_active(GTK_COMBO_BOX(widgets->UpdateIntervalCombo),0); - } else if (autoupdate_config[strlen(autoupdate_config)-1]=='h'){ + } else if (parsed[parsed_size-1][strlen(parsed[parsed_size-1])-1]=='h'){ gtk_combo_box_set_active(GTK_COMBO_BOX(widgets->UpdateIntervalCombo),1); - } else if (autoupdate_config[strlen(autoupdate_config)-1]=='d'){ + } else if (parsed[parsed_size-1][strlen(parsed[parsed_size-1])-1]=='d'){ gtk_combo_box_set_active(GTK_COMBO_BOX(widgets->UpdateIntervalCombo),2); - } else if (autoupdate_config[strlen(autoupdate_config)-1]=='M'){ + } else if (parsed[parsed_size-1][strlen(parsed[parsed_size-1])-1]=='M'){ gtk_combo_box_set_active(GTK_COMBO_BOX(widgets->UpdateIntervalCombo),3); } - gtk_spin_button_set_value(GTK_SPIN_BUTTON(widgets->UpdateIntervalSpin),atol(autoupdate_config)); + gtk_spin_button_set_value(GTK_SPIN_BUTTON(widgets->UpdateIntervalSpin),atol(parsed[parsed_size-1])); } else { gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(widgets->UpdateIntervalDefaultCheck),1); + gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(widgets->BootCheck),0); + gtk_spin_button_set_value(GTK_SPIN_BUTTON(widgets->UpdateIntervalSpin),0); + gtk_combo_box_set_active(GTK_COMBO_BOX(widgets->UpdateIntervalCombo),0); + } } diff --git a/source/ubl-settings-update.h b/source/ubl-settings-update.h index 7602ca5..5a2490f 100644 --- a/source/ubl-settings-update.h +++ b/source/ubl-settings-update.h @@ -83,6 +83,9 @@ #define AUTOUPDATE_timestamp "AUTOUPDATE[timestamp]" #define AUTOUPDATE_timestamp_command "ubconfig --source global get [update] AUTOUPDATE[timestamp]" + +extern template_app_info template_app_information; + typedef char* string; string version_application;