Add checkbox to allow editing the main text area
Former-commit-id: 67061d862173e3acd4c5b7eea9a5a62d84b1b6ba
This commit is contained in:
parent
2173e809a1
commit
63ba3bb6d4
@ -146,6 +146,13 @@
|
|||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QCheckBox" name="checkAllowEditing">
|
||||||
|
<property name="text">
|
||||||
|
<string>Allow editing</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
</widget>
|
</widget>
|
||||||
<widget class="QWidget" name="tabAnki">
|
<widget class="QWidget" name="tabAnki">
|
||||||
|
@ -11,5 +11,6 @@
|
|||||||
"scanLength": 16,
|
"scanLength": 16,
|
||||||
"stripReadings": false,
|
"stripReadings": false,
|
||||||
"tags": [],
|
"tags": [],
|
||||||
"wordWrap": false
|
"wordWrap": false,
|
||||||
|
"allowEditing": false
|
||||||
}
|
}
|
||||||
|
@ -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: Wed Dec 24 17:04:45 2014
|
# Created: Fri Jan 30 18:21:34 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!
|
||||||
|
@ -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: Wed Dec 24 17:04:45 2014
|
# Created: Fri Jan 30 18:21:34 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!
|
||||||
@ -104,6 +104,9 @@ class Ui_DialogPreferences(object):
|
|||||||
self.textSample = QtGui.QPlainTextEdit(self.tabAppearance)
|
self.textSample = QtGui.QPlainTextEdit(self.tabAppearance)
|
||||||
self.textSample.setObjectName(_fromUtf8("textSample"))
|
self.textSample.setObjectName(_fromUtf8("textSample"))
|
||||||
self.verticalLayout_3.addWidget(self.textSample)
|
self.verticalLayout_3.addWidget(self.textSample)
|
||||||
|
self.checkAllowEditing = QtGui.QCheckBox(self.tabAppearance)
|
||||||
|
self.checkAllowEditing.setObjectName(_fromUtf8("checkAllowEditing"))
|
||||||
|
self.verticalLayout_3.addWidget(self.checkAllowEditing)
|
||||||
self.tabWidget.addTab(self.tabAppearance, _fromUtf8(""))
|
self.tabWidget.addTab(self.tabAppearance, _fromUtf8(""))
|
||||||
self.tabAnki = QtGui.QWidget()
|
self.tabAnki = QtGui.QWidget()
|
||||||
self.tabAnki.setEnabled(False)
|
self.tabAnki.setEnabled(False)
|
||||||
@ -191,6 +194,7 @@ class Ui_DialogPreferences(object):
|
|||||||
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))
|
||||||
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.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.checkAllowEditing.setText(_translate("DialogPreferences", "Allow editing", None))
|
||||||
self.tabWidget.setTabText(self.tabWidget.indexOf(self.tabAppearance), _translate("DialogPreferences", "Appearance", None))
|
self.tabWidget.setTabText(self.tabWidget.indexOf(self.tabAppearance), _translate("DialogPreferences", "Appearance", None))
|
||||||
self.label.setText(_translate("DialogPreferences", "Displayed profile", None))
|
self.label.setText(_translate("DialogPreferences", "Displayed profile", None))
|
||||||
self.radioButtonVocab.setText(_translate("DialogPreferences", "Vocabulary", None))
|
self.radioButtonVocab.setText(_translate("DialogPreferences", "Vocabulary", None))
|
||||||
|
@ -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: Wed Dec 24 17:04:45 2014
|
# Created: Fri Jan 30 18:21:34 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!
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
# Resource object code
|
# Resource object code
|
||||||
#
|
#
|
||||||
# Created: Wed Dec 24 17:04:45 2014
|
# Created: Fri Jan 30 18:21:34 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!
|
||||||
|
@ -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.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'])
|
||||||
self.spinMaxResults.setValue(self.preferences['maxResults'])
|
self.spinMaxResults.setValue(self.preferences['maxResults'])
|
||||||
@ -63,6 +64,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['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()
|
||||||
self.preferences['scanLength'] = self.spinScanLength.value()
|
self.preferences['scanLength'] = self.spinScanLength.value()
|
||||||
|
@ -112,6 +112,9 @@ class MainWindowReader(QtGui.QMainWindow, gen.reader_ui.Ui_MainWindowReader):
|
|||||||
palette.setColor(QtGui.QPalette.Text, QtGui.QColor(self.preferences['fgColor']))
|
palette.setColor(QtGui.QPalette.Text, QtGui.QColor(self.preferences['fgColor']))
|
||||||
self.textContent.setPalette(palette)
|
self.textContent.setPalette(palette)
|
||||||
|
|
||||||
|
self.textContent.setReadOnly(not self.preferences['allowEditing'])
|
||||||
|
self.textContent.setAttribute(QtCore.Qt.WA_InputMethodEnabled)
|
||||||
|
|
||||||
font = self.textContent.font()
|
font = self.textContent.font()
|
||||||
font.setFamily(self.preferences['fontFamily'])
|
font.setFamily(self.preferences['fontFamily'])
|
||||||
font.setPointSize(self.preferences['fontSize'] + self.zoom)
|
font.setPointSize(self.preferences['fontSize'] + self.zoom)
|
||||||
|
Loading…
Reference in New Issue
Block a user