Convert enum to int and afterwards back, because PyQt4 doesn't find it with findData.

Tue, 11 Jul 2017 21:28:04 +0200

author
T.Rzepka <Tobias.Rzepka@gmail.com>
date
Tue, 11 Jul 2017 21:28:04 +0200
changeset 5803
8faca1bed582
parent 5802
abfb67a6f376
child 5804
f1861dd1935d

Convert enum to int and afterwards back, because PyQt4 doesn't find it with findData.

Preferences/ConfigurationPages/ShellPage.py file | annotate | diff | comparison | revisions
--- a/Preferences/ConfigurationPages/ShellPage.py	Tue Jul 11 21:25:35 2017 +0200
+++ b/Preferences/ConfigurationPages/ShellPage.py	Tue Jul 11 21:28:04 2017 +0200
@@ -38,11 +38,11 @@
         self.setObjectName("ShellPage")
         
         self.shellHistoryStyleComboBox.addItem(
-            self.tr("Disabled"), ShellHistoryStyle.Disabled)
+            self.tr("Disabled"), ShellHistoryStyle.Disabled.value)
         self.shellHistoryStyleComboBox.addItem(
-            self.tr("Linux Style"), ShellHistoryStyle.LinuxStyle)
+            self.tr("Linux Style"), ShellHistoryStyle.LinuxStyle.value)
         self.shellHistoryStyleComboBox.addItem(
-            self.tr("Windows Style"), ShellHistoryStyle.WindowsStyle)
+            self.tr("Windows Style"), ShellHistoryStyle.WindowsStyle.value)
         
         # set initial values
         self.shellLinenoCheckBox.setChecked(
@@ -58,7 +58,7 @@
         self.shellHistorySpinBox.setValue(
             Preferences.getShell("MaxHistoryEntries"))
         index = self.shellHistoryStyleComboBox.findData(
-            Preferences.getShell("HistoryStyle"))
+            Preferences.getShell("HistoryStyle").value)
         self.shellHistoryStyleComboBox.setCurrentIndex(index)
         self.shellHistoryWrapCheckBox.setChecked(
             Preferences.getShell("HistoryWrap"))
@@ -98,7 +98,7 @@
             self.shellHistorySpinBox.value())
         Preferences.setShell(
             "HistoryStyle",
-            self.shellHistoryStyleComboBox.currentData())
+            ShellHistoryStyle(self.shellHistoryStyleComboBox.currentData()))
         Preferences.setShell(
             "HistoryWrap",
             self.shellHistoryWrapCheckBox.isChecked())

eric ide

mercurial