160 """ |
160 """ |
161 Private slot to add an API file from the list of installed API files |
161 Private slot to add an API file from the list of installed API files |
162 for the selected lexer language. |
162 for the selected lexer language. |
163 """ |
163 """ |
164 installedAPIFiles = self.__currentAPI.installedAPIFiles() |
164 installedAPIFiles = self.__currentAPI.installedAPIFiles() |
165 installedAPIFilesPath = QFileInfo(installedAPIFiles[0]).path() |
165 if installedAPIFiles: |
166 installedAPIFilesShort = [] |
166 installedAPIFilesPath = QFileInfo(installedAPIFiles[0]).path() |
167 for installedAPIFile in installedAPIFiles: |
167 installedAPIFilesShort = [] |
168 installedAPIFilesShort.append(QFileInfo(installedAPIFile).fileName()) |
168 for installedAPIFile in installedAPIFiles: |
169 file, ok = QInputDialog.getItem( |
169 installedAPIFilesShort.append(QFileInfo(installedAPIFile).fileName()) |
170 self, |
170 file, ok = QInputDialog.getItem( |
171 self.trUtf8("Add from installed APIs"), |
171 self, |
172 self.trUtf8("Select from the list of installed API files"), |
172 self.trUtf8("Add from installed APIs"), |
173 installedAPIFilesShort, |
173 self.trUtf8("Select from the list of installed API files"), |
174 0, False) |
174 installedAPIFilesShort, |
175 if ok: |
175 0, False) |
176 self.apiList.addItem(Utilities.toNativeSeparators( |
176 if ok: |
177 QFileInfo(QDir(installedAPIFilesPath), file).absoluteFilePath())) |
177 self.apiList.addItem(Utilities.toNativeSeparators( |
|
178 QFileInfo(QDir(installedAPIFilesPath), file).absoluteFilePath())) |
|
179 else: |
|
180 self.addInstalledApiFileButton.setEnabled(False) |
178 |
181 |
179 @pyqtSlot() |
182 @pyqtSlot() |
180 def on_addPluginApiFileButton_clicked(self): |
183 def on_addPluginApiFileButton_clicked(self): |
181 """ |
184 """ |
182 Private slot to add an API file from the list of API files installed |
185 Private slot to add an API file from the list of API files installed |