Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
mantidproject
mantid
Commits
ac091a0e
Commit
ac091a0e
authored
Mar 02, 2021
by
Savici, Andrei T
Committed by
Peterson, Peter
Mar 03, 2021
Browse files
Port all interfaces to new convention
parent
c7539143
Changes
25
Hide whitespace changes
Inline
Side-by-side
qt/python/mantidqt/gui_helper.py
View file @
ac091a0e
...
...
@@ -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
...
...
qt/scientific_interfaces/Direct/ALFCustomInstrumentView.cpp
View file @
ac091a0e
...
...
@@ -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
(
...
...
@@ -97,4 +97,4 @@ void ALFCustomInstrumentView::addSpectrum(const std::string &wsName) {
}
}
// namespace CustomInterfaces
}
// namespace MantidQt
\ No newline at end of file
}
// namespace MantidQt
qt/scientific_interfaces/EnggDiffraction/EnggDiffractionViewQtGUI.cpp
View file @
ac091a0e
...
...
@@ -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
(
...
...
qt/scientific_interfaces/General/MantidEV.cpp
View file @
ac091a0e
...
...
@@ -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"
)
);
}
/**
...
...
qt/scientific_interfaces/General/SampleTransmission.cpp
View file @
ac091a0e
...
...
@@ -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"
)
);
}
/**
...
...
qt/scientific_interfaces/ISISReflectometry/GUI/MainWindow/MainWindowPresenter.cpp
View file @
ac091a0e
...
...
@@ -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
)
{
...
...
qt/scientific_interfaces/Indirect/IndirectInterface.cpp
View file @
ac091a0e
...
...
@@ -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
()
{
...
...
qt/scientific_interfaces/Indirect/IndirectSettingsView.cpp
View file @
ac091a0e
...
...
@@ -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
)
{
...
...
qt/scientific_interfaces/Muon/ALCBaselineModellingView.cpp
View file @
ac091a0e
...
...
@@ -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
();
}
...
...
qt/scientific_interfaces/Muon/ALCDataLoadingView.cpp
View file @
ac091a0e
...
...
@@ -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
()
{
...
...
qt/scientific_interfaces/Muon/ALCPeakFittingView.cpp
View file @
ac091a0e
...
...
@@ -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
)
{
...
...
qt/scientific_interfaces/Muon/MuonAnalysis.cpp
View file @
ac091a0e
...
...
@@ -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"
));
}
...
...
qt/scientific_interfaces/Muon/MuonAnalysisFitDataTab.cpp
View file @
ac091a0e
...
...
@@ -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"
));
}
/**
...
...
qt/widgets/common/src/HelpWindow.cpp
View file @
ac091a0e
...
...
@@ -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/"
;
...
...
qt/widgets/common/src/ManageUserDirectories.cpp
View file @
ac091a0e
...
...
@@ -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
...
...
scripts/DGSPlanner/DGSPlannerGUI.py
View file @
ac091a0e
...
...
@@ -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
()
...
...
scripts/Engineering/gui/engineering_diffraction/engineering_diffraction.py
View file @
ac091a0e
...
...
@@ -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
()
...
...
scripts/FilterEvents/eventFilterGUI.py
View file @
ac091a0e
...
...
@@ -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"
))
...
...
scripts/Interface/ui/drill/view/DrillView.py
View file @
ac091a0e
...
...
@@ -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
):
"""
...
...
scripts/Interface/ui/sans_isis/SANSSaveOtherWindow.py
View file @
ac091a0e
...
...
@@ -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
...
...
Prev
1
2
Next
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment