Bug 371593

Summary: Sort valuelist combo
Product: [Applications] KBibTeX Reporter: Juergen Spitzmueller <juergen>
Component: User interfaceAssignee: Thomas Fischer <fischer>
Status: RESOLVED FIXED    
Severity: normal    
Priority: NOR    
Version First Reported In: 0.6   
Target Milestone: ---   
Platform: Compiled Sources   
OS: Linux   
Latest Commit: Version Fixed/Implemented In:
Sentry Crash Report:
Attachments: Sort the valuelist combo locale-aware
Updated patch that considers two more combo boxes
Addon fix

Description Juergen Spitzmueller 2016-10-24 18:03:18 UTC
Created attachment 101748 [details]
Sort the valuelist combo locale-aware

The valuelist combo box does not seem to have a transparent sorting order, which makes its use (especially with many fields as in biblatex) rather clumsy.
I propose to sort it alphabetically (locale-aware). Patch attached.
Comment 1 Juergen Spitzmueller 2016-10-24 18:50:40 UTC
BTW the same should be done for the entry type combo in the entry edit dialog. I can provide a separate path if you like.
Comment 2 Juergen Spitzmueller 2016-10-25 05:59:05 UTC
(In reply to Juergen Spitzmueller from comment #1)
> BTW the same should be done for the entry type combo in the entry edit
> dialog. I can provide a separate path if you like.

... and the "Field" combobox in the filter bar.

Updated patch that considers all three cases follows.
Comment 3 Juergen Spitzmueller 2016-10-25 05:59:53 UTC
Created attachment 101765 [details]
Updated patch that considers two more combo boxes
Comment 4 Thomas Fischer 2016-11-03 21:45:31 UTC
Git commit 1397efc1bb858b34b4bed95f19cf5084a66b27e8 by Thomas Fischer, on behalf of Juergen Spitzmueller.
Committed on 03/11/2016 at 21:45.
Pushed by thomasfischer into branch 'kbibtex/0.6'.

Sorting field and entry types alphabetically

Sorting lists of field and entry types as used in comboboxs
locale-aware alphabetically.

The change affects the following places:
- Element widget, more specifically the combobox where
  the type of an entry can be selected: article, book, ...
- The filter bar that allows, among others, filter the
  main list view by entries of type article, book, ...
- The value list which can list and count occurrences
  of existing authors, titles, journals. The combobox to
  select which field type to assemble a list for is now
  sorted.

Signed-off-by: Thomas Fischer <fischer@unix-ag.uni-kl.de>

M  +18   -8    src/gui/element/elementwidgets.cpp
M  +14   -1    src/gui/widgets/filterbar.cpp
M  +7    -0    src/program/docklets/valuelist.cpp

http://commits.kde.org/kbibtex/1397efc1bb858b34b4bed95f19cf5084a66b27e8
Comment 5 Thomas Fischer 2016-11-03 21:59:36 UTC
(In reply to Juergen Spitzmueller from comment #3)
> Created attachment 101765 [details]
> Updated patch that considers two more combo boxes

Thank you for the patch! I applied it both to 0.6, 0.7, and master (not pushed yet). I made minor adjustments and some reformatting.
Comment 6 Juergen Spitzmueller 2016-11-06 12:41:08 UTC
Created attachment 102068 [details]
Addon fix

There is a small glitch in the commit. Customized text is set too early and then overwritten. This patch fixes the problem.
Comment 7 Thomas Fischer 2016-11-06 18:54:24 UTC
(In reply to Juergen Spitzmueller from comment #6)
> Created attachment 102068 [details]
> Addon fix
> 
> There is a small glitch in the commit. Customized text is set too early and
> then overwritten. This patch fixes the problem.

I applied your patch with minor editing as of commit 2efcd73009d411c2d502ab72883483b7b1d7ed90.
Thanks!