|
|
|
|
@ -27,7 +27,7 @@ void on_save_done(main_window *, config_str output, int size){
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void yon_save_interface(main_window *widgets){
|
|
|
|
|
void yon_save_interface( main_window *widgets){
|
|
|
|
|
if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(widgets->AutoUpdateCheck))){
|
|
|
|
|
yon_config_register(AUTOUPDATE,AUTOUPDATE_command,"enable");
|
|
|
|
|
} else {
|
|
|
|
|
@ -175,6 +175,7 @@ void yon_load_proceed(YON_CONFIG_TYPE type){
|
|
|
|
|
char *command = yon_config_get_custom_command(path);
|
|
|
|
|
yon_config_load_config(type,command,NULL);
|
|
|
|
|
}
|
|
|
|
|
yon_config_set_ignore(AUTOUPDATE_timestamp);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void yon_interface_update(main_window *widgets){
|
|
|
|
|
@ -241,13 +242,9 @@ void yon_interface_update(main_window *widgets){
|
|
|
|
|
{
|
|
|
|
|
int repos_size;
|
|
|
|
|
config_str publish_repos = yon_config_load(get_publication_list_command,&repos_size);
|
|
|
|
|
for (int i=0;i<repos_size;i++){
|
|
|
|
|
yon_char_remove_last_symbol(publish_repos[i],'\n');
|
|
|
|
|
gtk_list_store_append(widgets->PublicationList,&iter);
|
|
|
|
|
gtk_list_store_set(widgets->PublicationList,&iter,0,1,1,publish_repos[i],-1);
|
|
|
|
|
}
|
|
|
|
|
char *publish = config(REPOPUBLIC_NET_parameter);
|
|
|
|
|
if (publish) {
|
|
|
|
|
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(widgets->PublicationCheck),1);
|
|
|
|
|
int cur_size;
|
|
|
|
|
config_str parsed = yon_char_parse(publish,&cur_size,",");
|
|
|
|
|
if (cur_size){
|
|
|
|
|
@ -261,14 +258,23 @@ void yon_interface_update(main_window *widgets){
|
|
|
|
|
} else {
|
|
|
|
|
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(widgets->RecieveDBFromNetCheck),0);
|
|
|
|
|
}
|
|
|
|
|
for (int i=0;i<repos_size;i++){
|
|
|
|
|
yon_char_remove_last_symbol(publish_repos[i],'\n');
|
|
|
|
|
gtk_list_store_append(widgets->PublicationList,&iter);
|
|
|
|
|
gtk_list_store_set(widgets->PublicationList,&iter,1,publish_repos[i],0,!(cur_size-2)||(cur_size-2&&yon_char_parsed_check_exist(parsed,cur_size,publish_repos[i])>-1)?1:0,-1);
|
|
|
|
|
}
|
|
|
|
|
if (cur_size>2){
|
|
|
|
|
for (int i=2;i<cur_size;i++){
|
|
|
|
|
gtk_list_store_append(widgets->PublicationList,&iter);
|
|
|
|
|
gtk_list_store_set(widgets->PublicationList,&iter,1,parsed[i],-1);
|
|
|
|
|
if (yon_char_parsed_check_exist(publish_repos,repos_size,parsed[i])==-1){
|
|
|
|
|
gtk_list_store_append(widgets->PublicationList,&iter);
|
|
|
|
|
gtk_list_store_set(widgets->PublicationList,&iter,1,parsed[i],-1);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
yon_char_parsed_free(parsed,cur_size);
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(widgets->PublicationCheck),1);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
{
|
|
|
|
|
@ -323,6 +329,11 @@ void yon_interface_update(main_window *widgets){
|
|
|
|
|
int repos_size;
|
|
|
|
|
config_str overall_repos = yon_config_load(get_publication_list_command,&repos_size);
|
|
|
|
|
char *autoupdate_repos = config(AUTOUPDATE_repos);
|
|
|
|
|
if (autoupdate_repos){
|
|
|
|
|
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(widgets->UpdateRepoListCheck),1);
|
|
|
|
|
} else {
|
|
|
|
|
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(widgets->UpdateRepoListCheck),0);
|
|
|
|
|
}
|
|
|
|
|
if (repos_size){
|
|
|
|
|
int parsed_size;
|
|
|
|
|
GtkTreeIter iter;
|
|
|
|
|
@ -330,7 +341,7 @@ void yon_interface_update(main_window *widgets){
|
|
|
|
|
for (int i=0;i<repos_size;i++){
|
|
|
|
|
yon_char_remove_last_symbol(overall_repos[i],'\n');
|
|
|
|
|
gtk_list_store_append(GTK_LIST_STORE(widgets->UpdateRepoList),&iter);
|
|
|
|
|
gtk_list_store_set(widgets->UpdateRepoList,&iter,1,overall_repos[i],0,!parsed_size||(parsed_size&&yon_char_parsed_check_exist(overall_repos,repos_size,overall_repos[i])>-1)?1:0,-1);
|
|
|
|
|
gtk_list_store_set(widgets->UpdateRepoList,&iter,1,overall_repos[i],0,!parsed_size||(parsed_size&&yon_char_parsed_check_exist(parsed,parsed_size,overall_repos[i])>-1)?1:0,-1);
|
|
|
|
|
}
|
|
|
|
|
yon_char_parsed_free(parsed,parsed_size);
|
|
|
|
|
}
|
|
|
|
|
@ -347,11 +358,6 @@ void yon_interface_update(main_window *widgets){
|
|
|
|
|
}
|
|
|
|
|
gtk_spin_button_set_value(GTK_SPIN_BUTTON(widgets->UpdateIntervalSpin),atol(autoupdate_config));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
char *timestamp = config("AUTOUPDATE[timestamp]");
|
|
|
|
|
if (!yon_char_is_empty(timestamp)){
|
|
|
|
|
gtk_label_set_text(GTK_LABEL(widgets->HeadLabel),timestamp);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|