summaryrefslogtreecommitdiff
path: root/gtk/capture_file_dlg.c
diff options
context:
space:
mode:
authorStig Bjørlykke <stig@bjorlykke.org>2008-01-26 16:45:29 +0000
committerStig Bjørlykke <stig@bjorlykke.org>2008-01-26 16:45:29 +0000
commit9c8078686ec6a20b3c3c9880ed3145a402adfc33 (patch)
treea60d5ffa487f90262c7b73b483f514ab94802408 /gtk/capture_file_dlg.c
parent8d512b51d2aecef79e587e14e7f087c72f9ef44e (diff)
downloadwireshark-9c8078686ec6a20b3c3c9880ed3145a402adfc33.tar.gz
Destroy the save window after canceling a save to an existing file, so
the user is able to save again without having a hidden save window which will not open. Older GTK versions will show the hidden window after failure. This fixes bug 1896. svn path=/trunk/; revision=24202
Diffstat (limited to 'gtk/capture_file_dlg.c')
-rw-r--r--gtk/capture_file_dlg.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/gtk/capture_file_dlg.c b/gtk/capture_file_dlg.c
index dc5c162a85..244a2b1efd 100644
--- a/gtk/capture_file_dlg.c
+++ b/gtk/capture_file_dlg.c
@@ -1493,6 +1493,15 @@ static void file_save_as_exists_answered_cb(gpointer dialog _U_, gint btn, gpoin
file_save_as_cb(NULL, data);
break;
case(ESD_BTN_CANCEL):
+#if (GTK_MAJOR_VERSION == 2 && GTK_MINOR_VERSION >= 4) || GTK_MAJOR_VERSION > 2
+ /* XXX - as we cannot start a new event loop (using gtk_dialog_run()),
+ * as this will prevent the user from closing the now existing error
+ * message, simply close the dialog (this is the best we can do here). */
+ if (file_save_as_w)
+ window_destroy(file_save_as_w);
+#else
+ gtk_widget_show(file_save_as_w);
+#endif
break;
default:
g_assert_not_reached();