eric7/Preferences/ConfigurationPages/EditorAPIsPage.py

Sun, 23 May 2021 15:35:49 +0200

author
Detlev Offenbach <detlev@die-offenbachs.de>
date
Sun, 23 May 2021 15:35:49 +0200
branch
eric7
changeset 8366
2a9f5153c438
parent 8358
144a6b854f70
child 8881
54e42bc2437a
permissions
-rw-r--r--

Corrected some code style issues.

0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1 # -*- coding: utf-8 -*-
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
2
7923
91e843545d9a Updated copyright for 2021.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7780
diff changeset
3 # Copyright (c) 2006 - 2021 Detlev Offenbach <detlev@die-offenbachs.de>
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
4 #
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
5
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
6 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
7 Module implementing the Editor APIs configuration page.
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
8 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
9
8318
962bce857696 Replaced all imports of PyQt5 to PyQt6 and started to replace code using obsoleted methods and adapt to the PyQt6 enum usage.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8312
diff changeset
10 from PyQt6.QtCore import QDir, pyqtSlot, QFileInfo
962bce857696 Replaced all imports of PyQt5 to PyQt6 and started to replace code using obsoleted methods and adapt to the PyQt6 enum usage.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8312
diff changeset
11 from PyQt6.QtWidgets import QInputDialog
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
12
8358
144a6b854f70 Sorted the eric specific extensions into packages named like the corresponding PyQt packages (i.e. EricCore,EricGui and EricWidgets).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8356
diff changeset
13 from EricWidgets.EricApplication import ericApp
144a6b854f70 Sorted the eric specific extensions into packages named like the corresponding PyQt packages (i.e. EricCore,EricGui and EricWidgets).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8356
diff changeset
14 from EricWidgets import EricMessageBox
144a6b854f70 Sorted the eric specific extensions into packages named like the corresponding PyQt packages (i.e. EricCore,EricGui and EricWidgets).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8356
diff changeset
15 from EricWidgets.EricPathPicker import EricPathPickerModes
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
16
12
1d8dd9706f46 First commit after changing to Python 3.1.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7
diff changeset
17 from .ConfigurationPageBase import ConfigurationPageBase
1d8dd9706f46 First commit after changing to Python 3.1.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7
diff changeset
18 from .Ui_EditorAPIsPage import Ui_EditorAPIsPage
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
19
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
20 import Preferences
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
21 import Utilities
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
22
945
8cd4d08fa9f6 Made code mostly PEP 8 compliant (except all whitespace and line length).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 882
diff changeset
23
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
24 class EditorAPIsPage(ConfigurationPageBase, Ui_EditorAPIsPage):
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
25 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
26 Class implementing the Editor APIs configuration page.
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
27 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
28 def __init__(self):
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
29 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
30 Constructor
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
31 """
8218
7c09585bd960 Applied some more code simplifications suggested by the new Simplify checker (super(Foo, self) => super()).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8151
diff changeset
32 super().__init__()
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
33 self.setupUi(self)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
34 self.setObjectName("EditorAPIsPage")
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
35
8356
68ec9c3d4de5 Renamed the modules and classes of the E5Gui package to have the prefix 'Eric' instead of 'E5'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8327
diff changeset
36 self.apiFilePicker.setMode(EricPathPickerModes.OPEN_FILE_MODE)
4575
464a6b049f89 Changed the Python2 debugger and Editor APIs pages to use the path picker.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4554
diff changeset
37 self.apiFilePicker.setToolTip(self.tr(
464a6b049f89 Changed the Python2 debugger and Editor APIs pages to use the path picker.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4554
diff changeset
38 "Press to select an API file via a selection dialog"))
464a6b049f89 Changed the Python2 debugger and Editor APIs pages to use the path picker.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4554
diff changeset
39 self.apiFilePicker.setFilters(self.tr(
464a6b049f89 Changed the Python2 debugger and Editor APIs pages to use the path picker.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4554
diff changeset
40 "API File (*.api);;All Files (*)"))
3186
a05eff845522 Changed all the file or directory selection buttons to QToolButton and gave them an icon.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
41
3190
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3186
diff changeset
42 self.prepareApiButton.setText(self.tr("Compile APIs"))
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
43 self.__currentAPI = None
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
44 self.__inPreparation = False
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
45
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
46 # set initial values
8356
68ec9c3d4de5 Renamed the modules and classes of the E5Gui package to have the prefix 'Eric' instead of 'E5'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8327
diff changeset
47 self.pluginManager = ericApp().getObject("PluginManager")
564
b3d966393ba9 Did some code cleanup.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 500
diff changeset
48 self.apiAutoPrepareCheckBox.setChecked(
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
49 Preferences.getEditor("AutoPrepareAPIs"))
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
50
2408
dc3a7c9d8f6e Continued implementing the delayed import.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2302
diff changeset
51 import QScintilla.Lexers
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
52 self.apis = {}
3025
67064c71df21 Fixed a bunch of visible indentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3020
diff changeset
53 apiLanguages = sorted(
5358
2584d0a08bf4 Finished the project specific API code.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5350
diff changeset
54 [''] + list(QScintilla.Lexers.getSupportedApiLanguages()))
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
55 for lang in apiLanguages:
5427
614e88cfbd84 Added some eye candy.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5389
diff changeset
56 self.apiLanguageComboBox.addItem(
614e88cfbd84 Added some eye candy.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5389
diff changeset
57 QScintilla.Lexers.getLanguageIcon(lang, False),
614e88cfbd84 Added some eye candy.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5389
diff changeset
58 lang)
5349
bccda3b5920a Started implementing project type specific APIs.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4830
diff changeset
59 self.__currentApiLanguage = ""
8151
8c1445825e7b Changed code to not use QComboBox.activated[str] and QComboBoc.highlighted[str] signals but the int variants instead.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7923
diff changeset
60 self.on_apiLanguageComboBox_activated(0)
5349
bccda3b5920a Started implementing project type specific APIs.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4830
diff changeset
61
bccda3b5920a Started implementing project type specific APIs.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4830
diff changeset
62 def __apiKey(self, language, projectType):
bccda3b5920a Started implementing project type specific APIs.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4830
diff changeset
63 """
bccda3b5920a Started implementing project type specific APIs.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4830
diff changeset
64 Private method to generate a key for the apis dictionary.
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
65
5349
bccda3b5920a Started implementing project type specific APIs.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4830
diff changeset
66 @param language programming language of the API
bccda3b5920a Started implementing project type specific APIs.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4830
diff changeset
67 @type str
bccda3b5920a Started implementing project type specific APIs.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4830
diff changeset
68 @param projectType project type of the API
bccda3b5920a Started implementing project type specific APIs.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4830
diff changeset
69 @type str
bccda3b5920a Started implementing project type specific APIs.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4830
diff changeset
70 @return key to be used
bccda3b5920a Started implementing project type specific APIs.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4830
diff changeset
71 @rtype str
bccda3b5920a Started implementing project type specific APIs.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4830
diff changeset
72 """
8234
fcb6b4b96274 Applied some more code simplifications suggested by the new Simplify checker (Y108: use ternary operator) (batch 2).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8218
diff changeset
73 key = (language, projectType) if projectType else (language, "")
5349
bccda3b5920a Started implementing project type specific APIs.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4830
diff changeset
74 return key
bccda3b5920a Started implementing project type specific APIs.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4830
diff changeset
75
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
76 def save(self):
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
77 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
78 Public slot to save the Editor APIs configuration.
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
79 """
3025
67064c71df21 Fixed a bunch of visible indentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3020
diff changeset
80 Preferences.setEditor(
67064c71df21 Fixed a bunch of visible indentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3020
diff changeset
81 "AutoPrepareAPIs",
7
c679fb30c8f3 Change code dealing with QVariant (and QSettings) to use the PyQt4 QVariant v2 API.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 0
diff changeset
82 self.apiAutoPrepareCheckBox.isChecked())
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
83
5350
57e82ffafdfc Adjusted the APIs configuration page to support project type specific API sets.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5349
diff changeset
84 language = self.apiLanguageComboBox.currentText()
57e82ffafdfc Adjusted the APIs configuration page to support project type specific API sets.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5349
diff changeset
85 projectType = self.projectTypeComboBox.itemData(
57e82ffafdfc Adjusted the APIs configuration page to support project type specific API sets.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5349
diff changeset
86 self.projectTypeComboBox.currentIndex())
57e82ffafdfc Adjusted the APIs configuration page to support project type specific API sets.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5349
diff changeset
87 key = self.__apiKey(language, projectType)
57e82ffafdfc Adjusted the APIs configuration page to support project type specific API sets.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5349
diff changeset
88 self.apis[key] = self.__editorGetApisFromApiList()
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
89
5349
bccda3b5920a Started implementing project type specific APIs.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4830
diff changeset
90 for (language, projectType), apis in self.apis.items():
5350
57e82ffafdfc Adjusted the APIs configuration page to support project type specific API sets.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5349
diff changeset
91 Preferences.setEditorAPI(language, projectType, apis)
5349
bccda3b5920a Started implementing project type specific APIs.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4830
diff changeset
92
5350
57e82ffafdfc Adjusted the APIs configuration page to support project type specific API sets.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5349
diff changeset
93 @pyqtSlot(int)
57e82ffafdfc Adjusted the APIs configuration page to support project type specific API sets.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5349
diff changeset
94 def on_projectTypeComboBox_activated(self, index):
5349
bccda3b5920a Started implementing project type specific APIs.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4830
diff changeset
95 """
5350
57e82ffafdfc Adjusted the APIs configuration page to support project type specific API sets.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5349
diff changeset
96 Private slot to handle the selection of a project type.
5349
bccda3b5920a Started implementing project type specific APIs.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4830
diff changeset
97
5350
57e82ffafdfc Adjusted the APIs configuration page to support project type specific API sets.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5349
diff changeset
98 @param index index of the selected entry
5349
bccda3b5920a Started implementing project type specific APIs.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4830
diff changeset
99 @type str
bccda3b5920a Started implementing project type specific APIs.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4830
diff changeset
100 """
5350
57e82ffafdfc Adjusted the APIs configuration page to support project type specific API sets.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5349
diff changeset
101 if self.__currentApiProjectTypeIndex == index:
57e82ffafdfc Adjusted the APIs configuration page to support project type specific API sets.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5349
diff changeset
102 return
57e82ffafdfc Adjusted the APIs configuration page to support project type specific API sets.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5349
diff changeset
103
57e82ffafdfc Adjusted the APIs configuration page to support project type specific API sets.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5349
diff changeset
104 self.__currentApiProjectTypeIndex = index
57e82ffafdfc Adjusted the APIs configuration page to support project type specific API sets.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5349
diff changeset
105 self.__fillApisList()
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
106
8151
8c1445825e7b Changed code to not use QComboBox.activated[str] and QComboBoc.highlighted[str] signals but the int variants instead.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7923
diff changeset
107 @pyqtSlot(int)
8c1445825e7b Changed code to not use QComboBox.activated[str] and QComboBoc.highlighted[str] signals but the int variants instead.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7923
diff changeset
108 def on_apiLanguageComboBox_activated(self, index):
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
109 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
110 Private slot to fill the api listbox of the api page.
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
111
8151
8c1445825e7b Changed code to not use QComboBox.activated[str] and QComboBoc.highlighted[str] signals but the int variants instead.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7923
diff changeset
112 @param index index of the selected entry
8c1445825e7b Changed code to not use QComboBox.activated[str] and QComboBoc.highlighted[str] signals but the int variants instead.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7923
diff changeset
113 @type int
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
114 """
8151
8c1445825e7b Changed code to not use QComboBox.activated[str] and QComboBoc.highlighted[str] signals but the int variants instead.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7923
diff changeset
115 language = self.apiLanguageComboBox.itemText(index)
8c1445825e7b Changed code to not use QComboBox.activated[str] and QComboBoc.highlighted[str] signals but the int variants instead.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7923
diff changeset
116
5349
bccda3b5920a Started implementing project type specific APIs.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4830
diff changeset
117 if self.__currentApiLanguage == language:
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
118 return
5350
57e82ffafdfc Adjusted the APIs configuration page to support project type specific API sets.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5349
diff changeset
119
7164
6da6a0a5a448 Made "MicroPython" a selectable programming language in order to not mess with the normal API selections.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6942
diff changeset
120 self.__fillProjectTypeComboBox(language)
6da6a0a5a448 Made "MicroPython" a selectable programming language in order to not mess with the normal API selections.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6942
diff changeset
121
6da6a0a5a448 Made "MicroPython" a selectable programming language in order to not mess with the normal API selections.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6942
diff changeset
122 def __fillProjectTypeComboBox(self, language):
6da6a0a5a448 Made "MicroPython" a selectable programming language in order to not mess with the normal API selections.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6942
diff changeset
123 """
6da6a0a5a448 Made "MicroPython" a selectable programming language in order to not mess with the normal API selections.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6942
diff changeset
124 Private slot to fill the selection of available project types for the
6da6a0a5a448 Made "MicroPython" a selectable programming language in order to not mess with the normal API selections.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6942
diff changeset
125 given language.
6da6a0a5a448 Made "MicroPython" a selectable programming language in order to not mess with the normal API selections.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6942
diff changeset
126
6da6a0a5a448 Made "MicroPython" a selectable programming language in order to not mess with the normal API selections.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6942
diff changeset
127 @param language selected API language
6da6a0a5a448 Made "MicroPython" a selectable programming language in order to not mess with the normal API selections.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6942
diff changeset
128 @type str
6da6a0a5a448 Made "MicroPython" a selectable programming language in order to not mess with the normal API selections.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6942
diff changeset
129 """
6da6a0a5a448 Made "MicroPython" a selectable programming language in order to not mess with the normal API selections.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6942
diff changeset
130 self.projectTypeComboBox.clear()
6da6a0a5a448 Made "MicroPython" a selectable programming language in order to not mess with the normal API selections.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6942
diff changeset
131
6da6a0a5a448 Made "MicroPython" a selectable programming language in order to not mess with the normal API selections.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6942
diff changeset
132 apiProjectTypes = sorted(
6da6a0a5a448 Made "MicroPython" a selectable programming language in order to not mess with the normal API selections.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6942
diff changeset
133 [("", "")] +
6da6a0a5a448 Made "MicroPython" a selectable programming language in order to not mess with the normal API selections.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6942
diff changeset
134 [(trans, ptype) for ptype, trans in
8366
2a9f5153c438 Corrected some code style issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8358
diff changeset
135 ericApp().getObject("Project").getProjectTypes(language)
2a9f5153c438 Corrected some code style issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8358
diff changeset
136 .items()
7164
6da6a0a5a448 Made "MicroPython" a selectable programming language in order to not mess with the normal API selections.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6942
diff changeset
137 ]
6da6a0a5a448 Made "MicroPython" a selectable programming language in order to not mess with the normal API selections.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6942
diff changeset
138 )
6da6a0a5a448 Made "MicroPython" a selectable programming language in order to not mess with the normal API selections.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6942
diff changeset
139 for projectTypeStr, projectType in apiProjectTypes:
6da6a0a5a448 Made "MicroPython" a selectable programming language in order to not mess with the normal API selections.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6942
diff changeset
140 self.projectTypeComboBox.addItem(projectTypeStr, projectType)
6da6a0a5a448 Made "MicroPython" a selectable programming language in order to not mess with the normal API selections.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6942
diff changeset
141
6da6a0a5a448 Made "MicroPython" a selectable programming language in order to not mess with the normal API selections.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6942
diff changeset
142 self.__currentApiProjectTypeIndex = -1
6da6a0a5a448 Made "MicroPython" a selectable programming language in order to not mess with the normal API selections.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6942
diff changeset
143 self.__currentApiProjectType = ""
6da6a0a5a448 Made "MicroPython" a selectable programming language in order to not mess with the normal API selections.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6942
diff changeset
144
6da6a0a5a448 Made "MicroPython" a selectable programming language in order to not mess with the normal API selections.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6942
diff changeset
145 self.on_projectTypeComboBox_activated(0)
5350
57e82ffafdfc Adjusted the APIs configuration page to support project type specific API sets.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5349
diff changeset
146
57e82ffafdfc Adjusted the APIs configuration page to support project type specific API sets.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5349
diff changeset
147 def __fillApisList(self):
57e82ffafdfc Adjusted the APIs configuration page to support project type specific API sets.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5349
diff changeset
148 """
57e82ffafdfc Adjusted the APIs configuration page to support project type specific API sets.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5349
diff changeset
149 Private slot to fill the list of API files.
57e82ffafdfc Adjusted the APIs configuration page to support project type specific API sets.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5349
diff changeset
150 """
7263
c1af2e327675 Continued to resolve code style issue M841.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7229
diff changeset
151 self.apis[
c1af2e327675 Continued to resolve code style issue M841.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7229
diff changeset
152 self.__apiKey(self.__currentApiLanguage,
c1af2e327675 Continued to resolve code style issue M841.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7229
diff changeset
153 self.__currentApiProjectType)
c1af2e327675 Continued to resolve code style issue M841.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7229
diff changeset
154 ] = self.__editorGetApisFromApiList()
5350
57e82ffafdfc Adjusted the APIs configuration page to support project type specific API sets.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5349
diff changeset
155
57e82ffafdfc Adjusted the APIs configuration page to support project type specific API sets.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5349
diff changeset
156 self.__currentApiLanguage = self.apiLanguageComboBox.currentText()
57e82ffafdfc Adjusted the APIs configuration page to support project type specific API sets.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5349
diff changeset
157 self.__currentApiProjectType = self.projectTypeComboBox.itemData(
57e82ffafdfc Adjusted the APIs configuration page to support project type specific API sets.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5349
diff changeset
158 self.projectTypeComboBox.currentIndex())
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
159 self.apiList.clear()
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
160
5350
57e82ffafdfc Adjusted the APIs configuration page to support project type specific API sets.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5349
diff changeset
161 if not self.__currentApiLanguage:
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
162 self.apiGroup.setEnabled(False)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
163 return
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
164
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
165 self.apiGroup.setEnabled(True)
3098
02ee75d31584 Fixed a bug in the APIs configuration page of the config dialog and improved its functionality.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3038
diff changeset
166 self.deleteApiFileButton.setEnabled(False)
02ee75d31584 Fixed a bug in the APIs configuration page of the config dialog and improved its functionality.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3038
diff changeset
167 self.addApiFileButton.setEnabled(False)
4575
464a6b049f89 Changed the Python2 debugger and Editor APIs pages to use the path picker.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4554
diff changeset
168 self.apiFilePicker.clear()
3098
02ee75d31584 Fixed a bug in the APIs configuration page of the config dialog and improved its functionality.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3038
diff changeset
169
5350
57e82ffafdfc Adjusted the APIs configuration page to support project type specific API sets.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5349
diff changeset
170 key = self.__apiKey(self.__currentApiLanguage,
57e82ffafdfc Adjusted the APIs configuration page to support project type specific API sets.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5349
diff changeset
171 self.__currentApiProjectType)
57e82ffafdfc Adjusted the APIs configuration page to support project type specific API sets.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5349
diff changeset
172 if key not in self.apis:
57e82ffafdfc Adjusted the APIs configuration page to support project type specific API sets.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5349
diff changeset
173 # populate on demand
57e82ffafdfc Adjusted the APIs configuration page to support project type specific API sets.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5349
diff changeset
174 self.apis[key] = Preferences.getEditorAPI(
57e82ffafdfc Adjusted the APIs configuration page to support project type specific API sets.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5349
diff changeset
175 self.__currentApiLanguage,
57e82ffafdfc Adjusted the APIs configuration page to support project type specific API sets.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5349
diff changeset
176 projectType=self.__currentApiProjectType)[:]
57e82ffafdfc Adjusted the APIs configuration page to support project type specific API sets.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5349
diff changeset
177 for api in self.apis[key]:
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
178 if api:
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
179 self.apiList.addItem(api)
3098
02ee75d31584 Fixed a bug in the APIs configuration page of the config dialog and improved its functionality.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3038
diff changeset
180 self.prepareApiButton.setEnabled(self.apiList.count() > 0)
2408
dc3a7c9d8f6e Continued implementing the delayed import.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2302
diff changeset
181
dc3a7c9d8f6e Continued implementing the delayed import.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2302
diff changeset
182 from QScintilla.APIsManager import APIsManager
5350
57e82ffafdfc Adjusted the APIs configuration page to support project type specific API sets.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5349
diff changeset
183 self.__currentAPI = APIsManager().getAPIs(
57e82ffafdfc Adjusted the APIs configuration page to support project type specific API sets.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5349
diff changeset
184 self.__currentApiLanguage,
57e82ffafdfc Adjusted the APIs configuration page to support project type specific API sets.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5349
diff changeset
185 projectType=self.__currentApiProjectType)
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
186 if self.__currentAPI is not None:
500
c3abc7895a01 Continued porting signal/slot usage to the new API.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 130
diff changeset
187 self.__currentAPI.apiPreparationFinished.connect(
c3abc7895a01 Continued porting signal/slot usage to the new API.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 130
diff changeset
188 self.__apiPreparationFinished)
c3abc7895a01 Continued porting signal/slot usage to the new API.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 130
diff changeset
189 self.__currentAPI.apiPreparationCancelled.connect(
c3abc7895a01 Continued porting signal/slot usage to the new API.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 130
diff changeset
190 self.__apiPreparationCancelled)
c3abc7895a01 Continued porting signal/slot usage to the new API.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 130
diff changeset
191 self.__currentAPI.apiPreparationStarted.connect(
c3abc7895a01 Continued porting signal/slot usage to the new API.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 130
diff changeset
192 self.__apiPreparationStarted)
564
b3d966393ba9 Did some code cleanup.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 500
diff changeset
193 self.addInstalledApiFileButton.setEnabled(
3098
02ee75d31584 Fixed a bug in the APIs configuration page of the config dialog and improved its functionality.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3038
diff changeset
194 len(self.__currentAPI.installedAPIFiles()) > 0)
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
195 else:
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
196 self.addInstalledApiFileButton.setEnabled(False)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
197
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
198 self.addPluginApiFileButton.setEnabled(
4830
f609a22f43bd Fixed a few code style issues detected by the updated pep8 checker.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
199 len(self.pluginManager.getPluginApiFiles(
5349
bccda3b5920a Started implementing project type specific APIs.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4830
diff changeset
200 self.__currentApiLanguage)) > 0)
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
201
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
202 def __editorGetApisFromApiList(self):
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
203 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
204 Private slot to retrieve the api filenames from the list.
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
205
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
206 @return list of api filenames (list of strings)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
207 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
208 apis = []
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
209 for row in range(self.apiList.count()):
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
210 apis.append(self.apiList.item(row).text())
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
211 return apis
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
212
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
213 @pyqtSlot()
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
214 def on_addApiFileButton_clicked(self):
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
215 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
216 Private slot to add the api file displayed to the listbox.
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
217 """
4575
464a6b049f89 Changed the Python2 debugger and Editor APIs pages to use the path picker.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4554
diff changeset
218 file = self.apiFilePicker.text()
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
219 if file:
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
220 self.apiList.addItem(Utilities.toNativeSeparators(file))
4575
464a6b049f89 Changed the Python2 debugger and Editor APIs pages to use the path picker.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4554
diff changeset
221 self.apiFilePicker.clear()
3098
02ee75d31584 Fixed a bug in the APIs configuration page of the config dialog and improved its functionality.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3038
diff changeset
222 self.prepareApiButton.setEnabled(self.apiList.count() > 0)
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
223
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
224 @pyqtSlot()
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
225 def on_deleteApiFileButton_clicked(self):
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
226 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
227 Private slot to delete the currently selected file of the listbox.
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
228 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
229 crow = self.apiList.currentRow()
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
230 if crow >= 0:
4554
f3428ddd577c Fixed a few style and coding issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4021
diff changeset
231 itm = self.apiList.takeItem(crow) # __IGNORE_WARNING__
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
232 del itm
3098
02ee75d31584 Fixed a bug in the APIs configuration page of the config dialog and improved its functionality.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3038
diff changeset
233 self.prepareApiButton.setEnabled(self.apiList.count() > 0)
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
234
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
235 @pyqtSlot()
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
236 def on_addInstalledApiFileButton_clicked(self):
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
237 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
238 Private slot to add an API file from the list of installed API files
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
239 for the selected lexer language.
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
240 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
241 installedAPIFiles = self.__currentAPI.installedAPIFiles()
1118
2ff50209a57f Fixed a bug in the editor APIs page.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 945
diff changeset
242 if installedAPIFiles:
2ff50209a57f Fixed a bug in the editor APIs page.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 945
diff changeset
243 installedAPIFilesPath = QFileInfo(installedAPIFiles[0]).path()
2ff50209a57f Fixed a bug in the editor APIs page.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 945
diff changeset
244 installedAPIFilesShort = []
2ff50209a57f Fixed a bug in the editor APIs page.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 945
diff changeset
245 for installedAPIFile in installedAPIFiles:
3010
befeff46ec0f Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2964
diff changeset
246 installedAPIFilesShort.append(
befeff46ec0f Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2964
diff changeset
247 QFileInfo(installedAPIFile).fileName())
1118
2ff50209a57f Fixed a bug in the editor APIs page.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 945
diff changeset
248 file, ok = QInputDialog.getItem(
2ff50209a57f Fixed a bug in the editor APIs page.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 945
diff changeset
249 self,
3190
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3186
diff changeset
250 self.tr("Add from installed APIs"),
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3186
diff changeset
251 self.tr("Select from the list of installed API files"),
1118
2ff50209a57f Fixed a bug in the editor APIs page.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 945
diff changeset
252 installedAPIFilesShort,
2ff50209a57f Fixed a bug in the editor APIs page.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 945
diff changeset
253 0, False)
2ff50209a57f Fixed a bug in the editor APIs page.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 945
diff changeset
254 if ok:
2ff50209a57f Fixed a bug in the editor APIs page.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 945
diff changeset
255 self.apiList.addItem(Utilities.toNativeSeparators(
3010
befeff46ec0f Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2964
diff changeset
256 QFileInfo(QDir(installedAPIFilesPath), file)
3038
7fe9a53280bd Fixed a bunch of indentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3025
diff changeset
257 .absoluteFilePath()))
1118
2ff50209a57f Fixed a bug in the editor APIs page.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 945
diff changeset
258 else:
8356
68ec9c3d4de5 Renamed the modules and classes of the E5Gui package to have the prefix 'Eric' instead of 'E5'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8327
diff changeset
259 EricMessageBox.warning(
3020
542e97d4ecb3 Fixed a bunch of visible indentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3010
diff changeset
260 self,
3190
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3186
diff changeset
261 self.tr("Add from installed APIs"),
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3186
diff changeset
262 self.tr("""There are no APIs installed yet."""
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3186
diff changeset
263 """ Selection is not available."""))
1118
2ff50209a57f Fixed a bug in the editor APIs page.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 945
diff changeset
264 self.addInstalledApiFileButton.setEnabled(False)
3098
02ee75d31584 Fixed a bug in the APIs configuration page of the config dialog and improved its functionality.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3038
diff changeset
265 self.prepareApiButton.setEnabled(self.apiList.count() > 0)
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
266
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
267 @pyqtSlot()
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
268 def on_addPluginApiFileButton_clicked(self):
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
269 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
270 Private slot to add an API file from the list of API files installed
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
271 by plugins for the selected lexer language.
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
272 """
3010
befeff46ec0f Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2964
diff changeset
273 pluginAPIFiles = self.pluginManager.getPluginApiFiles(
5349
bccda3b5920a Started implementing project type specific APIs.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4830
diff changeset
274 self.__currentApiLanguage)
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
275 pluginAPIFilesDict = {}
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
276 for apiFile in pluginAPIFiles:
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
277 pluginAPIFilesDict[QFileInfo(apiFile).fileName()] = apiFile
564
b3d966393ba9 Did some code cleanup.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 500
diff changeset
278 file, ok = QInputDialog.getItem(
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
279 self,
3190
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3186
diff changeset
280 self.tr("Add from Plugin APIs"),
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3186
diff changeset
281 self.tr(
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
282 "Select from the list of API files installed by plugins"),
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
283 sorted(pluginAPIFilesDict.keys()),
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
284 0, False)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
285 if ok:
564
b3d966393ba9 Did some code cleanup.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 500
diff changeset
286 self.apiList.addItem(Utilities.toNativeSeparators(
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
287 pluginAPIFilesDict[file]))
3098
02ee75d31584 Fixed a bug in the APIs configuration page of the config dialog and improved its functionality.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3038
diff changeset
288 self.prepareApiButton.setEnabled(self.apiList.count() > 0)
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
289
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
290 @pyqtSlot()
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
291 def on_prepareApiButton_clicked(self):
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
292 """
3010
befeff46ec0f Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2964
diff changeset
293 Private slot to prepare the API file for the currently selected
befeff46ec0f Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2964
diff changeset
294 language.
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
295 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
296 if self.__inPreparation:
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
297 self.__currentAPI and self.__currentAPI.cancelPreparation()
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
298 else:
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
299 if self.__currentAPI is not None:
564
b3d966393ba9 Did some code cleanup.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 500
diff changeset
300 self.__currentAPI.prepareAPIs(
945
8cd4d08fa9f6 Made code mostly PEP 8 compliant (except all whitespace and line length).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 882
diff changeset
301 ondemand=True,
8cd4d08fa9f6 Made code mostly PEP 8 compliant (except all whitespace and line length).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 882
diff changeset
302 rawList=self.__editorGetApisFromApiList())
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
303
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
304 def __apiPreparationFinished(self):
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
305 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
306 Private method called after the API preparation has finished.
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
307 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
308 self.prepareApiProgressBar.reset()
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
309 self.prepareApiProgressBar.setRange(0, 100)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
310 self.prepareApiProgressBar.setValue(0)
3190
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3186
diff changeset
311 self.prepareApiButton.setText(self.tr("Compile APIs"))
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
312 self.__inPreparation = False
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
313
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
314 def __apiPreparationCancelled(self):
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
315 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
316 Private slot called after the API preparation has been cancelled.
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
317 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
318 self.__apiPreparationFinished()
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
319
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
320 def __apiPreparationStarted(self):
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
321 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
322 Private method called after the API preparation has started.
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
323 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
324 self.prepareApiProgressBar.setRange(0, 0)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
325 self.prepareApiProgressBar.setValue(0)
3190
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3186
diff changeset
326 self.prepareApiButton.setText(self.tr("Cancel compilation"))
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
327 self.__inPreparation = True
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
328
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
329 def saveState(self):
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
330 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
331 Public method to save the current state of the widget.
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
332
5350
57e82ffafdfc Adjusted the APIs configuration page to support project type specific API sets.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5349
diff changeset
333 @return tuple containing the index of the selected lexer language
57e82ffafdfc Adjusted the APIs configuration page to support project type specific API sets.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5349
diff changeset
334 and the index of the selected project type
57e82ffafdfc Adjusted the APIs configuration page to support project type specific API sets.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5349
diff changeset
335 @rtype tuple of int and int
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
336 """
5350
57e82ffafdfc Adjusted the APIs configuration page to support project type specific API sets.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5349
diff changeset
337 return (
57e82ffafdfc Adjusted the APIs configuration page to support project type specific API sets.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5349
diff changeset
338 self.apiLanguageComboBox.currentIndex(),
57e82ffafdfc Adjusted the APIs configuration page to support project type specific API sets.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5349
diff changeset
339 self.projectTypeComboBox.currentIndex()
57e82ffafdfc Adjusted the APIs configuration page to support project type specific API sets.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5349
diff changeset
340 )
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
341
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
342 def setState(self, state):
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
343 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
344 Public method to set the state of the widget.
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
345
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
346 @param state state data generated by saveState
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
347 """
5350
57e82ffafdfc Adjusted the APIs configuration page to support project type specific API sets.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5349
diff changeset
348 self.apiLanguageComboBox.setCurrentIndex(state[0])
3010
befeff46ec0f Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2964
diff changeset
349 self.on_apiLanguageComboBox_activated(
8151
8c1445825e7b Changed code to not use QComboBox.activated[str] and QComboBoc.highlighted[str] signals but the int variants instead.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7923
diff changeset
350 self.apiLanguageComboBox.currentIndex())
7164
6da6a0a5a448 Made "MicroPython" a selectable programming language in order to not mess with the normal API selections.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6942
diff changeset
351
6da6a0a5a448 Made "MicroPython" a selectable programming language in order to not mess with the normal API selections.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6942
diff changeset
352 self.projectTypeComboBox.setCurrentIndex(state[1])
5350
57e82ffafdfc Adjusted the APIs configuration page to support project type specific API sets.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5349
diff changeset
353 self.on_projectTypeComboBox_activated(state[1])
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
354
3098
02ee75d31584 Fixed a bug in the APIs configuration page of the config dialog and improved its functionality.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3038
diff changeset
355 @pyqtSlot()
02ee75d31584 Fixed a bug in the APIs configuration page of the config dialog and improved its functionality.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3038
diff changeset
356 def on_apiList_itemSelectionChanged(self):
02ee75d31584 Fixed a bug in the APIs configuration page of the config dialog and improved its functionality.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3038
diff changeset
357 """
02ee75d31584 Fixed a bug in the APIs configuration page of the config dialog and improved its functionality.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3038
diff changeset
358 Private slot to react on changes of API selections.
02ee75d31584 Fixed a bug in the APIs configuration page of the config dialog and improved its functionality.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3038
diff changeset
359 """
02ee75d31584 Fixed a bug in the APIs configuration page of the config dialog and improved its functionality.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3038
diff changeset
360 self.deleteApiFileButton.setEnabled(
02ee75d31584 Fixed a bug in the APIs configuration page of the config dialog and improved its functionality.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3038
diff changeset
361 len(self.apiList.selectedItems()) > 0)
02ee75d31584 Fixed a bug in the APIs configuration page of the config dialog and improved its functionality.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3038
diff changeset
362
02ee75d31584 Fixed a bug in the APIs configuration page of the config dialog and improved its functionality.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3038
diff changeset
363 @pyqtSlot(str)
4575
464a6b049f89 Changed the Python2 debugger and Editor APIs pages to use the path picker.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4554
diff changeset
364 def on_apiFilePicker_textChanged(self, txt):
3098
02ee75d31584 Fixed a bug in the APIs configuration page of the config dialog and improved its functionality.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3038
diff changeset
365 """
02ee75d31584 Fixed a bug in the APIs configuration page of the config dialog and improved its functionality.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3038
diff changeset
366 Private slot to handle the entering of an API file name.
02ee75d31584 Fixed a bug in the APIs configuration page of the config dialog and improved its functionality.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3038
diff changeset
367
02ee75d31584 Fixed a bug in the APIs configuration page of the config dialog and improved its functionality.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3038
diff changeset
368 @param txt text of the line edit (string)
02ee75d31584 Fixed a bug in the APIs configuration page of the config dialog and improved its functionality.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3038
diff changeset
369 """
02ee75d31584 Fixed a bug in the APIs configuration page of the config dialog and improved its functionality.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3038
diff changeset
370 enable = txt != ""
02ee75d31584 Fixed a bug in the APIs configuration page of the config dialog and improved its functionality.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3038
diff changeset
371
02ee75d31584 Fixed a bug in the APIs configuration page of the config dialog and improved its functionality.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3038
diff changeset
372 if enable:
02ee75d31584 Fixed a bug in the APIs configuration page of the config dialog and improved its functionality.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3038
diff changeset
373 # check for already added file
02ee75d31584 Fixed a bug in the APIs configuration page of the config dialog and improved its functionality.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3038
diff changeset
374 for row in range(self.apiList.count()):
02ee75d31584 Fixed a bug in the APIs configuration page of the config dialog and improved its functionality.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3038
diff changeset
375 if txt == self.apiList.item(row).text():
02ee75d31584 Fixed a bug in the APIs configuration page of the config dialog and improved its functionality.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3038
diff changeset
376 enable = False
02ee75d31584 Fixed a bug in the APIs configuration page of the config dialog and improved its functionality.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3038
diff changeset
377 break
02ee75d31584 Fixed a bug in the APIs configuration page of the config dialog and improved its functionality.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3038
diff changeset
378
02ee75d31584 Fixed a bug in the APIs configuration page of the config dialog and improved its functionality.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3038
diff changeset
379 self.addApiFileButton.setEnabled(enable)
02ee75d31584 Fixed a bug in the APIs configuration page of the config dialog and improved its functionality.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3038
diff changeset
380
945
8cd4d08fa9f6 Made code mostly PEP 8 compliant (except all whitespace and line length).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 882
diff changeset
381
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
382 def create(dlg):
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
383 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
384 Module function to create the configuration page.
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
385
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
386 @param dlg reference to the configuration dialog
2964
84b65fb9e780 Continued correcting doc strings by using the new doc string checker.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2408
diff changeset
387 @return reference to the instantiated page (ConfigurationPageBase)
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
388 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
389 page = EditorAPIsPage()
880
52ed20236a1c Added the option to not use the native file dialog to prevent crashes on Linux.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 791
diff changeset
390 return page

eric ide

mercurial