commit a9c1197450e51ebdded4e3e828f084dc40df5d7b
parent 3a4bbb2e2f0105d1b91d8c62c2b7e126de06ea23
Author: cfillion <cfillion@users.noreply.github.com>
Date: Sat, 10 Sep 2016 19:08:56 -0400
manager: ask to synchronize when enabling a repo or the auto install mode [p=1726030]
Diffstat:
1 file changed, 16 insertions(+), 2 deletions(-)
diff --git a/src/manager.cpp b/src/manager.cpp
@@ -429,8 +429,12 @@ bool Manager::apply()
if(!tx)
return false;
- if(m_autoInstall)
+ bool promptSync = false;
+
+ if(m_autoInstall) {
m_config->install.autoInstall = m_autoInstall.value();
+ promptSync = m_config->install.autoInstall;
+ }
if(m_bleedingEdge)
m_config->install.bleedingEdge = m_bleedingEdge.value();
@@ -442,13 +446,23 @@ bool Manager::apply()
const Remote &remote = pair.first;
const bool enable = pair.second;
- if(m_uninstall.find(remote) == m_uninstall.end())
+ if(m_uninstall.find(remote) == m_uninstall.end()) {
m_reapack->setRemoteEnabled(enable, remote);
+
+ if(enable)
+ promptSync = true;
+ }
}
for(const Remote &remote : m_uninstall)
m_reapack->uninstall(remote);
+ if(promptSync && MessageBox(handle(),
+ AUTO_STR("Synchronize packages (install/update) now?"),
+ AUTO_STR("ReaPack Query"), MB_YESNO) == IDYES) {
+ m_reapack->synchronizeAll();
+ }
+
tx->runTasks();
m_config->write();
reset();