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 162358 - GTK_FILE_CHOOSER_ACTION_CREATE_FOLDER doesn't allow selection of existing folders
GTK_FILE_CHOOSER_ACTION_CREATE_FOLDER doesn't allow selection of existing fol...
Status: RESOLVED FIXED
Product: gtk+
Classification: Platform
Component: Widget: GtkFileChooser
2.6.x
Other Linux
: Normal major
: ---
Assigned To: Federico Mena Quintero
Federico Mena Quintero
: 315424 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2004-12-28 02:51 UTC by Paul Sowden
Modified: 2011-02-04 16:18 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
testcase (539 bytes, text/plain)
2005-01-23 14:35 UTC, Paul Sowden
  Details
Patch which fixes this and some annoyances with autocompletion (15.98 KB, patch)
2005-06-10 05:52 UTC, Federico Mena Quintero
none Details | Review

Description Paul Sowden 2004-12-28 02:51:31 UTC
In the GTK+ 2.0 API docs the GtkFileChooserAction
GTK_FILE_CHOOSER_ACTION_CREATE_FOLDER is described as:

"Indicates a mode for creating a new folder. The file chooser will let the user
name an existing or new folder."

It seems however that the chooser will not allow the user to select an exisitng
folder. If a folder is selected in the view and the open button clicked the
chooser simply descends into that folder, and if the folder is not selected but
instead named in the name field, the same occurs, the chooser descends into the
exisitng folder instead of allowing it to be selected.
Comment 1 Paul Sowden 2005-01-23 14:35:54 UTC
Created attachment 36412 [details]
testcase

Opens up a folder chooser which demonstrates the behaviour of this bug
Comment 2 Paul Sowden 2005-01-23 14:40:02 UTC
If this bug is fixed the current behaviour of the folder chooser can be emulated
by using a custom filter which will only allow the selection of empty folders.
This would afford the user more flexibility as she can create the folder by
other means, eg in Nautilus, and then select it using this widget.
Comment 3 Maciej Katafiasz 2005-03-20 01:04:10 UTC
As it seems, CREATE_FOLDER doesn't work at all in 2.6.2, when I click on
existing folder it descends, and when I'm already in a folder, clicking OK
doesn't close the dialog. Entering name also doesn't seem to work, it makes
FileChooser closable, and return the current folder + name entered appended when
asked with _get_filename(), however it doesn't create the folder, so name
returned is actually bogus (unless I misunderstood the specification in this
mode). Marking as major, as CREATE_FOLDER is basically does not perform its
function at all (it requires substantial cooperation from user to get it to even
close)
Comment 4 Federico Mena Quintero 2005-03-31 03:25:16 UTC
This is related to bug #166836.  I'll have a fix shortly.
Comment 5 Matthias Clasen 2005-05-18 02:54:44 UTC
In response to #3, CREATE_FOLDER is the analogon to SAVE. SAVE doesn't create
the file either.
Comment 6 Federico Mena Quintero 2005-05-26 12:51:25 UTC
I'm working on this; I'll have a fix shortly.
Comment 7 Matthias Clasen 2005-06-09 04:34:22 UTC
Federico, whats the status of this ?
Comment 8 Federico Mena Quintero 2005-06-10 05:52:07 UTC
Created attachment 47520 [details] [review]
Patch which fixes this and some annoyances with autocompletion

This is the patch; I've committed it to gtk-2-6 and HEAD.
Comment 9 Federico Mena Quintero 2005-06-10 05:54:42 UTC
2005-06-09  Federico Mena Quintero  <federico@ximian.com>

	Fixes #162358:

	* gtk/gtkfilechooserdefault.c (update_chooser_entry): Don't return
	immediately if we are in CREATE_FOLDER mode, so that we can fill
	the entry with the newly-selected folder.
	(gtk_file_chooser_default_set_property): Warn against turning on
	multiple selection for CREATE_FOLDER mode, or about setting that
	action while multiple selection is on.
	(update_chooser_entry): Change the entry's contents as well if we
	are in CREATE_FOLDER mode.  If nothing is selected, clear the
	chooser entry.
	(trap_activate_cb): Don't trap enter/space if modifiers are
	pressed.  This lets one use Ctrl-space to toggle rows in multiple
	selection mode.
	(gtk_file_chooser_default_should_respond): Clean up the if-chain
	mess of special cases by using an array to determine what to do.
	Also, for the save-entry case in CREATE_FOLDER mode, actually fix
	the bug where the file chooser would switch to an existing folder
	rather than confirming with it, and create the folder ourselves.
	(error_creating_folder_over_existing_file_dialog): New function.

	* gtk/gtkfilechooserentry.c (check_completion_callback): Only
	insert the common prefix if we are in an "open" mode.  Use a
	helper function.
	(append_common_prefix): New helper function; code moved over from
	check_completion_callback().
	(find_common_prefix): New helper function.
	(gtk_file_chooser_entry_focus): Append the common prefix if the
	user requests it explicitly.
Comment 10 Federico Mena Quintero 2005-11-11 20:28:13 UTC
*** Bug 315424 has been marked as a duplicate of this bug. ***