|
|
|
@ -485,25 +485,29 @@ void on_logrotate_configuration_path_add(GtkWidget *self, logrotate_configure_wi
|
|
|
|
|
gtk_tree_view_set_cursor(GTK_TREE_VIEW(window->LogPathsTree),gtk_tree_model_get_path(model,&iter),column,1);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void on_path_editing_done(GtkCellRendererText* self,gchar* path,gchar* new_text,logrotate_configure_window *window){
|
|
|
|
|
void on_path_editing_done(GtkCellRendererText* self,gchar* gtkpath,gchar* new_text,logrotate_configure_window *window){
|
|
|
|
|
GtkTreeIter iter, itar;
|
|
|
|
|
char *cur_path;
|
|
|
|
|
gtk_tree_model_get_iter(GTK_TREE_MODEL(window->list),&iter,gtk_tree_path_new_from_string(path));
|
|
|
|
|
gtk_tree_model_get_iter(GTK_TREE_MODEL(window->list),&iter,gtk_tree_path_new_from_string(gtkpath));
|
|
|
|
|
gtk_tree_model_get(GTK_TREE_MODEL(window->list),&iter,0,&cur_path,-1);
|
|
|
|
|
int deleted=0;
|
|
|
|
|
|
|
|
|
|
if (!strcmp(new_text,"")||cur_path&&!strcmp(cur_path,""))
|
|
|
|
|
gtk_list_store_remove(window->list,&iter);
|
|
|
|
|
else if (new_text&&strcmp(new_text,"")){
|
|
|
|
|
int deleted=0;
|
|
|
|
|
int valid = gtk_tree_model_get_iter_first(GTK_TREE_MODEL(window->list),&itar);
|
|
|
|
|
for (;valid;valid=gtk_tree_model_iter_next(GTK_TREE_MODEL(window->list),&itar)){
|
|
|
|
|
char *path;
|
|
|
|
|
gtk_tree_model_get(GTK_TREE_MODEL(window->list),&itar,0,&path,-1);
|
|
|
|
|
if (path&&new_text)
|
|
|
|
|
int comp = gtk_tree_path_compare(gtk_tree_path_new_from_string(gtkpath),gtk_tree_model_get_path(GTK_TREE_MODEL(window->list),&itar));
|
|
|
|
|
if (path&&new_text&& comp)
|
|
|
|
|
if (!strcmp(path,new_text)){
|
|
|
|
|
yon_ubl_status_list_store_highlight_incorrect(window->list,gtk_tree_iter_copy(&itar));
|
|
|
|
|
yon_ubl_status_list_store_highlight_incorrect(window->list,gtk_tree_iter_copy(&iter));
|
|
|
|
|
yon_ubl_status_box_spawn(GTK_CONTAINER(window->StatusBox),REPEAT_PATHS_LABEL,5,BACKGROUND_IMAGE_FAIL_TYPE);
|
|
|
|
|
gtk_list_store_remove(window->list,&iter);
|
|
|
|
|
new_text[strlen(new_text)-1]='\0';
|
|
|
|
|
gtk_list_store_set(window->list,&iter,0,new_text,-1);
|
|
|
|
|
|
|
|
|
|
deleted=1;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
@ -511,11 +515,11 @@ void on_path_editing_done(GtkCellRendererText* self,gchar* path,gchar* new_text,
|
|
|
|
|
gtk_list_store_set(window->list,&iter,0,new_text,-1);
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
GValue *val = g_malloc0(sizeof(GValue));
|
|
|
|
|
g_object_get_property(G_OBJECT(self),"editable",val);
|
|
|
|
|
g_value_set_boolean(val,0);
|
|
|
|
|
g_object_set_property(G_OBJECT(self),"editable",val);
|
|
|
|
|
free(val);
|
|
|
|
|
GValue *val = g_malloc0(sizeof(GValue));
|
|
|
|
|
g_object_get_property(G_OBJECT(self),"editable",val);
|
|
|
|
|
g_value_set_boolean(val,0);
|
|
|
|
|
g_object_set_property(G_OBJECT(self),"editable",val);
|
|
|
|
|
free(val);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void on_path_editing_cancel(GtkCellRendererText* self,logrotate_configure_window *window){
|
|
|
|
|