diff --git a/resources/default_tweaks.py b/resources/default_tweaks.py index 420df116ce..3bba5ecca5 100644 --- a/resources/default_tweaks.py +++ b/resources/default_tweaks.py @@ -516,3 +516,11 @@ default_tweak_format = None # 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 + diff --git a/src/calibre/gui2/complete2.py b/src/calibre/gui2/complete2.py index 59f1070577..603177498d 100644 --- a/src/calibre/gui2/complete2.py +++ b/src/calibre/gui2/complete2.py @@ -16,6 +16,7 @@ from PyQt4.Qt import (QLineEdit, QAbstractListModel, Qt, pyqtSignal, QObject, 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 @@ class Completer(QListView): # {{{ 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():