|
|
|
@ -136,13 +136,26 @@ void on_save_parameters(GtkWidget *self, template_saving_window *window){
|
|
|
|
free(final_command);
|
|
|
|
free(final_command);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if (window->type == YON_CONFIG_GLOBAL)
|
|
|
|
|
|
|
|
yon_ubl_status_box_render(GLOBAL_SAVE_SUCCESS_LABEL,BACKGROUND_IMAGE_SUCCESS_TYPE);
|
|
|
|
|
|
|
|
else if (window->type == YON_CONFIG_LOCAL)
|
|
|
|
|
|
|
|
yon_ubl_status_box_render(LOCAL_SAVE_SUCCESS_LABEL,BACKGROUND_IMAGE_SUCCESS_TYPE);
|
|
|
|
|
|
|
|
else if (window->type == YON_CONFIG_BOTH)
|
|
|
|
|
|
|
|
yon_ubl_status_box_render(GLOBAL_LOCAL_SAVE_SUCCESS_LABEL,BACKGROUND_IMAGE_SUCCESS_TYPE);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
yon_window_config_custom_window_set(GTK_WINDOW(window->Window),"SaveWindow");
|
|
|
|
on_subwindow_close(self);
|
|
|
|
on_subwindow_close(self);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
template_saving_window *yon_save_proceed(char *path,YON_CONFIG_TYPE type, ...){
|
|
|
|
template_saving_window *yon_save_proceed(char *path,YON_CONFIG_TYPE type, ...){
|
|
|
|
if (((type==YON_CONFIG_LOCAL&& template_config->load_mode==1)||(type==YON_CONFIG_GLOBAL&& template_config->load_mode==0))){
|
|
|
|
if (((type==YON_CONFIG_LOCAL&& template_config->load_mode==1)||(type==YON_CONFIG_GLOBAL&& template_config->load_mode==0))){
|
|
|
|
yon_config_save_registered(path);
|
|
|
|
yon_config_save_registered(path);
|
|
|
|
return NULL;
|
|
|
|
if (type == YON_CONFIG_GLOBAL)
|
|
|
|
|
|
|
|
yon_ubl_status_box_render(GLOBAL_SAVE_SUCCESS_LABEL,BACKGROUND_IMAGE_SUCCESS_TYPE);
|
|
|
|
|
|
|
|
else if (type == YON_CONFIG_LOCAL)
|
|
|
|
|
|
|
|
yon_ubl_status_box_render(LOCAL_SAVE_SUCCESS_LABEL,BACKGROUND_IMAGE_SUCCESS_TYPE);
|
|
|
|
|
|
|
|
else if (type == YON_CONFIG_BOTH)
|
|
|
|
|
|
|
|
yon_ubl_status_box_render(GLOBAL_LOCAL_SAVE_SUCCESS_LABEL,BACKGROUND_IMAGE_SUCCESS_TYPE);
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
char *config_to_save = NULL;
|
|
|
|
char *config_to_save = NULL;
|
|
|
|
if (type==YON_CONFIG_GLOBAL) config_to_save="global";
|
|
|
|
if (type==YON_CONFIG_GLOBAL) config_to_save="global";
|
|
|
|
@ -150,10 +163,8 @@ template_saving_window *yon_save_proceed(char *path,YON_CONFIG_TYPE type, ...){
|
|
|
|
else if (type==YON_CONFIG_BOTH) {
|
|
|
|
else if (type==YON_CONFIG_BOTH) {
|
|
|
|
if (template_config->load_mode==1){
|
|
|
|
if (template_config->load_mode==1){
|
|
|
|
config_to_save="global";
|
|
|
|
config_to_save="global";
|
|
|
|
yon_config_save_registered("system");
|
|
|
|
|
|
|
|
} else if (template_config->load_mode==0){
|
|
|
|
} else if (template_config->load_mode==0){
|
|
|
|
config_to_save="system";
|
|
|
|
config_to_save="system";
|
|
|
|
yon_config_save_registered("global");
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
yon_config_set_status(0);
|
|
|
|
yon_config_set_status(0);
|
|
|
|
@ -280,11 +291,11 @@ template_saving_window *yon_save_proceed(char *path,YON_CONFIG_TYPE type, ...){
|
|
|
|
free(compare_value);
|
|
|
|
free(compare_value);
|
|
|
|
free(compare_name);
|
|
|
|
free(compare_name);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
// if (!yon_config_check_ignore(compare_keys[i])){
|
|
|
|
if (yon_config_check_ignore(compare_keys[i])){
|
|
|
|
|
|
|
|
gtk_list_store_set(window->list,&iter,0,0,1,compare_keys[i],4,NULL,5,0,-1);
|
|
|
|
|
|
|
|
|
|
|
|
// } else {
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
char *name,*value;
|
|
|
|
char *name,*value;
|
|
|
|
for (int i=0;i<config_keys_size;i++){
|
|
|
|
for (int i=0;i<config_keys_size;i++){
|
|
|
|
@ -296,9 +307,15 @@ template_saving_window *yon_save_proceed(char *path,YON_CONFIG_TYPE type, ...){
|
|
|
|
for (;valid;valid=gtk_tree_model_iter_next(GTK_TREE_MODEL(window->list),&iter)){
|
|
|
|
for (;valid;valid=gtk_tree_model_iter_next(GTK_TREE_MODEL(window->list),&iter)){
|
|
|
|
gtk_tree_model_get(GTK_TREE_MODEL(window->list),&iter,1,&name,2,&value,-1);
|
|
|
|
gtk_tree_model_get(GTK_TREE_MODEL(window->list),&iter,1,&name,2,&value,-1);
|
|
|
|
if (!yon_char_is_empty(name)&&!strcmp(name,config_keys[i])){
|
|
|
|
if (!yon_char_is_empty(name)&&!strcmp(name,config_keys[i])){
|
|
|
|
|
|
|
|
if (!yon_config_check_ignore(name)){
|
|
|
|
gtk_list_store_set(window->list,&iter,3,compare_value,4,NULL,6,section,-1);
|
|
|
|
gtk_list_store_set(window->list,&iter,3,compare_value,4,NULL,6,section,-1);
|
|
|
|
if ((value&&!strcmp(value,compare_value))||yon_char_is_empty(compare_value)){
|
|
|
|
if ((value&&!strcmp(value,compare_value))||yon_char_is_empty(compare_value)){
|
|
|
|
gtk_list_store_set(window->list,&iter,0,0,3,value,5,0,-1);
|
|
|
|
gtk_list_store_set(window->list,&iter,0,0,3,value,5,0,-1);
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
gtk_list_store_set(window->list,&iter,5,1,-1);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
printf ("%s ignored\n",name);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
found=1;
|
|
|
|
found=1;
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
|