Commit 4cc03f0a authored by winckel's avatar winckel

Fixed filter item selection issue.

Destroy filter menus when initializinf ilters.

git-svn-id: http://svn.eurecom.fr/openair4G/trunk@4319 818b1a75-f10b-46b9-bf7c-635c3b92a50f
parent d9c939dc
...@@ -319,9 +319,11 @@ gboolean ui_callback_on_tree_view_select(GtkWidget *widget, GdkEvent *event, gpo ...@@ -319,9 +319,11 @@ gboolean ui_callback_on_tree_view_select(GtkWidget *widget, GdkEvent *event, gpo
static gboolean ui_callback_on_menu_item_selected(GtkWidget *widget, gpointer data) static gboolean ui_callback_on_menu_item_selected(GtkWidget *widget, gpointer data)
{ {
ui_filter_item_t *filter_entry = data; ui_filter_item_t *filter_entry = data;
gboolean enabled;
// g_debug("ui_callback_on_menu_item_selected occurred %x %x %s", widget, data, filter_entry->name); enabled = gtk_check_menu_item_get_active (GTK_CHECK_MENU_ITEM(widget));
filter_entry->enabled = ~filter_entry->enabled; filter_entry->enabled = enabled;
// g_debug("ui_callback_on_menu_item_selected occurred %x %x %s %d", widget, data, filter_entry->name, enabled);
return TRUE; return TRUE;
} }
...@@ -346,7 +348,7 @@ static void ui_create_filter_menu(GtkWidget **menu, ui_filter_t *filter) ...@@ -346,7 +348,7 @@ static void ui_create_filter_menu(GtkWidget **menu, ui_filter_t *filter)
/* Connect function to be called when the menu item is selected */ /* Connect function to be called when the menu item is selected */
data = &filter->items[item]; data = &filter->items[item];
//g_debug("ui_create_filter_menu %x %x", menu_items, data); // g_debug("ui_create_filter_menu %x %x", menu_items, data);
g_signal_connect(G_OBJECT (menu_items), "activate", G_CALLBACK(ui_callback_on_menu_item_selected), data); g_signal_connect(G_OBJECT (menu_items), "activate", G_CALLBACK(ui_callback_on_menu_item_selected), data);
/* Show the widget */ /* Show the widget */
...@@ -358,11 +360,14 @@ static void ui_destroy_filter_menu(GtkWidget **menu, ui_filter_t *filter) ...@@ -358,11 +360,14 @@ static void ui_destroy_filter_menu(GtkWidget **menu, ui_filter_t *filter)
{ {
/* TODO destroy menu items ? */ /* TODO destroy menu items ? */
gtk_widget_destroy (*menu); if (*menu != NULL)
*menu = NULL; {
gtk_widget_destroy (*menu);
*menu = NULL;
}
} }
void ui_destroy_filter_menus() void ui_destroy_filter_menus(void)
{ {
ui_destroy_filter_menu (&ui_main_data.menu_filter_messages, &ui_filters.messages); ui_destroy_filter_menu (&ui_main_data.menu_filter_messages, &ui_filters.messages);
ui_destroy_filter_menu (&ui_main_data.menu_filter_origin_tasks, &ui_filters.origin_tasks); ui_destroy_filter_menu (&ui_main_data.menu_filter_origin_tasks, &ui_filters.origin_tasks);
...@@ -383,7 +388,7 @@ gboolean ui_callback_on_tree_column_header_click(GtkWidget *widget, gpointer dat ...@@ -383,7 +388,7 @@ gboolean ui_callback_on_tree_column_header_click(GtkWidget *widget, gpointer dat
{ {
col_type_e col = (col_type_e) data; col_type_e col = (col_type_e) data;
g_debug("ui_callback_on_tree_column_header_click %x", col); // g_debug("ui_callback_on_tree_column_header_click %x", col);
switch (col) switch (col)
{ {
case COL_SIGNAL: case COL_SIGNAL:
......
#ifndef UI_CALLBACKS_H_ #ifndef UI_CALLBACKS_H_
#define UI_CALLBACKS_H_ #define UI_CALLBACKS_H_
#include <gtk/gtk.h>
gboolean ui_callback_on_open_messages(GtkWidget *widget, gboolean ui_callback_on_open_messages(GtkWidget *widget,
GdkEvent *event, GdkEvent *event,
gpointer data); gpointer data);
...@@ -61,6 +63,8 @@ gboolean ui_callback_signal_clear_list(GtkWidget *widget, ...@@ -61,6 +63,8 @@ gboolean ui_callback_signal_clear_list(GtkWidget *widget,
gboolean ui_pipe_callback(gint source, gpointer user_data); gboolean ui_pipe_callback(gint source, gpointer user_data);
void ui_destroy_filter_menus(void);
gboolean ui_callback_on_tree_column_header_click(GtkWidget *widget, gboolean ui_callback_on_tree_column_header_click(GtkWidget *widget,
gpointer data); gpointer data);
#endif /* UI_CALLBACKS_H_ */ #endif /* UI_CALLBACKS_H_ */
...@@ -2,6 +2,7 @@ ...@@ -2,6 +2,7 @@
#include <stdlib.h> #include <stdlib.h>
#include <glib.h> #include <glib.h>
#include "ui_callbacks.h"
#include "ui_filters.h" #include "ui_filters.h"
#include "rc.h" #include "rc.h"
...@@ -45,6 +46,8 @@ int ui_init_filters(int reset, int clear_ids) ...@@ -45,6 +46,8 @@ int ui_init_filters(int reset, int clear_ids)
ui_init_filter (&ui_filters.origin_tasks, reset, clear_ids); ui_init_filter (&ui_filters.origin_tasks, reset, clear_ids);
ui_init_filter (&ui_filters.destination_tasks, reset, clear_ids); ui_init_filter (&ui_filters.destination_tasks, reset, clear_ids);
ui_destroy_filter_menus();
return (RC_OK); return (RC_OK);
} }
...@@ -109,10 +112,6 @@ void ui_filters_add(ui_filter_e filter, uint32_t value, char *name) ...@@ -109,10 +112,6 @@ void ui_filters_add(ui_filter_e filter, uint32_t value, char *name)
} }
} }
static void parse_filters(void)
{
}
static int write_filters_file(void) static int write_filters_file(void)
{ {
char *filter_file_name = "./filters.xml"; char *filter_file_name = "./filters.xml";
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment