GNOME Bugzilla – Bug 505857
filepath entered in location bar should be loaded after user press 'enter'
Last modified: 2008-03-07 08:57:01 UTC
Currently, when user enter a file path in the location bar in filechooser, the contents will not refresh after user pressing 'enter' key, although it can be workaround to clock on the 'Ok' button. Some gnome applications such as gedit implemented their own filechooser, which has this functionality. I don't know if there is any special reason why we don't implement this feature on filechooser as I think this is very useful. and only 4 lines of codes need to be added. Can some one provide some feedback on why we don't do this. Other information: This is a suggested fix for this bug --- gtk/gtkfilechooserdialog.c.orig 2007-10-16 21:20:38.000000000 +0800 +++ gtk/gtkfilechooserdialog.c 2007-12-27 16:20:18.388325000 +0800 @@ -465,6 +465,12 @@ { response_id = va_arg (varargs, gint); gtk_dialog_add_button (GTK_DIALOG (result), button_text, response_id); + + if ((response_id == GTK_RESPONSE_OK) || + (response_id == GTK_RESPONSE_ACCEPT) || + (response_id == GTK_RESPONSE_YES) || + (response_id == GTK_RESPONSE_APPLY)) + gtk_dialog_set_default_response (GTK_DIALOG (result), response_id); button_text = va_arg (varargs, const gchar *); }
Maybe related also with http://bugzilla.gnome.org/show_bug.cgi?id=482534
brasero and gnome-appearance-properties also suffer this problem, Should I open a separate bug report or wait for this? Thanks for the info
Thanks for catching this! Indeed, the problem happens with apps that don't call gtk_dialog_set_default_response() after creating the file chooser dialog. I'll commit your patch with some small fixes.
Created attachment 106754 [details] [review] gtk2-bgo505857-filechooser-dialog-ensure-default-response.diff This is now in trunk and gtk-2-12. Note that we ensure the default response in the ::map() handler, not in _new_valist(), so that people that use g_object_new() instead of gtk_file_chooser_dialog_new() will also get this functionality. Thanks for the patch, Chris! 2008-03-06 Federico Mena Quintero <federico@novell.com> Fix http://bugzilla.gnome.org/show_bug.cgi?id=505857 - GtkFileChooserDialog should set a default response button if the app doesn't set it. Based on a patch by Chris Wang <chris.wang@sun.com>. * gtk/gtkfilechooserdialog.c (is_stock_accept_response_id): New function, refactor from where there was duplicated code. (gtk_file_chooser_dialog_new_valist): If the response ID for the button is one of the stock ones, make it the default response button.
Is this the same bug that when using deluge and the desktop is the default folder I still have to double click on it to be able to click open?