QScintilla/SpellingDictionaryEditDialog.py

branch
Py2 comp.
changeset 3057
10516539f238
parent 2525
8b507a9a2d40
parent 3011
18292228c724
child 3145
a9de05d4a22f
equal deleted inserted replaced
3056:9986ec0e559a 3057:10516539f238
17 from .Ui_SpellingDictionaryEditDialog import Ui_SpellingDictionaryEditDialog 17 from .Ui_SpellingDictionaryEditDialog import Ui_SpellingDictionaryEditDialog
18 18
19 19
20 class SpellingDictionaryEditDialog(QDialog, Ui_SpellingDictionaryEditDialog): 20 class SpellingDictionaryEditDialog(QDialog, Ui_SpellingDictionaryEditDialog):
21 """ 21 """
22 Class implementing a dialog to edit the various spell checking dictionaries. 22 Class implementing a dialog to edit the various spell checking
23 dictionaries.
23 """ 24 """
24 def __init__(self, data, info, parent=None): 25 def __init__(self, data, info, parent=None):
25 """ 26 """
26 Constructor 27 Constructor
27 28
40 self.__proxyModel.setFilterCaseSensitivity(Qt.CaseInsensitive) 41 self.__proxyModel.setFilterCaseSensitivity(Qt.CaseInsensitive)
41 self.__proxyModel.setDynamicSortFilter(True) 42 self.__proxyModel.setDynamicSortFilter(True)
42 self.__proxyModel.setSourceModel(self.__model) 43 self.__proxyModel.setSourceModel(self.__model)
43 self.wordList.setModel(self.__proxyModel) 44 self.wordList.setModel(self.__proxyModel)
44 45
45 self.searchEdit.textChanged.connect(self.__proxyModel.setFilterFixedString) 46 self.searchEdit.textChanged.connect(
47 self.__proxyModel.setFilterFixedString)
46 48
47 self.removeButton.clicked[()].connect(self.wordList.removeSelected) 49 self.removeButton.clicked[()].connect(self.wordList.removeSelected)
48 self.removeAllButton.clicked[()].connect(self.wordList.removeAll) 50 self.removeAllButton.clicked[()].connect(self.wordList.removeAll)
49 51
50 @pyqtSlot() 52 @pyqtSlot()
51 def on_addButton_clicked(self): 53 def on_addButton_clicked(self):
52 """ 54 """
53 Private slot to handle adding an entry. 55 Private slot to handle adding an entry.
54 """ 56 """
55 self.__model.insertRow(self.__model.rowCount()) 57 self.__model.insertRow(self.__model.rowCount())
56 self.wordList.edit(self.__proxyModel.index(self.__model.rowCount() - 1, 0)) 58 self.wordList.edit(
59 self.__proxyModel.index(self.__model.rowCount() - 1, 0))
57 60
58 def getData(self): 61 def getData(self):
59 """ 62 """
60 Public method to get the data. 63 Public method to get the data.
61 64
62 @return data of the dialog (string) 65 @return data of the dialog (string)
63 """ 66 """
64 return os.linesep.join([line for line in self.__model.stringList() if line]) 67 return os.linesep.join(
68 [line for line in self.__model.stringList() if line])

eric ide

mercurial