Mailinglist Archive: yast-devel (35 mails)

< Previous Next >
Re: [yast-devel] Table sorting and locales in YaST UI
On Fri May 4 2012 11:19:24 Ladislav Slezak wrote:
Dne 4.5.2012 10:31, Thomas Goettlicher napsal(a):
On Thu May 3 2012 16:08:56 Ladislav Slezak wrote:
[...]

- The numeric sorting problem can be solved by padding numbers with
zeroes instead of spaces e.g. "090" instead of " 90" - it does not look
nice but I haven't found any better solution. Any idea? (I tried some
tricks with UTF-8 non-breakable space but that didn't help.)

I'd propose _NOT_ to add zeros to the ycp code, because it makes the
table unreadable. It's an UI issue that needs to be fixed in the UI.


I just fixed the numeric sorting in yast2-qt (version 2.22.6). Columns
that contain digits only are sorted in numeric order now.

Wow, good idea! Thanks!

Would it be possible to put a regexp there? I mean, the repository module
display the priority number but for 99 it adds _(" (default)") suffix so
the actual displayed value is "99 (default)". That's because users can
easily see what's the default and which repos have higer/lower priority
than the default.
Right now the following regexp is used to test if it's a number: \\d*
For conversion QString::toInt() is used, see:
http://qt-project.org/doc/qt-4.8/qstring.html#toInt

Which regexp do you propose? Please keep in mind, that the regexp needs to be
executed each time the user wants to sort the columns for all rows of the
table. We should keep the regexp simple as it's critical to performance.


(BTW the default value 99 looks strange, at least for me, I would use
100... This is another reason to explicitly tell users that value 99 is
OK.)


Or any other idea to force numeric sorting even for not completely numeric
values?
You can add the rows in the order you want the Table widget to show the items
and switch on keepSorting. See:
http://doc.opensuse.org/projects/YaST/SLES11/onefile/yast-onefile.html#Table


Cheers,
Thomas

--
Thomas Goettlicher
SUSE LINUX Products GmbH, GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer,
HRB 16746 (AG Nürnberg)
Maxfeldstraße 5
90409 Nürnberg
Germany
< Previous Next >
Follow Ups