diff --git a/MantidPlot/src/ApplicationWindow.cpp b/MantidPlot/src/ApplicationWindow.cpp index f75919758dfb3b38fc21f20275d6f031743ce383..6a9ed58323bf8241f3f2b2cb6c3ff091e7bb2db9 100644 --- a/MantidPlot/src/ApplicationWindow.cpp +++ b/MantidPlot/src/ApplicationWindow.cpp @@ -91,6 +91,7 @@ #include "PlotWizard.h" #include "PolynomFitDialog.h" #include "PolynomialFit.h" +#include "Process.h" #include "ProjectRecovery.h" #include "ProjectSerialiser.h" #include "QwtErrorPlotCurve.h" @@ -16638,7 +16639,9 @@ void ApplicationWindow::onAboutToStart() { resultsLog->scrollToTop(); // Kick off project recovery - checkForProjectRecovery(); + // but only if we are the only instance currently running + if (!Process::isAnotherInstanceRunning()) + checkForProjectRecovery(); } /** @@ -16768,6 +16771,11 @@ bool ApplicationWindow::saveProjectRecovery(std::string destination) { return projectWriter.save(QString::fromStdString(destination)); } +/** + * Checks for any recovery checkpoint and starts project + * saving if one doesn't exist. If one does, it prompts + * the user whether they would like to recover + */ void ApplicationWindow::checkForProjectRecovery() { if (!m_projectRecovery.checkForRecovery()) { m_projectRecovery.startProjectSaving(); diff --git a/MantidPlot/src/ProjectRecovery.cpp b/MantidPlot/src/ProjectRecovery.cpp index cc10f27086cf6d3237927ebb264f942ed810068b..77ebb1f2e0bb7b53ed64f8d748eeb109fa5a3215 100644 --- a/MantidPlot/src/ProjectRecovery.cpp +++ b/MantidPlot/src/ProjectRecovery.cpp @@ -16,8 +16,10 @@ #include "boost/range/algorithm_ext/erase.hpp" #include "Poco/DirectoryIterator.h" +#include "Poco/Environment.h" #include "Poco/NObserver.h" #include "Poco/Path.h" +#include "Poco/Process.h" #include <QMessageBox> #include <QMetaObject> @@ -62,8 +64,10 @@ boost::optional<bool> getConfigBool(const std::string &key) { /// Returns a string to the current top level recovery folder std::string getRecoveryFolder() { - static std::string recoverFolder = - Mantid::Kernel::ConfigService::Instance().getAppDataDir() + "/recovery/"; + static std::string appData = Mantid::Kernel::ConfigService::Instance().getAppDataDir(); + static std::string hostname = Poco::Environment::nodeName(); + + static std::string recoverFolder = appData + "/recovery/" + hostname + '/'; return recoverFolder; }