Skip to content

Commit

Permalink
Single function to set connected data name.
Browse files Browse the repository at this point in the history
Refs #5116
  • Loading branch information
arturbekasov committed Sep 11, 2013
1 parent d0a560c commit 4ea04c7
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -193,8 +193,8 @@ private slots:
/// Set start up interface look
void startUpLook();

/// Change the connected data text.
void setConnectedDataText();
/// Change the connected data name
void setCurrentDataName(const QString& name);

/// Catch when the interface is closed and do something before.
void closeEvent(QCloseEvent *e);
Expand Down
20 changes: 11 additions & 9 deletions Code/Mantid/MantidQt/CustomInterfaces/src/MuonAnalysis.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ const QString MuonAnalysis::NOT_AVAILABLE("N/A");
//----------------------
///Constructor
MuonAnalysis::MuonAnalysis(QWidget *parent) :
UserSubWindow(parent), m_last_dir(), m_workspace_name("MuonAnalysis"), m_currentDataName(NOT_AVAILABLE),
UserSubWindow(parent), m_last_dir(), m_workspace_name("MuonAnalysis"), m_currentDataName(),
m_groupTableRowInFocus(0), m_pairTableRowInFocus(0),m_tabNumber(0), m_groupNames(),
m_settingsGroup("CustomInterfaces/MuonAnalysis/"), m_updating(false), m_loaded(false),
m_deadTimesChanged(false), m_textToDisplay(""), m_nexusTimeZero(0.0)
Expand Down Expand Up @@ -131,7 +131,7 @@ void MuonAnalysis::initLayout()
m_optionTab->initLayout();
m_fitDataTab->init();

setConnectedDataText();
setCurrentDataName(NOT_AVAILABLE);

// Add the graphs back to mantid if the user selects not to hide graphs on settings tab.
connect(m_optionTab, SIGNAL(notHidingGraphs()), this, SIGNAL (showGraphs()));
Expand Down Expand Up @@ -235,10 +235,14 @@ void MuonAnalysis::muonAnalysisHelpGroupingClicked()


/**
* Set connected data text.
*/
void MuonAnalysis::setConnectedDataText()
* Set the connected workspace name.
* @param name The new connected ws name
*/
void MuonAnalysis::setCurrentDataName(const QString& name)
{
m_currentDataName = name;

// Update labels
m_uiForm.connectedDataHome->setText("Connected: " + m_currentDataName);
m_uiForm.connectedDataGrouping->setText("Connected: " + m_currentDataName);
m_uiForm.connectedDataSettings->setText("Connected: " + m_currentDataName);
Expand Down Expand Up @@ -2236,8 +2240,7 @@ void MuonAnalysis::plotGroup(const std::string& plotType)
QStringList plotDetails = m_fitDataTab->getAllPlotDetails(titleLabel);
changePlotType(plotDetails);

m_currentDataName = titleLabel;
setConnectedDataText();
setCurrentDataName(titleLabel);
}
m_updating = false;
}
Expand Down Expand Up @@ -2367,8 +2370,7 @@ void MuonAnalysis::plotPair(const std::string& plotType)
QStringList plotDetails = m_fitDataTab->getAllPlotDetails(titleLabel);
changePlotType(plotDetails);

m_currentDataName = titleLabel;
setConnectedDataText();
setCurrentDataName(titleLabel);
}
m_updating = false;
}
Expand Down

0 comments on commit 4ea04c7

Please sign in to comment.