diff options
author | sfisher <sfisher@f5534014-38df-0310-8fa8-9805f1628bb7> | 2006-11-16 07:04:02 +0000 |
---|---|---|
committer | sfisher <sfisher@f5534014-38df-0310-8fa8-9805f1628bb7> | 2006-11-16 07:04:02 +0000 |
commit | 5fd9bebe2cbb246d0247e33a226231ac72821592 (patch) | |
tree | 3eca0ad58a90d2ecc6a7b2736c78719650f03983 | |
parent | 015e0707fbe2013f3a8bb5cef73ef750e6e38c94 (diff) |
Fix for bug 948, "Apply capture preferences not applying." Now when the user
changes a capture option in the preferences, it will show up right away in
the capture options dialog.
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@19908 f5534014-38df-0310-8fa8-9805f1628bb7
-rw-r--r-- | gtk/main.c | 30 | ||||
-rw-r--r-- | gtk/main.h | 3 | ||||
-rw-r--r-- | gtk/prefs_dlg.c | 9 |
3 files changed, 31 insertions, 11 deletions
diff --git a/gtk/main.c b/gtk/main.c index 3782fecff8..d931848e7c 100644 --- a/gtk/main.c +++ b/gtk/main.c @@ -2428,17 +2428,8 @@ main(int argc, char *argv[]) } #endif -#ifdef HAVE_LIBPCAP - /* Set promiscuous mode from the preferences setting. */ - /* the same applies to other preferences settings as well. */ - capture_opts->promisc_mode = prefs->capture_prom_mode; - capture_opts->show_info = prefs->capture_show_info; - capture_opts->real_time_mode = prefs->capture_real_time; - auto_scroll_live = prefs->capture_auto_scroll; -#endif /* HAVE_LIBPCAP */ - - /* Set the name resolution code's flags from the preferences. */ - g_resolv_flags = prefs->name_resolve; + /* Fill in capture options with values from the preferences */ + prefs_to_capture_opts(); /* Read the capture filter file. */ read_filter_list(CFILTER_LIST, &cf_path, &cf_open_errno); @@ -4333,3 +4324,20 @@ show_main_window(gboolean doing_work) } #endif /* HAVE_AIRPCAP */ } + +/* Fill in capture options with values from the preferences */ +void +prefs_to_capture_opts(void) +{ +#ifdef HAVE_LIBPCAP + /* Set promiscuous mode from the preferences setting. */ + /* the same applies to other preferences settings as well. */ + capture_opts->promisc_mode = prefs.capture_prom_mode; + capture_opts->show_info = prefs.capture_show_info; + capture_opts->real_time_mode = prefs.capture_real_time; + auto_scroll_live = prefs.capture_auto_scroll; +#endif /* HAVE_LIBPCAP */ + + /* Set the name resolution code's flags from the preferences. */ + g_resolv_flags = prefs.name_resolve; +} diff --git a/gtk/main.h b/gtk/main.h index a02a537925..5cfb272f4e 100644 --- a/gtk/main.h +++ b/gtk/main.h @@ -324,4 +324,7 @@ extern void packets_bar_update(void); extern void create_console(void); #endif +/* Fill in capture options with values from the preferences */ +extern void prefs_to_capture_opts(void); + #endif /* __MAIN_H__ */ diff --git a/gtk/prefs_dlg.c b/gtk/prefs_dlg.c index ea1fa31d23..792f3c29a8 100644 --- a/gtk/prefs_dlg.c +++ b/gtk/prefs_dlg.c @@ -1371,6 +1371,9 @@ prefs_main_ok_cb(GtkWidget *ok_bt _U_, gpointer parent_w) prefs_main_apply_all(parent_w); + /* Fill in capture options with values from the preferences */ + prefs_to_capture_opts(); + #ifdef HAVE_AIRPCAP prefs_airpcap_update(); #endif @@ -1400,6 +1403,9 @@ prefs_main_apply_cb(GtkWidget *apply_bt _U_, gpointer parent_w) prefs_main_apply_all(parent_w); + /* Fill in capture options with values from the preferences */ + prefs_to_capture_opts(); + #ifdef HAVE_AIRPCAP prefs_airpcap_update(); #endif @@ -1436,6 +1442,9 @@ prefs_main_save_cb(GtkWidget *save_bt _U_, gpointer parent_w) 4) we did apply the protocol preferences, at least, in the past. */ prefs_main_apply_all(parent_w); + /* Fill in capture options with values from the preferences */ + prefs_to_capture_opts(); + if (must_redissect) { /* Redissect all the packets, and re-evaluate the display filter. */ cf_redissect_packets(&cfile); |