Use a radio button instead of a checkbox to make it clearer what search is generated

This commit is contained in:
Kovid Goyal 2013-04-27 15:17:56 +05:30
parent 30de50d4a9
commit 013a5bcde1

View File

@ -8,7 +8,7 @@ from functools import partial
from PyQt4.Qt import ( from PyQt4.Qt import (
Qt, QMenu, QPoint, QIcon, QDialog, QGridLayout, QLabel, QLineEdit, QComboBox, Qt, QMenu, QPoint, QIcon, QDialog, QGridLayout, QLabel, QLineEdit, QComboBox,
QDialogButtonBox, QSize, QVBoxLayout, QListWidget, QStringList, QCheckBox) QDialogButtonBox, QSize, QVBoxLayout, QListWidget, QStringList, QRadioButton)
from calibre.gui2 import error_dialog, question_dialog from calibre.gui2 import error_dialog, question_dialog
from calibre.gui2.widgets import ComboBoxWithHelp from calibre.gui2.widgets import ComboBoxWithHelp
@ -31,7 +31,10 @@ class SelectNames(QDialog): # {{{
self._names.setSelectionMode(self._names.ExtendedSelection) self._names.setSelectionMode(self._names.ExtendedSelection)
l.addWidget(self._names) l.addWidget(self._names)
self._and = QCheckBox(_('Match all selected %s names')%txt) self._or = QRadioButton(_('Match any of the selected %s names')%txt)
self._and = QRadioButton(_('Match all of the selected %s names')%txt)
self._or.setChecked(True)
l.addWidget(self._or)
l.addWidget(self._and) l.addWidget(self._and)
self.bb = QDialogButtonBox(QDialogButtonBox.Ok | QDialogButtonBox.Cancel) self.bb = QDialogButtonBox(QDialogButtonBox.Ok | QDialogButtonBox.Cancel)
@ -318,7 +321,6 @@ class SearchRestrictionMixin(object):
self.edit_menu = QMenu(_('Edit Virtual Library')) self.edit_menu = QMenu(_('Edit Virtual Library'))
self.rm_menu = QMenu(_('Remove Virtual Library')) self.rm_menu = QMenu(_('Remove Virtual Library'))
def add_virtual_library(self, db, name, search): def add_virtual_library(self, db, name, search):
virt_libs = db.prefs.get('virtual_libraries', {}) virt_libs = db.prefs.get('virtual_libraries', {})
virt_libs[name] = search virt_libs[name] = search