mirror of
git://github.com/kovidgoyal/calibre.git
synced 2025-12-31 19:05:57 +01:00
Fix bug 743645: Match any/all combo reverts on restart
This commit is contained in:
parent
177d15bdbb
commit
1982507fba
3 changed files with 10 additions and 0 deletions
|
|
@ -81,6 +81,8 @@ def _config():
|
|||
help=_('Use Roman numerals for series number'))
|
||||
c.add_opt('sort_tags_by', default='name',
|
||||
help=_('Sort tags list by name, popularity, or rating'))
|
||||
c.add_opt('match_tags_type', default='any',
|
||||
help=_('Match tags by any or all.'))
|
||||
c.add_opt('cover_flow_queue_length', default=6,
|
||||
help=_('Number of covers to show in the cover browsing mode'))
|
||||
c.add_opt('LRF_conversion_defaults', default=[],
|
||||
|
|
|
|||
|
|
@ -158,11 +158,14 @@ def set_database(self, db, tag_match, sort_by):
|
|||
self.setContextMenuPolicy(Qt.CustomContextMenu)
|
||||
pop = config['sort_tags_by']
|
||||
self.sort_by.setCurrentIndex(self.db.CATEGORY_SORTS.index(pop))
|
||||
match_pop = config['match_tags_type']
|
||||
self.tag_match.setCurrentIndex(self.db.MATCH_TYPE.index(match_pop))
|
||||
if not self.made_connections:
|
||||
self.clicked.connect(self.toggle)
|
||||
self.customContextMenuRequested.connect(self.show_context_menu)
|
||||
self.refresh_required.connect(self.recount, type=Qt.QueuedConnection)
|
||||
self.sort_by.currentIndexChanged.connect(self.sort_changed)
|
||||
self.tag_match.currentIndexChanged.connect(self.match_changed)
|
||||
self.made_connections = True
|
||||
self.refresh_signal_processed = True
|
||||
db.add_listener(self.database_changed)
|
||||
|
|
@ -179,6 +182,9 @@ def match_all(self):
|
|||
def sort_changed(self, pop):
|
||||
config.set('sort_tags_by', self.db.CATEGORY_SORTS[pop])
|
||||
self.recount()
|
||||
|
||||
def match_changed(self, pop):
|
||||
config.set('match_tags_type', self.db.MATCH_TYPE[pop])
|
||||
|
||||
def set_search_restriction(self, s):
|
||||
if s:
|
||||
|
|
@ -2114,6 +2120,7 @@ def __init__(self, parent):
|
|||
parent.sort_by.setCurrentIndex(0)
|
||||
self._layout.addWidget(parent.sort_by)
|
||||
|
||||
# Must be in the same order as db2.MATCH_TYPE
|
||||
parent.tag_match = QComboBox(parent)
|
||||
for x in (_('Match any'), _('Match all')):
|
||||
parent.tag_match.addItem(x)
|
||||
|
|
|
|||
|
|
@ -1228,6 +1228,7 @@ def get_books_for_category(self, category, id_):
|
|||
########## data structures for get_categories
|
||||
|
||||
CATEGORY_SORTS = ('name', 'popularity', 'rating')
|
||||
MATCH_TYPE = ('any', 'all')
|
||||
|
||||
class TCat_Tag(object):
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue