From 012ee1bb5dbbdb3b17c703ba9d3349b0200dd348 Mon Sep 17 00:00:00 2001
From: Pete Peterson <petersonpf@ornl.gov>
Date: Wed, 27 May 2015 14:26:31 -0400
Subject: [PATCH] Refs #11807. Adding convenience methods to InterfaceManager
 for help.

---
 .../API/inc/MantidQtAPI/InterfaceManager.h    | 20 ++++++++++++
 .../MantidQt/API/src/InterfaceManager.cpp     | 31 +++++++++++++++++++
 2 files changed, 51 insertions(+)

diff --git a/Code/Mantid/MantidQt/API/inc/MantidQtAPI/InterfaceManager.h b/Code/Mantid/MantidQt/API/inc/MantidQtAPI/InterfaceManager.h
index d864c1f1fa6..b86e753ec4f 100644
--- a/Code/Mantid/MantidQt/API/inc/MantidQtAPI/InterfaceManager.h
+++ b/Code/Mantid/MantidQt/API/inc/MantidQtAPI/InterfaceManager.h
@@ -109,6 +109,26 @@ public:
    * @return the help window
    */
   MantidHelpInterface *createHelpWindow() const;
+
+  /// @param url Relative URL of help page to show.
+  void showHelpPage(const QString &url = QString());
+
+  /// @param page Wiki page to show help for
+  void showWikiPage(const QString &page = QString());
+
+  /// @param name of algorithm to show help for
+  /// @param version of algorithm
+  void showAlgorithmHelp(const QString &name, const int version = -1);
+
+  /// @param name of concept to show help for
+  void showConceptHelp(const QString &name);
+
+  /// @param name of fit function to show help for
+  void showFitFunctionHelp(const QString &name = QString());
+
+  /// @param name of interface to show help for
+  void showCustomInterfaceHelp(const QString &name);
+
   /**
    * Registration function for the help window factory.
    * @param factory the factory instance
diff --git a/Code/Mantid/MantidQt/API/src/InterfaceManager.cpp b/Code/Mantid/MantidQt/API/src/InterfaceManager.cpp
index 45047ac64bc..9bba267c27d 100644
--- a/Code/Mantid/MantidQt/API/src/InterfaceManager.cpp
+++ b/Code/Mantid/MantidQt/API/src/InterfaceManager.cpp
@@ -245,3 +245,34 @@ MantidHelpInterface *InterfaceManager::createHelpWindow() const
     return interface;
   }
 }
+
+void InterfaceManager::showHelpPage(const QString &url) {
+  auto window = createHelpWindow();
+  window->showPage(url);
+}
+
+void InterfaceManager::showWikiPage(const QString &page) {
+  auto window = createHelpWindow();
+  window->showWikiPage(page);
+}
+
+void InterfaceManager::showAlgorithmHelp(const QString &name,
+                                         const int version) {
+  auto window = createHelpWindow();
+  window->showAlgorithm(name, version);
+}
+
+void InterfaceManager::showConceptHelp(const QString &name) {
+  auto window = createHelpWindow();
+  window->showConcept(name);
+}
+
+void InterfaceManager::showFitFunctionHelp(const QString &name) {
+  auto window = createHelpWindow();
+  window->showFitFunction(name);
+}
+
+void InterfaceManager::showCustomInterfaceHelp(const QString &name) {
+  auto window = createHelpWindow();
+  window->showCustomInterface(name);
+}
-- 
GitLab