PDA

View Full Version : [xubuntu] Noobish question about the file manager or something...



scubscub
May 29th, 2012, 08:22 PM
Hello, I was wondering, what is the actual name of the (sub?)program that saves files, for instance from firefox or LibreOffice? It looks like Thunar but does not say anything but "save" or "save as" on the top, and does not match thunar's settings (e.g., enabling "view hidden folders" on thunar does not affect this save program).

I only ask what it is so that I can find some way to modify it -- I would like to enable hidden folders, for instance. Also, it opens by default to a virtual folder titled "Recently Used", I would like to change this so it opens to the actual folder that was used most recently.

MG&TL
May 29th, 2012, 08:28 PM
It's a dialog from Gtk. Gtk is the framework behind Gnome, Xfce, and LXDE, among others.

Programs call gtk_file_chooser_new(), then set some parameters, and away it goes.

scubscub
May 29th, 2012, 08:49 PM
Thanks. Okay, so the program or dialog is called GTKFileChooser, it is modified by the commands or signals or whatever they're called, found here:

http://developer.gnome.org/gtk/2.24/GtkFileChooser.html

But to reassert my noobishness here, how do I go about changing the file chooser's behavior? Is there a file somewhere I modify in leafpad?

dniMretsaM
May 29th, 2012, 09:38 PM
But to reassert my noobishness here, how do I go about changing the file chooser's behavior? Is there a file somewhere I modify in leafpad?

You'll have to do some coding. Depending on what exactly you want to do, it could be the GtkFileChooser code (which is written in C) and/or the code of the program that's invoking said dialog (languages will obviously vary here). Or possibly the GTX+ wrappers for the language that the program uses.

scubscub
May 29th, 2012, 09:49 PM
Hmmm... but the behavior of the file chooser seems to be the same no matter what program invokes it, which is why I thought there might be a system-wide configuration file (or some such) determining how the file chooser acts when it is invoked.

And there is something here:

file:///usr/share/glib-2.0/schemas/org.gtk.Settings.FileChooser.gschema.xml

scubscub
May 29th, 2012, 10:26 PM
Here is a page with a "patch" doing pretty much what I want, but I have no idea how to implement this:

https://bugzilla.gnome.org/show_bug.cgi?id=644426 (https://bugzilla.gnome.org/show_bug.cgi?id=644426)

llua+
May 29th, 2012, 10:29 PM
That patch is for gtk3. The gtkfilechooser function thunar and firefox uses is from gtk2.

dniMretsaM
May 29th, 2012, 10:32 PM
Hmmm... but the behavior of the file chooser seems to be the same no matter what program invokes it, which is why I thought there might be a system-wide configuration file (or some such) determining how the file chooser acts when it is invoked.

And there is something here:

file:///usr/share/glib-2.0/schemas/org.gtk.Settings.FileChooser.gschema.xml

Apparently there is a settings file located at ~/.config/gtx-2.0/gtkfilechooser.ini (if it doesn't exist you can create it). Example contents here (https://dl.dropbox.com/u/51503579/gtkfilechooser.png). You'll want to start by changing ShowHidden to True. Sorry about the bit of misinformation earlier. And thanks to llua in the IRC room (llua+ who posted above) for pointing out my mistake to me.

scubscub
May 29th, 2012, 11:02 PM
I created the file with the ShowHidden changed to true, and restarted, it doesn't seem to have any effect -- hidden folders still do not appear in the chooser.

Ie, ~/.config/gtk-2.0/gtkfilechooser.ini . I had to create the gtk-2.0 folder as well.

llua+
May 29th, 2012, 11:04 PM
I highly doubt that screenshot is gonna be there for long. So for archiving purposes.
syntax for the file is

[Filechooser Settings]
LocationMode=filename-entry
ShowHidden=false
ExpandFolders=true
ShowSizeColumn=true
GeometryX=186
GeometryY=109
GeometryWidth=908
GeometryHeight=806
SortColumn=name
SortOrder=ascending
and like what dniMretsaM said, in your situation you want ShowHidden to read true.

EDIT: and again. that file only affects programs that uses gtk2 still. Firefox should be one. I haven't used LibreOffice before, but if it uses gtk3 (thus calls the gtk3 version of gtkfilechooser) you need to change a setting with dconf-editor(org.gtk.settings.file-chooser).

scubscub
May 30th, 2012, 12:07 AM
Thanks to both of you.

I had an error in my original version of the file but it is now working, showing the hidden files, when called up by firefox or by libreoffice, both.

I still want to change the default folder, is there a way to use something like that gtk3 patch for gtk 2?