From 42f4b55df96cd1b65d6f7e779dfe41352ab8cce4 Mon Sep 17 00:00:00 2001 From: Nick Draper <nick.draper@stfc.ac.uk> Date: Tue, 18 Feb 2020 11:33:31 +0000 Subject: [PATCH] Double click on any algorithm should execute it This now checks that the name is parsable, rather than the absence of children --- docs/source/release/v4.3.0/mantidworkbench.rst | 1 + qt/python/mantidqt/widgets/algorithmselector/widget.py | 5 +++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/docs/source/release/v4.3.0/mantidworkbench.rst b/docs/source/release/v4.3.0/mantidworkbench.rst index 98ce09c660f..58735cb5ad6 100644 --- a/docs/source/release/v4.3.0/mantidworkbench.rst +++ b/docs/source/release/v4.3.0/mantidworkbench.rst @@ -45,6 +45,7 @@ Bugfixes - Fixed a couple of errors in the python scripts generated from plots for newer versions of Matplotlib. - Colorbar scale no longer vanish on colorfill plots with a logarithmic scale - Figure options no longer causes a crash when using 2d plots created from a script. +- You can now execute algorithms with multiple versions by double clicking on them in the algorithm toolbox, this will now execute them rather than opening the tree to show previous versions. You can still click on the arrow to see and execute previous versions. - Running an algorithm that reduces the number of spectra on an active plot (eg SumSpectra) no longer causes an error - Fix crash when loading a script with syntax errors - The Show Instruments right click menu option is now disabled for workspaces that have had their spectrum axis converted to another axis using :ref:`ConvertSpectrumAxis <algm-ConvertSpectrumAxis>`. Once this axis has been converetd the workspace loses it's link between the data values and the detectors they were recorded on so we cannot display it in the instrument view. diff --git a/qt/python/mantidqt/widgets/algorithmselector/widget.py b/qt/python/mantidqt/widgets/algorithmselector/widget.py index c045540ea58..2df9ea7e353 100644 --- a/qt/python/mantidqt/widgets/algorithmselector/widget.py +++ b/qt/python/mantidqt/widgets/algorithmselector/widget.py @@ -46,9 +46,10 @@ class AlgorithmTreeWidget(QTreeWidget): def mouseDoubleClickEvent(self, mouse_event): if mouse_event.button() == Qt.LeftButton: - if self.selectedItems() and not self.selectedItems()[0].child(0): + if self.selectedItems() and get_name_and_version_from_item_label(self.selectedItems()[0].text(0)): self.parent.execute_algorithm() - super(AlgorithmTreeWidget, self).mouseDoubleClickEvent(mouse_event) + else: + super(AlgorithmTreeWidget, self).mouseDoubleClickEvent(mouse_event) class AlgorithmSelectorWidget(IAlgorithmSelectorView, QWidget): -- GitLab