mirror of
https://github.com/bec-project/bec_widgets.git
synced 2025-07-14 03:31:50 +02:00
WIP cleanup of accept and reject changes for setting widgets + general cleanup for curve settings
This commit is contained in:
@ -112,8 +112,17 @@ class SettingsDialog(QDialog):
|
||||
Accept the changes made in the settings widget and close the dialog.
|
||||
"""
|
||||
self.widget.accept_changes()
|
||||
self.cleanup()
|
||||
super().accept()
|
||||
|
||||
@SafeSlot()
|
||||
def reject(self):
|
||||
"""
|
||||
Reject the changes made in the settings widget and close the dialog.
|
||||
"""
|
||||
self.cleanup()
|
||||
super().reject()
|
||||
|
||||
@SafeSlot()
|
||||
def apply_changes(self):
|
||||
"""
|
||||
|
@ -544,6 +544,16 @@ class CurveTree(BECWidget, QWidget):
|
||||
if dap.config.parent_label == dev.config.label:
|
||||
CurveRow(self.tree, parent_item=dr, config=dap.config, device_manager=self.dev)
|
||||
|
||||
def cleanup(self):
|
||||
"""Cleanup the widget."""
|
||||
for item in self.all_items:
|
||||
if hasattr(item, "device_edit"):
|
||||
item.device_edit.close()
|
||||
item.device_edit.deleteLater()
|
||||
if hasattr(item, "dap_combo"):
|
||||
item.dap_combo.close()
|
||||
item.dap_combo.deleteLater()
|
||||
|
||||
def closeEvent(self, event):
|
||||
logger.info("CurveTree closeEvent")
|
||||
self.cleanup()
|
||||
return super().closeEvent(event)
|
||||
|
Reference in New Issue
Block a user