--- a/src/eric7/MicroPython/Devices/EspDevices.py Fri Oct 25 09:47:48 2024 +0200 +++ b/src/eric7/MicroPython/Devices/EspDevices.py Fri Oct 25 17:58:59 2024 +0200 @@ -264,7 +264,7 @@ """ Private slot to erase the device flash memory. """ - eraseFlash(self.microPython.getCurrentPort()) + eraseFlash(self.microPython.getCurrentPort(), parent=self.microPython) @pyqtSlot() def __flashMicroPython(self): @@ -313,6 +313,7 @@ showProgress=True, monospacedFont=Preferences.getEditorOtherFonts("MonospacedFont"), encoding=Preferences.getSystem("IOEncoding"), + parent=self.microPython, ) res = dlg.startProcess(PythonUtilities.getPythonExecutable(), flashArgs) if res: @@ -368,6 +369,7 @@ showProgress=True, monospacedFont=Preferences.getEditorOtherFonts("MonospacedFont"), encoding=Preferences.getSystem("IOEncoding"), + parent=self.microPython, ) res = dlg.startProcess(PythonUtilities.getPythonExecutable(), flashArgs) if res: @@ -465,6 +467,7 @@ self.tr("Show Chip ID"), monospacedFont=Preferences.getEditorOtherFonts("MonospacedFont"), encoding=Preferences.getSystem("IOEncoding"), + parent=self.microPython, ) res = dlg.startProcess(PythonUtilities.getPythonExecutable(), args) if res: @@ -488,6 +491,7 @@ self.tr("Show Flash ID"), monospacedFont=Preferences.getEditorOtherFonts("MonospacedFont"), encoding=Preferences.getSystem("IOEncoding"), + parent=self.microPython, ) res = dlg.startProcess(PythonUtilities.getPythonExecutable(), args) if res: @@ -511,6 +515,7 @@ self.tr("Show MAC Address"), monospacedFont=Preferences.getEditorOtherFonts("MonospacedFont"), encoding=Preferences.getSystem("IOEncoding"), + parent=self.microPython, ) res = dlg.startProcess(PythonUtilities.getPythonExecutable(), args) if res: @@ -1747,15 +1752,17 @@ @pyqtSlot() -def eraseFlash(port): +def eraseFlash(port, parent=None): """ Slot to erase the device flash memory. @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 """ ok = EricMessageBox.yesNo( - None, + parent, QCoreApplication.translate("EspDevice", "Erase Flash"), QCoreApplication.translate( "EspDevice", """Shall the flash of the selected device really be erased?""" @@ -1776,6 +1783,7 @@ showProgress=True, monospacedFont=Preferences.getEditorOtherFonts("MonospacedFont"), encoding=Preferences.getSystem("IOEncoding"), + parent=parent, ) res = dlg.startProcess(PythonUtilities.getPythonExecutable(), flashArgs) if res: @@ -1824,6 +1832,7 @@ showProgress=True, monospacedFont=Preferences.getEditorOtherFonts("MonospacedFont"), encoding=Preferences.getSystem("IOEncoding"), + parent=parent, ) res = dlg.startProcess(PythonUtilities.getPythonExecutable(), flashArgs) if res: @@ -1869,6 +1878,7 @@ showProgress=True, monospacedFont=Preferences.getEditorOtherFonts("MonospacedFont"), encoding=Preferences.getSystem("IOEncoding"), + parent=parent, ) res = dlg.startProcess(PythonUtilities.getPythonExecutable(), flashArgs) if res: