From 7b95bfcde07a19396daccc8949d80baaabe6b55f Mon Sep 17 00:00:00 2001
From: Raquel Alvarez Banos <raquel.alvarez.banos@gmail.com>
Date: Fri, 22 Jul 2016 11:16:20 +0100
Subject: [PATCH] Re #16869 Go back to HintingLineEdit

---
 .../Reflectometry/IReflMainWindowPresenter.h  |  13 +-
 .../Reflectometry/IReflSettingsTabPresenter.h |  14 +-
 .../Reflectometry/IReflSettingsTabView.h      |  20 +-
 .../Reflectometry/QtReflSettingsTabView.h     |  25 +-
 .../Reflectometry/ReflMainWindowPresenter.h   |  14 +-
 .../Reflectometry/ReflSettingsTabPresenter.h  |  23 +-
 .../Reflectometry/ReflSettingsTabWidget.ui    | 235 ++++++++----------
 .../Reflectometry/QtReflMainWindowView.cpp    |   6 +-
 .../Reflectometry/QtReflSettingsTabView.cpp   |  79 +++++-
 .../Reflectometry/ReflMainWindowPresenter.cpp |  42 ++--
 .../Reflectometry/ReflRunsTabPresenter.cpp    |  12 +-
 .../ReflSettingsTabPresenter.cpp              | 118 +++++++--
 12 files changed, 383 insertions(+), 218 deletions(-)

diff --git a/MantidQt/CustomInterfaces/inc/MantidQtCustomInterfaces/Reflectometry/IReflMainWindowPresenter.h b/MantidQt/CustomInterfaces/inc/MantidQtCustomInterfaces/Reflectometry/IReflMainWindowPresenter.h
index b16e5c92b54..75c56fd3c01 100644
--- a/MantidQt/CustomInterfaces/inc/MantidQtCustomInterfaces/Reflectometry/IReflMainWindowPresenter.h
+++ b/MantidQt/CustomInterfaces/inc/MantidQtCustomInterfaces/Reflectometry/IReflMainWindowPresenter.h
@@ -38,12 +38,13 @@ class IReflMainWindowPresenter {
 public:
   /// Destructor
   virtual ~IReflMainWindowPresenter(){};
-  /// Returns global pre-processing options
-  virtual std::map<std::string, std::string> getPreprocessingOptions() const = 0;
-  /// Returns global processing options
-  virtual std::string getProcessingOptions() const = 0;
-  /// Returns global post-processing options
-  virtual std::string getPostprocessingOptions() const = 0;
+  /// Pre-processing
+  virtual std::string getPlusOptions() const = 0;
+  virtual std::string getTransmissionOptions() const = 0;
+  /// Processing
+  virtual std::string getReductionOptions() const = 0;
+  /// Post-processing
+  virtual std::string getStitchOptions() const = 0;
   /// Dialog/Prompt methods
   virtual std::string askUserString(const std::string &prompt,
                                     const std::string &title,
diff --git a/MantidQt/CustomInterfaces/inc/MantidQtCustomInterfaces/Reflectometry/IReflSettingsTabPresenter.h b/MantidQt/CustomInterfaces/inc/MantidQtCustomInterfaces/Reflectometry/IReflSettingsTabPresenter.h
index 2a26e289092..9337df57f6c 100644
--- a/MantidQt/CustomInterfaces/inc/MantidQtCustomInterfaces/Reflectometry/IReflSettingsTabPresenter.h
+++ b/MantidQt/CustomInterfaces/inc/MantidQtCustomInterfaces/Reflectometry/IReflSettingsTabPresenter.h
@@ -37,13 +37,13 @@ public:
   virtual ~IReflSettingsTabPresenter(){};
   /// Accept a main presenter
   virtual void acceptMainPresenter(IReflMainWindowPresenter *mainPresenter) = 0;
-  /// Get global pre-processing options
-  virtual std::map<std::string, std::string>
-  getPreprocessingOptions() const = 0;
-  /// Get global processing options
-  virtual std::string getProcessingOptions() const = 0;
-  /// Get global post-processing options
-  virtual std::string getPostprocessingOptions() const = 0;
+  /// Pre-processing
+  virtual std::string getPlusOptions() const = 0;
+  virtual std::string getTransmissionOptions() const = 0;
+  /// Processing
+  virtual std::string getReductionOptions() const = 0;
+  /// Post-processing
+  virtual std::string getStitchOptions() const = 0;
 };
 }
 }
diff --git a/MantidQt/CustomInterfaces/inc/MantidQtCustomInterfaces/Reflectometry/IReflSettingsTabView.h b/MantidQt/CustomInterfaces/inc/MantidQtCustomInterfaces/Reflectometry/IReflSettingsTabView.h
index 079c004664d..28633366ecc 100644
--- a/MantidQt/CustomInterfaces/inc/MantidQtCustomInterfaces/Reflectometry/IReflSettingsTabView.h
+++ b/MantidQt/CustomInterfaces/inc/MantidQtCustomInterfaces/Reflectometry/IReflSettingsTabView.h
@@ -1,6 +1,8 @@
 #ifndef MANTID_CUSTOMINTERFACES_IREFLSETTINGSTABVIEW_H
 #define MANTID_CUSTOMINTERFACES_IREFLSETTINGSTABVIEW_H
 
+#include <map>
+
 namespace MantidQt {
 
 namespace CustomInterfaces {
@@ -44,13 +46,21 @@ public:
   /// Returns the presenter managing this view
   virtual IReflSettingsTabPresenter *const getPresenter() const = 0;
 
+  /// Pre-processing
+  virtual std::string getPlusOptions() const = 0;
+  virtual std::string getTransmissionOptions() const = 0;
+  virtual void
+  createPlusHints(const std::map<std::string, std::string> &hints) = 0;
+  virtual void
+  createTransmissionHints(const std::map<std::string, std::string> &hints) = 0;
   /// Processing
-  /// Returns selected analysis mode
-  virtual std::string getAnalysisMode() const = 0;
-
+  virtual std::string getReductionOptions() const = 0;
+  virtual void
+  createReductionHints(const std::map<std::string, std::string> &hints) = 0;
   /// Post-processing
-  /// Returns selected resolution (dQ/Q)
-  virtual std::string getResolution() const = 0;
+  virtual std::string getStitchOptions() const = 0;
+  virtual void
+  createStitchHints(const std::map<std::string, std::string> &hints) = 0;
 };
 }
 }
diff --git a/MantidQt/CustomInterfaces/inc/MantidQtCustomInterfaces/Reflectometry/QtReflSettingsTabView.h b/MantidQt/CustomInterfaces/inc/MantidQtCustomInterfaces/Reflectometry/QtReflSettingsTabView.h
index 48fda4c618c..2565571f6dd 100644
--- a/MantidQt/CustomInterfaces/inc/MantidQtCustomInterfaces/Reflectometry/QtReflSettingsTabView.h
+++ b/MantidQt/CustomInterfaces/inc/MantidQtCustomInterfaces/Reflectometry/QtReflSettingsTabView.h
@@ -43,10 +43,27 @@ public:
   ~QtReflSettingsTabView() override;
   /// Returns the presenter managing this view
   IReflSettingsTabPresenter *const getPresenter() const;
-  /// Returns selected analysis mode
-  std::string getAnalysisMode() const override;
-  /// Returns selected resolution (dQ/Q)
-  std::string getResolution() const override;
+  /// Returns global options for 'Plus' algorithm
+  std::string getPlusOptions() const;
+  /// Returns global options for 'CreateTransmissionWorkspaceAuto'
+  std::string getTransmissionOptions() const;
+  /// Returns global options for 'ReflectometryReductionOneAuto'
+  std::string getReductionOptions() const;
+  /// Returns global options for 'Stitch1DMany'
+  std::string getStitchOptions() const;
+
+  /// Creates hints for 'Plus'
+  void
+  createPlusHints(const std::map<std::string, std::string> &hints) override;
+  /// Creates hints for 'CreateTransmissionWorkspaceAuto'
+  void createTransmissionHints(
+      const std::map<std::string, std::string> &hints) override;
+  /// Creates hints for 'ReflectometryReductionOneAuto'
+  void createReductionHints(
+      const std::map<std::string, std::string> &hints) override;
+  /// Creates hints for 'Stitch1DMany'
+  void
+  createStitchHints(const std::map<std::string, std::string> &hints) override;
 
 private:
   /// Initialise the interface
diff --git a/MantidQt/CustomInterfaces/inc/MantidQtCustomInterfaces/Reflectometry/ReflMainWindowPresenter.h b/MantidQt/CustomInterfaces/inc/MantidQtCustomInterfaces/Reflectometry/ReflMainWindowPresenter.h
index 43d08a12191..866492b2544 100644
--- a/MantidQt/CustomInterfaces/inc/MantidQtCustomInterfaces/Reflectometry/ReflMainWindowPresenter.h
+++ b/MantidQt/CustomInterfaces/inc/MantidQtCustomInterfaces/Reflectometry/ReflMainWindowPresenter.h
@@ -44,12 +44,14 @@ public:
                           IReflSettingsTabPresenter *settingsPresenter);
   /// Destructor
   ~ReflMainWindowPresenter() override;
-  /// Returns global pre-processing options
-  std::map<std::string, std::string> getPreprocessingOptions() const override;
-  /// Returns global processing options
-  std::string getProcessingOptions() const override;
-  /// Returns global post-processing options
-  std::string getPostprocessingOptions() const override;
+  /// Returns global options for 'Plus' algorithm
+  std::string getPlusOptions() const;
+  /// Returns global options for 'CreateTransmissionWorkspaceAuto'
+  std::string getTransmissionOptions() const;
+  /// Returns global options for 'ReflectometryReductionOneAuto'
+  std::string getReductionOptions() const;
+  /// Returns global options for 'Stitch1DMany'
+  std::string getStitchOptions() const;
   /// Dialog/Prompt methods
   std::string askUserString(const std::string &prompt, const std::string &title,
                             const std::string &defaultValue) override;
diff --git a/MantidQt/CustomInterfaces/inc/MantidQtCustomInterfaces/Reflectometry/ReflSettingsTabPresenter.h b/MantidQt/CustomInterfaces/inc/MantidQtCustomInterfaces/Reflectometry/ReflSettingsTabPresenter.h
index 7492a93287e..a6aef1cd1f4 100644
--- a/MantidQt/CustomInterfaces/inc/MantidQtCustomInterfaces/Reflectometry/ReflSettingsTabPresenter.h
+++ b/MantidQt/CustomInterfaces/inc/MantidQtCustomInterfaces/Reflectometry/ReflSettingsTabPresenter.h
@@ -45,14 +45,21 @@ public:
   /// Accept a main presenter
   void acceptMainPresenter(IReflMainWindowPresenter *mainPresenter) override;
 
-  /// Get global pre-processing options
-  std::map<std::string, std::string> getPreprocessingOptions() const override;
-  /// Get global processing options
-  std::string getProcessingOptions() const override;
-  /// Get global post-processing options
-  std::string getPostprocessingOptions() const override;
-
-protected:
+  /// Returns global options for 'Plus' algorithm
+  std::string getPlusOptions() const;
+  /// Returns global options for 'CreateTransmissionWorkspaceAuto'
+  std::string getTransmissionOptions() const;
+  /// Returns global options for 'ReflectometryReductionOneAuto'
+  std::string getReductionOptions() const;
+  /// Returns global options for 'Stitch1DMany'
+  std::string getStitchOptions() const;
+
+private:
+  void createPlusHints();
+  void createTransmissionHints();
+  void createReductionHints();
+  void createStitchHints();
+
   /// The view we are managing
   IReflSettingsTabView *m_view;
   /// The main presenter
diff --git a/MantidQt/CustomInterfaces/inc/MantidQtCustomInterfaces/Reflectometry/ReflSettingsTabWidget.ui b/MantidQt/CustomInterfaces/inc/MantidQtCustomInterfaces/Reflectometry/ReflSettingsTabWidget.ui
index 748bfc1b6b1..8528d27774e 100644
--- a/MantidQt/CustomInterfaces/inc/MantidQtCustomInterfaces/Reflectometry/ReflSettingsTabWidget.ui
+++ b/MantidQt/CustomInterfaces/inc/MantidQtCustomInterfaces/Reflectometry/ReflSettingsTabWidget.ui
@@ -13,141 +13,118 @@
     <property name="windowTitle">
       <string>Settings Tab</string>
     </property>
-    <layout class="QVBoxLayout" name="settingsMainLayout">
+    <layout class="QGridLayout" name="optionsLayout">
       <property name="margin">
-        <number>5</number>
+        <number>20</number>
       </property>
-      <item>
-        <widget class="QGroupBox" name="expSettingsGroup">
-          <property name="title">
-            <string>Experiment Settings</string>
-          </property>
-          <property name="checkable">
-            <bool>true</bool>
-          </property>
-          <layout class="QGridLayout" name="expSettingsLayout">
-            <property name="margin">
-              <number>10</number>
-            </property>
-            <item row="0" column="0">
-              <widget class="QLabel" name="analysisModeLabel">
-                <property name="text">
-                  <string>Analysis Mode</string>
-                </property>
-              </widget>
-            </item>
-            <item row="0" column="1">
-              <widget class="QComboBox" name="analysisModeComboBox">
-                <item>
-                  <property name="text">
-                    <string>PointDetectorAnalysis</string>
-                  </property>
-                </item>
-                <item>
-                  <property name="text">
-                    <string>MultiDetectorAnalysis</string>
-                  </property>
-                </item>
-              </widget>
-            </item>
-            <item row="0" column="2">
-              <spacer name="instSettingsSpacer">
-                <property name="orientation">
-                  <enum>Qt::Horizontal</enum>
-                </property>
-                <property name="sizeHint" stdset="0">
-                  <size>
-                    <width>40</width>
-                    <height>20</height>
-                  </size>
-                </property>
-              </spacer>
-            </item>
-            <item row="1" column="0">
-              <widget class="QLabel" name="expSettingsCRhoLabel">
-                <property name="text">
-                  <string>CRho</string>
-                </property>
-              </widget>
-            </item>
-            <item row="1" column="1">
-              <widget class="QLineEdit" name="expSettingsCRhoEdit"/>
-            </item>
-            <item row="2" column="0">
-              <widget class="QLabel" name="expSettingsCAlphaLabel">
-                <property name="text">
-                  <string>CAlpha</string>
-                </property>
-              </widget>
-            </item>
-            <item row="2" column="1">
-              <widget class="QLineEdit" name="expSettingsCAlphaEdit"/>
-            </item>
-            <item row="3" column="0">
-              <widget class="QLabel" name="expSettingsCApLabel">
-                <property name="text">
-                  <string>CAp</string>
-                </property>
-              </widget>
-            </item>
-            <item row="3" column="1">
-              <widget class="QLineEdit" name="expSettingsCApEdit"/>
-            </item>
-            <item row="4" column="0">
-              <widget class="QLabel" name="expSettingsCPpLabel">
-                <property name="text">
-                  <string>CPp</string>
-                </property>
-              </widget>
-            </item>
-            <item row="4" column="1">
-              <widget class="QLineEdit" name="expSettingsCPpEdit"/>
-            </item>
-          </layout>
+      <item row ="0" column="0">
+        <widget class="QLabel" name="stageLabel">
+          <property name="text">
+            <string>Stage</string>
+          </property>
+          <property name="font">
+            <font>
+            <weight>75</weight>
+            <bold>true</bold>
+            </font>
+          </property>
+        </widget>
+      </item>
+      <item row ="0" column="1">
+        <widget class="QLabel" name="algorithmLabel">
+          <property name="text">
+            <string>Algorithm</string>
+          </property>
+          <property name="font">
+            <font>
+              <weight>75</weight>
+              <bold>true</bold>
+            </font>
+          </property>
+        </widget>
+      </item>
+      <item row ="0" column="2">
+        <widget class="QLabel" name="optionsLabel">
+          <property name="text">
+            <string>Global Options</string>
+          </property>
+          <property name="font">
+            <font>
+              <weight>75</weight>
+              <bold>true</bold>
+            </font>
+          </property>
         </widget>
       </item>
-      <item>
-        <widget class="QGroupBox" name="instSettingsGroup">
-          <property name="title">
-            <string>Instrument Settings</string>
-          </property>
-          <property name="checkable">
-            <bool>true</bool>
-          </property>
-          <layout class="QGridLayout" name="instSettingsLayout">
-            <property name="margin">
-              <number>10</number>
-            </property>
-            <item row="0" column="0">
-              <widget class="QLabel" name="resolutionLabel">
-                <property name="text">
-                  <string>Resolution (dQ/Q)</string>
-                </property>
-              </widget>
-            </item>
-            <item row="0" column="1">
-              <widget class="QLineEdit" name="resolutionLineEdit">
-                <property name="text">
-                  <string>-0.04</string>
-                </property>
-              </widget>
-            </item>
-            <item row="0" column="2">
-              <spacer name="expSettingsSpacer">
-                <property name="orientation">
-                  <enum>Qt::Horizontal</enum>
-                </property>
-                <property name="sizeHint" stdset="0">
-                  <size>
-                    <width>40</width>
-                    <height>20</height>
-                  </size>
-                </property>
-              </spacer>
-            </item>
-          </layout>
+      <item row="1" column="0">
+        <widget class="QLabel" name="preProcessLabel1">
+          <property name="text">
+            <string>Pre-process</string>
+          </property>
+        </widget>
+      </item>
+      <item row="1" column="1">
+        <widget class="QLabel" name="plusLabel">
+          <property name="text">
+            <string>Plus</string>
+          </property>
         </widget>
       </item>
+      <item row="2" column="0">
+        <widget class="QLabel" name="preProcessLabel2">
+          <property name="text">
+            <string>Pre-process</string>
+          </property>
+        </widget>
+      </item>
+      <item row="2" column="1">
+        <widget class="QLabel" name="transmissionLabel">
+          <property name="text">
+            <string>CreateTransmissionWorkspaceAuto</string>
+          </property>
+        </widget>
+      </item>
+      <item row="3" column="0">
+        <widget class="QLabel" name="processLabel">
+          <property name="text">
+            <string>Process</string>
+          </property>
+        </widget>
+      </item>
+      <item row="3" column="1">
+        <widget class="QLabel" name="reductionLabel">
+          <property name="text">
+            <string>ReflectometryReductionOneAuto</string>
+          </property>
+        </widget>
+      </item>
+      <item row="4" column="0">
+        <widget class="QLabel" name="postProcessLabel">
+          <property name="text">
+            <string>Post-process</string>
+          </property>
+        </widget>
+      </item>
+      <item row="4" column="1">
+        <widget class="QLabel" name="stitchLabel">
+          <property name="text">
+            <string>Stitch1DMany</string>
+          </property>
+        </widget>
+      </item>
+      <item row="5" column="0">
+        <spacer name="verticalSpacer">
+          <property name="orientation">
+            <enum>Qt::Vertical</enum>
+          </property>
+          <property name="sizeHint" stdset="0">
+            <size>
+              <width>40</width>
+              <height>40</height>
+            </size>
+          </property>
+        </spacer>
+      </item>
     </layout>
   </widget>
  <tabstops/>
diff --git a/MantidQt/CustomInterfaces/src/Reflectometry/QtReflMainWindowView.cpp b/MantidQt/CustomInterfaces/src/Reflectometry/QtReflMainWindowView.cpp
index 0496cff2ee1..43399c538f3 100644
--- a/MantidQt/CustomInterfaces/src/Reflectometry/QtReflMainWindowView.cpp
+++ b/MantidQt/CustomInterfaces/src/Reflectometry/QtReflMainWindowView.cpp
@@ -87,9 +87,9 @@ Show an information dialog
 @param title : The text for the title bar of the dialog
 */
 void QtReflMainWindowView::giveUserInfo(std::string prompt, std::string title) {
-	QMessageBox::information(this, QString(title.c_str()),
-		QString(prompt.c_str()), QMessageBox::Ok,
-		QMessageBox::Ok);
+  QMessageBox::information(this, QString(title.c_str()),
+                           QString(prompt.c_str()), QMessageBox::Ok,
+                           QMessageBox::Ok);
 }
 
 /**
diff --git a/MantidQt/CustomInterfaces/src/Reflectometry/QtReflSettingsTabView.cpp b/MantidQt/CustomInterfaces/src/Reflectometry/QtReflSettingsTabView.cpp
index a7b7ef91fd9..a1b2d7ea0ff 100644
--- a/MantidQt/CustomInterfaces/src/Reflectometry/QtReflSettingsTabView.cpp
+++ b/MantidQt/CustomInterfaces/src/Reflectometry/QtReflSettingsTabView.cpp
@@ -1,16 +1,21 @@
 #include "MantidQtCustomInterfaces/Reflectometry/QtReflSettingsTabView.h"
 #include "MantidQtCustomInterfaces/Reflectometry/ReflSettingsTabPresenter.h"
+#include "MantidQtMantidWidgets/HintingLineEdit.h"
 
 namespace MantidQt {
 namespace CustomInterfaces {
 
+using namespace MantidQt::MantidWidgets;
+
 //----------------------------------------------------------------------------------------------
 /** Constructor
 * @param parent :: [input] The parent of this widget
 */
-QtReflSettingsTabView::QtReflSettingsTabView(QWidget *parent): m_presenter(new ReflSettingsTabPresenter(this)) {
+QtReflSettingsTabView::QtReflSettingsTabView(QWidget *parent) {
 
   initLayout();
+
+  m_presenter.reset(new ReflSettingsTabPresenter(this));
 }
 
 //----------------------------------------------------------------------------------------------
@@ -31,20 +36,76 @@ IReflSettingsTabPresenter *const QtReflSettingsTabView::getPresenter() const {
   return m_presenter.get();
 }
 
-/** Retuns the selected analysis mode
-* @return :: Selected analysis mode
+/** Returns global options for 'Plus' algorithm
+* @return :: Global options for 'Plus' algorithm
+*/
+std::string QtReflSettingsTabView::getPlusOptions() const {
+
+  auto widget = m_ui.optionsLayout->itemAtPosition(1, 2)->widget();
+  return static_cast<HintingLineEdit *>(widget)->text().toStdString();
+}
+
+/** Returns global options for 'CreateTransmissionWorkspaceAuto'
+* @return :: Global options for 'CreateTransmissionWorkspaceAuto'
+*/
+std::string QtReflSettingsTabView::getTransmissionOptions() const {
+
+  auto widget = m_ui.optionsLayout->itemAtPosition(2, 2)->widget();
+  return static_cast<HintingLineEdit *>(widget)->text().toStdString();
+}
+
+/** Returns global options for 'ReflectometryReductionOneAuto'
+* @return :: Global options for 'ReflectometryReductionOneAuto'
+*/
+std::string QtReflSettingsTabView::getReductionOptions() const {
+
+  auto widget = m_ui.optionsLayout->itemAtPosition(3, 2)->widget();
+  return static_cast<HintingLineEdit *>(widget)->text().toStdString();
+}
+
+/** Returns global options for 'Stitch1DMany'
+* @return :: Global options for 'Stitch1DMany'
+*/
+std::string QtReflSettingsTabView::getStitchOptions() const {
+
+  auto widget = m_ui.optionsLayout->itemAtPosition(4, 2)->widget();
+  return static_cast<HintingLineEdit *>(widget)->text().toStdString();
+}
+
+/** Creates hints for 'Plus'
+* @param hints :: Hints as a map
+*/
+void QtReflSettingsTabView::createPlusHints(
+    const std::map<std::string, std::string> &hints) {
+
+  m_ui.optionsLayout->addWidget(new HintingLineEdit(this, hints), 1, 2);
+}
+
+/** Creates hints for 'CreateTransmissionWorkspaceAuto'
+* @param hints :: Hints as a map
+*/
+void QtReflSettingsTabView::createTransmissionHints(
+    const std::map<std::string, std::string> &hints) {
+
+  m_ui.optionsLayout->addWidget(new HintingLineEdit(this, hints), 2, 2);
+}
+
+/** Creates hints for 'ReflectometryReductionOneAuto'
+* @param hints :: Hints as a map
 */
-std::string QtReflSettingsTabView::getAnalysisMode() const {
+void QtReflSettingsTabView::createReductionHints(
+    const std::map<std::string, std::string> &hints) {
 
-  return m_ui.analysisModeComboBox->currentText().toStdString();
+  m_ui.optionsLayout->addWidget(new HintingLineEdit(this, hints), 3, 2);
 }
 
-/** Returns selected resolution (dQ/Q)
-* @return :: Resolution as a string
+/** Creates hints for 'Stitch1DMany'
+* @param hints :: Hints as a map
 */
-std::string QtReflSettingsTabView::getResolution() const {
+void QtReflSettingsTabView::createStitchHints(
+    const std::map<std::string, std::string> &hints) {
 
-  return m_ui.resolutionLineEdit->text().toStdString();
+  m_ui.optionsLayout->addWidget(new HintingLineEdit(this, hints), 4, 2);
 }
 
 } // namespace CustomInterfaces
diff --git a/MantidQt/CustomInterfaces/src/Reflectometry/ReflMainWindowPresenter.cpp b/MantidQt/CustomInterfaces/src/Reflectometry/ReflMainWindowPresenter.cpp
index 1eeb131a8c8..09b9e8e846b 100644
--- a/MantidQt/CustomInterfaces/src/Reflectometry/ReflMainWindowPresenter.cpp
+++ b/MantidQt/CustomInterfaces/src/Reflectometry/ReflMainWindowPresenter.cpp
@@ -26,40 +26,50 @@ ReflMainWindowPresenter::ReflMainWindowPresenter(
 */
 ReflMainWindowPresenter::~ReflMainWindowPresenter() {}
 
-/** Returns global pre-processing options
-* @return :: Global pre-processing options
+/** Returns global options for 'Plus' algorithm
+* @return :: Global options for 'Plus' algorithm
 */
-std::map<std::string, std::string>
-ReflMainWindowPresenter::getPreprocessingOptions() const {
+std::string ReflMainWindowPresenter::getPlusOptions() const {
 
-  // Empty map at present
-  // Options to 'CreateTransmissionWorkspaceAuto' are likely to be added
-  // in the future
-  return std::map<std::string, std::string>();
+  if (m_settingsPresenter == nullptr)
+    throw std::runtime_error("Could not read settings");
+
+  return m_settingsPresenter->getPlusOptions();
+}
+
+/** Returns global options for 'CreateTransmissionWorkspaceAuto'
+* @return :: Global options for 'CreateTransmissionWorkspaceAuto'
+*/
+std::string ReflMainWindowPresenter::getTransmissionOptions() const {
+
+  if (m_settingsPresenter == nullptr)
+    throw std::runtime_error("Could not read settings");
+
+  return m_settingsPresenter->getTransmissionOptions();
 }
 
 /** Returns global processing options
 * @return :: Global processing options
 */
-std::string ReflMainWindowPresenter::getProcessingOptions() const {
+std::string ReflMainWindowPresenter::getReductionOptions() const {
 
-	if (m_settingsPresenter == nullptr)
-		throw std::runtime_error("Could not read settings");
+  if (m_settingsPresenter == nullptr)
+    throw std::runtime_error("Could not read settings");
 
   // Request global processing options to 'Settings' presenter
-  return m_settingsPresenter->getProcessingOptions();
+  return m_settingsPresenter->getReductionOptions();
 }
 
 /** Returns global post-processing options
 * @return :: Global post-processing options
 */
-std::string ReflMainWindowPresenter::getPostprocessingOptions() const {
+std::string ReflMainWindowPresenter::getStitchOptions() const {
 
-	if (m_settingsPresenter == nullptr)
-		throw std::runtime_error("Could not read settings");
+  if (m_settingsPresenter == nullptr)
+    throw std::runtime_error("Could not read settings");
 
   // Request global post-processing options to 'Settings' presenter
-  return m_settingsPresenter->getPostprocessingOptions();
+  return m_settingsPresenter->getStitchOptions();
 }
 
 /**
diff --git a/MantidQt/CustomInterfaces/src/Reflectometry/ReflRunsTabPresenter.cpp b/MantidQt/CustomInterfaces/src/Reflectometry/ReflRunsTabPresenter.cpp
index 77f34a322e6..226211a07e8 100644
--- a/MantidQt/CustomInterfaces/src/Reflectometry/ReflRunsTabPresenter.cpp
+++ b/MantidQt/CustomInterfaces/src/Reflectometry/ReflRunsTabPresenter.cpp
@@ -334,7 +334,13 @@ void ReflRunsTabPresenter::notify(DataProcessorMainPresenter::Flag flag) {
 */
 std::map<std::string, std::string>
 ReflRunsTabPresenter::getPreprocessingOptions() const {
-  return m_mainPresenter->getPreprocessingOptions();
+
+  std::map<std::string, std::string> options;
+  options["Plus"] = m_mainPresenter->getPlusOptions();
+  options["CreateTransmissionWorkspaceAuto"] =
+      m_mainPresenter->getTransmissionOptions();
+
+  return options;
 }
 
 /** Requests global pre-processing options. Options are supplied by the main
@@ -342,7 +348,7 @@ ReflRunsTabPresenter::getPreprocessingOptions() const {
 * @return :: Global pre-processing options
 */
 std::string ReflRunsTabPresenter::getProcessingOptions() const {
-  return m_mainPresenter->getProcessingOptions();
+	return m_mainPresenter->getReductionOptions();
 }
 
 /** Requests global pre-processing options. Options are supplied by the main
@@ -350,7 +356,7 @@ std::string ReflRunsTabPresenter::getProcessingOptions() const {
 * @return :: Global pre-processing options
 */
 std::string ReflRunsTabPresenter::getPostprocessingOptions() const {
-  return m_mainPresenter->getPostprocessingOptions();
+	return m_mainPresenter->getStitchOptions();
 }
 
 /**
diff --git a/MantidQt/CustomInterfaces/src/Reflectometry/ReflSettingsTabPresenter.cpp b/MantidQt/CustomInterfaces/src/Reflectometry/ReflSettingsTabPresenter.cpp
index bba464ae6f8..dc86ad52019 100644
--- a/MantidQt/CustomInterfaces/src/Reflectometry/ReflSettingsTabPresenter.cpp
+++ b/MantidQt/CustomInterfaces/src/Reflectometry/ReflSettingsTabPresenter.cpp
@@ -1,17 +1,29 @@
 #include "MantidQtCustomInterfaces/Reflectometry/ReflSettingsTabPresenter.h"
+#include "MantidAPI/AlgorithmManager.h"
 #include "MantidQtCustomInterfaces/Reflectometry/IReflMainWindowPresenter.h"
 #include "MantidQtCustomInterfaces/Reflectometry/IReflSettingsTabView.h"
+#include "MantidQtMantidWidgets/AlgorithmHintStrategy.h"
 
 #include <boost/algorithm/string.hpp>
 
 namespace MantidQt {
 namespace CustomInterfaces {
 
+using namespace Mantid::API;
+using namespace MantidQt::MantidWidgets;
+
 /** Constructor
 * @param view :: The view we are handling
 */
 ReflSettingsTabPresenter::ReflSettingsTabPresenter(IReflSettingsTabView *view)
-    : m_view(view), m_mainPresenter() {}
+    : m_view(view), m_mainPresenter() {
+
+  // Create the 'HintingLineEdits'
+  createPlusHints();
+  createTransmissionHints();
+  createReductionHints();
+  createStitchHints();
+}
 
 /** Destructor
 */
@@ -25,41 +37,103 @@ void ReflSettingsTabPresenter::acceptMainPresenter(
   m_mainPresenter = mainPresenter;
 }
 
-/** Get global pre-processing options
-* @return :: Pre-processing options as a map where keys are column names that
-* need pre-processing and values pre-processing options
+/** Returns global options for 'Plus' algorithm
+* @return :: Global options for 'Plus' algorithm
+*/
+std::string ReflSettingsTabPresenter::getPlusOptions() const {
+
+  return m_view->getPlusOptions();
+}
+
+/** Returns global options for 'CreateTransmissionWorkspaceAuto'
+* @return :: Global options for 'CreateTransmissionWorkspaceAuto'
 */
-std::map<std::string, std::string>
-ReflSettingsTabPresenter::getPreprocessingOptions() const {
+std::string ReflSettingsTabPresenter::getTransmissionOptions() const {
 
-  // For the moment, return emtpy map
-  return std::map<std::string, std::string>();
+  return m_view->getTransmissionOptions();
 }
 
-/** Get global processing options
-* @return :: Processing options as a string
+/** Returns global options for 'ReflectometryReductionOneAuto'
+* @return :: Global options for 'ReflectometryReductionOneAuto'
 */
-std::string ReflSettingsTabPresenter::getProcessingOptions() const {
+std::string ReflSettingsTabPresenter::getReductionOptions() const {
 
-  std::vector<std::string> options;
+  return m_view->getReductionOptions();
+}
 
-  // Analysis mode
-  options.push_back("AnalysisMode=" + m_view->getAnalysisMode());
+/** Returns global options for 'Stitch1DMany'
+* @return :: Global options for 'Stitch1DMany'
+*/
+std::string ReflSettingsTabPresenter::getStitchOptions() const {
 
-  return boost::algorithm::join(options, ",");
+  return m_view->getStitchOptions();
 }
 
-/** Get global post-processing options
-* @return :: Post-processing options as a string
+/** Creates hints for 'Plus'
 */
-std::string ReflSettingsTabPresenter::getPostprocessingOptions() const {
+void ReflSettingsTabPresenter::createPlusHints() {
+
+  // The algorithm
+  IAlgorithm_sptr alg = AlgorithmManager::Instance().create("Plus");
+  // The blacklist
+  std::set<std::string> blacklist = {"LHSWorkspace", "RHSWorkspace",
+                                     "OutputWorkspace"};
+  AlgorithmHintStrategy strategy(alg, blacklist);
+
+  m_view->createPlusHints(strategy.createHints());
+}
 
-  std::vector<std::string> options;
+/** Creates hints for 'CreateTransmissionWorkspaceAuto'
+*/
+void ReflSettingsTabPresenter::createTransmissionHints() {
+
+  // The algorithm
+  IAlgorithm_sptr alg =
+      AlgorithmManager::Instance().create("CreateTransmissionWorkspaceAuto");
+  // The blacklist
+  std::set<std::string> blacklist = {
+      "FirstTransmissionRun", "SecondTransmissionRun", "OutputWorkspace"};
+  AlgorithmHintStrategy strategy(alg, blacklist);
+
+  m_view->createTransmissionHints(strategy.createHints());
+}
+
+/** Creates hints for 'ReflectometryReductionOneAuto'
+*/
+void ReflSettingsTabPresenter::createReductionHints() {
+
+  // The algorithm
+  IAlgorithm_sptr alg =
+      AlgorithmManager::Instance().create("ReflectometryReductionOneAuto");
+  // The blacklist
+  std::set<std::string> blacklist = {"ThetaIn",
+                                     "ThetaOut",
+                                     "InputWorkspace",
+                                     "OutputWorkspace",
+                                     "OutputWorkspaceWavelength",
+                                     "FirstTransmissionRun",
+                                     "SecondTransmissionRun",
+                                     "MomentumTransferMinimum",
+                                     "MomentumTransferMaximum",
+                                     "MomentumTransferStep",
+                                     "ScaleFactor"};
+  AlgorithmHintStrategy strategy(alg, blacklist);
+
+  m_view->createReductionHints(strategy.createHints());
+}
+
+/** Creates hints for 'Stitch1DMany'
+*/
+void ReflSettingsTabPresenter::createStitchHints() {
 
-  // Resolution (dQ/Q)
-  options.push_back("Params=\"" + m_view->getResolution());
+  // The algorithm
+  IAlgorithm_sptr alg = AlgorithmManager::Instance().create("Stitch1DMany");
+  // The blacklist
+  std::set<std::string> blacklist = {"InputWorkspaces", "OutputWorkspace",
+                                     "OutputWorkspace"};
+  AlgorithmHintStrategy strategy(alg, blacklist);
 
-  return boost::algorithm::join(options, ",");
+  m_view->createStitchHints(strategy.createHints());
 }
 }
 }
\ No newline at end of file
-- 
GitLab