|
12 | 12 | #include "clientmodel.h"
|
13 | 13 | #include "guiconstants.h"
|
14 | 14 | #include "guiutil.h"
|
| 15 | +#include "modaloverlay.h" |
15 | 16 | #include "networkstyle.h"
|
16 | 17 | #include "notificator.h"
|
17 | 18 | #include "openuridialog.h"
|
@@ -114,6 +115,7 @@ BitcoinGUI::BitcoinGUI(const PlatformStyle *platformStyle, const NetworkStyle *n
|
114 | 115 | notificator(0),
|
115 | 116 | rpcConsole(0),
|
116 | 117 | helpMessageDialog(0),
|
| 118 | + modalOverlay(0), |
117 | 119 | prevBlocks(0),
|
118 | 120 | spinnerFrame(0),
|
119 | 121 | platformStyle(platformStyle)
|
@@ -241,6 +243,12 @@ BitcoinGUI::BitcoinGUI(const PlatformStyle *platformStyle, const NetworkStyle *n
|
241 | 243 |
|
242 | 244 | // Subscribe to notifications from core
|
243 | 245 | subscribeToCoreSignals();
|
| 246 | + |
| 247 | + modalOverlay = new ModalOverlay(this->centralWidget()); |
| 248 | +#ifdef ENABLE_WALLET |
| 249 | + if(enableWallet) |
| 250 | + connect(walletFrame, SIGNAL(requestedOfSyncWarningInfo()), this, SLOT(showModalOverlay())); |
| 251 | +#endif |
244 | 252 | }
|
245 | 253 |
|
246 | 254 | BitcoinGUI::~BitcoinGUI()
|
@@ -491,6 +499,8 @@ void BitcoinGUI::setClientModel(ClientModel *clientModel)
|
491 | 499 | // initialize the disable state of the tray icon with the current value in the model.
|
492 | 500 | setTrayIconVisible(optionsModel->getHideTrayIcon());
|
493 | 501 | }
|
| 502 | + |
| 503 | + modalOverlay->setKnownBestHeight(clientModel->getHeaderHeight()); |
494 | 504 | } else {
|
495 | 505 | // Disable possibility to show main window via action
|
496 | 506 | toggleHideAction->setEnabled(false);
|
@@ -705,7 +715,14 @@ void BitcoinGUI::setNumConnections(int count)
|
705 | 715 |
|
706 | 716 | void BitcoinGUI::setNumBlocks(int count, const QDateTime& blockDate, double nVerificationProgress, bool header)
|
707 | 717 | {
|
708 |
| - if(!clientModel) |
| 718 | + if (modalOverlay) |
| 719 | + { |
| 720 | + if (header) |
| 721 | + modalOverlay->setKnownBestHeight(count); |
| 722 | + else |
| 723 | + modalOverlay->tipUpdate(count, blockDate, nVerificationProgress); |
| 724 | + } |
| 725 | + if (!clientModel) |
709 | 726 | return;
|
710 | 727 |
|
711 | 728 | // Prevent orphan statusbar messages (e.g. hover Quit in main menu, wait until chain-sync starts -> garbelled text)
|
@@ -754,7 +771,10 @@ void BitcoinGUI::setNumBlocks(int count, const QDateTime& blockDate, double nVer
|
754 | 771 |
|
755 | 772 | #ifdef ENABLE_WALLET
|
756 | 773 | if(walletFrame)
|
| 774 | + { |
757 | 775 | walletFrame->showOutOfSyncWarning(false);
|
| 776 | + modalOverlay->showHide(true, true); |
| 777 | + } |
758 | 778 | #endif // ENABLE_WALLET
|
759 | 779 |
|
760 | 780 | progressBarLabel->setVisible(false);
|
@@ -782,7 +802,10 @@ void BitcoinGUI::setNumBlocks(int count, const QDateTime& blockDate, double nVer
|
782 | 802 |
|
783 | 803 | #ifdef ENABLE_WALLET
|
784 | 804 | if(walletFrame)
|
| 805 | + { |
785 | 806 | walletFrame->showOutOfSyncWarning(true);
|
| 807 | + modalOverlay->showHide(); |
| 808 | + } |
786 | 809 | #endif // ENABLE_WALLET
|
787 | 810 |
|
788 | 811 | tooltip += QString("<br>");
|
@@ -1078,6 +1101,12 @@ void BitcoinGUI::setTrayIconVisible(bool fHideTrayIcon)
|
1078 | 1101 | }
|
1079 | 1102 | }
|
1080 | 1103 |
|
| 1104 | +void BitcoinGUI::showModalOverlay() |
| 1105 | +{ |
| 1106 | + if (modalOverlay) |
| 1107 | + modalOverlay->showHide(false, true); |
| 1108 | +} |
| 1109 | + |
1081 | 1110 | static bool ThreadSafeMessageBox(BitcoinGUI *gui, const std::string& message, const std::string& caption, unsigned int style)
|
1082 | 1111 | {
|
1083 | 1112 | bool modal = (style & CClientUIInterface::MODAL);
|
|
0 commit comments