You are not logged in.
Pages: 1
Topic closed
I hope that this information may be of some help to those who are frustrated with the layout of open file dialogs as I have been.
Some of you may be familiar with the post regarding the file chooser portal. The basic issue was that some programs have their own built-in means of opening a file, and some use a standard interface which is supplied by the environment. These have nothing to do with the file manager you or I may choose as our default one.
GTK and QT both have what is called a file chooser dialog. The programs which use it are therefore going to show the exact same dialog when we wish to open a file. Mostly, I have found that GTK is predominate.
One of the annoying problems is the sort order we see in the dialog. Well now there is a simple way to adjust that. Here's how it is done:
1. Install the dconf-editor program.
2. Open the program and select "I''ll be careful.".
3. Click on the line item named "org".
4. Next do the same with "gtk", then "settings", then "file-chooser".
5. One I was wanting to change was entitled "sort-directories-first". I went to the bottom of that one's list and changed it to True by selecting that button. Then, at the top right on the title bar it changes the X to an icon that looks like a clock is going counterclockwise. Select that and it will allow you to Apply or Dismiss the change you made.
The changes you make here will take affect immediately, and you can see this by checking in your favorite program when you try to open a file. If you change any setting, try it out before changing something else. If it does not do what you want, then set it back before you try to change another setting.
Have fun!
Last edited by KitchM (2022-04-07 20:11:49)
Offline
Nice tutorial. I wanted directories before files and open recent directory and that's exactly what I got.
I also wanted text-based location bar instead of path bar, but this setting will automatically revert. It's apparently broken in gtk.
Offline
Hi,
thx for the information about dconf-editor. There is yet a point i would like to customize in file chooser, but I didn't see a way to: ususal file name sorting is number based, not lexically, as follows:
p49.pdf
p111.pdf
p211a.pdf
p1003.pdf
(means, if files have same letter part, they are sorted by numbers after that and as 1003 and 111 are greater than 49 p49.pdf is first)
Lexically would be
p1003.pdf
p111.pdf
p211a.pdf
p49.pdf
this is, what ls (and mc as well) do. And as I have a lot of files named that way (letters and numbers were mixed) it's a mess to find one in the file chooser, if need one of the group of p11* files, when there are p11a1, p113a and p1146 for instance, as they aren't together but spread by their numbers.
Is there a way to change this to correct lexical sorting?
Thx for any idea
jth
Offline
I don't believe so. You can change the column and order of the final sort:
gsettings set org.gtk.Settings.FileChooser sort-column name|size|type|modified
gsettings set org.gtk.Settings.FileChooser sort-order ascending|descending
Remember to edit the subject of your topic to include the [SOLVED] tag once you're satisfied with the answers or have found a solution (in which case, don't forget to share it as well), so that other members of the community can quickly refer to it and save their time. Pretty please!
Offline
Hi,
as you said: this doesn't change the thing...
thx anyway
joerg
Offline
so many people complain about the sorting and want it like 49, 111, 211, 1003 everywhere. i have even written functions to make it easy to write scripts and programming easy enough to sort this way. it does seem most people want number sorting since that is how people think about the file names.
i can understand the difficulties of having a mix. changing to numeric sorting everywhere needs first steps like this. but they should have option to disable it by user choice. if nothing else then at least an environment variable like NUMERIC_SORTING=ON|OFF plus the upper case i18n values for on/off and yes/no.
Offline
numeric sorting is a nightmare as you can't rely on it. Professional programmers don't as well, see names generated by cameras, recorders and phones. It's rather simple to generate filenames where both lexical and numeric sorting give same results: file001...file033...file266, linux provides a lot of ways for doing this.
I believe all this numeric sorting is kind of "do it like windows does" as M$ windows explorer and so all file choosers does numeric sorting but cmd.exe and all basic programs do lexical sorting...
thx for your explanations anyway, i will survive this ;-)
regards
joerg
Last edited by jth (2022-12-09 07:14:00)
Offline
In any case, this should be directed at GTK developers. The sorting is provided by GtkTreeModelSort, I believe.
Remember to edit the subject of your topic to include the [SOLVED] tag once you're satisfied with the answers or have found a solution (in which case, don't forget to share it as well), so that other members of the community can quickly refer to it and save their time. Pretty please!
Offline
Pages: 1
Topic closed
[ Generated in 0.012 seconds, 10 queries executed - Memory usage: 548.02 KiB (Peak: 548.87 KiB) ]