diff options
author | ulfl <ulfl@f5534014-38df-0310-8fa8-9805f1628bb7> | 2005-12-31 17:09:27 +0000 |
---|---|---|
committer | ulfl <ulfl@f5534014-38df-0310-8fa8-9805f1628bb7> | 2005-12-31 17:09:27 +0000 |
commit | 7c4fca254fe1e4852ab9e4ba0d3cc6647c7cdee3 (patch) | |
tree | 55286d49e994f63ce7507ac842fb9229fa5f7a53 /gtk | |
parent | 163d3dd28b7c047b7cb6d25d773ec573652c380e (diff) |
fix #152
set the read filter dialog modal and transient to the parent window if requested. This way, it will receive input signals (solving problems with GTK2's gtk_file_chooser).
To do this, add another construct_args flag, so it will be modal only if really needed ...
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@16926 f5534014-38df-0310-8fa8-9805f1628bb7
Diffstat (limited to 'gtk')
-rw-r--r-- | gtk/dcerpc_stat.c | 3 | ||||
-rw-r--r-- | gtk/file_dlg.c | 6 | ||||
-rw-r--r-- | gtk/filter_dlg.c | 15 | ||||
-rw-r--r-- | gtk/filter_dlg.h | 2 | ||||
-rw-r--r-- | gtk/find_dlg.c | 3 | ||||
-rw-r--r-- | gtk/io_stat.c | 1 | ||||
-rw-r--r-- | gtk/main.c | 3 | ||||
-rw-r--r-- | gtk/rpc_stat.c | 3 | ||||
-rw-r--r-- | gtk/tap_dfilter_dlg.c | 1 |
9 files changed, 28 insertions, 9 deletions
diff --git a/gtk/dcerpc_stat.c b/gtk/dcerpc_stat.c index d2950e83f3..1116690057 100644 --- a/gtk/dcerpc_stat.c +++ b/gtk/dcerpc_stat.c @@ -550,7 +550,8 @@ gtk_dcerpcstat_cb(GtkWidget *w _U_, gpointer d _U_) static construct_args_t args = { "Service Response Time Statistics Filter", FALSE, - FALSE + FALSE, + FALSE }; /* if the window is already open, bring it to front and diff --git a/gtk/file_dlg.c b/gtk/file_dlg.c index 3d60e7fd94..a2a6dd0da8 100644 --- a/gtk/file_dlg.c +++ b/gtk/file_dlg.c @@ -431,7 +431,8 @@ file_open_cmd(GtkWidget *w) static construct_args_t args = { "Ethereal: Read Filter", FALSE, - FALSE + FALSE, + TRUE }; if (file_open_w != NULL) { @@ -760,7 +761,8 @@ file_merge_cmd(GtkWidget *w) static construct_args_t args = { "Ethereal: Read Filter", FALSE, - FALSE + FALSE, + TRUE }; if (file_merge_w != NULL) { diff --git a/gtk/filter_dlg.c b/gtk/filter_dlg.c index 2568f2825b..bfa0c7768d 100644 --- a/gtk/filter_dlg.c +++ b/gtk/filter_dlg.c @@ -105,7 +105,8 @@ capture_filter_construct_cb(GtkWidget *w, gpointer user_data _U_) static construct_args_t args = { "Ethereal: Capture Filter", FALSE, - FALSE + FALSE, + FALSE }; /* Has a filter dialog box already been opened for that button? */ @@ -194,7 +195,8 @@ cfilter_dialog_cb(GtkWidget *w _U_) static construct_args_t args = { "Ethereal: Capture Filter", FALSE, - FALSE + FALSE, + FALSE }; /* Has a filter dialog box already been opened for editing @@ -222,7 +224,8 @@ dfilter_dialog_cb(GtkWidget *w _U_) static construct_args_t args = { "Ethereal: Display Filter", TRUE, - TRUE + TRUE, + FALSE }; display_filter_construct_cb(OBJECT_GET_DATA(top_level, E_FILT_BT_PTR_KEY), &args); @@ -362,6 +365,12 @@ filter_dialog_new(GtkWidget *button, GtkWidget *parent_filter_te, gtk_window_set_default_size(GTK_WINDOW(main_w), 400, 400); OBJECT_SET_DATA(main_w, E_FILT_CONSTRUCT_ARGS_KEY, construct_args); + if(construct_args->modal_and_transient) { + GdkWindow* parent = gtk_widget_get_parent_window(parent_filter_te); + gtk_window_set_transient_for(GTK_WINDOW(main_w), GTK_WINDOW(parent)); + gtk_window_set_modal(GTK_WINDOW(main_w), TRUE); + } + main_vb = gtk_vbox_new(FALSE, 0); gtk_container_border_width(GTK_CONTAINER(main_vb), 5); gtk_container_add(GTK_CONTAINER(main_w), main_vb); diff --git a/gtk/filter_dlg.h b/gtk/filter_dlg.h index 2d1417e090..822c37f363 100644 --- a/gtk/filter_dlg.h +++ b/gtk/filter_dlg.h @@ -41,6 +41,8 @@ typedef struct { gboolean wants_apply_button; /**< dialog should have an Apply button */ gboolean activate_on_ok; /**< if parent text widget should be activated on "Ok" or "Apply" */ + gboolean modal_and_transient; /**< dialog is modal and transient to the + parent window (e.g. to gtk_file_chooser) */ } construct_args_t; /** Create a "Capture Filter" dialog box caused by a button click. diff --git a/gtk/find_dlg.c b/gtk/find_dlg.c index d7d0cfec35..280ac2203d 100644 --- a/gtk/find_dlg.c +++ b/gtk/find_dlg.c @@ -125,7 +125,8 @@ find_frame_cb(GtkWidget *w _U_, gpointer d _U_) static construct_args_t args = { "Ethereal: Search Filter", FALSE, - TRUE + TRUE, + FALSE }; if (find_frame_w != NULL) { diff --git a/gtk/io_stat.c b/gtk/io_stat.c index bfb4a5f40e..fe382a877e 100644 --- a/gtk/io_stat.c +++ b/gtk/io_stat.c @@ -1085,6 +1085,7 @@ gtk_iostat_init(const char *optarg _U_) io->graphs[i].args->title = NULL; io->graphs[i].args->wants_apply_button=TRUE; io->graphs[i].args->activate_on_ok=TRUE; + io->graphs[i].args->modal_and_transient=FALSE; io->graphs[i].filter_bt=NULL; } diff --git a/gtk/main.c b/gtk/main.c index fb786c74b0..5c040a3ceb 100644 --- a/gtk/main.c +++ b/gtk/main.c @@ -3273,7 +3273,8 @@ create_main_window (gint pl_size, gint tv_size, gint bv_size, e_prefs *prefs) static construct_args_t args = { "Ethereal: Display Filter", TRUE, - TRUE + TRUE, + FALSE }; /* use user-defined title if preference is set */ diff --git a/gtk/rpc_stat.c b/gtk/rpc_stat.c index 920341b81f..69978dcb53 100644 --- a/gtk/rpc_stat.c +++ b/gtk/rpc_stat.c @@ -418,7 +418,8 @@ gtk_rpcstat_cb(GtkWidget *w _U_, gpointer d _U_) static construct_args_t args = { "Service Response Time Statistics Filter", TRUE, - FALSE + FALSE, + FALSE }; /* if the window is already open, bring it to front */ diff --git a/gtk/tap_dfilter_dlg.c b/gtk/tap_dfilter_dlg.c index 967950e331..8781b29cc0 100644 --- a/gtk/tap_dfilter_dlg.c +++ b/gtk/tap_dfilter_dlg.c @@ -160,6 +160,7 @@ tap_dfilter_dlg_cb(GtkWidget *w _U_, gpointer data) end_dlg_list->args.title = g_strdup_printf("%s Filter", dlg_data->win_title); end_dlg_list->args.wants_apply_button = TRUE; end_dlg_list->args.activate_on_ok = FALSE; + end_dlg_list->args.modal_and_transient = FALSE; end_dlg_list->next = NULL; dlg_data->index = end_dlg_list->cont.index; current_dlg = end_dlg_list; |