Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/feature/6691_muon_save_deadtime_…
Browse files Browse the repository at this point in the history
…file'
  • Loading branch information
KarlPalmen committed Oct 9, 2013
2 parents ea36b3f + ccb5ffe commit 988413f
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 8 deletions.
15 changes: 8 additions & 7 deletions Code/Mantid/MantidPlot/src/ApplicationWindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9457,13 +9457,6 @@ void ApplicationWindow::dragMoveEvent( QDragMoveEvent* e )

void ApplicationWindow::closeEvent( QCloseEvent* ce )
{
// don't ask the closing sub-windows: the answer will be ignored
MDIWindowList windows = getAllWindows();
foreach(MdiSubWindow* w,windows)
{
w->confirmClose(false);
}

if(scriptingWindow && scriptingWindow->isExecuting())
{
if( ! QMessageBox::question(this, tr("MantidPlot"), "A script is still running, abort and quit application?", tr("Yes"), tr("No")) == 0 )
Expand All @@ -9487,6 +9480,14 @@ void ApplicationWindow::closeEvent( QCloseEvent* ce )
}
}

// Close all the MDI windows
MDIWindowList windows = getAllWindows();
foreach(MdiSubWindow* w,windows)
{
w->confirmClose(false);
w->close();
}

mantidUI->shutdown();

if( scriptingWindow )
Expand Down
15 changes: 14 additions & 1 deletion Code/Mantid/MantidQt/CustomInterfaces/src/MuonAnalysis.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3366,6 +3366,10 @@ void MuonAnalysis::loadAutoSavedValues(const QString& group)

int deadTimeTypeIndex = deadTimeOptions.value("deadTimes", 0).toInt();
m_uiForm.deadTimeType->setCurrentIndex(deadTimeTypeIndex);

QString savedDeadTimeFile = deadTimeOptions.value("deadTimeFile").toString();
m_uiForm.mwRunDeadTimeFile->setUserInput(savedDeadTimeFile);

if (deadTimeTypeIndex != 2)
m_uiForm.mwRunDeadTimeFile->setVisible(false);
}
Expand Down Expand Up @@ -3858,15 +3862,16 @@ void MuonAnalysis::setToolbarsHidden(bool hidden)
void MuonAnalysis::changeDeadTimeType(int choice)
{
m_deadTimesChanged = true;

if (choice == 0 || choice == 1) // if choice == none || choice == from file
{
m_uiForm.mwRunDeadTimeFile->setVisible(false);
homeTabUpdatePlot();
}
else // choice must be from workspace
{
m_uiForm.mwRunDeadTimeFile->setText("");
m_uiForm.mwRunDeadTimeFile->setVisible(true);
m_uiForm.mwRunDeadTimeFile->setUserInput("");
}

QSettings group;
Expand All @@ -3882,6 +3887,14 @@ void MuonAnalysis::changeDeadTimeType(int choice)
*/
void MuonAnalysis::deadTimeFileSelected()
{
if(!m_uiForm.mwRunDeadTimeFile->isValid())
return;

// Remember the filename for the next time interface is opened
QSettings group;
group.beginGroup(m_settingsGroup + "DeadTimeOptions");
group.setValue("deadTimeFile", m_uiForm.mwRunDeadTimeFile->getText());

m_deadTimesChanged = true;
homeTabUpdatePlot();
}
Expand Down

0 comments on commit 988413f

Please sign in to comment.