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 136294 - Need GTK_FILE_CHOOSER_ACTION_SELECT_FILES_AND_FOLDERS
Need GTK_FILE_CHOOSER_ACTION_SELECT_FILES_AND_FOLDERS
Status: RESOLVED WONTFIX
Product: gtk+
Classification: Platform
Component: Widget: GtkFileChooser
2.3.x
Other Linux
: Normal enhancement
: Medium API
Assigned To: gtk-bugs
Federico Mena Quintero
: 549515 (view as bug list)
Depends on:
Blocks: 342701 480578
 
 
Reported: 2004-03-05 16:12 UTC by Christophe Fergeau
Modified: 2016-01-24 05:54 UTC
See Also:
GNOME target: ---
GNOME version: Unversioned Enhancement


Attachments
proposed patch (2.98 KB, patch)
2004-03-05 21:57 UTC, Christophe Fergeau
none Details | Review
Patch adding SELECT_FILES_AND_FOLDERS action (11.86 KB, patch)
2009-07-29 19:26 UTC, Pascal Terjan
none Details | Review

Description Christophe Fergeau 2004-03-05 16:12:12 UTC
After the changes described in
http://primates.ximian.com/~federico/news-2004-03.html#04
it's no longer possible to have a GtkFileChooser dialog where the user can
select a mix of files and directories.

Rhythmbox relied on this behaviour for its "add to library" GtkFileChooser.
Music files selected by the user were added to the library, while it
recursed in folders adding all the music files it could find. 

It would be nice if there was some way to get an hybrid file/folder
selection mode in GtkFileChooser
Comment 1 Federico Mena Quintero 2004-03-05 16:18:45 UTC
We need to extend GtkFileChooserAction to support this.  Want to
propose a patch to add GTK_FILE_CHOOSER_ACTION_SELECT_FILES_AND_FOLDERS?

There is no need to add a "save" version of this, as multiple
selection does not make sense in a save-type mode.
Comment 2 Christophe Fergeau 2004-03-05 21:57:15 UTC
Created attachment 25247 [details] [review]
proposed patch
Comment 3 Federico Mena Quintero 2004-03-06 01:45:50 UTC
Retitling for clarity.  Thanks for the patch; this will most likely go
in for 2.6.
Comment 4 Christophe Fergeau 2004-03-06 09:51:18 UTC
GTK 2.6 or GNOME 2.6 ?
Comment 5 Christian Neumair 2004-04-25 16:04:14 UTC
Can we have this reviewed?

regs,
 Chris
Comment 6 Owen Taylor 2004-09-16 21:22:44 UTC
I don't think you'll ever get reasonable behavior for such a hybrid
selection ... the user doesn't have a clear view of what will happen

 - When they double click on a folder
 - When they select a folder and click [Open] / [Import]
 - If they deselect all files and click [Open] / [Import]

File-or-folder works well if you are dragging files in a file manager,
or right clicking on files in a file manager because it's very clear
what the action is, and what the object is. I don't think that will be
the case here.

I would suggest a more flexible rethinking of what
the UI should be for rythmbox is needed. Similar things come up for photos,
evolutions mail import dialog. It's not a one-off. But I think it
has to be much more obvious what is going to happen than what is
proposed here.
Comment 7 Christophe Fergeau 2004-09-16 21:29:04 UTC
Imo, a logical behaviour would be:

 - When they double click on a folder 
      => browse the folder in the file choser
 - When they select a folder and click [Open] / [Import]
      => import the folder
 - If they deselect all files and click [Open] / [Import]
      => import is grayed out and nothing can be done

I think what is a bit more difficult is getting a consistent and convenient
behaviour with keynav, especially when pressing enter.
Comment 8 Tino Meinen 2004-10-03 10:52:05 UTC
This bug is also the cause of http://bugzilla.gnome.org/show_bug.cgi?id=149356

In file-roller => create archive,  the user will want to use the fileselector to
add files AND directories at the same time, to be put into the archive.
Comment 9 Jean-Yves Lefort 2007-09-09 18:57:51 UTC
(In reply to comment #7)
> Imo, a logical behaviour would be:
> 
>  - When they double click on a folder 
>       => browse the folder in the file choser
>  - When they select a folder and click [Open] / [Import]
>       => import the folder
>  - If they deselect all files and click [Open] / [Import]
>       => import is grayed out and nothing can be done
> 
> I think what is a bit more difficult is getting a consistent and convenient
> behaviour with keynav, especially when pressing enter.

It's not only a logical behaviour, it's also the default behaviour of GTK_FILE_CHOOSER_ACTION_SELECT_FOLDER (double-click: navigate, click Open: emit response signal). Owen Taylor's argument therefore does not stand.

People who are tired of waiting on the GTK+ developers tergiversations can have a look at mn_file_chooser_dialog_allow_select_folder() in Mail Notification (http://www.nongnu.org/mailnotify/). It implements the behaviour described above in just a few lines of code.
Comment 10 Federico Mena Quintero 2008-05-14 02:27:57 UTC
Let's resurrect this.  Christophe, would you be willing to redo your patch for GTK+ trunk or 2.12.x?
Comment 11 Matthias Clasen 2008-09-11 04:43:41 UTC
*** Bug 549515 has been marked as a duplicate of this bug. ***
Comment 12 Pascal Terjan 2009-07-29 19:26:33 UTC
Created attachment 139501 [details] [review]
Patch adding SELECT_FILES_AND_FOLDERS action

Here is a patch against current git adding such action.

I have only tested it in browse mode:
- selecting files or folders and clicking on open button returns them
- double clicking a file returns it
- selecting a file and pressing enter returns it
- double clicking folder enters it
- selecting a folder and pressing enter enters it
- clicking on open button when nothing is selected returns current directory
Comment 13 Gabor Fekete 2009-07-31 07:47:45 UTC
Hi,

The last behaviour (#6), "clicking on open button when nothing is selected
returns current directory", often confuses me when I deal with "directory
selection" dialogs. It makes the whole __selection__ idea inconsistent.

Here is an example:
- The user gets used to the behaviour of #6. So, she always looks at the
  breadcrumbs to identify the directory that will be used.
- Then, she may accidentally "select" a directory and she is surprised
  that the operation took place in a child directory. Not really what she
  intended.

I guess, the reason for behaviour #6 is some legacy from the past and
a supposed (but questionable) "usability enhancement".

I think it is quite confusing that the current directory
is automatically selected when actually "__nothing__ is selected explicitly"
by the user.

So, I second Christophe Fergeau's suggestion:

"If they deselect all files and click [Open] / [Import]
       => import is grayed out and nothing can be done"

Comment 14 Pascal Terjan 2009-07-31 08:47:10 UTC
Well I am not sure about it, but I think it's important to be consistent with directory selection mode.

I think the case where it is useful is when you double click on a folder and enter it, without this behaviour you would need to go up before validating.

And also without this behavior I don't know how single click mode would be possible to implement.

And I don't think that it's so confusing, if people select the action and not cancel, they expect something to be done.
Comment 15 tito 2009-07-31 12:36:51 UTC
Hi,
just to add what a non-technical user expects:

a) return path of whatever is selected (file or folder) when hitting ok
b) return current dir if nothing is selected when hitting ok
c) return invalid path when hitting Cancel or closing the window
d) single click selects files or folders
e) multi selection if available returns list of paths of files and folders
f) double click (or enter if already selected) enters folders 

This is what I as user would expect as behaviour and I suppose that this is 
what the use of different operative systems has taught me to be some kind
of default sane behaviour.

Comment 16 Pascal Terjan 2009-07-31 12:41:52 UTC
(In reply to comment #15)
> Hi,
> just to add what a non-technical user expects:
> 
> a) return path of whatever is selected (file or folder) when hitting ok
> b) return current dir if nothing is selected when hitting ok
> c) return invalid path when hitting Cancel or closing the window
> d) single click selects files or folders
> e) multi selection if available returns list of paths of files and folders
> f) double click (or enter if already selected) enters folders 

That is what happens
Comment 17 Pascal Terjan 2009-11-16 17:14:48 UTC
Ping
Can someone have a look at it before it needs to much work to update ? :)
Comment 18 Pascal Terjan 2010-08-05 17:32:42 UTC
One year later, should I check/update the patch for latest git or lose hope to get it reviewed ?
Comment 19 Federico Mena Quintero 2012-10-09 15:54:47 UTC
We are like Ents here; we do things slowly ;)

Sorry for the delay.  Yes, could you please check if the patch is still current?