|
32 | 32 | #include <QTranslator>
|
33 | 33 | #include <QWeakPointer>
|
34 | 34 | #include <QThread>
|
| 35 | +#include <QVBoxLayout> |
| 36 | +#include <QLabel> |
35 | 37 |
|
36 | 38 | #if defined(QT_STATICPLUGIN)
|
37 | 39 | #include <QtPlugin>
|
@@ -347,17 +349,34 @@ void BitcoinApplication::requestShutdown()
|
347 | 349 | window->setClientModel(0);
|
348 | 350 | window->removeAllWallets();
|
349 | 351 | guiref.clear();
|
| 352 | + |
350 | 353 | delete walletModel;
|
| 354 | + |
| 355 | + // Show a simple window indicating shutdown status |
| 356 | + QWidget *shutdownWindow = new QWidget(); |
| 357 | + QVBoxLayout *layout = new QVBoxLayout(); |
| 358 | + layout->addWidget(new QLabel( |
| 359 | + tr("Bitcoin Core is shutting down...\n") + |
| 360 | + tr("Do not shut down the computer until this window disappears."))); |
| 361 | + shutdownWindow->setLayout(layout); |
| 362 | + |
| 363 | + // Center shutdown window at where main window was |
| 364 | + const QPoint global = window->mapToGlobal(window->rect().center()); |
| 365 | + shutdownWindow->move(global.x() - shutdownWindow->width() / 2, global.y() - shutdownWindow->height() / 2); |
| 366 | + shutdownWindow->show(); |
| 367 | + |
| 368 | + // Request shutdown from core thread |
351 | 369 | emit requestedShutdown();
|
352 | 370 | }
|
353 | 371 |
|
354 | 372 | void BitcoinApplication::initializeResult(int retval)
|
355 | 373 | {
|
356 | 374 | LogPrintf("Initialization result: %i\n", retval);
|
357 |
| - /// Set exit result: 0 if successful, 1 if failure |
| 375 | + // Set exit result: 0 if successful, 1 if failure |
358 | 376 | returnValue = retval ? 0 : 1;
|
359 | 377 | if(retval)
|
360 | 378 | {
|
| 379 | + // Miscellaneous initialization after core is initialized |
361 | 380 | optionsModel->Upgrade(); // Must be done after AppInit2
|
362 | 381 |
|
363 | 382 | PaymentServer::LoadRootCAs();
|
|
0 commit comments