comboboxes - sorted lists in KDE4 - idea

Ferdinand Gassauer gassauer at kde.org
Thu Feb 22 13:44:59 GMT 2007


Am Donnerstag, 22. Februar 2007 schrieb Thomas Zander:
> On Thursday 22 February 2007 10:21, Ferdinand Gassauer wrote:
> > Unfortunaltely a lot of application return the items in a combobox/drop
> > down list unsorted and/or ungrouped
> > While it make sense for some lists not to be sorted because the list is
> > short and / or some other reasoning is valid - (default item should be on
> > the first place, To/CC/BCC in addresses New Mail) for all lists with a
> > big number of items - alphabetical sorting is a must IMHO.
>
> Some points;
>
> As Ferdinand said; long lists should be typically be a listview.
> For most comboboxes sorting can very well be based on usage. Since you
> mentioned KMail, I made the ordering in the combobox that filters which
> messages there are to be based on most used.  'any' at top, 'unread' next.
> etc.
> More importantly; there is no generic method in KDE to store items that can
> be translated in a combobox and get the untranslated 'key' back when a user
> selects something. This is the main reason people insert items in a static
> ordering.
>
> So, your idea to sort items goes wrong on many levels, as stated above.
> If you have some code to back your proposal that solves these issues,
> please don't hold back.

I am aware of the programming problems, but also - and much more - about the 
usability. IMHO it is almost impossible to choose from a unsorted combobox 
which has to be scrolled to see all values.

So let's discuss this matter. 

1) The order of items should always be understandable by the user
2) the chosen method must  support multilingual representation.

What we did elsewhere: (in a ORACLE Database, but it should be valid for every 
language)

We introduced one (or more)  group levels - separated by "----------------" 
(like in help)
and a "sort number" for each item.

the necessary attributes for every item are
* group 
* sort
* item text

a list is always sorted by group, sort, item text.

if the application designer decides that he needs a special sequence he can 
define group and sort items

if group and/or sort items are not defined, or have identical values only 
alphabetical sort of the item text occurs.

additionally it would be nice of course to assign a name to the group but IMHO 
this would not be necessary

Example
page format

possible group names
1 ISO formats
2 US formats

1,1, ISO A0
1,2, ISO A1
1,3, ISO A2
..
1,11, ISO A10 (no idea if that exists, but one should take care that it 
appears after A9 and not after A1)

2,1, US Legal
2,2, US Letter
... OR
2,1 US Legal
2,1 US Letter 
which would mean that a translation gets sorted in group 2

alternatively one could do

a special group for the most common used formats.

possible group names
1 commonly used formats
2 ISO formats
3 US formats


1,1, ISO A4
1,2, US Letter

2,1, ISO A0
2,2, ISO A1
2,3, ISO A2
2,4, ISO A3
2,5, ISO A5 (because A4 is already defined)

3,1, US

or leave the sorting to the system. but take car not to get a sort of 
A1,A10,A2

2,1, ISO A0
2,1, ISO A1
2,1, ISO A2
...
2,1, ISO A9
2,2, ISO A10
..
2,2, ISO A99

I do not want to say that all problems can be solved this way, but most of 
what I have in mind.

It's not KDE - but have a look at the filter of OO - Open file dialog to see 
what I mean. BTW I do not want say something is bad, just where I see room 
for improvement.
 
-- 
cu
Ferdinand 




More information about the kde-core-devel mailing list