Loading from AddWorkspaceDialog freezes the GUI #37184
Labels
Bug
Issues and pull requests that are regressions or would be considered a bug by users (e.g. crashing)
Indirect/Inelastic
Issues and pull requests related to indirect or inelastic
ISIS Team: Spectroscopy
Issue and pull requests managed by the Spectroscopy subteam at ISIS
Describe the bug
When loading a file from the AddWorkspaceDialog's in the Inelastic interfaces, the GUI will freeze while loading takes place. We don't want this to happen. Instead, we want the loading to be performed in a background thread so that the GUI remains responsive. We probably also want to disable the "Add" button on the dialog until it is finished loading. Perhaps changing the "Add" button text to "Loading..." would also make it clear that the data is loading during this time.
In previous situations, I have created a "Manager" class to handle the background thread execution for algorithms. As an examaple, for the ALFView interface, see this class https://github.com/mantidproject/mantid/blob/main/qt/scientific_interfaces/Direct/ALFAlgorithmManager.cpp
To Reproduce
For example
Open Inelastic QENS Fitting interface
Go to F(Q) fit tab
Click Add Workspace
Browse to the following workspace
irs26176_graphite002_red_Conv_seq_2L_0-50__Result.zip
The GUI will freeze while loading the workspace
When finished loading, the GUI will unfreeze
Expected behavior
The loading should be done in the background thread so the GUI remains responsive. The Add button should be disabled while loading, and the text changed to something like "Loading..."
Platform/Version (please complete the following information):
The text was updated successfully, but these errors were encountered: