src/eric7/MicroPython/Devices/EspDevices.py

branch
eric7
changeset 11005
b918c6c2736b
parent 10933
95a15b70f7bb
child 11006
a671918232f3
--- a/src/eric7/MicroPython/Devices/EspDevices.py	Fri Oct 25 08:42:57 2024 +0200
+++ b/src/eric7/MicroPython/Devices/EspDevices.py	Fri Oct 25 09:47:48 2024 +0200
@@ -271,14 +271,14 @@
         """
         Private slot to flash a MicroPython firmware to the device.
         """
-        flashPythonFirmware(self.microPython.getCurrentPort())
+        flashPythonFirmware(self.microPython.getCurrentPort(), parent=self.microPython)
 
     @pyqtSlot()
     def __flashAddons(self):
         """
         Private slot to flash some additional firmware images.
         """
-        flashAddonFirmware(self.microPython.getCurrentPort())
+        flashAddonFirmware(self.microPython.getCurrentPort(), parent=self.microPython)
 
     @pyqtSlot()
     def __backupFlash(self):
@@ -289,7 +289,7 @@
             EspBackupRestoreFirmwareDialog,
         )
 
-        dlg = EspBackupRestoreFirmwareDialog(backupMode=True)
+        dlg = EspBackupRestoreFirmwareDialog(backupMode=True, parent=self.microPython)
         if dlg.exec() == QDialog.DialogCode.Accepted:
             chip, flashSize, baudRate, flashMode, firmware = dlg.getData()
             flashArgs = [
@@ -327,7 +327,7 @@
             EspBackupRestoreFirmwareDialog,
         )
 
-        dlg = EspBackupRestoreFirmwareDialog(backupMode=False)
+        dlg = EspBackupRestoreFirmwareDialog(backupMode=False, parent=self.microPython)
         if dlg.exec() == QDialog.DialogCode.Accepted:
             chip, flashSize, baudRate, flashMode, firmware = dlg.getData()
             flashArgs = [
@@ -1351,7 +1351,7 @@
         """
         from ..WifiDialogs.WifiCountryDialog import WifiCountryDialog
 
-        dlg = WifiCountryDialog()
+        dlg = WifiCountryDialog(parent=self.microPython)
         if dlg.exec() == QDialog.DialogCode.Accepted:
             country, remember = dlg.getCountry()
             if remember:
@@ -1783,16 +1783,18 @@
 
 
 @pyqtSlot()
-def flashPythonFirmware(port):
+def flashPythonFirmware(port, parent=None):
     """
     Slot to flash a MicroPython firmware to the device.
 
     @param port name of the serial port device to be used
     @type str
+    @param parent reference to the parent widget (defaults to None)
+    @type QWidget
     """
     from .EspDialogs.EspFirmwareSelectionDialog import EspFirmwareSelectionDialog
 
-    dlg = EspFirmwareSelectionDialog()
+    dlg = EspFirmwareSelectionDialog(parent=parent)
     if dlg.exec() == QDialog.DialogCode.Accepted:
         chip, firmware, baudRate, flashMode, flashAddress = dlg.getData()
         flashArgs = [
@@ -1829,16 +1831,18 @@
 
 
 @pyqtSlot()
-def flashAddonFirmware(port):
+def flashAddonFirmware(port, parent=None):
     """
     Slot to flash some additional firmware images.
 
     @param port name of the serial port device to be used
     @type str
+    @param parent reference to the parent widget (defaults to None)
+    @type QWidget
     """
     from .EspDialogs.EspFirmwareSelectionDialog import EspFirmwareSelectionDialog
 
-    dlg = EspFirmwareSelectionDialog(addon=True)
+    dlg = EspFirmwareSelectionDialog(addon=True, parent=parent)
     if dlg.exec() == QDialog.DialogCode.Accepted:
         chip, firmware, baudRate, flashMode, flashAddress = dlg.getData()
         flashArgs = [

eric ide

mercurial