mirror of
git://github.com/kovidgoyal/calibre.git
synced 2026-05-08 16:43:40 +02:00
Limit selection in completion popup to boxes containing less than completion_change_to_ascii_sorting items
This commit is contained in:
parent
1d9285df7a
commit
7b502b06f7
1 changed files with 8 additions and 7 deletions
|
|
@ -168,13 +168,14 @@ def showPopup(self):
|
|||
v = unicode(c.currentCompletion())
|
||||
c.setCompletionPrefix('')
|
||||
c.complete()
|
||||
i = 0;
|
||||
while c.setCurrentRow(i):
|
||||
cr = unicode(c.currentIndex().data().toString())
|
||||
if cr.startswith(v):
|
||||
c.popup().setCurrentIndex(c.currentIndex())
|
||||
return
|
||||
i += 1
|
||||
if c.model().rowCount() < tweaks['completion_change_to_ascii_sorting']:
|
||||
i = 0;
|
||||
while c.setCurrentRow(i):
|
||||
cr = unicode(c.currentIndex().data().toString())
|
||||
if cr.startswith(v):
|
||||
c.popup().setCurrentIndex(c.currentIndex())
|
||||
break
|
||||
i += 1
|
||||
|
||||
def update_items_cache(self, complete_items):
|
||||
self.lineEdit().update_items_cache(complete_items)
|
||||
|
|
|
|||
Loading…
Reference in a new issue