mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Sort the new tweaks box.
This commit is contained in:
parent
1311f65c49
commit
7be21fc77f
@ -60,7 +60,10 @@ class Tweak(object): # {{{
|
|||||||
return ans
|
return ans
|
||||||
|
|
||||||
def __cmp__(self, other):
|
def __cmp__(self, other):
|
||||||
return cmp(self.is_customized, getattr(other, 'is_customized', False))
|
if self.is_customized != getattr(other, 'is_customized', False):
|
||||||
|
return -1 * cmp(self.is_customized,
|
||||||
|
getattr(other, 'is_customized', False))
|
||||||
|
return cmp(icu_lower(self.name), icu_lower(getattr(other, 'name', '')))
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def is_customized(self):
|
def is_customized(self):
|
||||||
@ -139,6 +142,7 @@ class Tweaks(QAbstractListModel): # {{{
|
|||||||
pos = self.read_tweak(lines, pos, dl, l)
|
pos = self.read_tweak(lines, pos, dl, l)
|
||||||
pos += 1
|
pos += 1
|
||||||
|
|
||||||
|
self.tweaks.sort()
|
||||||
default_keys = set(dl.iterkeys())
|
default_keys = set(dl.iterkeys())
|
||||||
custom_keys = set(l.iterkeys())
|
custom_keys = set(l.iterkeys())
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user