src/eric7/MicroPython/BluetoothDialogs/BluetoothController.py

branch
eric7
changeset 11270
0e220c26e60e
parent 11167
a3f5af773bc7
--- a/src/eric7/MicroPython/BluetoothDialogs/BluetoothController.py	Tue May 06 11:09:21 2025 +0200
+++ b/src/eric7/MicroPython/BluetoothDialogs/BluetoothController.py	Tue May 06 15:32:29 2025 +0200
@@ -30,6 +30,7 @@
         super().__init__(parent)
 
         self.__mpy = microPython
+        self.__mpy.disconnected.connect(self.__disconnectedFromDevice)
 
         self.__btStatusDialog = None
 
@@ -64,6 +65,15 @@
         return btMenu
 
     @pyqtSlot()
+    def __disconnectedFromDevice(self):
+        """
+        Private slot handling disconnection from a device.
+        """
+        if self.__btStatusDialog is not None:
+            self.__btStatusDialog.deleteLater()
+            self.__btStatusDialog = None
+
+    @pyqtSlot()
     def __showBtStatus(self):
         """
         Private slot to show the status and some parameters of the Bluetooth interface.

eric ide

mercurial