From d753fc64adf44229c82db464997416f6244b6e1c Mon Sep 17 00:00:00 2001
From: Anthony Lim <anthony.lim@stfc.ac.uk>
Date: Mon, 2 Mar 2020 16:32:42 +0000
Subject: [PATCH] update muon doc, add ALFView title and ALC error msg improved

---
 docs/source/release/v5.0.0/muon.rst           | 33 ++++++++++++-------
 qt/scientific_interfaces/Direct/ALFView.cpp   |  1 +
 .../Muon/ALCDataLoadingPresenter.cpp          | 14 ++++++++
 3 files changed, 37 insertions(+), 11 deletions(-)

diff --git a/docs/source/release/v5.0.0/muon.rst b/docs/source/release/v5.0.0/muon.rst
index 337a960f43d..5a03d3456b0 100644
--- a/docs/source/release/v5.0.0/muon.rst
+++ b/docs/source/release/v5.0.0/muon.rst
@@ -5,22 +5,20 @@ MuSR Changes
 .. contents:: Table of Contents
    :local:
 
-New
-###
-
-Improvements
-############
 
 Algorithms
--------------
+##########
 
 Bug Fixes
-#########
+---------
 - :ref:`LoadPSIMuonBin <algm-LoadPSIMuonBin>` can produce an empty dead time table, the time data is offset such that the start of thepulse is at time zero. The start and end date logs have been fixed and if no group name is present a default is generated.
 
 
 Muon Analysis 2 and Frequency Domain Interfaces
----------------------------------------------------
+############
+
+New Features
+------------
 - The plotting window within the Muon Analysis 2 and Frequency Domain Interfaces has been converted into a dockable window,
   which can be docked and undocked at will. This change improves the user experience for those working on laptops.
 - Improved the plotting within the Muon Analysis 2 and Frequency Domain interfaces by introducing tiled plotting.
@@ -38,12 +36,25 @@ Muon Analysis 2 and Frequency Domain Interfaces
 - Elemental analysis bug has been fixed that prevented co-adding data.
 
 Bug Fixes
-#########
+---------
 
-- The elemental analysis GUI can now handle legacy data which is missing a response dataset, e.g Delayed.
 - Fixed a bug with constraints in the Muon Analysis 2 GUI which would cause Mantid to crash.
-- Fixed a bug in Muon Analysis Old that prevented the muon fitting functions from appearing in the data analysis tab.
 - Data sets can now be reloaded while the Instrument View is open without crashing Mantid.
 - Fixed a bug where the incorrect path would be shown after loading a data file by run number.
 
+Elemental Analysis
+##################
+
+Bug Fixes
+---------
+- The elemental analysis GUI can now handle legacy data which is missing a response dataset, e.g Delayed.
+
+Muon Analysis (old)
+###################
+
+Bug Fixes
+---------
+- Fixed a bug in Muon Analysis Old that prevented the muon fitting functions from appearing in the data analysis tab.
+
+
 :ref:`Release 5.0.0 <v5.0.0>`
\ No newline at end of file
diff --git a/qt/scientific_interfaces/Direct/ALFView.cpp b/qt/scientific_interfaces/Direct/ALFView.cpp
index 995675fab20..80900df4c3f 100644
--- a/qt/scientific_interfaces/Direct/ALFView.cpp
+++ b/qt/scientific_interfaces/Direct/ALFView.cpp
@@ -24,6 +24,7 @@ Mantid::Kernel::Logger g_log("ALFView");
 ALFView::ALFView(QWidget *parent)
     : UserSubWindow(parent), m_view(nullptr), m_presenter(nullptr),
       m_analysisPane(nullptr) {
+  this->setWindowTitle("ALF View");
   m_model = new ALFCustomInstrumentModel();
   m_view = new ALFCustomInstrumentView(m_model->getInstrument(), this);
   auto analysisView =
diff --git a/qt/scientific_interfaces/Muon/ALCDataLoadingPresenter.cpp b/qt/scientific_interfaces/Muon/ALCDataLoadingPresenter.cpp
index 3e3de2da0b2..b73b268f1f3 100644
--- a/qt/scientific_interfaces/Muon/ALCDataLoadingPresenter.cpp
+++ b/qt/scientific_interfaces/Muon/ALCDataLoadingPresenter.cpp
@@ -159,6 +159,18 @@ void ALCDataLoadingPresenter::load(const std::string &lastFile) {
   }
 
   try {
+    if (lastRunPath.toString() == "") {
+      throw std::invalid_argument(
+          "The last run is not a valid run number. \n"
+          "This could be because the file is not in the search path or the "
+          "file does not exist yet. ");
+    }
+    if (firstRunPath.toString() == "") {
+      throw std::invalid_argument(
+          "The first run is not a valid run number. \n"
+          "This could be because the file is not in the search path or the "
+          "file does not exist yet. ");
+    }
     IAlgorithm_sptr alg =
         AlgorithmManager::Instance().create("PlotAsymmetryByLogValue");
     alg->setChild(true); // Don't want workspaces in the ADS
@@ -235,6 +247,8 @@ void ALCDataLoadingPresenter::load(const std::string &lastFile) {
 
     emit dataChanged();
 
+  } catch (const std::invalid_argument &e) {
+    m_view->displayError(e.what());
   } catch (std::exception &e) {
     m_view->displayError(e.what());
   }
-- 
GitLab