12 |
12 |
13 from .Ui_SpellCheckingDialog import Ui_SpellCheckingDialog |
13 from .Ui_SpellCheckingDialog import Ui_SpellCheckingDialog |
14 |
14 |
15 import Utilities |
15 import Utilities |
16 |
16 |
|
17 |
17 class SpellCheckingDialog(QDialog, Ui_SpellCheckingDialog): |
18 class SpellCheckingDialog(QDialog, Ui_SpellCheckingDialog): |
18 """ |
19 """ |
19 Class implementing the spell checking dialog. |
20 Class implementing the spell checking dialog. |
20 """ |
21 """ |
21 def __init__(self, spellChecker, startPos, endPos, parent = None): |
22 def __init__(self, spellChecker, startPos, endPos, parent=None): |
22 """ |
23 """ |
23 Constructor |
24 Constructor |
24 """ |
25 """ |
25 QDialog.__init__(self, parent) |
26 QDialog.__init__(self, parent) |
26 self.setupUi(self) |
27 self.setupUi(self) |
58 self.__enableButtons(True) |
59 self.__enableButtons(True) |
59 self.word, self.wordStart, self.wordEnd = self.__spell.getError() |
60 self.word, self.wordStart, self.wordEnd = self.__spell.getError() |
60 lcontext, rcontext = self.__spell.getContext(self.wordStart, self.wordEnd) |
61 lcontext, rcontext = self.__spell.getContext(self.wordStart, self.wordEnd) |
61 self.changeEdit.setText(self.word) |
62 self.changeEdit.setText(self.word) |
62 self.contextLabel.setText('{0}<font color="#FF0000">{1}</font>{2}'.format( |
63 self.contextLabel.setText('{0}<font color="#FF0000">{1}</font>{2}'.format( |
63 Utilities.html_encode(lcontext), |
64 Utilities.html_encode(lcontext), |
64 self.word, |
65 self.word, |
65 Utilities.html_encode(rcontext))) |
66 Utilities.html_encode(rcontext))) |
66 suggestions = self.__spell.getSuggestions(self.word) |
67 suggestions = self.__spell.getSuggestions(self.word) |
67 self.suggestionsList.clear() |
68 self.suggestionsList.clear() |
68 self.suggestionsList.addItems(suggestions) |
69 self.suggestionsList.addItems(suggestions) |
69 |
70 |