23 """ |
27 """ |
24 super().__init__() |
28 super().__init__() |
25 self.setupUi(self) |
29 self.setupUi(self) |
26 self.setObjectName("EditorCalltipsPage") |
30 self.setObjectName("EditorCalltipsPage") |
27 |
31 |
|
32 if QSCINTILLA_VERSION() >= 0x020700: |
|
33 self.positionComboBox.addItem(self.trUtf8("Below Text"), |
|
34 QsciScintilla.CallTipsBelowText) |
|
35 self.positionComboBox.addItem(self.trUtf8("Above Text"), |
|
36 QsciScintilla.CallTipsAboveText) |
|
37 else: |
|
38 self.calltipsPositionBox.hide() |
|
39 |
28 # set initial values |
40 # set initial values |
29 self.ctEnabledCheckBox.setChecked( |
41 self.ctEnabledCheckBox.setChecked( |
30 Preferences.getEditor("CallTipsEnabled")) |
42 Preferences.getEditor("CallTipsEnabled")) |
31 |
43 |
32 self.ctVisibleSlider.setValue( |
44 self.ctVisibleSlider.setValue( |
34 self.initColour("CallTipsBackground", self.calltipsBackgroundButton, |
46 self.initColour("CallTipsBackground", self.calltipsBackgroundButton, |
35 Preferences.getEditorColour) |
47 Preferences.getEditorColour) |
36 |
48 |
37 self.ctScintillaCheckBox.setChecked( |
49 self.ctScintillaCheckBox.setChecked( |
38 Preferences.getEditor("CallTipsScintillaOnFail")) |
50 Preferences.getEditor("CallTipsScintillaOnFail")) |
|
51 |
|
52 if QSCINTILLA_VERSION() >= 0x020700: |
|
53 self.positionComboBox.setCurrentIndex(self.positionComboBox.findData( |
|
54 Preferences.getEditor("CallTipsPosition"))) |
39 |
55 |
40 def save(self): |
56 def save(self): |
41 """ |
57 """ |
42 Public slot to save the EditorCalltips configuration. |
58 Public slot to save the EditorCalltips configuration. |
43 """ |
59 """ |
48 self.ctVisibleSlider.value()) |
64 self.ctVisibleSlider.value()) |
49 self.saveColours(Preferences.setEditorColour) |
65 self.saveColours(Preferences.setEditorColour) |
50 |
66 |
51 Preferences.setEditor("CallTipsScintillaOnFail", |
67 Preferences.setEditor("CallTipsScintillaOnFail", |
52 self.ctScintillaCheckBox.isChecked()) |
68 self.ctScintillaCheckBox.isChecked()) |
|
69 |
|
70 if QSCINTILLA_VERSION() >= 0x020700: |
|
71 Preferences.setEditor("CallTipsPosition", |
|
72 self.positionComboBox.itemData(self.positionComboBox.currentIndex())) |
53 |
73 |
54 |
74 |
55 def create(dlg): |
75 def create(dlg): |
56 """ |
76 """ |
57 Module function to create the configuration page. |
77 Module function to create the configuration page. |