Saving fixes

pull/7/head
parent 1d2048aad5
commit 605bd3d712

@ -154,9 +154,7 @@
<property name="sizing">fixed</property>
<property name="title" translatable="yes">Old value</property>
<child>
<object class="GtkCellRendererText">
<property name="wrap-width">250</property>
</object>
<object class="GtkCellRendererText"/>
<attributes>
<attribute name="cell-background">4</attribute>
<attribute name="sensitive">5</attribute>
@ -170,9 +168,7 @@
<property name="sizing">autosize</property>
<property name="title" translatable="yes">New value</property>
<child>
<object class="GtkCellRendererText">
<property name="wrap-width">250</property>
</object>
<object class="GtkCellRendererText"/>
<attributes>
<attribute name="cell-background">4</attribute>
<attribute name="sensitive">5</attribute>

@ -136,13 +136,26 @@ void on_save_parameters(GtkWidget *self, template_saving_window *window){
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);
}
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))){
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 {
char *config_to_save = NULL;
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) {
if (template_config->load_mode==1){
config_to_save="global";
yon_config_save_registered("system");
} else if (template_config->load_mode==0){
config_to_save="system";
yon_config_save_registered("global");
}
}
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_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;
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)){
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_config_check_ignore(name)){
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)){
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;
break;

Loading…
Cancel
Save