Differential D4852 Diff 11987 plugins/extensions/pykrita/plugin/plugins/scripter/ui_scripter/actions/settingsaction/syntaxstylescombobox.py
Changeset View
Changeset View
Standalone View
Standalone View
plugins/extensions/pykrita/plugin/plugins/scripter/ui_scripter/actions/settingsaction/syntaxstylescombobox.py
Show All 16 Lines | 13 | for styleClass in self.styleClasses: | |||
---|---|---|---|---|---|
17 | if className == type(self.highlight.getSyntaxStyle()).__name__: | 17 | if className == type(self.highlight.getSyntaxStyle()).__name__: | ||
18 | self.setCurrentIndex(self.findText(className)) | 18 | self.setCurrentIndex(self.findText(className)) | ||
19 | 19 | | |||
20 | self.currentIndexChanged.connect(self._currentIndexChanged) | 20 | self.currentIndexChanged.connect(self._currentIndexChanged) | ||
21 | 21 | | |||
22 | def _currentIndexChanged(self, index): | 22 | def _currentIndexChanged(self, index): | ||
23 | self.highlight.setSyntaxStyle(getattr(syntaxstyles, self.itemText(index))()) | 23 | self.highlight.setSyntaxStyle(getattr(syntaxstyles, self.itemText(index))()) | ||
24 | self.highlight.rehighlight() | 24 | self.highlight.rehighlight() | ||
25 | | ||||
26 | def readSettings(self, settings): | ||||
27 | syntaxStyle = settings.value('syntaxStyle', '') | ||||
28 | | ||||
29 | if syntaxStyle: | ||||
30 | self.setCurrentIndex(self.findText(syntaxStyle)) | ||||
31 | | ||||
32 | def writeSettings(self, settings): | ||||
33 | settings.setValue('syntaxStyle', type(self.highlight.getSyntaxStyle()).__name__) |