From a7086a2beb3ee7f2c1eace6029d28c7639944f58 Mon Sep 17 00:00:00 2001 From: Ivan Yarcev Date: Thu, 15 Feb 2024 11:03:56 +0600 Subject: [PATCH 1/2] Saving improvements --- source/libublsettingsui-gtk3.c | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/source/libublsettingsui-gtk3.c b/source/libublsettingsui-gtk3.c index a4bc63e..3f4057d 100644 --- a/source/libublsettingsui-gtk3.c +++ b/source/libublsettingsui-gtk3.c @@ -356,7 +356,9 @@ template_saving_window *yon_save_proceed(char *path,YON_CONFIG_TYPE type, ...){ char *compare_name = yon_char_divide_search(compare_value,"=",-1); if (!strcmp(compare_name,compare_keys[i])){ char *cur_section = (char*)yon_dictionary_get(&loaded.dict->first,compare_keys[i])->prev->data; - gtk_list_store_set(window->list,&iter,2,compare_value,4,rgba_string,6,cur_section,-1); + char *combined = yon_char_unite("",compare_value,"\n",NULL); + gtk_list_store_set(window->list,&iter,2,compare_value,4,rgba_string,6,cur_section,7,combined,-1); + free(combined); } free(compare_value); free(compare_name); @@ -384,9 +386,11 @@ template_saving_window *yon_save_proceed(char *path,YON_CONFIG_TYPE type, ...){ 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,0,1,5,1,-1); + if (yon_config_get_status(name)==1){ + gtk_list_store_set(window->list,&iter,0,1,5,1,-1); } - } + }; + }; found=1; break; } @@ -396,7 +400,10 @@ template_saving_window *yon_save_proceed(char *path,YON_CONFIG_TYPE type, ...){ GtkTreeIter itar; gtk_list_store_append(window->list,&itar); char *combined = yon_char_append("\n",compare_value); - gtk_list_store_set(window->list,&itar,0,1,1,compare_name,3,compare_value,5,1,6,section,7,combined,-1); + gtk_list_store_set(window->list,&itar,0,0,1,compare_name,3,compare_value,5,1,6,section,7,combined,-1); + if (yon_config_get_status(compare_name)==1){ + gtk_list_store_set(window->list,&itar,0,1,-1); + } free(combined); } } -- 2.35.1 From 362c381b5c914765dd397b4086aff1963a0352bc Mon Sep 17 00:00:00 2001 From: Ivan Yarcev Date: Fri, 16 Feb 2024 17:59:49 +0600 Subject: [PATCH 2/2] Removed comments --- source/libublsettingsui-gtk3.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/source/libublsettingsui-gtk3.c b/source/libublsettingsui-gtk3.c index 3f4057d..ce808b2 100644 --- a/source/libublsettingsui-gtk3.c +++ b/source/libublsettingsui-gtk3.c @@ -323,12 +323,9 @@ template_saving_window *yon_save_proceed(char *path,YON_CONFIG_TYPE type, ...){ gtk_window_set_title(GTK_WINDOW(window->Window),template_app_information.app_title); gtk_label_set_text(GTK_LABEL(window->HeaderTopic),template_app_information.app_title); gtk_image_set_from_pixbuf(GTK_IMAGE(window->HeaderImage),gtk_icon_theme_load_icon_for_scale(gtk_icon_theme_get_default(),yon_char_append("com.ublinux.",template_app_information.app_tech_name),32,1,GTK_ICON_LOOKUP_FORCE_SIZE,NULL)); - // yon_gtk_tree_view_minimal_fixed_size_set_full(GTK_TREE_VIEW(window->ParametersTree)); g_signal_connect(G_OBJECT(window->CancelButton),"clicked",G_CALLBACK(on_subwindow_close),NULL); g_signal_connect(G_OBJECT(window->SaveButton),"clicked", G_CALLBACK(on_save_parameters),window); g_signal_connect(G_OBJECT(window->ToggleCell),"toggled", G_CALLBACK(on_save_window_parameter_switched),window); - // g_signal_connect(G_OBJECT(window->OldValueColumn),"notify::width",G_CALLBACK(on_column_resize),window->OldValueCell); - // g_signal_connect(G_OBJECT(window->NewValueColumn),"notify::width",G_CALLBACK(on_column_resize),window->NewValueCell); int config_size=0; config_str config_strings = yon_config_get_all(&config_size); if (config_strings){ @@ -383,7 +380,7 @@ template_saving_window *yon_save_proceed(char *path,YON_CONFIG_TYPE type, ...){ char *combined = yon_char_unite("",value,"\n",compare_value,NULL); gtk_list_store_set(window->list,&iter,3,compare_value,4,NULL,6,section,7,combined,-1); free(combined); - if ((value&&!strcmp(value,compare_value))){ //||yon_char_is_empty(compare_value) + if ((value&&!strcmp(value,compare_value))){ gtk_list_store_set(window->list,&iter,0,0,3,value,5,0,-1); } else { if (yon_config_get_status(name)==1){ -- 2.35.1