X-Git-Url: http://git.lttng.org./?a=blobdiff_plain;f=ltt%2Fbranches%2Fpoly%2Flttv%2Fmodules%2Fgui%2Ffilter%2Ffilter.c;h=66108652e08061c69766f72a62cbf8c8e8afcd90;hb=0305fe774206ec12a98378be3cf891446b1b901c;hp=8420650957aabaa3cbbcc43550cbff070a71aa14;hpb=e433e6d6da2cc572a3d14257abe18bc3afd5c7e6;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 84206509..66108652 100644 --- a/ltt/branches/poly/lttv/modules/gui/filter/filter.c +++ b/ltt/branches/poly/lttv/modules/gui/filter/filter.c @@ -79,6 +79,7 @@ gboolean callback_enter_check(GtkWidget *widget, void callback_add_button(GtkWidget *widget, gpointer data); void callback_logical_op_box(GtkWidget *widget, gpointer data); void callback_expression_field(GtkWidget *widget, gpointer data); +void callback_cancel_button(GtkWidget *widget, gpointer data); /** * @struct _FilterViewerDataLine @@ -125,6 +126,7 @@ 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) */ + GtkWidget *f_cancel_button; /**< cancel and close dialog (GtkButton) */ }; @@ -189,6 +191,7 @@ gui_filter(LttvPlugin *plugin) g_ptr_array_add(fvd->f_field_options,(gpointer) g_string_new("event.category")); g_ptr_array_add(fvd->f_field_options,(gpointer) g_string_new("event.time")); g_ptr_array_add(fvd->f_field_options,(gpointer) g_string_new("event.tsc")); + g_ptr_array_add(fvd->f_field_options,(gpointer) g_string_new("event.target_pid")); /* * TODO: Add core.xml fields here ! */ @@ -220,6 +223,7 @@ gui_filter(LttvPlugin *plugin) gtk_window_set_transient_for(GTK_WINDOW(fvd->f_window), GTK_WINDOW(gtk_widget_get_toplevel(GTK_WIDGET(fvd->plugin->top_widget)))); gtk_window_set_destroy_with_parent(GTK_WINDOW(fvd->f_window), TRUE); + gtk_window_set_resizable(GTK_WINDOW(fvd->f_window), FALSE); /* * Initiating GtkTable layout @@ -267,7 +271,14 @@ gui_filter(LttvPlugin *plugin) g_signal_connect (G_OBJECT (fvd->f_add_button), "clicked", G_CALLBACK (callback_add_button), (gpointer) fvd); - gtk_table_attach( GTK_TABLE(fvd->f_main_box),fvd->f_add_button,6,7,1,2,GTK_FILL,GTK_FILL,0,0); + gtk_table_attach( GTK_TABLE(fvd->f_main_box),fvd->f_add_button,6,7,2,3,GTK_FILL,GTK_FILL,0,0); + + fvd->f_cancel_button = gtk_button_new_with_label("Cancel"); + gtk_widget_show (fvd->f_cancel_button); + g_signal_connect (G_OBJECT (fvd->f_cancel_button), "clicked", + G_CALLBACK (callback_cancel_button), (gpointer) fvd); + + gtk_table_attach( GTK_TABLE(fvd->f_main_box),fvd->f_cancel_button,6,7,1,2,GTK_FILL,GTK_FILL,0,0); fvd->f_logical_op_junction_box = gtk_combo_box_new_text(); for(i=0;if_logical_op_options->len;i++) { @@ -537,6 +548,20 @@ callback_process_button(GtkWidget *widget, gpointer data) { lttv_plugin_update_filter(fvd->plugin, filter); } +/** + * @fn void callback_cancel_button(GtkWidget*,gpointer) + * + * The Cancel Button callback function + * @param widget The Button widget passed to the callback function + * @param data Data sent along with the callback function + */ +void +callback_cancel_button(GtkWidget *widget, gpointer data) { + + FilterViewerData *fvd = (FilterViewerData*)data; + gtk_widget_destroy(fvd->f_window); +} + gboolean callback_enter_check(GtkWidget *widget, GdkEventKey *event, gpointer user_data)