Bug with "save as"?
Enrico Tröger
enrico.troeger at uvena.de
Tue Feb 12 16:32:33 CET 2008
On Tue, 12 Feb 2008 15:07:41 +0100, Enrico Tröger
<enrico.troeger at uvena.de> wrote:
> [...missing filename in GTK save as dialog after changing folders...]
>
> > This happens with other GTK+ apps too, like Geany (everyone's favorite
> > text-editor)
;-)
> > I know other apps suffer from the same behavior, but I can't seem to find
> > another example...
> mousepad seems to fail in the same way as Geany. I will have a look at
> this, maybe it's a GTK bug, maybe a bug in using the GTK API or
> anything completely different ;-).
IMO it's a misuse of the GTK API, at least in the case of Geany. I'm
about to change the behaviour for Geany.
The problem is that GTK offers two different ways to preset the
filename in the Save As dialog. The one, used by Geany, Mousepad and
probably Thunderbird, is to set an existing file and it will be
selected automatically. But when the user changes a folder, the
filename is no longer valid and will be removed from the file name
entry. IMO, this isn't a bug but a feature because this method is not
intended for Save As dialogs but rather for File Open dialogs and there
this behaviour makes sense.
For Save As dialogs, there is another way to preset the filename which
e.g. epdfview already does and Geany will do it soon. It's about to
preset the _new_ and desired filename for the _new_ file in the file
name entry. There is no need that this file already exist. So, IMO
developers should use gtk_file_chooser_set_current_name for Save As
dialogs(this function is the second way).
So, it's not really a bug in GTK, only the GTK docs could state the
above a bit more clearly, IMO.
Please correct me, if I'm wrong at any point.
> But it's probably quite off-topic here.
Not really since it also affects mousepad and maybe other Xfce apps
(I like to disagree to myself ;-)).
@Nick: maybe you want to have a look at the GTK docs for
gtk_file_chooser_set_filename() and gtk_file_chooser_set_current_name
(). Using gtk_file_chooser_set_current_name() requires much work in the
application because the path part of an existing filename should be
stripped and only the basename used, but it increase the usability of
the dialog significantly, IMO.
Regards,
Enrico
--
Get my GPG key from http://www.uvena.de/pub.key
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
URL: <http://mail.xfce.org/pipermail/xfce/attachments/20080212/f1fe367f/attachment.pgp>
More information about the Xfce
mailing list