diff options
author | Anders Broman <anders.broman@ericsson.com> | 2011-10-05 05:53:53 +0000 |
---|---|---|
committer | Anders Broman <anders.broman@ericsson.com> | 2011-10-05 05:53:53 +0000 |
commit | 33fc6f13caf49b4109f30a0652bb04d756d6504e (patch) | |
tree | 99200499803a28b41fc2afde9cca4ec794a3579d /gtk | |
parent | c22cc0a5bb93d93d5452c32848a03761a5474f3c (diff) |
Michael Mann:
Removed the Save button if live capture is going on when File->Quit is selected. Solves Assertion failed when doing File->Quit->Save during live capture
https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=1710
svn path=/trunk/; revision=39266
Diffstat (limited to 'gtk')
-rw-r--r-- | gtk/main.c | 16 | ||||
-rw-r--r-- | gtk/simple_dialog.c | 3 |
2 files changed, 12 insertions, 7 deletions
diff --git a/gtk/main.c b/gtk/main.c index a94dbbf6c8..d40bae7ba5 100644 --- a/gtk/main.c +++ b/gtk/main.c @@ -1008,7 +1008,8 @@ main_window_delete_event_cb(GtkWidget *widget _U_, GdkEvent *event _U_, gpointer if((cfile.state != FILE_CLOSED) && !cfile.user_saved && prefs.gui_ask_unsaved) { gtk_window_present(GTK_WINDOW(top_level)); /* user didn't saved his current file, ask him */ - dialog = simple_dialog(ESD_TYPE_CONFIRMATION, ESD_BTNS_SAVE_QUIT_DONTSAVE_CANCEL, + dialog = simple_dialog(ESD_TYPE_CONFIRMATION, + ((cfile.state == FILE_READ_IN_PROGRESS) ? ESD_BTNS_QUIT_DONTSAVE_CANCEL : ESD_BTNS_SAVE_QUIT_DONTSAVE_CANCEL), "%sSave capture file before program quit?%s\n\n" "If you quit the program without saving, your capture data will be discarded.", simple_dialog_primary_start(), simple_dialog_primary_end()); @@ -1113,12 +1114,13 @@ file_quit_cmd_cb(GtkWidget *widget _U_, gpointer data _U_) gpointer dialog; if((cfile.state != FILE_CLOSED) && !cfile.user_saved && prefs.gui_ask_unsaved) { - /* user didn't saved his current file, ask him */ - dialog = simple_dialog(ESD_TYPE_CONFIRMATION, ESD_BTNS_SAVE_QUIT_DONTSAVE_CANCEL, - "%sSave capture file before program quit?%s\n\n" - "If you quit the program without saving, your capture data will be discarded.", - simple_dialog_primary_start(), simple_dialog_primary_end()); - simple_dialog_set_cb(dialog, file_quit_answered_cb, NULL); + /* user didn't saved his current file, ask him */ + dialog = simple_dialog(ESD_TYPE_CONFIRMATION, + ((cfile.state == FILE_READ_IN_PROGRESS) ? ESD_BTNS_QUIT_DONTSAVE_CANCEL : ESD_BTNS_SAVE_QUIT_DONTSAVE_CANCEL), + "%sSave capture file before program quit?%s\n\n" + "If you quit the program without saving, your capture data will be discarded.", + simple_dialog_primary_start(), simple_dialog_primary_end()); + simple_dialog_set_cb(dialog, file_quit_answered_cb, NULL); } else { /* unchanged file, just exit */ main_do_quit(); diff --git a/gtk/simple_dialog.c b/gtk/simple_dialog.c index a5e31da0ed..56c4d76e25 100644 --- a/gtk/simple_dialog.c +++ b/gtk/simple_dialog.c @@ -196,6 +196,9 @@ display_simple_dialog(gint type, gint btn_mask, char *message) case(ESD_BTNS_SAVE_QUIT_DONTSAVE_CANCEL): bbox = dlg_button_row_new(GTK_STOCK_SAVE, WIRESHARK_STOCK_QUIT_DONT_SAVE, GTK_STOCK_CANCEL, NULL); break; + case (ESD_BTNS_QUIT_DONTSAVE_CANCEL): + bbox = dlg_button_row_new(WIRESHARK_STOCK_QUIT_DONT_SAVE, GTK_STOCK_CANCEL, NULL); + break; case(ESD_BTNS_YES_NO): bbox = dlg_button_row_new(GTK_STOCK_YES, GTK_STOCK_NO, NULL); break; |