X-Git-Url: http://git.lttng.org./?a=blobdiff_plain;f=ltt%2Fbranches%2Fpoly%2Flttv%2Fmodules%2Fgui%2Ffilter%2Ffilter.c;h=fb67b72c77beb4c704403b3a5f640333b1177aeb;hb=c607371be079c36e281398a753221002c1c4c851;hp=c21239e5eb74852c7c9831853d1f4c153a4035a5;hpb=0fc64e11d52a1c0022d3c8d45afc17819db4db15;p=lttv.git diff --git a/ltt/branches/poly/lttv/modules/gui/filter/filter.c b/ltt/branches/poly/lttv/modules/gui/filter/filter.c index c21239e5..fb67b72c 100644 --- a/ltt/branches/poly/lttv/modules/gui/filter/filter.c +++ b/ltt/branches/poly/lttv/modules/gui/filter/filter.c @@ -103,6 +103,8 @@ struct _FilterViewerDataLine { struct _FilterViewerData { Tab *tab; /**< current tab of module */ + GtkWidget *f_window; /**< filter window */ + GtkWidget *f_main_box; /**< main container */ GtkWidget *f_expression_field; /**< entire expression (GtkEntry) */ @@ -119,7 +121,8 @@ struct _FilterViewerData { GPtrArray *f_math_op_options; /**< array of operators types for math_op box */ GtkWidget *f_add_button; /**< add expression to current expression (GtkButton) */ - + + gchar *name; /**< Name of the window in the main window */ }; /** @@ -133,7 +136,7 @@ struct _FilterViewerData { GtkWidget* guifilter_get_widget(FilterViewerData *fvd) { - return fvd->f_main_box; + return fvd->f_window; } /** @@ -146,7 +149,7 @@ guifilter_get_widget(FilterViewerData *fvd) FilterViewerData* gui_filter(Tab *tab) { - g_print("filter::gui_filter()"); + g_debug("filter::gui_filter()"); unsigned i; GtkCellRenderer *renderer; @@ -187,6 +190,7 @@ gui_filter(Tab *tab) */ g_ptr_array_add(fvd->f_field_options,(gpointer) g_string_new("tracefile.name")); g_ptr_array_add(fvd->f_field_options,(gpointer) g_string_new("trace.name")); + g_ptr_array_add(fvd->f_field_options,(gpointer) g_string_new("state.process_name")); g_ptr_array_add(fvd->f_field_options,(gpointer) g_string_new("state.pid")); g_ptr_array_add(fvd->f_field_options,(gpointer) g_string_new("state.ppid")); g_ptr_array_add(fvd->f_field_options,(gpointer) g_string_new("state.creation_time")); @@ -206,6 +210,8 @@ gui_filter(Tab *tab) g_ptr_array_add(fvd->f_math_op_options,(gpointer) g_string_new(">=")); + fvd->f_window = gtk_window_new(GTK_WINDOW_TOPLEVEL); + /* * Initiating GtkTable layout * starts with 2 rows and 5 columns and @@ -215,6 +221,8 @@ gui_filter(Tab *tab) gtk_table_set_row_spacings(GTK_TABLE(fvd->f_main_box),5); gtk_table_set_col_spacings(GTK_TABLE(fvd->f_main_box),5); + gtk_container_add(GTK_CONTAINER(fvd->f_window), GTK_WIDGET(fvd->f_main_box)); + /* * First half of the filter window * - textual entry of filter expression @@ -273,6 +281,7 @@ gui_filter(Tab *tab) * show main container */ gtk_widget_show(fvd->f_main_box); + gtk_widget_show(fvd->f_window); g_object_set_data_full( @@ -417,6 +426,10 @@ gui_filter_destructor(FilterViewerData *fvd) lttvwindowtraces_background_notify_remove(fvd); g_filter_list = g_slist_remove(g_filter_list, fvd); + + main_window_remove_child_window(tab, fvd->name); + + g_free(fvd->name); g_free(fvd); } @@ -436,10 +449,14 @@ GtkWidget * h_guifilter(Tab *tab) { FilterViewerData* f = gui_filter(tab) ; + f->name = g_new(gchar, 256); + + snprintf(f->name, 256, "guifilter %p", f); if(f) - return guifilter_get_widget(f); - else return NULL; + main_window_add_child_window(tab, f, + f->name, (GDestroyNotify)gui_filter_destructor); + return NULL; }