[opensuse-gnome] Changing the path opened by default by GTK/Gnome file open dialogue
Hi! I've asked this on the general openSUSE list but so far have had no luck. Since GTK and GNOME are closely related, I thought maybe someone here had something to say on this. I'm running KDE on 10.2, and would like to change the default path opened by the file open dialogue that is used by GTK applications. Now the dialogue always opens my home folder, and I'd like to have it open one of my documents folders instead, so I don't have to navigate there manually. I regularly use a number of Gnome/GTK apps, and it would be nice to get this set somewhere. On KDE I can simply go to the Control Centre and set paths there. I tried running Gnome and looked at the Control Centre there, but found nothing. I also tried something called GTK or Gnome configuration etc. tool that allowed me to change system and application settings, but using the find to search for '~' or '~/' only resulted some application specific settings. I tried to google for this but found nothing there either. Nor do any of the .gnome* folders in my home folder contain anything that would seem to affect this. I'm starting to have a feeling the apps simply use $HOME or something similar and I can't change what the dialogue opens. It would be nice to still receive an educated opinion on this before giving up. Thanks for any ideas! Regards, Tero Pesonen -- To unsubscribe, e-mail: opensuse-gnome+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-gnome+help@opensuse.org
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@opensuse.org For additional commands, e-mail: opensuse-gnome+help@opensuse.org
On Tuesday 02 October 2007, you wrote:
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).
Hi Ricardo! Yes, the File chooser indeed uses the current working directory, and setting it appropriately solves the issue for what my simple needs are concerned.
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+ :))
Thanks for you advice and offer for help! Unfortunately, I'm not a programmer, and I'm afraid although I'd like to, I fall at the "if you can" step :( I doubt there'd much to test about this if someone chose to implement it, as it is so simple a job, but if any such help is of any use, I'm available. Thanks again, Tero Pesonen -- To unsubscribe, e-mail: opensuse-gnome+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-gnome+help@opensuse.org
On Mon, 2007-10-01 at 23:52 +0300, Tero Pesonen wrote:
I'm running KDE on 10.2, and would like to change the default path opened by the file open dialogue that is used by GTK applications. Now the dialogue always opens my home folder, and I'd like to have it open one of my documents folders instead, so I don't have to navigate there manually. I regularly use a number of Gnome/GTK apps, and it would be nice to get this set somewhere. On KDE I can simply go to the Control Centre and set paths there.
This is a big usability problem in the file chooser. The way it works is this: * If an app decides to set its starting directory, it uses that. * If an app doesn't set the starting directory, it uses $cwd. Some applications don't care to set a directory, so you get $cwd in the file chooser (which is usually $HOME). Other applications try to be nice and remember the last directory you used, but that of course only works within *that* application (and I think some others, like OpenOffice.org, always try to look for your ~/Documents...). The end result is a big mess from the user's viewpoint :) This needs to be thought out and fixed. In the meantime, you can set up a quick keyboard shortcut to jump to a directory: http://www.gnome.org/~federico/news-2005-09.html#filechooser-quickie-bookmar... Good luck, Federico -- To unsubscribe, e-mail: opensuse-gnome+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-gnome+help@opensuse.org
participants (3)
-
Federico Mena Quintero
-
Ricardo Cruz
-
Tero Pesonen