From 42288931ec6f83233e53f56d3749842c19949cd4 Mon Sep 17 00:00:00 2001 From: DenioD <41270280+DenioD@users.noreply.github.com> Date: Mon, 13 Apr 2020 23:37:56 +0200 Subject: [PATCH] add InfoBox for reindex and zindex --- src/mainwindow.cpp | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index 8355cbb..ff808d4 100644 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -361,7 +361,6 @@ void MainWindow::setupSettingsModal() { settings.chkConso->setEnabled(false); } - //Use Deletetx bool isUsingDeletetx = false; @@ -489,6 +488,7 @@ void MainWindow::setupSettingsModal() { // Check to see if rescan or reindex have been enabled bool showRestartInfo = false; + bool showReindexInfo = false; if (settings.chkRescan->isChecked()) { Settings::addToZcashConf(zcashConfLocation, "rescan=1"); showRestartInfo = true; @@ -531,7 +531,7 @@ void MainWindow::setupSettingsModal() { if (settings.chkzindex->isChecked()) { Settings::addToZcashConf(zcashConfLocation, "zindex=1"); Settings::addToZcashConf(zcashConfLocation, "reindex=1"); - showRestartInfo = true; + showReindexInfo = true; } } @@ -539,13 +539,19 @@ void MainWindow::setupSettingsModal() { if (settings.chkzindex->isChecked() == false) { Settings::removeFromZcashConf(zcashConfLocation, "zindex"); Settings::addToZcashConf(zcashConfLocation, "reindex=1"); - showRestartInfo = true; + showReindexInfo = true; } } if (showRestartInfo) { auto desc = tr("SilentDragon needs to restart to rescan,reindex,consolidation or deletetx. SilentDragon will now close, please restart SilentDragon to continue"); + QMessageBox::information(this, tr("Restart SilentDragon"), desc, QMessageBox::Ok); + QTimer::singleShot(1, [=]() { this->close(); }); + } + if (showReindexInfo) { + auto desc = tr("SilentDragon needs to reindex for zindex. SilentDragon will now close, please restart SilentDragon to continue"); + QMessageBox::information(this, tr("Restart SilentDragon"), desc, QMessageBox::Ok); QTimer::singleShot(1, [=]() { this->close(); }); }