Skip to content

Commit

Permalink
Refs #8816 longer interface and enable parameters by default
Browse files Browse the repository at this point in the history
  • Loading branch information
VickieLynch committed Feb 7, 2014
1 parent ceb7f58 commit f468b05
Show file tree
Hide file tree
Showing 3 changed files with 44 additions and 29 deletions.
Expand Up @@ -326,7 +326,7 @@ private slots:
void setEnabledFindPeaksParams_slot( bool on );

/// Slot to enable/disable the predict peaks controls
void setEnabledPredictPeaksParams_slot( bool on );
void setEnabledPredictPeaksParams_slot();

/// Slot to enable/disable the Load Peaks File controls
void setEnabledLoadPeaksParams_slot( bool on );
Expand Down
Expand Up @@ -6,8 +6,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>778</width>
<height>735</height>
<width>943</width>
<height>810</height>
</rect>
</property>
<property name="minimumSize">
Expand Down Expand Up @@ -57,7 +57,7 @@
<string/>
</property>
<property name="currentIndex">
<number>2</number>
<number>0</number>
</property>
<widget class="QWidget" name="SelectData">
<property name="sizePolicy">
Expand Down Expand Up @@ -116,8 +116,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>738</width>
<height>633</height>
<width>903</width>
<height>708</height>
</rect>
</property>
<property name="minimumSize">
Expand Down Expand Up @@ -616,8 +616,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>738</width>
<height>633</height>
<width>372</width>
<height>330</height>
</rect>
</property>
<layout class="QVBoxLayout" name="verticalLayout_10">
Expand Down Expand Up @@ -980,9 +980,9 @@
<property name="geometry">
<rect>
<x>0</x>
<y>-66</y>
<width>720</width>
<height>699</height>
<y>0</y>
<width>903</width>
<height>708</height>
</rect>
</property>
<layout class="QVBoxLayout" name="verticalLayout_12">
Expand Down Expand Up @@ -1823,8 +1823,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>738</width>
<height>633</height>
<width>345</width>
<height>280</height>
</rect>
</property>
<layout class="QVBoxLayout" name="verticalLayout_14">
Expand Down Expand Up @@ -2378,8 +2378,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>738</width>
<height>633</height>
<width>389</width>
<height>188</height>
</rect>
</property>
<layout class="QVBoxLayout" name="verticalLayout_16">
Expand Down Expand Up @@ -2632,7 +2632,7 @@
<rect>
<x>0</x>
<y>0</y>
<width>720</width>
<width>606</width>
<height>635</height>
</rect>
</property>
Expand Down
41 changes: 28 additions & 13 deletions Code/Mantid/MantidQt/CustomInterfaces/src/MantidEV.cpp
Expand Up @@ -337,8 +337,8 @@ void MantidEV::initLayout()
QObject::connect( m_uiForm.FindPeaks_rbtn, SIGNAL(toggled(bool)),
this, SLOT( setEnabledFindPeaksParams_slot(bool) ) );

QObject::connect( m_uiForm.PredictPeaks_ckbx, SIGNAL(clicked(bool)),
this, SLOT( setEnabledPredictPeaksParams_slot(bool) ) );
QObject::connect( m_uiForm.PredictPeaks_ckbx, SIGNAL(clicked()),
this, SLOT( setEnabledPredictPeaksParams_slot() ) );

QObject::connect( m_uiForm.LoadIsawPeaks_rbtn, SIGNAL(toggled(bool)),
this, SLOT( setEnabledLoadPeaksParams_slot(bool) ) );
Expand Down Expand Up @@ -447,7 +447,7 @@ void MantidEV::setDefaultState_slot()
m_uiForm.min_pred_dspacing_ledt->setText("0.4");
m_uiForm.max_pred_dspacing_ledt->setText("8.5");
setEnabledFindPeaksParams_slot(true);
setEnabledPredictPeaksParams_slot(true);
setEnabledPredictPeaksParams_slot();
setEnabledLoadPeaksParams_slot(false);
last_peaks_file.clear();
// Find UB tab
Expand Down Expand Up @@ -1590,18 +1590,32 @@ void MantidEV::setEnabledFindPeaksParams_slot( bool on )
* Set the enabled state of the load find peaks components to the
* specified value.
*
* @param on If true, components will be enabled, if false, disabled.
*/
void MantidEV::setEnabledPredictPeaksParams_slot( bool on)
void MantidEV::setEnabledPredictPeaksParams_slot()
{
m_uiForm.min_pred_wl_lbl->setEnabled( on );
m_uiForm.min_pred_wl_ledt->setEnabled( on );
m_uiForm.max_pred_wl_lbl->setEnabled( on );
m_uiForm.max_pred_wl_ledt->setEnabled( on );
m_uiForm.min_pred_dspacing_lbl->setEnabled( on );
m_uiForm.min_pred_dspacing_ledt->setEnabled( on );
m_uiForm.max_pred_dspacing_lbl->setEnabled( on );
m_uiForm.max_pred_dspacing_ledt->setEnabled( on );
bool predict_new_peaks = m_uiForm.PredictPeaks_ckbx->isChecked();
if ( predict_new_peaks )
{
m_uiForm.min_pred_wl_lbl->setEnabled( true );
m_uiForm.min_pred_wl_ledt->setEnabled( true );
m_uiForm.max_pred_wl_lbl->setEnabled( true );
m_uiForm.max_pred_wl_ledt->setEnabled( true );
m_uiForm.min_pred_dspacing_lbl->setEnabled( true );
m_uiForm.min_pred_dspacing_ledt->setEnabled( true );
m_uiForm.max_pred_dspacing_lbl->setEnabled( true );
m_uiForm.max_pred_dspacing_ledt->setEnabled( true );
}
else
{
m_uiForm.min_pred_wl_lbl->setEnabled( false );
m_uiForm.min_pred_wl_ledt->setEnabled( false );
m_uiForm.max_pred_wl_lbl->setEnabled( false );
m_uiForm.max_pred_wl_ledt->setEnabled( false );
m_uiForm.min_pred_dspacing_lbl->setEnabled( false );
m_uiForm.min_pred_dspacing_ledt->setEnabled( false );
m_uiForm.max_pred_dspacing_lbl->setEnabled( false );
m_uiForm.max_pred_dspacing_ledt->setEnabled( false );
}
}

/**
Expand Down Expand Up @@ -2146,6 +2160,7 @@ void MantidEV::loadSettings( const std::string & filename )
restore( state, "LoadIsawPeaks_rbtn", m_uiForm.LoadIsawPeaks_rbtn );
restore( state, "SelectPeaksFile_ledt", m_uiForm.SelectPeaksFile_ledt );
restore( state, "PredictPeaks_ckbx", m_uiForm.PredictPeaks_ckbx );
setEnabledPredictPeaksParams_slot();
restore( state, "min_pred_wl_ledt", m_uiForm.min_pred_wl_ledt );
restore( state, "max_pred_wl_ledt", m_uiForm.max_pred_wl_ledt );
restore( state, "min_pred_dspacing_ledt", m_uiForm.min_pred_dspacing_ledt );
Expand Down

0 comments on commit f468b05

Please sign in to comment.