1

Adding checkbox for rememberTextContent setting

Former-commit-id: de85f3c192b2943d763b4ad7fea0e38969feb752
This commit is contained in:
Alex Yatskov 2015-02-15 13:31:13 +09:00
parent a7813b9acd
commit 30cb4926b9
6 changed files with 29 additions and 12 deletions

View File

@ -24,6 +24,9 @@
<string>General</string> <string>General</string>
</attribute> </attribute>
<layout class="QFormLayout" name="formLayout"> <layout class="QFormLayout" name="formLayout">
<property name="fieldGrowthPolicy">
<enum>QFormLayout::AllNonFixedFieldsGrow</enum>
</property>
<item row="0" column="0" colspan="2"> <item row="0" column="0" colspan="2">
<widget class="QCheckBox" name="checkLoadRecentFile"> <widget class="QCheckBox" name="checkLoadRecentFile">
<property name="text"> <property name="text">
@ -45,14 +48,14 @@
</property> </property>
</widget> </widget>
</item> </item>
<item row="3" column="0"> <item row="4" column="0">
<widget class="QLabel" name="label_2"> <widget class="QLabel" name="label_2">
<property name="text"> <property name="text">
<string>Max search results</string> <string>Max search results</string>
</property> </property>
</widget> </widget>
</item> </item>
<item row="3" column="1"> <item row="4" column="1">
<widget class="QSpinBox" name="spinMaxResults"> <widget class="QSpinBox" name="spinMaxResults">
<property name="sizePolicy"> <property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed"> <sizepolicy hsizetype="Fixed" vsizetype="Fixed">
@ -65,14 +68,14 @@
</property> </property>
</widget> </widget>
</item> </item>
<item row="4" column="0"> <item row="5" column="0">
<widget class="QLabel" name="label_14"> <widget class="QLabel" name="label_14">
<property name="text"> <property name="text">
<string>Text scan length</string> <string>Text scan length</string>
</property> </property>
</widget> </widget>
</item> </item>
<item row="4" column="1"> <item row="5" column="1">
<widget class="QSpinBox" name="spinScanLength"> <widget class="QSpinBox" name="spinScanLength">
<property name="sizePolicy"> <property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed"> <sizepolicy hsizetype="Fixed" vsizetype="Fixed">
@ -85,6 +88,13 @@
</property> </property>
</widget> </widget>
</item> </item>
<item row="3" column="0">
<widget class="QCheckBox" name="checkRememberTextContent">
<property name="text">
<string>Remember text content</string>
</property>
</widget>
</item>
</layout> </layout>
</widget> </widget>
<widget class="QWidget" name="tabAppearance"> <widget class="QWidget" name="tabAppearance">

View File

@ -2,7 +2,7 @@
# Form implementation generated from reading ui file 'ui/about.ui' # Form implementation generated from reading ui file 'ui/about.ui'
# #
# Created: Fri Jan 30 18:40:48 2015 # Created: Sun Feb 15 13:27:51 2015
# by: PyQt4 UI code generator 4.10.4 # by: PyQt4 UI code generator 4.10.4
# #
# WARNING! All changes made in this file will be lost! # WARNING! All changes made in this file will be lost!

View File

@ -2,7 +2,7 @@
# Form implementation generated from reading ui file 'ui/preferences.ui' # Form implementation generated from reading ui file 'ui/preferences.ui'
# #
# Created: Fri Jan 30 18:40:48 2015 # Created: Sun Feb 15 13:27:51 2015
# by: PyQt4 UI code generator 4.10.4 # by: PyQt4 UI code generator 4.10.4
# #
# WARNING! All changes made in this file will be lost! # WARNING! All changes made in this file will be lost!
@ -34,6 +34,7 @@ class Ui_DialogPreferences(object):
self.tabGeneral = QtGui.QWidget() self.tabGeneral = QtGui.QWidget()
self.tabGeneral.setObjectName(_fromUtf8("tabGeneral")) self.tabGeneral.setObjectName(_fromUtf8("tabGeneral"))
self.formLayout = QtGui.QFormLayout(self.tabGeneral) self.formLayout = QtGui.QFormLayout(self.tabGeneral)
self.formLayout.setFieldGrowthPolicy(QtGui.QFormLayout.AllNonFixedFieldsGrow)
self.formLayout.setObjectName(_fromUtf8("formLayout")) self.formLayout.setObjectName(_fromUtf8("formLayout"))
self.checkLoadRecentFile = QtGui.QCheckBox(self.tabGeneral) self.checkLoadRecentFile = QtGui.QCheckBox(self.tabGeneral)
self.checkLoadRecentFile.setObjectName(_fromUtf8("checkLoadRecentFile")) self.checkLoadRecentFile.setObjectName(_fromUtf8("checkLoadRecentFile"))
@ -46,7 +47,7 @@ class Ui_DialogPreferences(object):
self.formLayout.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 = QtGui.QLabel(self.tabGeneral)
self.label_2.setObjectName(_fromUtf8("label_2")) self.label_2.setObjectName(_fromUtf8("label_2"))
self.formLayout.setWidget(3, QtGui.QFormLayout.LabelRole, self.label_2) self.formLayout.setWidget(4, QtGui.QFormLayout.LabelRole, self.label_2)
self.spinMaxResults = QtGui.QSpinBox(self.tabGeneral) self.spinMaxResults = QtGui.QSpinBox(self.tabGeneral)
sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Fixed, QtGui.QSizePolicy.Fixed) sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Fixed, QtGui.QSizePolicy.Fixed)
sizePolicy.setHorizontalStretch(0) sizePolicy.setHorizontalStretch(0)
@ -55,10 +56,10 @@ class Ui_DialogPreferences(object):
self.spinMaxResults.setSizePolicy(sizePolicy) self.spinMaxResults.setSizePolicy(sizePolicy)
self.spinMaxResults.setMinimum(1) self.spinMaxResults.setMinimum(1)
self.spinMaxResults.setObjectName(_fromUtf8("spinMaxResults")) self.spinMaxResults.setObjectName(_fromUtf8("spinMaxResults"))
self.formLayout.setWidget(3, QtGui.QFormLayout.FieldRole, self.spinMaxResults) self.formLayout.setWidget(4, QtGui.QFormLayout.FieldRole, self.spinMaxResults)
self.label_14 = QtGui.QLabel(self.tabGeneral) self.label_14 = QtGui.QLabel(self.tabGeneral)
self.label_14.setObjectName(_fromUtf8("label_14")) self.label_14.setObjectName(_fromUtf8("label_14"))
self.formLayout.setWidget(4, QtGui.QFormLayout.LabelRole, self.label_14) self.formLayout.setWidget(5, QtGui.QFormLayout.LabelRole, self.label_14)
self.spinScanLength = QtGui.QSpinBox(self.tabGeneral) self.spinScanLength = QtGui.QSpinBox(self.tabGeneral)
sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Fixed, QtGui.QSizePolicy.Fixed) sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Fixed, QtGui.QSizePolicy.Fixed)
sizePolicy.setHorizontalStretch(0) sizePolicy.setHorizontalStretch(0)
@ -67,7 +68,10 @@ class Ui_DialogPreferences(object):
self.spinScanLength.setSizePolicy(sizePolicy) self.spinScanLength.setSizePolicy(sizePolicy)
self.spinScanLength.setMinimum(1) self.spinScanLength.setMinimum(1)
self.spinScanLength.setObjectName(_fromUtf8("spinScanLength")) self.spinScanLength.setObjectName(_fromUtf8("spinScanLength"))
self.formLayout.setWidget(4, QtGui.QFormLayout.FieldRole, self.spinScanLength) self.formLayout.setWidget(5, QtGui.QFormLayout.FieldRole, self.spinScanLength)
self.checkRememberTextContent = QtGui.QCheckBox(self.tabGeneral)
self.checkRememberTextContent.setObjectName(_fromUtf8("checkRememberTextContent"))
self.formLayout.setWidget(3, QtGui.QFormLayout.LabelRole, self.checkRememberTextContent)
self.tabWidget.addTab(self.tabGeneral, _fromUtf8("")) self.tabWidget.addTab(self.tabGeneral, _fromUtf8(""))
self.tabAppearance = QtGui.QWidget() self.tabAppearance = QtGui.QWidget()
self.tabAppearance.setObjectName(_fromUtf8("tabAppearance")) self.tabAppearance.setObjectName(_fromUtf8("tabAppearance"))
@ -190,6 +194,7 @@ class Ui_DialogPreferences(object):
self.checkCheckForUpdates.setText(_translate("DialogPreferences", "Check for updates", None)) self.checkCheckForUpdates.setText(_translate("DialogPreferences", "Check for updates", None))
self.label_2.setText(_translate("DialogPreferences", "Max search results", None)) self.label_2.setText(_translate("DialogPreferences", "Max search results", None))
self.label_14.setText(_translate("DialogPreferences", "Text scan length", None)) self.label_14.setText(_translate("DialogPreferences", "Text scan length", None))
self.checkRememberTextContent.setText(_translate("DialogPreferences", "Remember text content", None))
self.tabWidget.setTabText(self.tabWidget.indexOf(self.tabGeneral), _translate("DialogPreferences", "General", None)) self.tabWidget.setTabText(self.tabWidget.indexOf(self.tabGeneral), _translate("DialogPreferences", "General", None))
self.buttonColorFg.setText(_translate("DialogPreferences", "Foreground...", None)) self.buttonColorFg.setText(_translate("DialogPreferences", "Foreground...", None))
self.buttonColorBg.setText(_translate("DialogPreferences", "Background...", None)) self.buttonColorBg.setText(_translate("DialogPreferences", "Background...", None))

View File

@ -2,7 +2,7 @@
# Form implementation generated from reading ui file 'ui/reader.ui' # Form implementation generated from reading ui file 'ui/reader.ui'
# #
# Created: Fri Jan 30 18:40:48 2015 # Created: Sun Feb 15 13:27:51 2015
# by: PyQt4 UI code generator 4.10.4 # by: PyQt4 UI code generator 4.10.4
# #
# WARNING! All changes made in this file will be lost! # WARNING! All changes made in this file will be lost!

View File

@ -2,7 +2,7 @@
# Resource object code # Resource object code
# #
# Created: Fri Jan 30 18:40:48 2015 # Created: Sun Feb 15 13:27:51 2015
# by: The Resource Compiler for PyQt (Qt v4.8.6) # by: The Resource Compiler for PyQt (Qt v4.8.6)
# #
# WARNING! All changes made in this file will be lost! # WARNING! All changes made in this file will be lost!

View File

@ -45,6 +45,7 @@ class DialogPreferences(QtGui.QDialog, gen.preferences_ui.Ui_DialogPreferences):
def dataToDialog(self): def dataToDialog(self):
self.checkCheckForUpdates.setChecked(self.preferences['checkForUpdates']) self.checkCheckForUpdates.setChecked(self.preferences['checkForUpdates'])
self.checkRememberTextContent.setChecked(self.preferences['rememberTextContent'])
self.checkAllowEditing.setChecked(self.preferences['allowEditing']) self.checkAllowEditing.setChecked(self.preferences['allowEditing'])
self.checkLoadRecentFile.setChecked(self.preferences['loadRecentFile']) self.checkLoadRecentFile.setChecked(self.preferences['loadRecentFile'])
self.checkStripReadings.setChecked(self.preferences['stripReadings']) self.checkStripReadings.setChecked(self.preferences['stripReadings'])
@ -64,6 +65,7 @@ class DialogPreferences(QtGui.QDialog, gen.preferences_ui.Ui_DialogPreferences):
def dialogToData(self): def dialogToData(self):
self.preferences['checkForUpdates'] = self.checkCheckForUpdates.isChecked() self.preferences['checkForUpdates'] = self.checkCheckForUpdates.isChecked()
self.preferences['rememberTextContent'] = self.checkRememberTextContent.isChecked()
self.preferences['allowEditing'] = self.checkAllowEditing.isChecked() self.preferences['allowEditing'] = self.checkAllowEditing.isChecked()
self.preferences['loadRecentFile'] = self.checkLoadRecentFile.isChecked() self.preferences['loadRecentFile'] = self.checkLoadRecentFile.isChecked()
self.preferences['maxResults'] = self.spinMaxResults.value() self.preferences['maxResults'] = self.spinMaxResults.value()