9 import os |
9 import os |
10 import re |
10 import re |
11 import difflib |
11 import difflib |
12 |
12 |
13 from PyQt4.QtCore import QDir, QTimer, QModelIndex, QFileInfo, pyqtSignal, \ |
13 from PyQt4.QtCore import QDir, QTimer, QModelIndex, QFileInfo, pyqtSignal, \ |
14 QCryptographicHash, QEvent, QDateTime, QRegExp, Qt |
14 pyqtSlot, QCryptographicHash, QEvent, QDateTime, QRegExp, Qt |
15 from PyQt4.QtGui import QCursor, QPrinter, QPrintDialog, QLineEdit, QActionGroup, \ |
15 from PyQt4.QtGui import QCursor, QPrinter, QPrintDialog, QLineEdit, QActionGroup, \ |
16 QDialog, QAbstractPrintDialog, QInputDialog, QApplication, QMenu, QPalette, QFont |
16 QDialog, QAbstractPrintDialog, QInputDialog, QApplication, QMenu, QPalette, QFont |
17 from PyQt4.Qsci import QsciScintilla, QsciMacro, QsciStyledText |
17 from PyQt4.Qsci import QsciScintilla, QsciMacro, QsciStyledText |
18 |
18 |
19 from E5Gui.E5Application import e5App |
19 from E5Gui.E5Application import e5App |
5980 def setAutoSpellChecking(self): |
5980 def setAutoSpellChecking(self): |
5981 """ |
5981 """ |
5982 Public method to set the automatic spell checking. |
5982 Public method to set the automatic spell checking. |
5983 """ |
5983 """ |
5984 if Preferences.getEditor("AutoSpellCheckingEnabled"): |
5984 if Preferences.getEditor("AutoSpellCheckingEnabled"): |
5985 self.SCN_CHARADDED.connect(self.__spellCharAdded) |
5985 try: |
|
5986 self.SCN_CHARADDED.connect(self.__spellCharAdded, Qt.UniqueConnection) |
|
5987 except TypeError: |
|
5988 pass |
5986 self.spell.checkDocumentIncrementally() |
5989 self.spell.checkDocumentIncrementally() |
5987 else: |
5990 else: |
5988 try: |
5991 try: |
5989 self.SCN_CHARADDED.disconnect(self.__spellCharAdded) |
5992 self.SCN_CHARADDED.disconnect(self.__spellCharAdded) |
5990 except TypeError: |
5993 except TypeError: |
6004 if self.lexer_ is not None: |
6007 if self.lexer_ is not None: |
6005 return self.lexer_.isCommentStyle(style) or \ |
6008 return self.lexer_.isCommentStyle(style) or \ |
6006 self.lexer_.isStringStyle(style) |
6009 self.lexer_.isStringStyle(style) |
6007 return True |
6010 return True |
6008 |
6011 |
|
6012 @pyqtSlot(int) |
6009 def __spellCharAdded(self, charNumber): |
6013 def __spellCharAdded(self, charNumber): |
6010 """ |
6014 """ |
6011 Public slot called to handle the user entering a character. |
6015 Public slot called to handle the user entering a character. |
6012 |
6016 |
6013 @param charNumber value of the character entered (integer) |
6017 @param charNumber value of the character entered (integer) |