Skip to content
Snippets Groups Projects
Commit ea160feb authored by Conor Finn's avatar Conor Finn
Browse files

RE #26846 Fix startup script and add comments

parent 40d9ae43
No related branches found
No related tags found
No related merge requests found
# Mantid Repository : https://github.com/mantidproject/mantid # Mantid Repository : https://github.com/mantidproject/mantid
# #
# Copyright © 2018 ISIS Rutherford Appleton Laboratory UKRI, # Copyright © 2019 ISIS Rutherford Appleton Laboratory UKRI,
# NScD Oak Ridge National Laboratory, European Spallation Source # NScD Oak Ridge National Laboratory, European Spallation Source
# & Institut Laue - Langevin # & Institut Laue - Langevin
# SPDX - License - Identifier: GPL - 3.0 + # SPDX - License - Identifier: GPL - 3.0 +
...@@ -10,16 +10,17 @@ from Engineering.gui.engineering_diffraction.engineering_diffraction import Engi ...@@ -10,16 +10,17 @@ from Engineering.gui.engineering_diffraction.engineering_diffraction import Engi
from qtpy import QtCore from qtpy import QtCore
# Check if the interface is loaded and if so show it while maintaining its state.
if 'engineering_diffraction' in globals(): if 'engineering_diffraction' in globals():
eng_diff = globals()['engineering_diffraction'] engineering_diffraction = globals()['engineering_diffraction']
if not eng_diff.isHidden(): # Restore a minimised window.
eng_diff.setWindowState( if not engineering_diffraction.isHidden():
eng_diff.windowState( engineering_diffraction.setWindowState(engineering_diffraction.windowState() & ~QtCore.Qt.WindowMinimized
) & ~QtCore.Qt.WindowMinimized | QtCore.Qt.WindowActive) | QtCore.Qt.WindowActive)
eng_diff.activateWindow() engineering_diffraction.activateWindow()
else: else:
eng_diff = EngineeringDiffractionGui() engineering_diffraction = EngineeringDiffractionGui()
eng_diff.show() engineering_diffraction.show()
else: else: # Reload GUI if not currently loaded.
eng_diff = EngineeringDiffractionGui() engineering_diffraction = EngineeringDiffractionGui()
eng_diff.show() engineering_diffraction.show()
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment