Save state of remote API checkbox to preferences
This commit is contained in:
parent
426745fdb4
commit
9f9d2221db
@ -7,7 +7,7 @@
|
|||||||
<x>0</x>
|
<x>0</x>
|
||||||
<y>0</y>
|
<y>0</y>
|
||||||
<width>600</width>
|
<width>600</width>
|
||||||
<height>300</height>
|
<height>323</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
<property name="windowTitle">
|
<property name="windowTitle">
|
||||||
@ -299,7 +299,7 @@
|
|||||||
</sizepolicy>
|
</sizepolicy>
|
||||||
</property>
|
</property>
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>(see the <a href="https://foosoft.net/projects/yomichan-ext">extension page</a> for details)</string>
|
<string>(see the <a href="https://foosoft.net/projects/yomichan-chrome">extension page</a> for details)</string>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
@ -15,5 +15,6 @@
|
|||||||
"tags": [],
|
"tags": [],
|
||||||
"wordWrap": false,
|
"wordWrap": false,
|
||||||
"allowEditing": true,
|
"allowEditing": true,
|
||||||
|
"enableRemoteApi": false,
|
||||||
"firstRun": true
|
"firstRun": true
|
||||||
}
|
}
|
||||||
|
@ -25,7 +25,7 @@ except AttributeError:
|
|||||||
class Ui_DialogPreferences(object):
|
class Ui_DialogPreferences(object):
|
||||||
def setupUi(self, DialogPreferences):
|
def setupUi(self, DialogPreferences):
|
||||||
DialogPreferences.setObjectName(_fromUtf8("DialogPreferences"))
|
DialogPreferences.setObjectName(_fromUtf8("DialogPreferences"))
|
||||||
DialogPreferences.resize(600, 300)
|
DialogPreferences.resize(600, 323)
|
||||||
self.verticalLayout = QtGui.QVBoxLayout(DialogPreferences)
|
self.verticalLayout = QtGui.QVBoxLayout(DialogPreferences)
|
||||||
self.verticalLayout.setObjectName(_fromUtf8("verticalLayout"))
|
self.verticalLayout.setObjectName(_fromUtf8("verticalLayout"))
|
||||||
self.tabWidget = QtGui.QTabWidget(DialogPreferences)
|
self.tabWidget = QtGui.QTabWidget(DialogPreferences)
|
||||||
@ -227,7 +227,7 @@ class Ui_DialogPreferences(object):
|
|||||||
item = self.tableFields.horizontalHeaderItem(1)
|
item = self.tableFields.horizontalHeaderItem(1)
|
||||||
item.setText(_translate("DialogPreferences", "Value", None))
|
item.setText(_translate("DialogPreferences", "Value", None))
|
||||||
self.checkEnableRemoteApi.setText(_translate("DialogPreferences", "Enable remote API", None))
|
self.checkEnableRemoteApi.setText(_translate("DialogPreferences", "Enable remote API", None))
|
||||||
self.label_3.setText(_translate("DialogPreferences", "(see the <a href=\"https://foosoft.net/projects/yomichan-ext\">extension page</a> for details)", None))
|
self.label_3.setText(_translate("DialogPreferences", "(see the <a href=\"https://foosoft.net/projects/yomichan-chrome\">extension page</a> for details)", None))
|
||||||
self.tabWidget.setTabText(self.tabWidget.indexOf(self.tabAnki), _translate("DialogPreferences", "Anki", None))
|
self.tabWidget.setTabText(self.tabWidget.indexOf(self.tabAnki), _translate("DialogPreferences", "Anki", None))
|
||||||
|
|
||||||
import resources_rc
|
import resources_rc
|
||||||
|
@ -51,6 +51,7 @@ class DialogPreferences(QtGui.QDialog, gen.preferences_ui.Ui_DialogPreferences):
|
|||||||
self.checkStripReadings.setChecked(self.preferences['stripReadings'])
|
self.checkStripReadings.setChecked(self.preferences['stripReadings'])
|
||||||
self.spinMaxResults.setValue(self.preferences['maxResults'])
|
self.spinMaxResults.setValue(self.preferences['maxResults'])
|
||||||
self.spinScanLength.setValue(self.preferences['scanLength'])
|
self.spinScanLength.setValue(self.preferences['scanLength'])
|
||||||
|
self.checkEnableRemoteApi.setChecked(self.preferences['enableRemoteApi'])
|
||||||
|
|
||||||
self.updateSampleText()
|
self.updateSampleText()
|
||||||
font = self.textSample.font()
|
font = self.textSample.font()
|
||||||
@ -71,6 +72,7 @@ class DialogPreferences(QtGui.QDialog, gen.preferences_ui.Ui_DialogPreferences):
|
|||||||
self.preferences['maxResults'] = self.spinMaxResults.value()
|
self.preferences['maxResults'] = self.spinMaxResults.value()
|
||||||
self.preferences['scanLength'] = self.spinScanLength.value()
|
self.preferences['scanLength'] = self.spinScanLength.value()
|
||||||
self.preferences['stripReadings'] = self.checkStripReadings.isChecked()
|
self.preferences['stripReadings'] = self.checkStripReadings.isChecked()
|
||||||
|
self.preferences['enableRemoteApi'] = self.checkEnableRemoteApi.isChecked()
|
||||||
self.preferences['firstRun'] = False
|
self.preferences['firstRun'] = False
|
||||||
|
|
||||||
if self.anki is not None:
|
if self.anki is not None:
|
||||||
|
Loading…
Reference in New Issue
Block a user