Commit c7539143 authored by Peterson, Peter's avatar Peterson, Peter
Browse files

Add area to list of arguments

parent 29d1cda2
......@@ -328,7 +328,7 @@ public:
void showAlgorithmHelp(const QString &name, const int version=-1);
void showConceptHelp(const QString &name);
void showFitFunctionHelp(const QString &name=QString());
void showCustomInterfaceHelp(const QString &name);
void showCustomInterfaceHelp(const QString &name, const QString &area=QString(), const QString &section=QString());
void showWebPage(const QString &url);
void closeHelpWindow();
};
......
......@@ -394,7 +394,8 @@ void MuonAnalysis::muonAnalysisHelpClicked() {
*/
void MuonAnalysis::muonAnalysisHelpGroupingClicked() {
MantidQt::API::HelpWindow::showCustomInterface(
nullptr, QString("Muon Analysis"), QString("grouping-options"));
nullptr, QString("Muon Analysis"), QString(""),
QString("grouping-options"));
}
/**
......
......@@ -151,7 +151,7 @@ void MuonAnalysisOptionTab::initLayout() {
*/
void MuonAnalysisOptionTab::muonAnalysisHelpSettingsClicked() {
MantidQt::API::HelpWindow::showCustomInterface(
nullptr, QString("Muon Analysis"), QString("settings"));
nullptr, QString("Muon Analysis"), QString(""), QString("settings"));
}
/*
......@@ -159,7 +159,7 @@ void MuonAnalysisOptionTab::muonAnalysisHelpSettingsClicked() {
*/
void MuonAnalysisOptionTab::rebinHelpClicked() {
MantidQt::API::HelpWindow::showCustomInterface(
nullptr, QString("Muon Analysis"), QString("data-binning"));
nullptr, QString("Muon Analysis"), QString(""), QString("data-binning"));
}
/**
......
......@@ -102,7 +102,7 @@ MuonAnalysisResultTableTab::MuonAnalysisResultTableTab(Ui::MuonAnalysis &uiForm)
*/
void MuonAnalysisResultTableTab::helpResultsClicked() {
MantidQt::API::HelpWindow::showCustomInterface(
nullptr, QString("Muon Analysis"), QString("results-table"));
nullptr, QString("Muon Analysis"), QString(""), QString("results-table"));
}
/**
......
......@@ -33,10 +33,12 @@ public:
static void showFitFunction(QWidget *parent,
const std::string &name = std::string());
static void showCustomInterface(QWidget *parent, const QString &name,
const QString &area = QString(),
const QString &section = QString());
static void showCustomInterface(QWidget *parent,
const std::string &name = std::string(),
const std::string &area = std::string(),
const std::string &section = std::string());
};
} // namespace API
} // namespace MantidQt
\ No newline at end of file
} // namespace MantidQt
......@@ -101,7 +101,9 @@ public:
void showFitFunctionHelp(const QString &name = QString());
/// @param name of interface to show help for
void showCustomInterfaceHelp(const QString &name);
void showCustomInterfaceHelp(const QString &name,
const QString &area = QString(),
const QString &section = QString());
/// @param url of web page to open in browser
void showWebPage(const QString &url);
......
......@@ -40,8 +40,10 @@ public:
virtual void showFitFunction(const std::string &name = std::string());
virtual void showFitFunction(const QString &name);
virtual void showCustomInterface(const std::string &name,
const std::string &area = std::string(),
const std::string &section = std::string());
virtual void showCustomInterface(const QString &name,
const QString &area = QString(),
const QString &section = QString());
public slots:
......
......@@ -44,8 +44,9 @@ public:
void showFitFunction(const std::string &name = std::string()) override;
void showFitFunction(const QString &name) override;
void showCustomInterface(const std::string &name = std::string(),
const std::string &area = std::string(),
const std::string &section = std::string()) override;
void showCustomInterface(const QString &name,
void showCustomInterface(const QString &name, const QString &area = QString(),
const QString &section = QString()) override;
private:
......@@ -73,4 +74,4 @@ public slots:
};
} // namespace MantidWidgets
} // namespace MantidQt
\ No newline at end of file
} // namespace MantidQt
......@@ -117,12 +117,15 @@ void HelpWindow::showFitFunction(QWidget *parent, const std::string &name) {
}
void HelpWindow::showCustomInterface(QWidget *parent, const std::string &name,
const std::string &area,
const std::string &section) {
showCustomInterface(parent, QString::fromStdString(name),
QString::fromStdString(area),
QString::fromStdString(section));
}
void HelpWindow::showCustomInterface(QWidget *parent, const QString &name,
const QString &area,
const QString &section) {
InterfaceManager interfaceManager;
MantidHelpInterface *gui = interfaceManager.createHelpWindow();
......@@ -132,6 +135,9 @@ void HelpWindow::showCustomInterface(QWidget *parent, const QString &name,
} else {
// Open online help
QString baseUrl = "https://docs.mantidproject.org/interfaces/";
if (!area.toStdString().empty()) {
baseUrl += area + "/";
}
QString url = baseUrl + name + ".html";
MantidDesktopServices::openUrl(QUrl(url));
g_log.debug("Opening online help page:\n" + url.toStdString());
......
......@@ -283,9 +283,11 @@ void InterfaceManager::showFitFunctionHelp(const QString &name) {
window->showFitFunction(name);
}
void InterfaceManager::showCustomInterfaceHelp(const QString &name) {
void InterfaceManager::showCustomInterfaceHelp(const QString &name,
const QString &area,
const QString &section) {
auto window = createHelpWindow();
window->showCustomInterface(name);
window->showCustomInterface(name, area, section);
}
void InterfaceManager::showWebPage(const QString &url) {
......
......@@ -56,14 +56,18 @@ void MantidHelpInterface::showFitFunction(const QString &name) {
}
void MantidHelpInterface::showCustomInterface(const std::string &name,
const std::string &area,
const std::string &section) {
UNUSED_ARG(name);
UNUSED_ARG(area);
UNUSED_ARG(section);
}
void MantidHelpInterface::showCustomInterface(const QString &name,
const QString &area,
const QString &section) {
UNUSED_ARG(name);
UNUSED_ARG(area);
UNUSED_ARG(section);
}
......
......@@ -325,8 +325,10 @@ void MantidHelpWindow::showFitFunction(const QString &name) {
* @param section :: the section of the interface to show
*/
void MantidHelpWindow::showCustomInterface(const QString &name,
const QString &area,
const QString &section) {
this->showCustomInterface(name.toStdString(), section.toStdString());
this->showCustomInterface(name.toStdString(), area.toStdString(),
section.toStdString());
}
/**
......@@ -336,10 +338,14 @@ void MantidHelpWindow::showCustomInterface(const QString &name,
* @param section :: the section of the interface to show
*/
void MantidHelpWindow::showCustomInterface(const std::string &name,
const std::string &area,
const std::string &section) {
if (bool(g_helpWindow)) {
QString url(BASE_URL);
url += "interfaces/";
if (!area.empty()) {
url += QString::fromStdString(area) + "/";
}
if (name.empty()) {
url += "index.html";
} else {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment