Skip to content

Commit

Permalink
minor closing fix
Browse files Browse the repository at this point in the history
- fix: don't close control panel if cancel scanner closure
  • Loading branch information
Python-simulation committed Oct 11, 2024
1 parent 77e53ba commit eccf5c0
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
5 changes: 5 additions & 0 deletions autolab/core/gui/controlcenter/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -619,6 +619,11 @@ def closeEvent(self, event):
""" This function does some steps before the window is really killed """
if self.scanner:
self.scanner.close()

if self.scanner is not None and self.scanner.isVisible():
event.ignore()
return None

closePlotter()
closeAbout()
closeAddDevice()
Expand Down
1 change: 0 additions & 1 deletion autolab/core/gui/scanning/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -537,7 +537,6 @@ def closeEvent(self, event):
# Stop datamanager timer
self.dataManager.timer.stop()


scanner_config = get_scanner_config()
ask_close = boolean(scanner_config["ask_close"])
if ask_close and not all([scanset.saved for scanset in self.dataManager.datasets]):
Expand Down

0 comments on commit eccf5c0

Please sign in to comment.