Mailinglist Archive: opensuse-gnome (216 mails)
| < Previous | Next > |
Re: [opensuse-gnome] Changing the path opened by default by GTK/Gnome file open dialogue
- From: Ricardo Cruz <rpmcruz@xxxxxxxxxxxxxxxxxxx>
- Date: Tue, 02 Oct 2007 01:19:51 +0100
- Message-id: <1191284391.4507.38.camel@xxxxxxxxxxxx>
Hi Tero,
GtkFileChooser uses the current working directory (try to launch your
app from the terminal at another directory than home). If you use few
GTK+ programs, you could just edit the menu .desktop files to specify
the working directory (see
http://standards.freedesktop.org/desktop-entry-spec/latest/ar01s05.html , entry Path).
If you can and would like to help out, making it configurable; the code
in question is at file gtkfilechooserdefault.c, function
gtk_file_chooser_default_get_current_folder. You specify the gtkrc entry
to parse at gtksettings.c, and use its API to get the property from the
file at question (grep some property name to see the settings API is
used). [1]
Now, you can create ~/.gtkrc-2.0 with your entry specified.
Would you like to give it a try, or should I? (this seems to be a fast
fix, but I rather not break the system installing some other gtk+ :))
Cheers,
Ricardo
[1] Notes:
1) GtkFileSystem might understand stuff like "~" and ".", but check that
(and note we don't want to break win32 :)). It might be safer to just
have hard-coded values like HOME and PWD (or simply, use a default for
an empty string).
2) GtkSettings will give you the string in UTF8, and it seems that
GtkFileSystem uses the current locale (because thats what system calls
it), so you need to convert it using g_filename_from_utf8() (google it
-- its from Glib).
--
To unsubscribe, e-mail: opensuse-gnome+unsubscribe@xxxxxxxxxxxx
For additional commands, e-mail: opensuse-gnome+help@xxxxxxxxxxxx
GtkFileChooser uses the current working directory (try to launch your
app from the terminal at another directory than home). If you use few
GTK+ programs, you could just edit the menu .desktop files to specify
the working directory (see
http://standards.freedesktop.org/desktop-entry-spec/latest/ar01s05.html , entry Path).
If you can and would like to help out, making it configurable; the code
in question is at file gtkfilechooserdefault.c, function
gtk_file_chooser_default_get_current_folder. You specify the gtkrc entry
to parse at gtksettings.c, and use its API to get the property from the
file at question (grep some property name to see the settings API is
used). [1]
Now, you can create ~/.gtkrc-2.0 with your entry specified.
Would you like to give it a try, or should I? (this seems to be a fast
fix, but I rather not break the system installing some other gtk+ :))
Cheers,
Ricardo
[1] Notes:
1) GtkFileSystem might understand stuff like "~" and ".", but check that
(and note we don't want to break win32 :)). It might be safer to just
have hard-coded values like HOME and PWD (or simply, use a default for
an empty string).
2) GtkSettings will give you the string in UTF8, and it seems that
GtkFileSystem uses the current locale (because thats what system calls
it), so you need to convert it using g_filename_from_utf8() (google it
-- its from Glib).
--
To unsubscribe, e-mail: opensuse-gnome+unsubscribe@xxxxxxxxxxxx
For additional commands, e-mail: opensuse-gnome+help@xxxxxxxxxxxx
| < Previous | Next > |