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 132043 - gnome file entry should use the GtkFileChooser API
gnome file entry should use the GtkFileChooser API
Status: RESOLVED FIXED
Product: libgnomeui
Classification: Deprecated
Component: general
2.5.x
Other Linux
: High major
: future
Assigned To: libgnomeui maintainers
libgnomeui maintainers
: 132907 (view as bug list)
Depends on:
Blocks: 132908 133885
 
 
Reported: 2004-01-20 23:02 UTC by Carlos Garnacho
Modified: 2004-12-22 21:47 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
yay! patch for fixing this (13.39 KB, patch)
2004-01-24 18:19 UTC, Carlos Garnacho
none Details | Review
patch that fixes this without breaking API backwards compatibility (17.15 KB, patch)
2004-02-09 01:53 UTC, Carlos Garnacho
none Details | Review
Patch for libgnomeui to register this prop with glade (1.76 KB, patch)
2004-02-09 12:47 UTC, Fernando Herrera
none Details | Review
Patch for glade-2 supporting this prop (2.64 KB, patch)
2004-02-09 12:49 UTC, Fernando Herrera
none Details | Review
Proposed patch file to fix the folder-mode problem described above. (1.53 KB, patch)
2004-02-12 05:08 UTC, Dennis Cranston
none Details | Review

Description Carlos Garnacho 2004-01-20 23:02:03 UTC
As far as I can see in a gnome 2.5.x built a few days ago with jhbuild, the
GnomeFileEntry widgets still use the GtkFileSelection API, I'll try to have
a look at the code and provide a patch that uses GtkFileChooser, but cannot
guarantee this in a short term :(
Comment 1 Carlos Garnacho 2004-01-24 18:19:32 UTC
Created attachment 23707 [details] [review]
yay! patch for fixing this
Comment 2 Fernando Herrera 2004-01-27 11:35:36 UTC
Set prio --> High due to PATCH
set sev --> major due to big UI inconsistence without it

Anders, this patch looks okey for me. Can you review it?
Comment 3 Fernando Herrera 2004-01-27 11:51:35 UTC
Wow, this is an API change!

This changes at GnomeFileEntry
        GtkWidget *fsw; 
to 
        GtkWidget *fc;

and this is in the public part.

Possible solutions?
A GnomeFileEntry using the old fileselection dialog is really UI-ugly,
but it's too late for marking it as deprecated and adding a new one...


Comment 4 Carlos Garnacho 2004-01-27 12:56:09 UTC
gosh, that's true :/, and every solution I can find is crappy... 
there is a GtkWidget (the name is the less important issue here), and 
it's now casted to a GtkFileChooserDialog, so breaking the programs 
that access this widget directly is unavoidable (at least we'd break 
their behaviour)

I guess that we should wait for 2.8 or bribe the release team...
Comment 5 Fernando Herrera 2004-01-27 19:10:57 UTC
Carlos, can you ask about this on d-d-l?
Comment 6 Dennis Cranston 2004-01-30 00:14:09 UTC
*** Bug 132907 has been marked as a duplicate of this bug. ***
Comment 7 Carlos Garnacho 2004-02-09 01:53:16 UTC
Created attachment 24214 [details] [review]
patch that fixes this without breaking API backwards compatibility
Comment 8 Carlos Garnacho 2004-02-09 01:55:26 UTC
the patch adds a "use_filechooser" property to gnome-file-entry and
gnome-pixmap-entry (which inherits from the former), it defaults to
FALSE, and if set to TRUE, then uses the GtkFileChooser API

The gnome-icon-entry only uses the GtkFileSelection stuff internally,
so it could be safely switched to GtkFileChooser without external changes

ok to commit?
Comment 9 Anders Carlsson 2004-02-09 08:32:41 UTC
Looks good, but could you make the property a construct only property? 
Comment 10 Fernando Herrera 2004-02-09 12:46:59 UTC
Making this prop construct only woudn't allow libglade to set it, and
lot of programs are using GnomeFileEntry via libglade.
I'm attaching a patch to register this new property with glade. I'm
also attaching the glade-2 patch with allows to edit this prop if you
can test if.
Comment 11 Fernando Herrera 2004-02-09 12:47:54 UTC
Created attachment 24226 [details] [review]
Patch for libgnomeui to register this prop with glade
Comment 12 Fernando Herrera 2004-02-09 12:49:41 UTC
Created attachment 24227 [details] [review]
Patch for glade-2 supporting this prop
Comment 13 Carlos Garnacho 2004-02-10 20:24:06 UTC
Ok, The patch is committed, I guess the bug will be closed when
Fernando commits his patches :)
Comment 14 Fernando Herrera 2004-02-10 21:02:28 UTC
Committed. Closing!
Comment 15 Dennis Cranston 2004-02-11 21:28:24 UTC
Apparently, we are not handling gnome_file_entry_set_directory_entry
(entry, TRUE) correctly.  In gnome-search-tool, I use this widget for
the 'look in files' entry, and I set the values of use_filechooser and
directory_entry properties to TRUE.  But, the filechooser displays
files and folder.  The following error is sent to stderr...

(gnome-search-tool:23954): GLib-GObject-WARNING **: value "TRUE" of
type `gboolean' is invalid or out of range for property `folder-mode'
of type `gboolean'
Comment 16 Dennis Cranston 2004-02-12 05:08:31 UTC
Created attachment 24337 [details] [review]
Proposed patch file to fix the folder-mode problem described above.
Comment 17 Fernando Herrera 2004-02-12 07:44:04 UTC
Brbrbr, same fix here at just same time!!!!
I spent 40 minutes or more with the ugly gdb crashing before realizing
that "-1" vales!
BTW, in gsearchtool.c... is it not better:

 g_object_set (G_OBJECT (interface.look_in_folder_entry),
use_filechooser", TRUE, NULL);

than:
{
             GValue value = { 0 };
               g_value_init (&value, G_TYPE_INT);
               g_value_set_int (&value, 1);
               g_object_set_property (G_OBJECT
(interface.look_in_folder_entry), "use_filechooser", &value);
}

I'not sure if this leaks, but really looks worse :)      
Comment 18 Dennis Cranston 2004-02-12 16:58:06 UTC
g_object_set (G_OBJECT (interface.look_in_folder_entry),
use_filechooser", TRUE, NULL);

Yah. Actually, I have this exact same code in my local version of
gnome-search-tool.  I'll check it in after when the libgnomeui issue
is fixed.  ;-)

Comment 19 Dennis Cranston 2004-02-12 23:14:44 UTC
So, can I commit?
Comment 20 Anders Carlsson 2004-02-13 08:17:31 UTC
Hmm, I wonder if we shouldn't try to fix this directly in gtk, it
makes more sense. ccing federico
Comment 21 Carlos Garnacho 2004-02-22 17:04:17 UTC
any new about this?
Comment 22 Fernando Herrera 2004-02-24 23:16:39 UTC
committed.