sorting menu entries (or not)

Hello,

Do we want to have menu entries sorted alphabetically or not?
For some menus it makes sense: eg layer > new > sub menus of all categories could be sorted.
The downside is: entries position would be different based on the language of interface (may be misleading in international screencasts, for instance)

Berteh.

Apparently (English version) they are sorted. I don’t know why some of them are not sorted (Paste Canvas first in the ‘Other’ list)

I wouldn’t waste time on that for the moment. There are many other interesting things to do before that. Apart of that, it would be extremly difficult to sort them by local language, specially non latin characters.

-G

They are not sorted in my stable version (see eg “other” and “blur” categories), the ones that seem sorted are so because of the order they are sprinted to the UI definition XML.

I asked the question because the code needed to have them sorted seems ready (see attached patch). I just don’t know in which file to put the first few lines (localised comparison method and class)… I guess ETL would be nice, but doesn’t look like I can use gettext() in there.

I will not update this patch since you mentioned it’s not worth, if you wanna use it nevertheless feel free!

btw: it relies on C++ internal string comparison for sorting, so I guess that even non-latin chars should sort alright.
Berteh.
menusort-diff.txt (4.09 KB)

The patch looks fine to me at first sight. I would like to compile and run to see how does is work on local versions.

The ‘compate_localized’ seems not used anywhere so it can be removed. The struct that uses dgettext can be shipped where it is now. If later needs to be moved elsewhere it can be done without troubles.

Good work!
-G