Skip to content

Commit

Permalink
Refs #6473. Disabling input widgets when running.
Browse files Browse the repository at this point in the history
  • Loading branch information
arturbekasov committed Nov 20, 2013
1 parent e8786ba commit afbef9e
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
Expand Up @@ -58,6 +58,9 @@ namespace MantidWidgets
/// Set the type of the control button
void setControlButtonType(ControlButtonType type);

/// Update enabled state off all the input widgets (except for control ones)
void setInputEnabled(bool enabled);

// -- VARIABLES -----------------------------------------------------------

/// UI form
Expand Down
15 changes: 15 additions & 0 deletions Code/Mantid/MantidQt/MantidWidgets/src/MuonSequentialFitDialog.cpp
Expand Up @@ -104,13 +104,27 @@ namespace MantidWidgets
m_ui.controlButton->setText(buttonText);
}

/** * Update enabled state off all the input widgets (except for control ones).
* @param enabled :: True if widgets should be enabled, false otherwise
*/
void MuonSequentialFitDialog::setInputEnabled(bool enabled)
{
m_ui.runs->setEnabled(enabled);
m_ui.labelInput->setEnabled(enabled);

foreach(QAbstractButton* button, m_ui.paramTypeGroup->buttons())
button->setEnabled(enabled);

}

/**
* Start fitting process.
*/
void MuonSequentialFitDialog::startFit()
{
g_log.notice("Seq. fitting started");
setControlButtonType(Stop);
setInputEnabled(false);
}

/**
Expand All @@ -120,6 +134,7 @@ namespace MantidWidgets
{
g_log.notice("Seq. fitting stopped");
setControlButtonType(Start);
setInputEnabled(true);
}

/**
Expand Down

0 comments on commit afbef9e

Please sign in to comment.