11 from PyQt4.QtGui import QFileDialog, QInputDialog |
11 from PyQt4.QtGui import QFileDialog, QInputDialog |
12 |
12 |
13 from E4Gui.E4Application import e4App |
13 from E4Gui.E4Application import e4App |
14 from E4Gui.E4Completers import E4FileCompleter |
14 from E4Gui.E4Completers import E4FileCompleter |
15 |
15 |
16 from ConfigurationPageBase import ConfigurationPageBase |
16 from .ConfigurationPageBase import ConfigurationPageBase |
17 from Ui_EditorAPIsPage import Ui_EditorAPIsPage |
17 from .Ui_EditorAPIsPage import Ui_EditorAPIsPage |
18 |
18 |
19 from QScintilla.APIsManager import APIsManager |
19 from QScintilla.APIsManager import APIsManager |
20 import QScintilla.Lexers |
20 import QScintilla.Lexers |
21 |
21 |
22 import Preferences |
22 import Preferences |
45 self.pluginManager = e4App().getObject("PluginManager") |
45 self.pluginManager = e4App().getObject("PluginManager") |
46 self.apiAutoPrepareCheckBox.setChecked(\ |
46 self.apiAutoPrepareCheckBox.setChecked(\ |
47 Preferences.getEditor("AutoPrepareAPIs")) |
47 Preferences.getEditor("AutoPrepareAPIs")) |
48 |
48 |
49 self.apis = {} |
49 self.apis = {} |
50 apiLanguages = [''] + QScintilla.Lexers.getSupportedLanguages().keys() |
50 apiLanguages = sorted([''] + list(QScintilla.Lexers.getSupportedLanguages().keys())) |
51 apiLanguages.sort() |
|
52 for lang in apiLanguages: |
51 for lang in apiLanguages: |
53 if lang != "Guessed": |
52 if lang != "Guessed": |
54 self.apiLanguageComboBox.addItem(lang) |
53 self.apiLanguageComboBox.addItem(lang) |
55 self.currentApiLanguage = '' |
54 self.currentApiLanguage = '' |
56 self.on_apiLanguageComboBox_activated(self.currentApiLanguage) |
55 self.on_apiLanguageComboBox_activated(self.currentApiLanguage) |
66 self.apiAutoPrepareCheckBox.isChecked()) |
65 self.apiAutoPrepareCheckBox.isChecked()) |
67 |
66 |
68 lang = self.apiLanguageComboBox.currentText() |
67 lang = self.apiLanguageComboBox.currentText() |
69 self.apis[lang] = self.__editorGetApisFromApiList() |
68 self.apis[lang] = self.__editorGetApisFromApiList() |
70 |
69 |
71 for lang, apis in self.apis.items(): |
70 for lang, apis in list(self.apis.items()): |
72 Preferences.setEditorAPI(lang, apis) |
71 Preferences.setEditorAPI(lang, apis) |
73 |
72 |
74 @pyqtSlot(str) |
73 @pyqtSlot(str) |
75 def on_apiLanguageComboBox_activated(self, language): |
74 def on_apiLanguageComboBox_activated(self, language): |
76 """ |
75 """ |