After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 158423 - Confirming the Location dialog should accept the file chooser and close it
Confirming the Location dialog should accept the file chooser and close it
Status: RESOLVED FIXED
Product: gtk+
Classification: Platform
Component: Widget: GtkFileChooser
2.4.x
Other Windows
: Normal trivial
: Small fix
Assigned To: gtk-bugs
Federico Mena Quintero
: 308917 315523 324995 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2004-11-16 02:12 UTC by Phil Harper
Modified: 2006-10-19 15:50 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
patch to implement the suggested behaviour (2.67 KB, patch)
2005-05-25 13:19 UTC, Sven Neumann
needs-work Details | Review
patch changed as suggested (includes debugging statements!) (1.06 KB, patch)
2005-05-26 11:36 UTC, Sven Neumann
none Details | Review
complete version of previous patch (3.20 KB, patch)
2005-05-26 11:38 UTC, Sven Neumann
none Details | Review

Description Phil Harper 2004-11-16 02:12:02 UTC
there are a few issues listed here, because they're fairly trivial, and they may
not be GIMP specific but general GTK issues, i'm afraid that i've only got GIMP
installed to test with at the moment.

Ctrl+L can be used to display the "Save in location" dialog as many times as you
like until you press the cancel button in that dialog and then cancel the save
dialog too. now, if you attempt to save the image again, Ctrl+L will no longer
work. this only affects save dialogs from the originating image window each time
it occurs.

similar issue with Opening files, though it disables Ctrl+L for any open file
dialog opened from any window including the toolbox.

also, the caption text used for the confirmation button in the Save/Open in
location dialog is misleading, clicking save when a filename has been entered
doesn't actually save the file, but returns the user to the save dialog with the
new path and filename filled in.

another miniscule bug occurs when creating new directories, the icon used for
the new directory during initial text entry is that of the file that was
previously at the top of the directory listing.
Comment 1 Sven Neumann 2004-11-16 11:02:36 UTC
You should try to avoid reporting multiple problems in a single bug report and
you should have definitely searched for duplicates first. At least one of these
issues has been reported before (and fixed).

Reassigning to GTK+ so that the GTK+ developers can deal with this.
Comment 2 Federico Mena Quintero 2004-11-20 06:24:39 UTC
The first two issues are described in a comment to bug #145470.  I just fixed
the fourth issue; it was a silly bug.

I'll retitle this bug and leave the third issue open:  Have the Location dialog
confirm the entire file chooser if you accept what you typed.
Comment 3 Hans Breuer 2004-12-06 00:19:56 UTC
IMHO this should only be done if what you type actually was an
existing filename. At least I was using the location dialog
to quickly change the directory - not knowing the concrete
filename.
Comment 4 Sven Neumann 2005-05-25 13:19:18 UTC
Created attachment 46870 [details] [review]
patch to implement the suggested behaviour

The should_respond() handler already takes care of deciding if the dialog is in
a state that can be safely activated so this patch is rather simple. It
duplicates some code from gtkfilechooserdialog.c though. This could be avoided
by adding an internal API to activate the confirmative action of the
file-chooser dialog.
Comment 5 Federico Mena Quintero 2005-05-26 01:32:14 UTC
Comment on attachment 46870 [details] [review]
patch to implement the suggested behaviour

Thanks for the patch, Sven!  Instead of doing all the default response stuff,
can't you just emit ::file_activated if the user confirms the location dialog? 
This will get caught by GtkFileChooserDialog, which will in turn call
should_respond() - which should already pick up the changes done to the file
chooser's state in update_from_entry().
Comment 6 Sven Neumann 2005-05-26 11:36:11 UTC
Created attachment 46898 [details] [review]
patch changed as suggested (includes debugging statements!)

Sounds like a good plan but unfortunately it doesn't seem to work. I've changed
my patch and added some debugging output. As you can see,
gtk_window_activate_default() is being called on the dialog but it doesn't have
the desired effect.
Comment 7 Sven Neumann 2005-05-26 11:38:10 UTC
Created attachment 46899 [details] [review]
complete version of previous patch

sorry, the previously attached patch is incomplete
Comment 8 Federico Mena Quintero 2005-06-27 16:39:44 UTC
*** Bug 308917 has been marked as a duplicate of this bug. ***
Comment 9 Federico Mena Quintero 2005-11-11 20:29:18 UTC
*** Bug 315523 has been marked as a duplicate of this bug. ***
Comment 10 Federico Mena Quintero 2005-12-29 18:25:51 UTC
*** Bug 324995 has been marked as a duplicate of this bug. ***
Comment 11 gnutter 2006-01-19 09:27:36 UTC
(In reply to comment #3)
> IMHO this should only be done if what you type actually was an
> existing filename. At least I was using the location dialog
> to quickly change the directory - not knowing the concrete
> filename.

yes , I think there is a great danger of retrograding usablility if you try to preempt what the user is doing. This one area where Windows falls down , it always thinks it knows what you want to do ... and often gets it wrong.

An interface needs to be consistant in how it behaves otherwise it is confusing.

It is a basic principal of interface design to avoid modes of behaviour. ie different response to that same action in different contexts.

In this context an open dlg and a save dlg are two different things to the user (even if there is a common code base) so it is ligitimate to have different behaviour - within reason. 

Different modes of behaviour within the same dlg really should be avoided.

regards.
Comment 12 Jon Kåre Hellan 2006-10-17 07:59:12 UTC
I was about to report this issue, but see that it is already well known. Let me add a 'me too'. Particularly annoying: You know from bitter experience that populating /usr/bin takes a while, so you type <ctrl+l>/usr/bin/acroread instead. Lightning fast, because of the excellent completion. Then you confirm - the button even says "open". And you have to wait for the file list to be populated before you get the chance to "open" once more.

One final compliment: Populating /usr/bin is a lot faster these days :-)
Comment 13 Jon Kåre Hellan 2006-10-17 09:22:35 UTC
Hmm. Tried HEAD and Ubuntu Edgy, and it looks like this is fixed. Can the bug be closed?
Comment 14 Federico Mena Quintero 2006-10-19 15:50:46 UTC
Yes.  There is no location dialog anymore in GTK+ 2.10.