46 self.apiAutoPrepareCheckBox.setChecked( |
46 self.apiAutoPrepareCheckBox.setChecked( |
47 Preferences.getEditor("AutoPrepareAPIs")) |
47 Preferences.getEditor("AutoPrepareAPIs")) |
48 |
48 |
49 import QScintilla.Lexers |
49 import QScintilla.Lexers |
50 self.apis = {} |
50 self.apis = {} |
51 apiLanguages = sorted([''] + \ |
51 apiLanguages = sorted( |
52 list(QScintilla.Lexers.getSupportedLanguages().keys())) |
52 [''] + list(QScintilla.Lexers.getSupportedLanguages().keys())) |
53 for lang in apiLanguages: |
53 for lang in apiLanguages: |
54 if lang != "Guessed": |
54 if lang != "Guessed": |
55 self.apiLanguageComboBox.addItem(lang) |
55 self.apiLanguageComboBox.addItem(lang) |
56 self.currentApiLanguage = '' |
56 self.currentApiLanguage = '' |
57 self.on_apiLanguageComboBox_activated(self.currentApiLanguage) |
57 self.on_apiLanguageComboBox_activated(self.currentApiLanguage) |
61 |
61 |
62 def save(self): |
62 def save(self): |
63 """ |
63 """ |
64 Public slot to save the Editor APIs configuration. |
64 Public slot to save the Editor APIs configuration. |
65 """ |
65 """ |
66 Preferences.setEditor("AutoPrepareAPIs", |
66 Preferences.setEditor( |
|
67 "AutoPrepareAPIs", |
67 self.apiAutoPrepareCheckBox.isChecked()) |
68 self.apiAutoPrepareCheckBox.isChecked()) |
68 |
69 |
69 lang = self.apiLanguageComboBox.currentText() |
70 lang = self.apiLanguageComboBox.currentText() |
70 self.apis[lang] = self.__editorGetApisFromApiList() |
71 self.apis[lang] = self.__editorGetApisFromApiList() |
71 |
72 |
180 if ok: |
181 if ok: |
181 self.apiList.addItem(Utilities.toNativeSeparators( |
182 self.apiList.addItem(Utilities.toNativeSeparators( |
182 QFileInfo(QDir(installedAPIFilesPath), file) |
183 QFileInfo(QDir(installedAPIFilesPath), file) |
183 .absoluteFilePath())) |
184 .absoluteFilePath())) |
184 else: |
185 else: |
185 E5MessageBox.warning(self, |
186 E5MessageBox.warning( |
|
187 self, |
186 self.trUtf8("Add from installed APIs"), |
188 self.trUtf8("Add from installed APIs"), |
187 self.trUtf8("""There are no APIs installed yet.""" |
189 self.trUtf8("""There are no APIs installed yet.""" |
188 """ Selection is not available.""")) |
190 """ Selection is not available.""")) |
189 self.addInstalledApiFileButton.setEnabled(False) |
191 self.addInstalledApiFileButton.setEnabled(False) |
190 |
192 |