GNOME Bugzilla – Bug 102792
gtk_file_selection_complete () doesn't work on unmapped filesel
Last modified: 2011-02-04 16:12:10 UTC
Package: gtk+ Severity: normal Version: 2.2.0 Synopsis: gtk_file_selection_complete () doesn't work as documented Bugzilla-Product: gtk+ Bugzilla-Component: GtkFileSel Description: Description of Problem: From the docs: "If a partial match can be made, the "Files" list will contain those file names which have been partially matched, and the "Folders" list those directories which have been partially matched." This is not the case; the files list contains *all* of the files in the directory and only the text entry widget contains the partial match. ------- Bug moved to this database by unknown@bugzilla.gnome.org 2003-01-07 18:13 ------- The original reporter (node@users.sourceforge.net) of this bug does not have an account here. Reassigning to the exporter, unknown@bugzilla.gnome.org. Reassigning to the default owner of the component, gtk-bugs@gtk.org.
Will work after you show the filesel on the screen. What broke the unshown case was the change: Wed Jan 16 19:33:41 2002 Owen Taylor <otaylor@redhat.com> * gtk/gtkfilesel.c (gtk_file_selection_map): Refresh the dialog on map. (#52877, inspired by request from Murray Cumming) This essentially does a gtk_file_selection_complete (filesel, "") when the filesel is shown. I don't have much of an idea how to fix this; perhaps simple special case the case where gtk_file_selection_complete() is called by the programmer while the filesel is unmapped.
This one is going to be a fairly substantial (if very straightforward) change. * Add a GtkFileselectionPrivate structure done the same way as GtkMenuPrivate/gtk_menu_get_private. * In this structure, put a single: guint entry_text_is_completion; * Add a set_entry_text() utility method that does gtk_entry_set_text (GTK_ENTRY (filesel->selection_entry), str); and sets entry_text_is_completion to FALSE. * Make gtk_file_selection_complete() set entry_text_is_completion to TRUE. * in gtk_fileselection_map, replace: gtk_file_selection_populate (filesel, "", FALSE, FALSE); with: const char *text_to_complete = ""; if (private->entry_is_completion) text_to_complete = gtk_entry_get_text (filesel->selection_entry); gtk_file_seleciton_popuplate (filesel, text_to_complete, FALSE, FALSE);
Setting the priority to "Low" for all bugs related to GtkFileSelection. This has been deprecated in favor of GtkFileChooser.
Too much work to be worth fixing at this point now we have GtkFileChooser as a replacement.