1
0
mirror of https://github.com/bec-project/bec_widgets.git synced 2026-03-04 16:02:51 +01:00

feat: attach config cancellation to closeEvent

This commit is contained in:
2026-01-21 09:28:25 +01:00
committed by Christian Appel
parent 75162ef8a8
commit beb337201c

View File

@@ -226,9 +226,9 @@ class DeviceManagerDisplayWidget(DockAreaWidget):
# Build dock layout using shared helpers
self._build_docks()
# TODO Implement once issue #1012 is solved
# logger.info("Connecting application about to quit signal to device manager view...")
# QApplication.instance().aboutToQuit.connect(self._about_to_quit_handler)
def closeEvent(self, event):
self._about_to_quit_handler()
return super().closeEvent(event)
##############################
### Custom set busy widget ###
@@ -244,17 +244,15 @@ class DeviceManagerDisplayWidget(DockAreaWidget):
### Application quit handler ###
################################
# TODO Implement once issue #1012 is solved
# @SafeSlot()
# def _about_to_quit_handler(self):
# """Handle application about to quit event. If config upload is active, cancel it."""
# logger.info("Application is quitting, checking for active config upload...")
# if self._config_upload_active:
# logger.info("Application is quitting, cancelling active config upload...")
# self._config_helper.send_config_request(
# action="cancel", config=None, wait_for_response=True, timeout_s=10
# )
# logger.info("Config upload cancelled.")
def _about_to_quit_handler(self):
"""Handle application about to quit event. If config upload is active, cancel it."""
logger.info("Application is quitting, checking for active config upload...")
if self._config_upload_active:
logger.info("Application is quitting, cancelling active config upload...")
self._config_helper.send_config_request(
action="cancel", config=None, wait_for_response=True, timeout_s=10
)
logger.info("Config upload cancelled.")
def _set_busy_wrapper(self, enabled: bool):
"""Thin wrapper around set_busy to flip the state variable."""