aboutsummaryrefslogtreecommitdiffstats
path: root/ui
diff options
context:
space:
mode:
authorAnders Broman <anders.broman@ericsson.com>2012-04-20 05:20:04 +0000
committerAnders Broman <anders.broman@ericsson.com>2012-04-20 05:20:04 +0000
commita094f232ea9ee747f6239c4849982d1170528a46 (patch)
tree9696bc32cc09eca1fcfb84d6e56d7f504dd66e9c /ui
parentb02b6a932f06981b25428e5167f8ceb93d48e582 (diff)
From Martin Kaiser: menus, main window title, icons are not reset when capture is interrupted before any data arrives. https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=7129
svn path=/trunk/; revision=42149
Diffstat (limited to 'ui')
-rw-r--r--ui/gtk/main.c29
1 files changed, 29 insertions, 0 deletions
diff --git a/ui/gtk/main.c b/ui/gtk/main.c
index 81cf2e8adc..75b18d2d46 100644
--- a/ui/gtk/main.c
+++ b/ui/gtk/main.c
@@ -1647,6 +1647,34 @@ main_capture_cb_capture_fixed_finished(capture_options *capture_opts _U_)
main_do_quit();
}
}
+
+static void
+main_capture_cb_capture_failed(capture_options *capture_opts _U_)
+{
+ static GList *icon_list = NULL;
+
+ /* the capture failed before the first packet was captured
+ reset title, menus and icon */
+
+ set_main_window_name("The Wireshark Network Analyzer");
+
+ set_menus_for_capture_in_progress(FALSE);
+ set_capture_if_dialog_for_capture_in_progress(FALSE);
+
+ main_set_for_capture_file(FALSE);
+
+ if(icon_list == NULL) {
+ icon_list = icon_list_create(wsicon16_xpm, wsicon32_xpm, wsicon48_xpm, wsicon64_xpm);
+ }
+ gtk_window_set_icon_list(GTK_WINDOW(top_level), icon_list);
+
+
+ if(global_capture_opts.quit_after_cap) {
+ /* command line asked us to quit after the capture */
+ /* don't pop up a dialog to ask for unsaved files etc. */
+ main_do_quit();
+ }
+}
#endif /* HAVE_LIBPCAP */
static void
@@ -1792,6 +1820,7 @@ main_capture_callback(gint event, capture_options *capture_opts, gpointer user_d
break;
case(capture_cb_capture_failed):
g_log(LOG_DOMAIN_MAIN, G_LOG_LEVEL_DEBUG, "Callback: capture failed");
+ main_capture_cb_capture_failed(capture_opts);
break;
default:
g_warning("main_capture_callback: event %u unknown", event);