42 self.pwlCompleter = E5FileCompleter(self.pwlEdit) |
42 self.pwlCompleter = E5FileCompleter(self.pwlEdit) |
43 self.pelCompleter = E5FileCompleter(self.pelEdit) |
43 self.pelCompleter = E5FileCompleter(self.pelEdit) |
44 |
44 |
45 from QScintilla.SpellChecker import SpellChecker |
45 from QScintilla.SpellChecker import SpellChecker |
46 self.spellingComboBox.addItem(self.trUtf8("<default>")) |
46 self.spellingComboBox.addItem(self.trUtf8("<default>")) |
47 self.spellingComboBox.addItems(sorted(SpellChecker.getAvailableLanguages())) |
47 self.spellingComboBox.addItems( |
|
48 sorted(SpellChecker.getAvailableLanguages())) |
48 |
49 |
49 if not new: |
50 if not new: |
50 self.initDialog() |
51 self.initDialog() |
51 |
52 |
52 def initDialog(self): |
53 def initDialog(self): |
53 """ |
54 """ |
54 Public method to initialize the dialogs data. |
55 Public method to initialize the dialogs data. |
55 """ |
56 """ |
56 index = self.spellingComboBox.findText(self.project.pdata["SPELLLANGUAGE"][0]) |
57 index = self.spellingComboBox.findText( |
|
58 self.project.pdata["SPELLLANGUAGE"][0]) |
57 if index == -1: |
59 if index == -1: |
58 index = 0 |
60 index = 0 |
59 self.spellingComboBox.setCurrentIndex(index) |
61 self.spellingComboBox.setCurrentIndex(index) |
60 if self.project.pdata["SPELLWORDS"][0]: |
62 if self.project.pdata["SPELLWORDS"][0]: |
61 self.pwlEdit.setText( |
63 self.pwlEdit.setText(Utilities.toNativeSeparators( |
62 Utilities.toNativeSeparators(self.project.pdata["SPELLWORDS"][0])) |
64 self.project.pdata["SPELLWORDS"][0])) |
63 if self.project.pdata["SPELLEXCLUDES"][0]: |
65 if self.project.pdata["SPELLEXCLUDES"][0]: |
64 self.pelEdit.setText( |
66 self.pelEdit.setText(Utilities.toNativeSeparators( |
65 Utilities.toNativeSeparators(self.project.pdata["SPELLEXCLUDES"][0])) |
67 self.project.pdata["SPELLEXCLUDES"][0])) |
66 |
68 |
67 @pyqtSlot() |
69 @pyqtSlot() |
68 def on_pwlButton_clicked(self): |
70 def on_pwlButton_clicked(self): |
69 """ |
71 """ |
70 Private slot to select the project word list file. |
72 Private slot to select the project word list file. |
71 """ |
73 """ |
72 pwl = Utilities.fromNativeSeparators(self.pwlEdit.text()) |
74 pwl = Utilities.fromNativeSeparators(self.pwlEdit.text()) |
73 if not pwl: |
75 if not pwl: |
74 pwl = self.project.ppath |
76 pwl = self.project.ppath |
75 elif not os.path.isabs(pwl): |
77 elif not os.path.isabs(pwl): |
76 pwl = Utilities.fromNativeSeparators(os.path.join(self.project.ppath, pwl)) |
78 pwl = Utilities.fromNativeSeparators( |
|
79 os.path.join(self.project.ppath, pwl)) |
77 file = E5FileDialog.getOpenFileName( |
80 file = E5FileDialog.getOpenFileName( |
78 self, |
81 self, |
79 self.trUtf8("Select project word list"), |
82 self.trUtf8("Select project word list"), |
80 pwl, |
83 pwl, |
81 self.trUtf8("Dictionary File (*.dic);;All Files (*)")) |
84 self.trUtf8("Dictionary File (*.dic);;All Files (*)")) |
91 """ |
94 """ |
92 pel = Utilities.fromNativeSeparators(self.pelEdit.text()) |
95 pel = Utilities.fromNativeSeparators(self.pelEdit.text()) |
93 if not pel: |
96 if not pel: |
94 pel = self.project.ppath |
97 pel = self.project.ppath |
95 elif not os.path.isabs(pel): |
98 elif not os.path.isabs(pel): |
96 pel = Utilities.fromNativeSeparators(os.path.join(self.project.ppath, pel)) |
99 pel = Utilities.fromNativeSeparators( |
|
100 os.path.join(self.project.ppath, pel)) |
97 file = E5FileDialog.getOpenFileName( |
101 file = E5FileDialog.getOpenFileName( |
98 self, |
102 self, |
99 self.trUtf8("Select project exclude list"), |
103 self.trUtf8("Select project exclude list"), |
100 pel, |
104 pel, |
101 self.trUtf8("Dictionary File (*.dic);;All Files (*)")) |
105 self.trUtf8("Dictionary File (*.dic);;All Files (*)")) |