commit f65b9cfe2c8a73e9457431d8cb0d777a61bf01f4
parent 7bdceaec140feaea4a9f4751863ca2bfac830370
Author: cfillion <cfillion@users.noreply.github.com>
Date: Sun, 14 Feb 2016 00:58:25 -0500
gently invite the user to restart REAPER after installing extensions
Diffstat:
3 files changed, 15 insertions(+), 1 deletion(-)
diff --git a/src/report.cpp b/src/report.cpp
@@ -82,6 +82,14 @@ void Report::fillReport()
<< NL
;
+ if(m_transaction->isRestartNeeded()) {
+ stream()
+ << NL
+ << "Notice: One or more native REAPER extensions were installed." << NL
+ << "The newly installed files won't be loaded until REAPER is restarted."
+ << NL;
+ }
+
if(errors)
printErrors();
diff --git a/src/transaction.cpp b/src/transaction.cpp
@@ -31,7 +31,8 @@
using namespace std;
Transaction::Transaction(const RemoteList *rl)
- : m_remoteList(rl), m_isCancelled(false), m_enableReport(false)
+ : m_remoteList(rl), m_isCancelled(false),
+ m_enableReport(false), m_needRestart(false)
{
m_registry = new Registry(Path::prefixCache("registry.db"));
@@ -164,6 +165,9 @@ void Transaction::installTicket(const InstallTicket &ticket)
else
m_new.push_back(ticket);
+ if(newEntry.type == Package::ExtensionType)
+ m_needRestart = true;
+
const set<Path> &removedFiles = task->removedFiles();
m_removals.insert(removedFiles.begin(), removedFiles.end());
diff --git a/src/transaction.hpp b/src/transaction.hpp
@@ -66,6 +66,7 @@ public:
bool isCancelled() const { return m_isCancelled; }
bool isReportEnabled() const { return m_enableReport && !m_isCancelled; }
+ bool isRestartNeeded() const { return m_needRestart; }
DownloadQueue *downloadQueue() { return &m_downloadQueue; }
size_t taskCount() const { return m_tasks.size(); }
@@ -96,6 +97,7 @@ private:
const RemoteList *m_remoteList;
bool m_isCancelled;
bool m_enableReport;
+ bool m_needRestart;
Registry *m_registry;
std::multimap<Remote, IndexCallback> m_remotes;