diff --git a/ui/preferences.ui b/ui/preferences.ui
index 552153b..6a2a5cf 100644
--- a/ui/preferences.ui
+++ b/ui/preferences.ui
@@ -23,7 +23,7 @@
General
-
+
-
@@ -46,13 +46,33 @@
-
+
+
+ Max search results
+
+
+
+ -
+
+
+
+ 0
+ 0
+
+
+
+ 1
+
+
+
+ -
Text scan length
- -
+
-
@@ -136,6 +156,47 @@
Anki
+
-
+
+
-
+
+
+ Profile
+
+
+
+ -
+
+
+ Vocabulary
+
+
+ true
+
+
+
+ -
+
+
+ Kanji
+
+
+
+ -
+
+
+ Qt::Horizontal
+
+
+
+ 40
+ 20
+
+
+
+
+
+
-
-
@@ -202,47 +263,6 @@
- -
-
-
-
-
-
- Profile
-
-
-
- -
-
-
- Vocabulary
-
-
- true
-
-
-
- -
-
-
- Kanji
-
-
-
- -
-
-
- Qt::Horizontal
-
-
-
- 40
- 20
-
-
-
-
-
-
diff --git a/yomi_base/gen/about_ui.py b/yomi_base/gen/about_ui.py
index 422f1c1..04c44ba 100644
--- a/yomi_base/gen/about_ui.py
+++ b/yomi_base/gen/about_ui.py
@@ -2,7 +2,7 @@
# Form implementation generated from reading ui file 'ui/about.ui'
#
-# Created: Sun Nov 10 17:56:51 2013
+# Created: Mon Nov 11 15:13:30 2013
# by: PyQt4 UI code generator 4.10
#
# WARNING! All changes made in this file will be lost!
diff --git a/yomi_base/gen/preferences_ui.py b/yomi_base/gen/preferences_ui.py
index fdebe21..3fb6f25 100644
--- a/yomi_base/gen/preferences_ui.py
+++ b/yomi_base/gen/preferences_ui.py
@@ -2,7 +2,7 @@
# Form implementation generated from reading ui file 'ui/preferences.ui'
#
-# Created: Sun Nov 10 17:56:51 2013
+# Created: Mon Nov 11 15:13:30 2013
# by: PyQt4 UI code generator 4.10
#
# WARNING! All changes made in this file will be lost!
@@ -33,20 +33,32 @@ class Ui_DialogPreferences(object):
self.tabWidget.setObjectName(_fromUtf8("tabWidget"))
self.tabGeneral = QtGui.QWidget()
self.tabGeneral.setObjectName(_fromUtf8("tabGeneral"))
- self.formLayout_2 = QtGui.QFormLayout(self.tabGeneral)
- self.formLayout_2.setObjectName(_fromUtf8("formLayout_2"))
+ self.formLayout = QtGui.QFormLayout(self.tabGeneral)
+ self.formLayout.setObjectName(_fromUtf8("formLayout"))
self.checkLoadRecentFile = QtGui.QCheckBox(self.tabGeneral)
self.checkLoadRecentFile.setObjectName(_fromUtf8("checkLoadRecentFile"))
- self.formLayout_2.setWidget(0, QtGui.QFormLayout.SpanningRole, self.checkLoadRecentFile)
+ self.formLayout.setWidget(0, QtGui.QFormLayout.SpanningRole, self.checkLoadRecentFile)
self.checkStripReadings = QtGui.QCheckBox(self.tabGeneral)
self.checkStripReadings.setObjectName(_fromUtf8("checkStripReadings"))
- self.formLayout_2.setWidget(1, QtGui.QFormLayout.SpanningRole, self.checkStripReadings)
+ self.formLayout.setWidget(1, QtGui.QFormLayout.SpanningRole, self.checkStripReadings)
self.checkCheckForUpdates = QtGui.QCheckBox(self.tabGeneral)
self.checkCheckForUpdates.setObjectName(_fromUtf8("checkCheckForUpdates"))
- self.formLayout_2.setWidget(2, QtGui.QFormLayout.SpanningRole, self.checkCheckForUpdates)
+ self.formLayout.setWidget(2, QtGui.QFormLayout.SpanningRole, self.checkCheckForUpdates)
+ self.label_2 = QtGui.QLabel(self.tabGeneral)
+ self.label_2.setObjectName(_fromUtf8("label_2"))
+ self.formLayout.setWidget(3, QtGui.QFormLayout.LabelRole, self.label_2)
+ self.spinMaxResults = QtGui.QSpinBox(self.tabGeneral)
+ sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Fixed, QtGui.QSizePolicy.Fixed)
+ sizePolicy.setHorizontalStretch(0)
+ sizePolicy.setVerticalStretch(0)
+ sizePolicy.setHeightForWidth(self.spinMaxResults.sizePolicy().hasHeightForWidth())
+ self.spinMaxResults.setSizePolicy(sizePolicy)
+ self.spinMaxResults.setMinimum(1)
+ self.spinMaxResults.setObjectName(_fromUtf8("spinMaxResults"))
+ self.formLayout.setWidget(3, QtGui.QFormLayout.FieldRole, self.spinMaxResults)
self.label_14 = QtGui.QLabel(self.tabGeneral)
self.label_14.setObjectName(_fromUtf8("label_14"))
- self.formLayout_2.setWidget(3, QtGui.QFormLayout.LabelRole, self.label_14)
+ self.formLayout.setWidget(4, QtGui.QFormLayout.LabelRole, self.label_14)
self.spinScanLength = QtGui.QSpinBox(self.tabGeneral)
sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Fixed, QtGui.QSizePolicy.Fixed)
sizePolicy.setHorizontalStretch(0)
@@ -55,7 +67,7 @@ class Ui_DialogPreferences(object):
self.spinScanLength.setSizePolicy(sizePolicy)
self.spinScanLength.setMinimum(1)
self.spinScanLength.setObjectName(_fromUtf8("spinScanLength"))
- self.formLayout_2.setWidget(3, QtGui.QFormLayout.FieldRole, self.spinScanLength)
+ self.formLayout.setWidget(4, QtGui.QFormLayout.FieldRole, self.spinScanLength)
self.tabWidget.addTab(self.tabGeneral, _fromUtf8(""))
self.tabAppearance = QtGui.QWidget()
self.tabAppearance.setObjectName(_fromUtf8("tabAppearance"))
@@ -98,6 +110,21 @@ class Ui_DialogPreferences(object):
self.tabAnki.setObjectName(_fromUtf8("tabAnki"))
self.verticalLayout_2 = QtGui.QVBoxLayout(self.tabAnki)
self.verticalLayout_2.setObjectName(_fromUtf8("verticalLayout_2"))
+ self.horizontalLayout_2 = QtGui.QHBoxLayout()
+ self.horizontalLayout_2.setObjectName(_fromUtf8("horizontalLayout_2"))
+ self.label = QtGui.QLabel(self.tabAnki)
+ self.label.setObjectName(_fromUtf8("label"))
+ self.horizontalLayout_2.addWidget(self.label)
+ self.radioButtonVocab = QtGui.QRadioButton(self.tabAnki)
+ self.radioButtonVocab.setChecked(True)
+ self.radioButtonVocab.setObjectName(_fromUtf8("radioButtonVocab"))
+ self.horizontalLayout_2.addWidget(self.radioButtonVocab)
+ self.radioButtonKanji = QtGui.QRadioButton(self.tabAnki)
+ self.radioButtonKanji.setObjectName(_fromUtf8("radioButtonKanji"))
+ self.horizontalLayout_2.addWidget(self.radioButtonKanji)
+ spacerItem = QtGui.QSpacerItem(40, 20, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum)
+ self.horizontalLayout_2.addItem(spacerItem)
+ self.verticalLayout_2.addLayout(self.horizontalLayout_2)
self.horizontalLayout_3 = QtGui.QHBoxLayout()
self.horizontalLayout_3.setObjectName(_fromUtf8("horizontalLayout_3"))
self.label_13 = QtGui.QLabel(self.tabAnki)
@@ -139,21 +166,6 @@ class Ui_DialogPreferences(object):
self.labelTags.setText(_fromUtf8(""))
self.labelTags.setObjectName(_fromUtf8("labelTags"))
self.verticalLayout_2.addWidget(self.labelTags)
- self.horizontalLayout_2 = QtGui.QHBoxLayout()
- self.horizontalLayout_2.setObjectName(_fromUtf8("horizontalLayout_2"))
- self.label = QtGui.QLabel(self.tabAnki)
- self.label.setObjectName(_fromUtf8("label"))
- self.horizontalLayout_2.addWidget(self.label)
- self.radioButtonVocab = QtGui.QRadioButton(self.tabAnki)
- self.radioButtonVocab.setChecked(True)
- self.radioButtonVocab.setObjectName(_fromUtf8("radioButtonVocab"))
- self.horizontalLayout_2.addWidget(self.radioButtonVocab)
- self.radioButtonKanji = QtGui.QRadioButton(self.tabAnki)
- self.radioButtonKanji.setObjectName(_fromUtf8("radioButtonKanji"))
- self.horizontalLayout_2.addWidget(self.radioButtonKanji)
- spacerItem = QtGui.QSpacerItem(40, 20, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum)
- self.horizontalLayout_2.addItem(spacerItem)
- self.verticalLayout_2.addLayout(self.horizontalLayout_2)
self.tabWidget.addTab(self.tabAnki, _fromUtf8(""))
self.verticalLayout.addWidget(self.tabWidget)
self.buttonBox = QtGui.QDialogButtonBox(DialogPreferences)
@@ -173,12 +185,16 @@ class Ui_DialogPreferences(object):
self.checkLoadRecentFile.setText(_translate("DialogPreferences", "Load most recent file", None))
self.checkStripReadings.setText(_translate("DialogPreferences", "Strip readings from files", None))
self.checkCheckForUpdates.setText(_translate("DialogPreferences", "Check for updates", None))
+ self.label_2.setText(_translate("DialogPreferences", "Max search results", None))
self.label_14.setText(_translate("DialogPreferences", "Text scan length", None))
self.tabWidget.setTabText(self.tabWidget.indexOf(self.tabGeneral), _translate("DialogPreferences", "General", None))
self.buttonColorFg.setText(_translate("DialogPreferences", "Foreground...", None))
self.buttonColorBg.setText(_translate("DialogPreferences", "Background...", None))
self.textSample.setPlainText(_translate("DialogPreferences", "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nam accumsan nisi a leo faucibus ut varius velit fringilla. Cras hendrerit eleifend porttitor. Quisque eu elit quis tellus hendrerit ornare et ac tellus. Nunc id felis ut sapien blandit viverra vel ac est. Ut erat lorem, rutrum at scelerisque sollicitudin, lacinia quis diam. Suspendisse potenti. Integer id justo ac ligula aliquet mattis. Etiam malesuada faucibus risus, vel hendrerit elit consectetur quis. Etiam consectetur ipsum ut odio feugiat suscipit. Etiam a tellus metus. ", None))
self.tabWidget.setTabText(self.tabWidget.indexOf(self.tabAppearance), _translate("DialogPreferences", "Appearance", None))
+ self.label.setText(_translate("DialogPreferences", "Profile", None))
+ self.radioButtonVocab.setText(_translate("DialogPreferences", "Vocabulary", None))
+ self.radioButtonKanji.setText(_translate("DialogPreferences", "Kanji", None))
self.label_13.setText(_translate("DialogPreferences", "Deck", None))
self.label_12.setText(_translate("DialogPreferences", "Model", None))
self.label_11.setText(_translate("DialogPreferences", "Specify how your model fields are populated when adding facts", None))
@@ -186,9 +202,6 @@ class Ui_DialogPreferences(object):
item.setText(_translate("DialogPreferences", "Field", None))
item = self.tableFields.horizontalHeaderItem(1)
item.setText(_translate("DialogPreferences", "Value", None))
- self.label.setText(_translate("DialogPreferences", "Profile", None))
- self.radioButtonVocab.setText(_translate("DialogPreferences", "Vocabulary", None))
- self.radioButtonKanji.setText(_translate("DialogPreferences", "Kanji", None))
self.tabWidget.setTabText(self.tabWidget.indexOf(self.tabAnki), _translate("DialogPreferences", "Anki", None))
import resources_rc
diff --git a/yomi_base/gen/reader_ui.py b/yomi_base/gen/reader_ui.py
index a6d5ba4..d08033b 100644
--- a/yomi_base/gen/reader_ui.py
+++ b/yomi_base/gen/reader_ui.py
@@ -2,7 +2,7 @@
# Form implementation generated from reading ui file 'ui/reader.ui'
#
-# Created: Sun Nov 10 17:56:51 2013
+# Created: Mon Nov 11 15:13:30 2013
# by: PyQt4 UI code generator 4.10
#
# WARNING! All changes made in this file will be lost!
diff --git a/yomi_base/gen/resources_rc.py b/yomi_base/gen/resources_rc.py
index 3d23083..333e5bc 100644
--- a/yomi_base/gen/resources_rc.py
+++ b/yomi_base/gen/resources_rc.py
@@ -2,7 +2,7 @@
# Resource object code
#
-# Created: Sun Nov 10 17:56:51 2013
+# Created: Mon Nov 11 15:13:30 2013
# by: The Resource Compiler for PyQt (Qt v4.8.4)
#
# WARNING! All changes made in this file will be lost!
diff --git a/yomi_base/preferences.py b/yomi_base/preferences.py
index a41fe37..03c09d1 100644
--- a/yomi_base/preferences.py
+++ b/yomi_base/preferences.py
@@ -47,6 +47,7 @@ class DialogPreferences(QtGui.QDialog, gen.preferences_ui.Ui_DialogPreferences):
self.checkCheckForUpdates.setChecked(self.preferences['checkForUpdates'])
self.checkLoadRecentFile.setChecked(self.preferences['loadRecentFile'])
self.checkStripReadings.setChecked(self.preferences['stripReadings'])
+ self.spinMaxResults.setValue(self.preferences['maxResults'])
self.spinScanLength.setValue(self.preferences['scanLength'])
self.updateSampleText()
@@ -63,6 +64,7 @@ class DialogPreferences(QtGui.QDialog, gen.preferences_ui.Ui_DialogPreferences):
def dialogToData(self):
self.preferences['checkForUpdates'] = self.checkCheckForUpdates.isChecked()
self.preferences['loadRecentFile'] = self.checkLoadRecentFile.isChecked()
+ self.preferences['maxResults'] = self.spinMaxResults.value()
self.preferences['scanLength'] = self.spinScanLength.value()
self.preferences['stripReadings'] = self.checkStripReadings.isChecked()
@@ -103,7 +105,7 @@ class DialogPreferences(QtGui.QDialog, gen.preferences_ui.Ui_DialogPreferences):
}[name]
allowedTags = map(lambda t: '{' + t + '}', allowedTags)
- self.labelTags.setText('Allowed tags: {0}'.format(', '.join(allowedTags)))
+ self.labelTags.setText('Allowed tags are {0}'.format(', '.join(allowedTags)))
self.updateAnkiFields()