reapack

Package manager for REAPER
Log | Files | Refs | Submodules | README | LICENSE

commit cd4be28705da88733b6d506e117780b1f3374216
parent 54413c1228f517ab15a45b6e1637eb3197fa26c4
Author: cfillion <cfillion@users.noreply.github.com>
Date:   Thu, 24 Aug 2017 18:28:58 -0400

browser: show confirmation dialog only when uninstalling packages

Diffstat:
Msrc/browser.cpp | 10++++++----
1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/src/browser.cpp b/src/browser.cpp @@ -1069,14 +1069,16 @@ auto Browser::currentView() const -> View bool Browser::confirm() const { - if(m_actions.empty()) - return true; + // count uninstallation actions + const size_t count = count_if(m_actions.begin(), m_actions.end(), + [](const Entry *e) { return e->target && *e->target == nullptr; }); - const size_t count = m_actions.size(); + if(!count) + return true; auto_char msg[255]; auto_snprintf(msg, auto_size(msg), - AUTO_STR("Confirm execution of %zu action%s?\n"), + AUTO_STR("Are you sure to uninstall %zu package%s?\r\nThe files and settings will be permanently deleted from this computer."), count, count == 1 ? AUTO_STR("") : AUTO_STR("s")); const auto_char *title = AUTO_STR("ReaPack Query");