Added repeating paths highlight

pull/62/head
parent cc51f66b50
commit 1f616f716c

@ -717,6 +717,7 @@ void on_logrotate_save(GtkWidget *self, dictionary *dict){
return; return;
} }
GtkTreeIter *lastiter; GtkTreeIter *lastiter;
GtkTreeIter *lastitar;
for (;valid;valid=gtk_tree_model_iter_next(GTK_TREE_MODEL(window->list),&iter)){ for (;valid;valid=gtk_tree_model_iter_next(GTK_TREE_MODEL(window->list),&iter)){
char *cur_path; char *cur_path;
gtk_tree_model_get(GTK_TREE_MODEL(window->list),&iter,0,&cur_path,-1); gtk_tree_model_get(GTK_TREE_MODEL(window->list),&iter,0,&cur_path,-1);
@ -726,10 +727,11 @@ void on_logrotate_save(GtkWidget *self, dictionary *dict){
path_amount++; path_amount++;
paths = yon_char_unite(paths,strcmp(paths,"") ? "," : "", cur_path,NULL); paths = yon_char_unite(paths,strcmp(paths,"") ? "," : "", cur_path,NULL);
lastiter=gtk_tree_iter_copy(&iter); lastiter=gtk_tree_iter_copy(&iter);
lastitar=gtk_tree_iter_copy(&iter);
} }
if(!window->paths) { if(!window->paths) {
if (matched==path_amount) { if (matched==path_amount) {
yon_ubl_status_list_store_highlight_incorrect(window->list,lastiter); yon_ubl_status_highlight_incorrect(gtk_widget_get_parent(window->LogPathsTree));
yon_ubl_status_box_spawn(GTK_CONTAINER(window->StatusBox),REPEATED_PATHS_LABEL,5,BACKGROUND_IMAGE_FAIL_TYPE); yon_ubl_status_box_spawn(GTK_CONTAINER(window->StatusBox),REPEATED_PATHS_LABEL,5,BACKGROUND_IMAGE_FAIL_TYPE);
return; return;
} }
@ -740,7 +742,10 @@ void on_logrotate_save(GtkWidget *self, dictionary *dict){
int so=0; int so=0;
config_str paths_parsed = yon_char_parse(paths,&psize,","); config_str paths_parsed = yon_char_parse(paths,&psize,",");
if (yon_char_parsed_check_repeats(paths_parsed,psize,&fo,&so)){ if (yon_char_parsed_check_repeats(paths_parsed,psize,&fo,&so)){
yon_ubl_status_highlight_incorrect(gtk_widget_get_parent(window->LogPathsTree)); gtk_tree_model_get_iter_from_string(GTK_TREE_MODEL(window->list),lastiter,yon_char_from_int(fo));
gtk_tree_model_get_iter_from_string(GTK_TREE_MODEL(window->list),lastitar,yon_char_from_int(so));
yon_ubl_status_list_store_highlight_incorrect(window->list,lastiter);
yon_ubl_status_list_store_highlight_incorrect(window->list,lastitar);
yon_ubl_status_box_spawn(GTK_CONTAINER(window->StatusBox),REPEAT_PATHS_LABEL,5,BACKGROUND_IMAGE_FAIL_TYPE); yon_ubl_status_box_spawn(GTK_CONTAINER(window->StatusBox),REPEAT_PATHS_LABEL,5,BACKGROUND_IMAGE_FAIL_TYPE);
return; return;
} }

@ -2265,6 +2265,31 @@ void yon_ubl_status_highlight_incorrect(GtkWidget *widget){
GThread *thread = g_thread_new(NULL,(GThreadFunc)_yon_ubl_status_highlight_incorrect,widget); GThread *thread = g_thread_new(NULL,(GThreadFunc)_yon_ubl_status_highlight_incorrect,widget);
} }
void _yon_ubl_status_list_store_highlight_incorrect(GtkWidget **widget_pack){
GtkListStore *list = (GtkListStore*)widget_pack[0];
GtkTreeIter *iter = (GtkTreeIter*)widget_pack[1];
GdkRGBA rgba,rgba2;
rgba.alpha=1;
rgba.blue=153.0/255.0;
rgba.green=153.0/255.0;
rgba.red=234.0/255.0;
rgba2.alpha=1;
rgba2.blue=0;
rgba2.green=0;
rgba2.red=0;
printf("%s\n",gdk_rgba_to_string(&rgba));
gtk_list_store_set(list,iter,1,gdk_rgba_to_string(&rgba2),2,gdk_rgba_to_string(&rgba),-1);
sleep(5);
gtk_list_store_set(list,iter,1,NULL,2,NULL,-1);
}
void yon_ubl_status_list_store_highlight_incorrect(GtkListStore *list, GtkTreeIter *iter){
GtkWidget **pack = malloc(sizeof(GtkWidget *)*2);
pack[0]=(GtkWidget*)list;
pack[1]=(GtkWidget*)iter;
GThread *thread = g_thread_new(NULL,(GThreadFunc)_yon_ubl_status_list_store_highlight_incorrect,pack);
}
struct temp_statusbox { struct temp_statusbox {
int times; int times;
GtkWidget *revealer; GtkWidget *revealer;

@ -367,6 +367,8 @@ void yon_ubl_status_box_render(char *text, BACKGROUND_IMAGE_TYPE type);
void yon_ubl_status_highlight_incorrect(GtkWidget *widget); void yon_ubl_status_highlight_incorrect(GtkWidget *widget);
void yon_ubl_status_list_store_highlight_incorrect(GtkListStore *list, GtkTreeIter *iter);
static int status_thread_busy; static int status_thread_busy;
void yon_ubl_status_box_spawn(GtkContainer *container,char *display_text, int timeout,BACKGROUND_IMAGE_TYPE type); void yon_ubl_status_box_spawn(GtkContainer *container,char *display_text, int timeout,BACKGROUND_IMAGE_TYPE type);

Loading…
Cancel
Save