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
8b174de4
Commit
8b174de4
authored
Jan 22, 2016
by
Anton Piccardo-Selg
Browse files
Refs #10677 Add more button logic
parent
9de58fb2
Changes
2
Hide whitespace changes
Inline
Side-by-side
MantidQt/CustomInterfaces/inc/MantidQtCustomInterfaces/SANSRunWindow.h
View file @
8b174de4
...
...
@@ -316,6 +316,7 @@ private slots:
/// Handle a change of the aperture geometry for QResolution
void
handleQResolutionApertureChange
(
int
aperture
);
private:
/// used to specify the range of validation to do
enum
ValCheck
{
...
...
@@ -497,6 +498,10 @@ private:
bool
hasUserFileValidFileExtension
();
/// Check if the user file is valid
bool
isValidUserFile
();
/// Disable controls when user file is being loaded
void
userFileLoadingBegin
();
/// Enable controls when user file has finished loading
void
userFileLoadingEnd
();
UserSubWindow
*
slicingWindow
;
};
...
...
MantidQt/CustomInterfaces/src/SANSRunWindow.cpp
View file @
8b174de4
...
...
@@ -211,13 +211,9 @@ void SANSRunWindow::initLayout() {
connectButtonSignals
();
m_uiForm
.
tabWidget
->
setCurrentWidget
(
m_uiForm
.
runNumbers
);
// Disable most things so that load is the only thing that can be done
m_uiForm
.
oneDBtn
->
setEnabled
(
false
);
m_uiForm
.
twoDBtn
->
setEnabled
(
false
);
m_uiForm
.
saveDefault_btn
->
setEnabled
(
false
);
for
(
int
i
=
1
;
i
<
4
;
++
i
)
{
m_uiForm
.
tabWidget
->
setTabEnabled
(
i
,
false
);
}
userFileLoadingBegin
();
// Mode switches
connect
(
m_uiForm
.
single_mode_btn
,
SIGNAL
(
clicked
()),
this
,
...
...
@@ -783,6 +779,11 @@ bool SANSRunWindow::loadUserFile() {
m_uiForm
.
mask_table
->
removeRow
(
i
);
}
// Disable some settings on the GUI such that the user cannot press
// a Reduce button while the user file is loading
userFileLoadingBegin
();
QString
pyCode
=
"i.Clean()"
;
pyCode
+=
"
\n
i."
+
getInstrumentClass
();
pyCode
+=
"
\n
i.ReductionSingleton().user_settings ="
;
...
...
@@ -812,6 +813,7 @@ bool SANSRunWindow::loadUserFile() {
return
false
;
}
const
auto
settings
=
getReductionSettings
();
const
double
unit_conv
(
1000.
);
...
...
@@ -1059,9 +1061,9 @@ bool SANSRunWindow::loadUserFile() {
m_cfg_loaded
=
true
;
emit
userfileLoaded
();
m_uiForm
.
tabWidget
->
setTabEnabled
(
1
,
true
);
m_uiForm
.
tabWidget
->
setTabEnabled
(
2
,
true
);
m_uiForm
.
tabWidget
->
setTabEnabled
(
3
,
true
);
// Enable buttons and tabs
userFileLoadingEnd
(
);
return
true
;
}
...
...
@@ -4920,6 +4922,32 @@ bool SANSRunWindow::isValidUserFile() {
return
true
;
}
/**
* Disable controls when the user file beings to load
*/
void
SANSRunWindow
::
userFileLoadingBegin
()
{
// Disable the reduction and save buttons on the first tab
m_uiForm
.
oneDBtn
->
setEnabled
(
false
);
m_uiForm
.
twoDBtn
->
setEnabled
(
false
);
m_uiForm
.
saveDefault_btn
->
setEnabled
(
false
);
for
(
int
i
=
1
;
i
<
4
;
++
i
)
{
m_uiForm
.
tabWidget
->
setTabEnabled
(
i
,
false
);
}
}
/**
* Enable controls when the user file has loaded
*/
void
SANSRunWindow
::
userFileLoadingEnd
()
{
// Enable the reduction and save buttons on the first tab
m_uiForm
.
oneDBtn
->
setEnabled
(
true
);
m_uiForm
.
twoDBtn
->
setEnabled
(
true
);
m_uiForm
.
saveDefault_btn
->
setEnabled
(
true
);
for
(
int
i
=
1
;
i
<
4
;
++
i
)
{
m_uiForm
.
tabWidget
->
setTabEnabled
(
i
,
true
);
}
}
}
// namespace CustomInterfaces
}
// namespace MantidQt
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