Don't set the sensitivity of the Open button based on whether we can
authorguy <guy@f5534014-38df-0310-8fa8-9805f1628bb7>
Wed, 12 May 2010 19:44:23 +0000 (19:44 +0000)
committerguy <guy@f5534014-38df-0310-8fa8-9805f1628bb7>
Wed, 12 May 2010 19:44:23 +0000 (19:44 +0000)
open the currently-selected file; that button is also used to select the
file or directory typed in the location bar.  This should fix bug 1791.

git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@32774 f5534014-38df-0310-8fa8-9805f1628bb7

gtk/capture_file_dlg.c

index 43f409c5b609b0365388cbbe95bbcd90354b69ab..e19f5bdbef4a13ffaac07047d0f3f67dec2d61eb 100644 (file)
@@ -342,9 +342,32 @@ file_open_entry_changed(GtkWidget *w _U_, gpointer file_sel)
     /* make the preview widget sensitive */
     gtk_widget_set_sensitive(prev, have_preview);
 
+    /*
+     * XXX - if the Open button isn't sensitive, you can't type into
+     * the location bar and select the file or directory you've typed.
+     * See
+     *
+     * https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=1791
+     *
+     * It's not as if allowing users to click Open when they've
+     * selected a file that's not a valid capture file will cause
+     * anything worse than an error dialog, so we'll leave the Open
+     * button sensitive for now.  Perhaps making it sensitive if
+     * cf_name is NULL would also work, although I don't know whether
+     * there are any cases where it would be non-null when you've
+     * typed in the location bar.
+     *
+     * XXX - Bug 1791 also notes that, with the line removed, Bill
+     * Meier "somehow managed to get the file chooser window somewhat
+     * wedged in that neither the cancel or open buttons were responsive".
+     * That seems a bit odd, given that, without this line, we're not
+     * monkeying with the Open button's sensitivity, but...
+     */
+#if 0
     /* make the open/save/... dialog button sensitive */
 
     gtk_dialog_set_response_sensitive(file_sel, GTK_RESPONSE_ACCEPT, have_preview);
+#endif
 
     /* do the actual preview */
     if(have_preview)