Commit ac091a0e authored by Savici, Andrei T's avatar Savici, Andrei T Committed by Peterson, Peter
Browse files

Port all interfaces to new convention

parent c7539143
......@@ -84,7 +84,7 @@ def __get_collection_file(collection_file: str) -> str:
return os.path.abspath(collection_file)
def show_interface_help(mantidplot_name, assistant_process, section: str='',
def show_interface_help(mantidplot_name, assistant_process, area: str='',
collection_file: str='',
qt_url: str='', external_url: str=""):
''' Shows the help page for a custom interface
......@@ -117,7 +117,7 @@ def show_interface_help(mantidplot_name, assistant_process, section: str='',
try:
# try using built-in help in mantid
import mantidqt
mantidqt.interfacemanager.InterfaceManager().showCustomInterfaceHelp(mantidplot_name, section)
mantidqt.interfacemanager.InterfaceManager().showCustomInterfaceHelp(mantidplot_name, area)
except: #(ImportError, ModuleNotFoundError) raises the wrong type of error
# built-in help failed, try external qtassistant then give up and launch a browser
......
......@@ -22,7 +22,7 @@ ALFCustomInstrumentView::ALFCustomInstrumentView(const std::string &instrument,
m_extractSingleTubeObservable(nullptr), m_averageTubeObservable(nullptr),
m_extractAction(nullptr), m_averageAction(nullptr),
m_analysisPane(nullptr) {
m_helpPage = "ALF View";
m_helpPage = "direct/ALF View";
}
void ALFCustomInstrumentView::setUpInstrument(
......
......@@ -1101,7 +1101,7 @@ void EnggDiffractionViewQtGUI::closeEvent(QCloseEvent *event) {
void EnggDiffractionViewQtGUI::openHelpWin() {
MantidQt::API::HelpWindow::showCustomInterface(
nullptr, QString("Engineering Diffraction"));
nullptr, QString("Engineering Diffraction"), QString("diffraction"));
}
void EnggDiffractionViewQtGUI::updateTabsInstrument(
......
......@@ -507,7 +507,7 @@ void MantidEV::setDefaultState_slot() {
*/
void MantidEV::help_slot() {
MantidQt::API::HelpWindow::showCustomInterface(
nullptr, QString("SCD Event Data Reduction"));
nullptr, QString("SCD Event Data Reduction"), QString("diffraction"));
}
/**
......
......@@ -55,7 +55,7 @@ void SampleTransmission::initLayout() {
*/
void SampleTransmission::showHelp() {
MantidQt::API::HelpWindow::showCustomInterface(
nullptr, QString("Sample Transmission Calculator"));
nullptr, QString("Sample Transmission Calculator"), QString("general"));
}
/**
......
......@@ -306,8 +306,7 @@ void MainWindowPresenter::initNewBatch(IBatchPresenter *batchPresenter,
}
void MainWindowPresenter::showHelp() {
MantidQt::API::HelpWindow::showCustomInterface(nullptr,
QString("ISIS Reflectometry"));
MantidQt::API::HelpWindow::showCustomInterface(nullptr,std::string("ISIS Reflectometry"), std::string("reflectometry"));
}
void MainWindowPresenter::notifySaveBatchRequested(int tabIndex) {
......
......@@ -25,7 +25,7 @@ IndirectInterface::IndirectInterface(QWidget *parent)
void IndirectInterface::help() {
HelpWindow::showCustomInterface(nullptr,
QString::fromStdString(documentationPage()));
QString::fromStdString(documentationPage()),QString("indirect"));
}
void IndirectInterface::settings() {
......
......@@ -32,7 +32,7 @@ void IndirectSettingsView::emitCancelClicked() { emit cancelClicked(); }
void IndirectSettingsView::openHelp() {
MantidQt::API::HelpWindow::showCustomInterface(nullptr,
QString("Indirect Settings"));
QString("Indirect Settings"), QString("indirect"));
}
void IndirectSettingsView::setSelectedFacility(QString const &text) {
......
......@@ -226,7 +226,7 @@ void ALCBaselineModellingView::setSelectorValues(
}
void ALCBaselineModellingView::help() {
MantidQt::API::HelpWindow::showCustomInterface(nullptr, QString("Muon ALC"));
MantidQt::API::HelpWindow::showCustomInterface(nullptr, QString("Muon ALC"), QString("muon"));
}
void ALCBaselineModellingView::emitFitRequested() { emit fitRequested(); }
......
......@@ -316,7 +316,7 @@ void ALCDataLoadingView::setTimeRange(double tMin, double tMax) {
}
void ALCDataLoadingView::help() {
MantidQt::API::HelpWindow::showCustomInterface(nullptr, QString("Muon ALC"));
MantidQt::API::HelpWindow::showCustomInterface(nullptr, QString("Muon ALC"), QString("muon"));
}
void ALCDataLoadingView::disableAll() {
......
......@@ -124,7 +124,7 @@ void ALCPeakFittingView::setPeakPicker(const IPeakFunction_const_sptr &peak) {
}
void ALCPeakFittingView::help() {
MantidQt::API::HelpWindow::showCustomInterface(nullptr, QString("Muon ALC"));
MantidQt::API::HelpWindow::showCustomInterface(nullptr, QString("Muon ALC"), QString("muon"));
}
void ALCPeakFittingView::displayError(const QString &message) {
......
......@@ -386,7 +386,7 @@ void MuonAnalysis::setChosenGroupAndPeriods(const QString &wsName) {
*/
void MuonAnalysis::muonAnalysisHelpClicked() {
MantidQt::API::HelpWindow::showCustomInterface(nullptr,
QString("Muon Analysis"));
QString("Muon Analysis"), QString("muon"));
}
/**
......@@ -394,7 +394,7 @@ void MuonAnalysis::muonAnalysisHelpClicked() {
*/
void MuonAnalysis::muonAnalysisHelpGroupingClicked() {
MantidQt::API::HelpWindow::showCustomInterface(
nullptr, QString("Muon Analysis"), QString(""),
nullptr, QString("Muon Analysis"), QString("muon"),
QString("grouping-options"));
}
......
......@@ -37,7 +37,7 @@ void MuonAnalysisFitDataTab::init() {
*/
void MuonAnalysisFitDataTab::muonAnalysisHelpDataAnalysisClicked() {
MantidQt::API::HelpWindow::showCustomInterface(
nullptr, QString("Muon Analysis"), QString("data-analysis"));
nullptr, QString("Muon Analysis"), QString("muon"), QString("data-analysis"));
}
/**
......
......@@ -131,7 +131,7 @@ void HelpWindow::showCustomInterface(QWidget *parent, const QString &name,
MantidHelpInterface *gui = interfaceManager.createHelpWindow();
if (gui) {
connectParent(gui, parent);
gui->showCustomInterface(name, section);
gui->showCustomInterface(name, area, section);
} else {
// Open online help
QString baseUrl = "https://docs.mantidproject.org/interfaces/";
......
......@@ -245,7 +245,7 @@ QListWidget *ManageUserDirectories::listWidget(QObject *sender) {
/// Show the help for ManageUserDirectories
void ManageUserDirectories::helpClicked() {
HelpWindow::showCustomInterface(nullptr, HELP_ID);
HelpWindow::showCustomInterface(nullptr, HELP_ID, "framework");
}
/// Close the dialog without saving the configuration
......
......@@ -154,7 +154,7 @@ class DGSPlannerGUI(QtWidgets.QWidget):
self.masterDict.update(copy.deepcopy(d))
def help(self):
show_interface_help(self.mantidplot_name, self.assistant_process, section='direct')
show_interface_help(self.mantidplot_name, self.assistant_process, area='direct')
def closeEvent(self, event):
self.assistant_process.close()
......
......@@ -142,7 +142,7 @@ class EngineeringDiffractionGui(QtWidgets.QMainWindow, Ui_main_window):
self.comboBox_instrument.currentIndexChanged.connect(slot)
def open_help_window(self):
InterfaceManager().showCustomInterfaceHelp(self.doc)
InterfaceManager().showCustomInterfaceHelp(self.doc,'diffraction')
def open_settings(self):
self.settings_presenter.show()
......
......@@ -1070,7 +1070,7 @@ class MainWindow(QMainWindow):
def helpClicked(self):
try:
import mantidqt
mantidqt.interfacemanager.InterfaceManager().showCustomInterfaceHelp("Filter Events")
mantidqt.interfacemanager.InterfaceManager().showCustomInterfaceHelp("Filter Events","utility")
except ImportError:
url = ("http://docs.mantidproject.org/nightly/interfaces/{}.html"
"".format("Filter Events"))
......
......@@ -140,6 +140,9 @@ class DrillView(QMainWindow):
super(DrillView, self).__init__(None, Qt.Window)
self.here = os.path.dirname(os.path.realpath(__file__))
# help
self.assistant_process = QProcess(self)
# setup ui
uic.loadUi(os.path.join(self.here, 'ui/main.ui'), self)
self.setup_header()
......@@ -254,6 +257,8 @@ class DrillView(QMainWindow):
Args:
event (QCloseEvent): the close event
"""
self.assistant_process.close()
self.assistant_process.waitForFinished()
children = self.findChildren(QDialog)
for child in children:
child.close()
......@@ -421,8 +426,8 @@ class DrillView(QMainWindow):
"""
Popup the help window.
"""
InterfaceManager().showHelpPage(
"qthelp://org.mantidproject/doc/interfaces/DrILL.html")
from mantidqt.gui_helper import show_interface_help
show_interface_help("DrILL",self.assistant_process,area="ILL")
def automatic_filling(self):
"""
......
......@@ -98,7 +98,7 @@ class SANSSaveOtherDialog(QtWidgets.QDialog, Ui_SaveOtherDialog):
def _on_help_button_clicked(self):
try:
import mantidqt
mantidqt.interfacemanager.InterfaceManager().showCustomInterfaceHelp('sans_save_other')
mantidqt.interfacemanager.InterfaceManager().showCustomInterfaceHelp('sans_save_other','isis_sans')
except:
pass
......
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