diff options
author | Guy Harris <guy@alum.mit.edu> | 2012-05-20 08:56:06 +0000 |
---|---|---|
committer | Guy Harris <guy@alum.mit.edu> | 2012-05-20 08:56:06 +0000 |
commit | 4a9b825c49a228b6456fbf24731aadcdd47d2c4e (patch) | |
tree | 55a654e285d7298213738a4b58db5e65a09e59d8 /ui/gtk/drag_and_drop.c | |
parent | acc2a3706bf20e518f63492f424d0276d70e7e32 (diff) | |
download | wireshark-4a9b825c49a228b6456fbf24731aadcdd47d2c4e.tar.gz |
Change the "user_saved" member of a capture_file structure to
"unsaved_changes", and have it be TRUE iff changes have been made to the
file since it was read - *not* if it's a temporary file from a live
capture.
Check the "is_tempfile" member, and the "unsaved_changes" member, when
appropriate.
Just have a set_toolbar_for_capture_file() routine that updates the
"save", "close", and "reload" toolbar as appropriate, given a
capture_file structure - absorb the function of
set_toolbar_for_unsaved_capture_file() into it.
svn path=/trunk/; revision=42721
Diffstat (limited to 'ui/gtk/drag_and_drop.c')
-rw-r--r-- | ui/gtk/drag_and_drop.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/ui/gtk/drag_and_drop.c b/ui/gtk/drag_and_drop.c index 5db1be8a34..a11853d2b7 100644 --- a/ui/gtk/drag_and_drop.c +++ b/ui/gtk/drag_and_drop.c @@ -356,8 +356,10 @@ dnd_data_received(GtkWidget *widget _U_, GdkDragContext *dc _U_, gint x _U_, gin cf_names_freeme[sel_data_len] = '\0'; /* ask the user to save it's current capture file first */ - if((cfile.state != FILE_CLOSED) && !cfile.user_saved && prefs.gui_ask_unsaved) { - /* user didn't saved his current file, ask him */ + if((cfile.state != FILE_CLOSED) && (cfile.is_tempfile || cfile.unsaved_changes) && + prefs.gui_ask_unsaved) { + /* This is a temporary capture file or has unsaved changes; ask the + user whether to save the capture. */ dialog = simple_dialog(ESD_TYPE_CONFIRMATION, ESD_BTNS_SAVE_DONTSAVE_CANCEL, "%sSave capture file before opening a new one?%s\n\n" |