diff --git a/source/ubl-settings-update.c b/source/ubl-settings-update.c index a1c7e9a..8542fed 100644 --- a/source/ubl-settings-update.c +++ b/source/ubl-settings-update.c @@ -41,6 +41,17 @@ void yon_load_proceed(YON_CONFIG_TYPE type){ void yon_interface_update(main_window *widgets){ int size; + char *repo_config = config(REPOSITORY_parameter); + if (!yon_char_is_empty(repo_config)){ + if (!strcmp(repo_config,"disable")){ + gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(widgets->RepositoriesRepoListConfigurationCheck),0); + } else if (!strcmp(repo_config,"enable")){ + gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(widgets->RepositoriesRepoListConfigurationCheck),1); + }else if (!strcmp(repo_config,"only")){ + gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(widgets->RepositoriesDisableSystemReposCheck),1); + } + } + config_str repos = yon_config_get_all_by_key(REPOSITORY_search,&size); GtkTreeIter iter; for (int i=0;iPublicationConnectPublicCheck),1); + } + if (cur_size>1&&!strcmp(parsed[1],"db")){ + gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(widgets->RecieveDBFromNetCheck),1); + } + if (cur_size>2){ + for (int i=2;iPublicationList,&iter); + gtk_list_store_set(widgets->PublicationList,&iter,1,parsed[i],-1); + } + } + yon_char_parsed_free(parsed,cur_size); + } + } + + char *mirror = config(REPOPUBLIC_CACHE); + if (!yon_char_is_empty(mirror)){ + if (!strcmp(mirror,"enable")||!strcmp(mirror,"yes")){ + gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(widgets->MirrorPublicCheck),1); + } else if (!strcmp(mirror,"disable")||!strcmp(mirror,"no")||!strcmp(mirror,"none")){ + gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(widgets->MirrorPublicCheck),0); + } } + + // config_str mirror_list = yon_config_get_all_by_key(REPOPUBLIC_CACHE_search,&size); + // if (size){ + // for (int i=0;iMirrorList,&iter); + // gtk_list_store_set(widgets->MirrorList,&iter,,-1); + // } + // } + // } + + char *autoupdate_config = config(AUTOUPDATE); + if (!yon_char_is_empty(autoupdate_config)&&!strcmp(autoupdate_config,"enable")){ + gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(widgets->AutoUpdateCheck),1); + } + + autoupdate_config = config(AUTOUPDATE_mode); + if (!yon_char_is_empty(autoupdate_config)){ + if (!strcmp(autoupdate_config,"modsys")){ + gtk_combo_box_set_active(GTK_COMBO_BOX(widgets->UpdateModeCombo),1); + } else if (!strcmp(autoupdate_config,"modules")){ + gtk_combo_box_set_active(GTK_COMBO_BOX(widgets->UpdateModeCombo),2); + } else if (!strcmp(autoupdate_config,"system")){ + gtk_combo_box_set_active(GTK_COMBO_BOX(widgets->UpdateModeCombo),3); + } + } + + autoupdate_config = config(AUTOUPDATE_interval); + if (!yon_char_is_empty(autoupdate_config)){ + if (!strcmp(autoupdate_config,"boot")){ + gtk_combo_box_set_active(GTK_COMBO_BOX(widgets->UpdateIntervalCombo),0); + } else { + if (strstr(autoupdate_config,"min")){ + gtk_combo_box_set_active(GTK_COMBO_BOX(widgets->UpdateIntervalCombo),1); + } else if (autoupdate_config[strlen(autoupdate_config)-1]=='h'){ + gtk_combo_box_set_active(GTK_COMBO_BOX(widgets->UpdateIntervalCombo),2); + } else if (autoupdate_config[strlen(autoupdate_config)-1]=='d'){ + gtk_combo_box_set_active(GTK_COMBO_BOX(widgets->UpdateIntervalCombo),3); + } else if (autoupdate_config[strlen(autoupdate_config)-1]=='M'){ + gtk_combo_box_set_active(GTK_COMBO_BOX(widgets->UpdateIntervalCombo),4); + } + gtk_spin_button_set_value(GTK_SPIN_BUTTON(widgets->UpdateIntervalSpin),atol(autoupdate_config)); + } + } + } // standard functions @@ -385,8 +481,10 @@ void yon_main_window_complete(main_window *widgets){ // Custom widgets configuration { widgets->AutoUpdateCheck = yon_gtk_builder_get_widget(builder,"AutoUpdateCheck"); - widgets->UpdateCheckFreqCombo = yon_gtk_builder_get_widget(builder,"UpdateCheckFreqCombo"); - widgets->UpdateCheckIntervalCombo = yon_gtk_builder_get_widget(builder,"UpdateCheckIntervalCombo"); + widgets->UpdateModeCombo = yon_gtk_builder_get_widget(builder,"UpdateModeCombo"); + widgets->UpdateIntervalDefaultCheck = yon_gtk_builder_get_widget(builder,"UpdateIntervalDefaultCheck"); + widgets->UpdateIntervalSpin = yon_gtk_builder_get_widget(builder,"UpdateIntervalSpin"); + widgets->UpdateIntervalCombo = yon_gtk_builder_get_widget(builder,"UpdateIntervalCombo"); widgets->UpdateRepoListCombo = yon_gtk_builder_get_widget(builder,"UpdateRepoListCombo"); widgets->UpdateRepoTree = yon_gtk_builder_get_widget(builder,"UpdateRepoTree"); widgets->RepositoriesRepoListConfigurationCheck = yon_gtk_builder_get_widget(builder,"RepositoriesRepoListConfigurationCheck"); diff --git a/source/ubl-settings-update.h b/source/ubl-settings-update.h index 1f006dd..a7000c6 100644 --- a/source/ubl-settings-update.h +++ b/source/ubl-settings-update.h @@ -72,8 +72,10 @@ typedef struct { typedef struct { template_window_fields GtkWidget *AutoUpdateCheck; - GtkWidget *UpdateCheckFreqCombo; - GtkWidget *UpdateCheckIntervalCombo; + GtkWidget *UpdateModeCombo; + GtkWidget *UpdateIntervalDefaultCheck; + GtkWidget *UpdateIntervalSpin; + GtkWidget *UpdateIntervalCombo; GtkWidget *UpdateRepoListCombo; GtkWidget *UpdateRepoTree; GtkListStore *UpdateRepoList; diff --git a/ubl-settings-update.css b/ubl-settings-update.css index 8687d4a..3873397 100644 --- a/ubl-settings-update.css +++ b/ubl-settings-update.css @@ -26,7 +26,7 @@ background:transparent; } .menuitembottom{ margin-top:0px; - margin-bottom:3px; + margin-bottom:4px; border-color:inherit; border-left-width:inherit; border-right-width:inherit; @@ -46,56 +46,59 @@ background:transparent; border-left-width:inherit; border-right-width:inherit; } - .menuitemtop *{ + .menuitemtop>*{ margin:2px 2px 0 2px; - padding: 5px 10px 3px 5px; + padding: 3px 10px 3px 5px; border:transparent; } - .menuitemmiddle *{ + .menuitemmiddle>*{ margin:0 2px 0 2px; padding: 3px 10px 3px 5px; border:transparent; } - .menuitembottom *{ + .menuitembottom>*{ margin:0 2px 2px 2px; - padding: 3px 10px 5px 5px; + padding: 3px 10px 3px 5px; } .menuitemtop:hover { - background:@theme_bg_color; + background:@theme_base_color; border-color:inherit; border-top-width:inherit; border-left-width:inherit; border-right-width:inherit; } .menuitemmiddle:hover { - background:@theme_bg_color; + background:@theme_base_color; border-color:inherit; border-left-width:inherit; border-right-width:inherit; } .menuitembottom:hover { - background:@theme_bg_color; + background:@theme_base_color; border-color:inherit; border-bottom-width:0px; border-left-width:inherit; border-right-width:inherit; } - .menuitemtop:hover* { + .menuitemtop:hover>* { margin:2px 2px 0 2px; - padding: 5px 10px 3px 5px; + padding: 3px 10px 3px 5px; + /* padding: 5px 0 3px 5px; */ background:@theme_selected_bg_color; border-radius:2px; } - .menuitemmiddle:hover* { - margin:0 2px 0 2px; + .menuitemmiddle:hover>* { + margin:0 2px 0px 2px; padding: 3px 10px 3px 5px; + /* padding: 3px 0px 3px 5px; */ background:@theme_selected_bg_color; border-radius:2px; } - .menuitembottom:hover* { + .menuitembottom:hover>* { margin:0 2px 2px 2px; - padding: 3px 10px 5px 5px; + padding: 3px 10px 3px 5px; + /* padding: 3px 0px 5px 5px; */ background:@theme_selected_bg_color; border-radius:2px; } diff --git a/ubl-settings-update.glade b/ubl-settings-update.glade index c98ea53..9e8e317 100644 --- a/ubl-settings-update.glade +++ b/ubl-settings-update.glade @@ -25,8 +25,24 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - - + + + + + + + + + + + + + + + + + + @@ -44,6 +60,11 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + + 100 + 1 + 10 + True @@ -115,6 +136,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. False document-edit-symbolic + True False @@ -180,7 +202,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - + True False 0 @@ -223,19 +245,58 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - + True False - 0 - - Default - First update all modules and then the system - Update only modules - Update everything in the order of the specified repositories - + 5 + + + Default + True + True + False + True + + + False + True + 0 + + + + + True + True + adjustment1 + + + False + True + 1 + + + + + True + False + 0 + + Boot + Minutes + Hours + Days + Months + + + + False + True + 2 + + - True + False True 1 @@ -251,8 +312,8 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. True False - 0 - none + 0.019999999552965164 + in True @@ -804,6 +865,9 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. Chosen + + 0 + @@ -812,6 +876,9 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. Repository name + + 1 + @@ -960,59 +1027,94 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - + True - True - in + False + vertical - + True True - WebPublicationList + liststore1 - - Enabled - + - Source - - - - - Repository - - - - - Reviewer - - - - - Port - - - - - Name - - - - - Password/Hash type + Authtorization parameters + + + False + True + 0 + + + + + True + True + in - - Password/Password hash + + True + True + WebPublicationList + + + + + + Enabled + + + + + Storage + + + + + Chosen repositories + + + + + Reviewer + + + + + Port + + + + + Name + + + + + Password/Hash type + + + + + Password/Password hash + + + + True + True + 1 + @@ -1206,6 +1308,9 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. Repository + + 0 + @@ -1214,6 +1319,9 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. Type + + 1 + @@ -1222,6 +1330,9 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. Resource URL + + 2 +