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