Preferences/ConfigurationPages/EditorSearchPage.py

changeset 2230
2b1b9265156c
parent 1509
c0b5e693b0eb
child 2302
f29e9405c851
equal deleted inserted replaced
2229:78539385a8df 2230:2b1b9265156c
4 # 4 #
5 5
6 """ 6 """
7 Module implementing the Editor Search configuration page. 7 Module implementing the Editor Search configuration page.
8 """ 8 """
9
10 from PyQt4.QtCore import pyqtSlot
11 9
12 from .ConfigurationPageBase import ConfigurationPageBase 10 from .ConfigurationPageBase import ConfigurationPageBase
13 from .Ui_EditorSearchPage import Ui_EditorSearchPage 11 from .Ui_EditorSearchPage import Ui_EditorSearchPage
14 12
15 import Preferences 13 import Preferences
38 Preferences.getEditor("MarkOccurrencesEnabled")) 36 Preferences.getEditor("MarkOccurrencesEnabled"))
39 37
40 self.markOccurrencesTimeoutSpinBox.setValue( 38 self.markOccurrencesTimeoutSpinBox.setValue(
41 Preferences.getEditor("MarkOccurrencesTimeout")) 39 Preferences.getEditor("MarkOccurrencesTimeout"))
42 40
43 self.editorColours["SearchMarkers"] = \ 41 self.initColour("SearchMarkers", self.searchMarkerButton,
44 self.initColour("SearchMarkers", self.searchMarkerButton, 42 Preferences.getEditorColour, hasAlpha=True)
45 Preferences.getEditorColour)
46 43
47 def save(self): 44 def save(self):
48 """ 45 """
49 Public slot to save the Editor Search configuration. 46 Public slot to save the Editor Search configuration.
50 """ 47 """
56 self.occurrencesMarkersEnabledCheckBox.isChecked()) 53 self.occurrencesMarkersEnabledCheckBox.isChecked())
57 54
58 Preferences.setEditor("MarkOccurrencesTimeout", 55 Preferences.setEditor("MarkOccurrencesTimeout",
59 self.markOccurrencesTimeoutSpinBox.value()) 56 self.markOccurrencesTimeoutSpinBox.value())
60 57
61 for key in list(self.editorColours.keys()): 58 self.saveColours(Preferences.setEditorColour)
62 Preferences.setEditorColour(key, self.editorColours[key])
63
64 @pyqtSlot()
65 def on_searchMarkerButton_clicked(self):
66 """
67 Private slot to set the colour of the search markers.
68 """
69 self.editorColours["SearchMarkers"] = \
70 self.selectColour(self.searchMarkerButton,
71 self.editorColours["SearchMarkers"], True)
72 59
73 60
74 def create(dlg): 61 def create(dlg):
75 """ 62 """
76 Module function to create the configuration page. 63 Module function to create the configuration page.

eric ide

mercurial