22 |
22 |
23 def __init__(self, spellChecker, startPos, endPos, parent=None): |
23 def __init__(self, spellChecker, startPos, endPos, parent=None): |
24 """ |
24 """ |
25 Constructor |
25 Constructor |
26 |
26 |
27 @param spellChecker reference to the spell checker (SpellChecker) |
27 @param spellChecker reference to the spell checker |
28 @param startPos position to start spell checking (integer) |
28 @type SpellChecker |
29 @param endPos end position for spell checking (integer) |
29 @param startPos position to start spell checking |
30 @param parent reference to the parent widget (QWidget) |
30 @type int |
|
31 @param endPos end position for spell checking |
|
32 @type int |
|
33 @param parent reference to the parent widget |
|
34 @type QWidget |
31 """ |
35 """ |
32 super().__init__(parent) |
36 super().__init__(parent) |
33 self.setupUi(self) |
37 self.setupUi(self) |
34 |
38 |
35 self.__spell = spellChecker |
39 self.__spell = spellChecker |
41 |
45 |
42 def __enableButtons(self, enable): |
46 def __enableButtons(self, enable): |
43 """ |
47 """ |
44 Private method to set the buttons enabled state. |
48 Private method to set the buttons enabled state. |
45 |
49 |
46 @param enable enable state (boolean) |
50 @param enable enable state |
|
51 @type bool |
47 """ |
52 """ |
48 self.addButton.setEnabled(enable) |
53 self.addButton.setEnabled(enable) |
49 self.ignoreButton.setEnabled(enable) |
54 self.ignoreButton.setEnabled(enable) |
50 self.ignoreAllButton.setEnabled(enable) |
55 self.ignoreAllButton.setEnabled(enable) |
51 self.replaceButton.setEnabled(enable) |
56 self.replaceButton.setEnabled(enable) |
82 @pyqtSlot(str) |
87 @pyqtSlot(str) |
83 def on_changeEdit_textChanged(self, text): |
88 def on_changeEdit_textChanged(self, text): |
84 """ |
89 """ |
85 Private method to handle a change of the replacement text. |
90 Private method to handle a change of the replacement text. |
86 |
91 |
87 @param text contents of the line edit (string) |
92 @param text contents of the line edit |
|
93 @type str |
88 """ |
94 """ |
89 self.replaceButton.setEnabled(text != "") |
95 self.replaceButton.setEnabled(text != "") |
90 self.replaceAllButton.setEnabled(text != "") |
96 self.replaceAllButton.setEnabled(text != "") |
91 |
97 |
92 @pyqtSlot(str) |
98 @pyqtSlot(str) |
93 def on_suggestionsList_currentTextChanged(self, currentText): |
99 def on_suggestionsList_currentTextChanged(self, currentText): |
94 """ |
100 """ |
95 Private method to handle the selection of a suggestion. |
101 Private method to handle the selection of a suggestion. |
96 |
102 |
97 @param currentText the currently selected text (string) |
103 @param currentText the currently selected text |
|
104 @type str |
98 """ |
105 """ |
99 if currentText: |
106 if currentText: |
100 self.changeEdit.setText(currentText) |
107 self.changeEdit.setText(currentText) |
101 |
108 |
102 @pyqtSlot() |
109 @pyqtSlot() |