eric6/MicroPython/CircuitPythonDevices.py

changeset 8096
5425a9072300
parent 8072
58491f4c99d6
child 8117
aaa5e0eacd4e
--- a/eric6/MicroPython/CircuitPythonDevices.py	Thu Feb 11 11:59:32 2021 +0100
+++ b/eric6/MicroPython/CircuitPythonDevices.py	Fri Feb 12 16:15:18 2021 +0100
@@ -214,6 +214,15 @@
                              self.__installLibraryFiles)
         act.setEnabled(self.__deviceVolumeMounted())
     
+    def hasFlashMenuEntry(self):
+        """
+        Public method to check, if the device has its own flash menu entry.
+        
+        @return flag indicating a specific flash menu entry
+        @rtype bool
+        """
+        return True
+    
     @pyqtSlot()
     def __flashCircuitPython(self):
         """
@@ -226,21 +235,9 @@
                     self.__nonUF2devices[name]()
                     break
             else:
-                button = E5MessageBox.information(
-                    self.microPython,
-                    self.tr("Flash CircuitPython Firmware"),
-                    self.tr("Please reset the device to bootloader mode and"
-                            " confirm when ready."),
-                    E5MessageBox.StandardButtons(
-                        E5MessageBox.Abort |
-                        E5MessageBox.Ok))
-                if button == E5MessageBox.Ok:
-                    from .CircuitPythonFirmwareSelectionDialog import (
-                        CircuitPythonFirmwareSelectionDialog)
-                    dlg = CircuitPythonFirmwareSelectionDialog()
-                    if dlg.exec() == QDialog.Accepted:
-                        cpyPath, devicePath = dlg.getData()
-                        shutil.copy2(cpyPath, devicePath)
+                from .UF2FlashDialog import UF2FlashDialog
+                dlg = UF2FlashDialog(boardType="circuitpython")
+                dlg.exec()
     
     def __flashTeensy(self):
         """

eric ide

mercurial