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