Fixed saving of ignored parameters

pull/35/head
Ivan Dmitrievich Yartsev 12 months ago
parent 0d71ef0e4d
commit 3d986cc6eb

@ -371,45 +371,49 @@ template_saving_window *yon_save_proceed(char *path,YON_CONFIG_TYPE type, ...){
struct loaded_config *current = NULL; struct loaded_config *current = NULL;
if (current_loaded){ if (current_loaded){
for_dictionaries(current,current_loaded){ for_dictionaries(current,current_loaded){
dictionary *dict = yon_dictionary_get((dictionary**)&config_compare,current->key); if (!yon_config_check_ignore(current->key)){
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; if (!yon_config_check_ignore(current->key)){
dictionary *dict = yon_dictionary_get((dictionary**)&current_loaded,current->key); GtkTreeIter iter;
if (!dict){ dictionary *dict = yon_dictionary_get((dictionary**)&current_loaded,current->key);
GdkRGBA rgba; if (!dict){
rgba.alpha=0.8; GdkRGBA rgba;
rgba.red=1; rgba.alpha=0.8;
rgba.blue=0.3; rgba.red=1;
rgba.green=0.65; rgba.blue=0.3;
char *rgba_string = gdk_rgba_to_string(&rgba); rgba.green=0.65;
int status=0; char *rgba_string = gdk_rgba_to_string(&rgba);
char *compare_string = yon_char_unite((char*)current->data,"\n",NULL); int status=0;
gtk_list_store_append(window->list,&iter); char *compare_string = yon_char_unite((char*)current->data,"\n",NULL);
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_append(window->list,&iter);
free(compare_string); 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);
free(compare_string);
}
} }
} }
} }
@ -744,6 +748,7 @@ void on_root_access(GtkWidget *self, template_main_window *widgets){
} }
if (getuid()!=0){ if (getuid()!=0){
argline = yon_char_unite("setsid /usr/bin/bash -c 'pkexec ",argline,"'; exit",NULL); argline = yon_char_unite("setsid /usr/bin/bash -c 'pkexec ",argline,"'; exit",NULL);
printf("%s\n",argline);
pthread_t thread_id; pthread_t thread_id;
pthread_create(&thread_id, NULL, (void *)on_root_get_root,argline); pthread_create(&thread_id, NULL, (void *)on_root_get_root,argline);
gtk_widget_destroy(widgets->Window); gtk_widget_destroy(widgets->Window);

Loading…
Cancel
Save