diff options
author | Wladimir J. van der Laan <laanwj@gmail.com> | 2014-01-07 16:04:47 +0100 |
---|---|---|
committer | Wladimir J. van der Laan <laanwj@gmail.com> | 2014-01-11 10:20:28 +0100 |
commit | 55fe4de96056cf7b6bdf708a2912927dc9857207 (patch) | |
tree | 878570e2c92dd3baf40dfcfc47deccc191fab858 /src | |
parent | 202d853bbea8ecb2164b9c9dc69e2129b45f05f8 (diff) |
qt: Show window while shutting down
Makes it clear to the user that the application is still wrapping up
and the computer should not be turned off until it is finished.
Diffstat (limited to 'src')
-rw-r--r-- | src/qt/bitcoin.cpp | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/src/qt/bitcoin.cpp b/src/qt/bitcoin.cpp index d4a834acb6..8bcf187ae7 100644 --- a/src/qt/bitcoin.cpp +++ b/src/qt/bitcoin.cpp @@ -32,6 +32,8 @@ #include <QTranslator> #include <QWeakPointer> #include <QThread> +#include <QVBoxLayout> +#include <QLabel> #if defined(QT_STATICPLUGIN) #include <QtPlugin> @@ -347,17 +349,34 @@ void BitcoinApplication::requestShutdown() window->setClientModel(0); window->removeAllWallets(); guiref.clear(); + delete walletModel; + + // Show a simple window indicating shutdown status + QWidget *shutdownWindow = new QWidget(); + QVBoxLayout *layout = new QVBoxLayout(); + layout->addWidget(new QLabel( + tr("Bitcoin Core is shutting down...\n") + + tr("Do not shut down the computer until this window disappears."))); + shutdownWindow->setLayout(layout); + + // Center shutdown window at where main window was + const QPoint global = window->mapToGlobal(window->rect().center()); + shutdownWindow->move(global.x() - shutdownWindow->width() / 2, global.y() - shutdownWindow->height() / 2); + shutdownWindow->show(); + + // Request shutdown from core thread emit requestedShutdown(); } void BitcoinApplication::initializeResult(int retval) { LogPrintf("Initialization result: %i\n", retval); - /// Set exit result: 0 if successful, 1 if failure + // Set exit result: 0 if successful, 1 if failure returnValue = retval ? 0 : 1; if(retval) { + // Miscellaneous initialization after core is initialized optionsModel->Upgrade(); // Must be done after AppInit2 PaymentServer::LoadRootCAs(); |