Fixed rendering of missing saving parameters

pull/15/head
parent f2bfcfa5ba
commit c65d78a138

@ -352,61 +352,63 @@ template_saving_window *yon_save_proceed(char *path,YON_CONFIG_TYPE type, ...){
struct loaded_config *current_loaded = yon_config_convert_parameter(current_config,current_size); struct loaded_config *current_loaded = yon_config_convert_parameter(current_config,current_size);
struct loaded_config *current = NULL; struct loaded_config *current = NULL;
for_dictionaries(current,current_loaded){ if (current_loaded){
dictionary *dict = yon_dictionary_get((dictionary**)&config_compare,current->key); for_dictionaries(current,current_loaded){
gboolean status=0; dictionary *dict = yon_dictionary_get((dictionary**)&config_compare,current->key);
status = yon_config_get_status(current->key); gboolean status=0;
if (dict&&!yon_char_is_empty((char*)dict->data)&&status!=-2){ status = yon_config_get_status(current->key);
if (strcmp((char*)dict->data,(char*)current->data)){ if (dict&&!yon_char_is_empty((char*)dict->data)&&status!=-2){
if (strcmp((char*)dict->data,(char*)current->data)){
GtkTreeIter iter;
if (status==0||status==-2) status = 0;
else status=1;
char *compare_string = yon_char_unite("<s>",(char*)dict->data,"</s>\n",(char*)current->data,NULL);
gtk_list_store_append(window->list,&iter);
gtk_list_store_set(window->list,&iter,0,status,1,current->key,2,(char*)dict->data,3,(char*)current->data,4,compare_string,6,1,-1);
free(compare_string);
}
} else if ((strcmp((char*)current->data,""))&&status!=-2){
GtkTreeIter iter; GtkTreeIter iter;
if (status==0||status==-2) status = 0; if (status==0||status==-2) status = 0;
else status=1; else status=1;
char *compare_string = yon_char_unite("<s>",(char*)dict->data,"</s>\n",(char*)current->data,NULL); char *compare_string = yon_char_unite("\n",(char*)current->data,NULL);
gtk_list_store_append(window->list,&iter); gtk_list_store_append(window->list,&iter);
gtk_list_store_set(window->list,&iter,0,status,1,current->key,2,(char*)dict->data,3,(char*)current->data,4,compare_string,6,1,-1); gtk_list_store_set(window->list,&iter,0,status,1,current->key,3,(char*)current->data,4,compare_string,6,1,-1);
free(compare_string); free(compare_string);
} }
} else if ((strcmp((char*)current->data,""))&&status!=-2){
GtkTreeIter iter;
if (status==0||status==-2) status = 0;
else status=1;
char *compare_string = yon_char_unite("\n",(char*)current->data,NULL);
gtk_list_store_append(window->list,&iter);
gtk_list_store_set(window->list,&iter,0,status,1,current->key,3,(char*)current->data,4,compare_string,6,1,-1);
free(compare_string);
} }
} if (config_compare){
if (config_compare){ for_dictionaries(current,config_compare){
for_dictionaries(current,config_compare){ GtkTreeIter iter;
GtkTreeIter iter; dictionary *dict = yon_dictionary_get((dictionary**)&current_loaded,current->key);
dictionary *dict = yon_dictionary_get((dictionary**)&current_loaded,current->key); if (!dict){
if (!dict){ GdkRGBA rgba;
GdkRGBA rgba; rgba.alpha=0.8;
rgba.alpha=0.8; rgba.red=1;
rgba.red=1; rgba.blue=0.3;
rgba.blue=0.3; rgba.green=0.65;
rgba.green=0.65; char *rgba_string = gdk_rgba_to_string(&rgba);
char *rgba_string = gdk_rgba_to_string(&rgba); int status=0;
int status=0; char *compare_string = yon_char_unite((char*)current->data,"\n",NULL);
char *compare_string = yon_char_unite((char*)current->data,"\n",NULL); gtk_list_store_append(window->list,&iter);
gtk_list_store_append(window->list,&iter); gtk_list_store_set(window->list,&iter,0,0,1,current->key,2,(char*)current->data,4,compare_string,5,rgba_string,6,1,-1);
gtk_list_store_set(window->list,&iter,0,0,1,current->key,3,(char*)current->data,4,compare_string,5,rgba_string,6,1,-1); free(compare_string);
free(compare_string); }
} }
} }
} }
GtkTreeIter iter; GtkTreeIter iter;
if (!gtk_tree_model_get_iter_first(GTK_TREE_MODEL(window->list),&iter)){ if (!gtk_tree_model_get_iter_first(GTK_TREE_MODEL(window->list),&iter)){
gtk_widget_destroy(window->Window); gtk_widget_destroy(window->Window);
textdomain(template_ui_LocaleName); textdomain(template_ui_LocaleName);
yon_ubl_status_box_render(NOTHING_TO_SAVE_LABEL,BACKGROUND_IMAGE_FAIL_TYPE); yon_ubl_status_box_render(NOTHING_TO_SAVE_LABEL,BACKGROUND_IMAGE_FAIL_TYPE);
textdomain(template_app_information.app_locale); textdomain(template_app_information.app_locale);
return NULL; return NULL;
} }
gtk_tree_view_set_model(GTK_TREE_VIEW(window->ParametersTree),GTK_TREE_MODEL(window->list)); gtk_tree_view_set_model(GTK_TREE_VIEW(window->ParametersTree),GTK_TREE_MODEL(window->list));
gtk_widget_show(window->Window); gtk_widget_show(window->Window);
on_save_window_parameter_switched(NULL,NULL,window); on_save_window_parameter_switched(NULL,NULL,window);
return window; return window;
} }
int yon_confirmation_dialog_call(GtkWidget *self,dialog_confirmation_data *data){ int yon_confirmation_dialog_call(GtkWidget *self,dialog_confirmation_data *data){

Loading…
Cancel
Save