mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Advanced search dialog: When starting on the title/author/etc. tab, restore the previously used search kind as well. Fixes #1029745 (Advanced search default to Contains even for existing alternative)
This commit is contained in:
parent
62b135a6c3
commit
79f60d00f3
@ -12,6 +12,7 @@ from calibre.utils.icu import sort_key
|
|||||||
from calibre.utils.config import tweaks
|
from calibre.utils.config import tweaks
|
||||||
|
|
||||||
box_values = {}
|
box_values = {}
|
||||||
|
last_matchkind = CONTAINS_MATCH
|
||||||
|
|
||||||
class SearchDialog(QDialog, Ui_Dialog):
|
class SearchDialog(QDialog, Ui_Dialog):
|
||||||
|
|
||||||
@ -57,6 +58,9 @@ class SearchDialog(QDialog, Ui_Dialog):
|
|||||||
|
|
||||||
current_tab = gprefs.get('advanced search dialog current tab', 0)
|
current_tab = gprefs.get('advanced search dialog current tab', 0)
|
||||||
self.tabWidget.setCurrentIndex(current_tab)
|
self.tabWidget.setCurrentIndex(current_tab)
|
||||||
|
if current_tab == 1:
|
||||||
|
self.matchkind.setCurrentIndex(last_matchkind)
|
||||||
|
|
||||||
self.tabWidget.currentChanged[int].connect(self.tab_changed)
|
self.tabWidget.currentChanged[int].connect(self.tab_changed)
|
||||||
self.tab_changed(current_tab)
|
self.tab_changed(current_tab)
|
||||||
|
|
||||||
@ -173,7 +177,9 @@ class SearchDialog(QDialog, Ui_Dialog):
|
|||||||
general_index = unicode(self.general_combo.currentText())
|
general_index = unicode(self.general_combo.currentText())
|
||||||
self.box_last_values['general_index'] = general_index
|
self.box_last_values['general_index'] = general_index
|
||||||
global box_values
|
global box_values
|
||||||
|
global last_matchkind
|
||||||
box_values = copy.deepcopy(self.box_last_values)
|
box_values = copy.deepcopy(self.box_last_values)
|
||||||
|
last_matchkind = mk
|
||||||
if general:
|
if general:
|
||||||
ans.append(unicode(self.general_combo.currentText()) + ':"' +
|
ans.append(unicode(self.general_combo.currentText()) + ':"' +
|
||||||
self.mc + general + '"')
|
self.mc + general + '"')
|
||||||
|
Loading…
x
Reference in New Issue
Block a user