389 """ |
389 """ |
390 Private slot to show the available modules. |
390 Private slot to show the available modules. |
391 |
391 |
392 These are modules which could be installed on the device. |
392 These are modules which could be installed on the device. |
393 """ |
393 """ |
394 from .ShowModulesDialog import ShowModulesDialog |
394 from ..ShowModulesDialog import ShowModulesDialog |
395 |
395 |
396 with EricOverrideCursor(): |
396 with EricOverrideCursor(): |
397 dlg = ShowModulesDialog() |
397 availableModules = circup.get_bundle_versions(circup.get_bundles_list()) |
|
398 moduleNames = [m.replace(".py", "") for m in availableModules] |
|
399 |
|
400 dlg = ShowModulesDialog(moduleNames) |
398 dlg.exec() |
401 dlg.exec() |
399 |
402 |
400 @pyqtSlot() |
403 @pyqtSlot() |
401 def __showInstalledModules(self): |
404 def __showInstalledModules(self): |
402 """ |
405 """ |
413 @pyqtSlot() |
416 @pyqtSlot() |
414 def __installFromAvailable(self): |
417 def __installFromAvailable(self): |
415 """ |
418 """ |
416 Private slot to install modules onto the connected device. |
419 Private slot to install modules onto the connected device. |
417 """ |
420 """ |
418 from .ShowModulesDialog import ShowModulesDialog |
421 from ..ShowModulesDialog import ShowModulesDialog |
419 |
422 |
420 with EricOverrideCursor(): |
423 with EricOverrideCursor(): |
421 dlg = ShowModulesDialog(selectionMode=True) |
424 availableModules = circup.get_bundle_versions(circup.get_bundles_list()) |
|
425 moduleNames = [m.replace(".py", "") for m in availableModules] |
|
426 |
|
427 dlg = ShowModulesDialog(moduleNames, selectionMode=True) |
422 if dlg.exec() == QDialog.DialogCode.Accepted: |
428 if dlg.exec() == QDialog.DialogCode.Accepted: |
423 modules = dlg.getSelection() |
429 modules = dlg.getSelection() |
424 self.__installModules(modules) |
430 self.__installModules(modules) |
425 |
431 |
426 @pyqtSlot() |
432 @pyqtSlot() |
479 os.path.join(devicePath, "code.py"), |
485 os.path.join(devicePath, "code.py"), |
480 self.tr("Python Files (*.py);;All Files (*)"), |
486 self.tr("Python Files (*.py);;All Files (*)"), |
481 ) |
487 ) |
482 if codeFile: |
488 if codeFile: |
483 if os.path.exists(codeFile): |
489 if os.path.exists(codeFile): |
484 |
|
485 with EricOverrideCursor(): |
490 with EricOverrideCursor(): |
486 availableModules = circup.get_bundle_versions( |
491 availableModules = circup.get_bundle_versions( |
487 circup.get_bundles_list() |
492 circup.get_bundles_list() |
488 ) |
493 ) |
489 moduleNames = {} |
494 moduleNames = {} |