|
|
|
|
@ -186,27 +186,27 @@ template_saving_window *yon_save_proceed(char *path,YON_CONFIG_TYPE type, ...){
|
|
|
|
|
struct loaded_config loaded;
|
|
|
|
|
loaded.dict = yon_dictionary_new();
|
|
|
|
|
dictionary *dct;
|
|
|
|
|
for_dictionaries(dct,section_commands){
|
|
|
|
|
char *command = yon_char_unite(ubconfig_load_command," default get ", dct->key," ", yon_dictionary_get_data(dct,char*),NULL);
|
|
|
|
|
FILE *output = popen(command, "r");
|
|
|
|
|
char **output_strings = NULL;
|
|
|
|
|
output_strings = malloc(sizeof(char*));
|
|
|
|
|
int i = 0;
|
|
|
|
|
char str[4096];
|
|
|
|
|
memset(str, 0, 4096);
|
|
|
|
|
while (fgets(str, 4096, output))
|
|
|
|
|
{
|
|
|
|
|
if (!yon_char_is_empty(str)&& strcmp(str,"(null)\n")!=0)
|
|
|
|
|
{
|
|
|
|
|
char *final_str = yon_char_new(str);
|
|
|
|
|
char *key =yon_char_divide_search(final_str,"=",-1);
|
|
|
|
|
if (final_str[strlen(final_str)-1]=='\n')final_str[strlen(final_str)-1]='\0';
|
|
|
|
|
yon_dictionary_add_or_create_if_exists_with_data(loaded.dict,NULL,yon_char_new(dct->key));
|
|
|
|
|
yon_dictionary_add_or_create_if_exists_with_data(loaded.dict,key,yon_char_new(final_str));
|
|
|
|
|
yon_char_parsed_add_or_create_if_exists(config_compare,&compare_size,yon_char_new(str));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
// for_dictionaries(dct,section_commands){
|
|
|
|
|
// char *command = yon_char_unite(ubconfig_load_command," default get ", dct->key," ", yon_dictionary_get_data(dct,char*),NULL);
|
|
|
|
|
// FILE *output = popen(command, "r");
|
|
|
|
|
// char **output_strings = NULL;
|
|
|
|
|
// output_strings = malloc(sizeof(char*));
|
|
|
|
|
// int i = 0;
|
|
|
|
|
// char str[4096];
|
|
|
|
|
// memset(str, 0, 4096);
|
|
|
|
|
// while (fgets(str, 4096, output))
|
|
|
|
|
// {
|
|
|
|
|
// if (!yon_char_is_empty(str)&& strcmp(str,"(null)\n")!=0)
|
|
|
|
|
// {
|
|
|
|
|
// char *final_str = yon_char_new(str);
|
|
|
|
|
// char *key =yon_char_divide_search(final_str,"=",-1);
|
|
|
|
|
// if (final_str[strlen(final_str)-1]=='\n')final_str[strlen(final_str)-1]='\0';
|
|
|
|
|
// yon_dictionary_add_or_create_if_exists_with_data(loaded.dict,NULL,yon_char_new(dct->key));
|
|
|
|
|
// yon_dictionary_add_or_create_if_exists_with_data(loaded.dict,key,yon_char_new(final_str));
|
|
|
|
|
// yon_char_parsed_add_or_create_if_exists(config_compare,&compare_size,yon_char_new(str));
|
|
|
|
|
// }
|
|
|
|
|
// }
|
|
|
|
|
// }
|
|
|
|
|
for_dictionaries(dct,section_commands){
|
|
|
|
|
char *command = yon_char_unite(ubconfig_load_command," ", config_to_save," get ", dct->key," ", yon_dictionary_get_data(dct,char*),NULL);
|
|
|
|
|
FILE *output = popen(command, "r");
|
|
|
|
|
@ -255,7 +255,7 @@ 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));
|
|
|
|
|
// 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);
|
|
|
|
|
|