mirror of
git://github.com/kovidgoyal/calibre.git
synced 2026-05-05 21:23:49 +02:00
Add a tweak to not preselect the first completion in the new combobox
This commit is contained in:
parent
e6a4163623
commit
a317af75aa
2 changed files with 11 additions and 2 deletions
|
|
@ -516,3 +516,11 @@
|
|||
# enable_multicharacters_in_tag_browser = False
|
||||
enable_multicharacters_in_tag_browser = True
|
||||
|
||||
#: Do not preselect a completion when editing authors/tags/series/etc.
|
||||
# This means that you can make changes and press Enter and your changes will
|
||||
# not be overwritten by a matching completion. However, if you wish to use the
|
||||
# completions you will now have to press Tab to select one before pressing
|
||||
# Enter. Which technique you prefer will depend on the state of metadata in
|
||||
# your library and your personal editing style.
|
||||
preselect_first_completion = False
|
||||
|
||||
|
|
|
|||
|
|
@ -16,6 +16,7 @@
|
|||
from calibre.utils.icu import sort_key, primary_startswith
|
||||
from calibre.gui2 import NONE
|
||||
from calibre.gui2.widgets import EnComboBox, LineEditECM
|
||||
from calibre.utils.config import tweaks
|
||||
|
||||
class CompleteModel(QAbstractListModel): # {{{
|
||||
|
||||
|
|
@ -157,8 +158,8 @@ def popup(self, select_first=True):
|
|||
|
||||
p.setGeometry(pos.x(), pos.y(), w, h)
|
||||
|
||||
if (select_first and not self.currentIndex().isValid() and
|
||||
self.model().rowCount() > 0):
|
||||
if (tweaks['preselect_first_completion'] and select_first and not
|
||||
self.currentIndex().isValid() and self.model().rowCount() > 0):
|
||||
self.setCurrentIndex(self.model().index(0))
|
||||
|
||||
if not p.isVisible():
|
||||
|
|
|
|||
Loading…
Reference in a new issue