Bitcoin Core  22.99.0
P2P Digital Currency
bitcoingui.cpp
Go to the documentation of this file.
1 // Copyright (c) 2011-2021 The Bitcoin Core developers
2 // Distributed under the MIT software license, see the accompanying
3 // file COPYING or http://www.opensource.org/licenses/mit-license.php.
4 
5 #include <qt/bitcoingui.h>
6 
7 #include <qt/bitcoinunits.h>
8 #include <qt/clientmodel.h>
10 #include <qt/guiconstants.h>
11 #include <qt/guiutil.h>
12 #include <qt/modaloverlay.h>
13 #include <qt/networkstyle.h>
14 #include <qt/notificator.h>
15 #include <qt/openuridialog.h>
16 #include <qt/optionsdialog.h>
17 #include <qt/optionsmodel.h>
18 #include <qt/platformstyle.h>
19 #include <qt/rpcconsole.h>
20 #include <qt/utilitydialog.h>
21 
22 #ifdef ENABLE_WALLET
23 #include <qt/walletcontroller.h>
24 #include <qt/walletframe.h>
25 #include <qt/walletmodel.h>
26 #include <qt/walletview.h>
27 #endif // ENABLE_WALLET
28 
29 #ifdef Q_OS_MAC
30 #include <qt/macdockiconhandler.h>
31 #endif
32 
33 #include <functional>
34 #include <chain.h>
35 #include <chainparams.h>
36 #include <interfaces/handler.h>
37 #include <interfaces/node.h>
38 #include <node/ui_interface.h>
39 #include <util/system.h>
40 #include <util/translation.h>
41 #include <validation.h>
42 
43 #include <QAction>
44 #include <QApplication>
45 #include <QComboBox>
46 #include <QCursor>
47 #include <QDateTime>
48 #include <QDragEnterEvent>
49 #include <QListWidget>
50 #include <QMenu>
51 #include <QMenuBar>
52 #include <QMessageBox>
53 #include <QMimeData>
54 #include <QProgressDialog>
55 #include <QScreen>
56 #include <QSettings>
57 #include <QShortcut>
58 #include <QStackedWidget>
59 #include <QStatusBar>
60 #include <QStyle>
61 #include <QSystemTrayIcon>
62 #include <QTimer>
63 #include <QToolBar>
64 #include <QUrlQuery>
65 #include <QVBoxLayout>
66 #include <QWindow>
67 
68 
69 const std::string BitcoinGUI::DEFAULT_UIPLATFORM =
70 #if defined(Q_OS_MAC)
71  "macosx"
72 #elif defined(Q_OS_WIN)
73  "windows"
74 #else
75  "other"
76 #endif
77  ;
78 
79 BitcoinGUI::BitcoinGUI(interfaces::Node& node, const PlatformStyle *_platformStyle, const NetworkStyle *networkStyle, QWidget *parent) :
80  QMainWindow(parent),
81  m_node(node),
82  trayIconMenu{new QMenu()},
83  platformStyle(_platformStyle),
84  m_network_style(networkStyle)
85 {
86  QSettings settings;
87  if (!restoreGeometry(settings.value("MainWindowGeometry").toByteArray())) {
88  // Restore failed (perhaps missing setting), center the window
89  move(QGuiApplication::primaryScreen()->availableGeometry().center() - frameGeometry().center());
90  }
91 
92  setContextMenuPolicy(Qt::PreventContextMenu);
93 
94 #ifdef ENABLE_WALLET
95  enableWallet = WalletModel::isWalletEnabled();
96 #endif // ENABLE_WALLET
97  QApplication::setWindowIcon(m_network_style->getTrayAndWindowIcon());
98  setWindowIcon(m_network_style->getTrayAndWindowIcon());
99  updateWindowTitle();
100 
101  rpcConsole = new RPCConsole(node, _platformStyle, nullptr);
102  helpMessageDialog = new HelpMessageDialog(this, false);
103 #ifdef ENABLE_WALLET
104  if(enableWallet)
105  {
107  walletFrame = new WalletFrame(_platformStyle, this);
108  connect(walletFrame, &WalletFrame::createWalletButtonClicked, [this] {
109  auto activity = new CreateWalletActivity(getWalletController(), this);
110  activity->create();
111  });
112  connect(walletFrame, &WalletFrame::message, [this](const QString& title, const QString& message, unsigned int style) {
113  this->message(title, message, style);
114  });
115  connect(walletFrame, &WalletFrame::currentWalletSet, [this] { updateWalletStatus(); });
116  setCentralWidget(walletFrame);
117  } else
118 #endif // ENABLE_WALLET
119  {
120  /* When compiled without wallet or -disablewallet is provided,
121  * the central widget is the rpc console.
122  */
123  setCentralWidget(rpcConsole);
124  Q_EMIT consoleShown(rpcConsole);
125  }
126 
127  modalOverlay = new ModalOverlay(enableWallet, this->centralWidget());
128 
129  // Accept D&D of URIs
130  setAcceptDrops(true);
131 
132  // Create actions for the toolbar, menu bar and tray/dock icon
133  // Needs walletFrame to be initialized
134  createActions();
135 
136  // Create application menu bar
137  createMenuBar();
138 
139  // Create the toolbars
140  createToolBars();
141 
142  // Create system tray icon and notification
143  if (QSystemTrayIcon::isSystemTrayAvailable()) {
144  createTrayIcon();
145  }
146  notificator = new Notificator(QApplication::applicationName(), trayIcon, this);
147 
148  // Create status bar
149  statusBar();
150 
151  // Disable size grip because it looks ugly and nobody needs it
152  statusBar()->setSizeGripEnabled(false);
153 
154  // Status bar notification icons
155  QFrame *frameBlocks = new QFrame();
156  frameBlocks->setContentsMargins(0,0,0,0);
157  frameBlocks->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Preferred);
158  QHBoxLayout *frameBlocksLayout = new QHBoxLayout(frameBlocks);
159  frameBlocksLayout->setContentsMargins(3,0,3,0);
160  frameBlocksLayout->setSpacing(3);
161  unitDisplayControl = new UnitDisplayStatusBarControl(platformStyle);
162  labelWalletEncryptionIcon = new GUIUtil::ThemedLabel(platformStyle);
163  labelWalletHDStatusIcon = new GUIUtil::ThemedLabel(platformStyle);
164  labelProxyIcon = new GUIUtil::ClickableLabel(platformStyle);
165  connectionsControl = new GUIUtil::ClickableLabel(platformStyle);
166  labelBlocksIcon = new GUIUtil::ClickableLabel(platformStyle);
167  if(enableWallet)
168  {
169  frameBlocksLayout->addStretch();
170  frameBlocksLayout->addWidget(unitDisplayControl);
171  frameBlocksLayout->addStretch();
172  frameBlocksLayout->addWidget(labelWalletEncryptionIcon);
173  labelWalletEncryptionIcon->hide();
174  frameBlocksLayout->addWidget(labelWalletHDStatusIcon);
175  labelWalletHDStatusIcon->hide();
176  }
177  frameBlocksLayout->addWidget(labelProxyIcon);
178  frameBlocksLayout->addStretch();
179  frameBlocksLayout->addWidget(connectionsControl);
180  frameBlocksLayout->addStretch();
181  frameBlocksLayout->addWidget(labelBlocksIcon);
182  frameBlocksLayout->addStretch();
183 
184  // Progress bar and label for blocks download
185  progressBarLabel = new QLabel();
186  progressBarLabel->setVisible(false);
187  progressBar = new GUIUtil::ProgressBar();
188  progressBar->setAlignment(Qt::AlignCenter);
189  progressBar->setVisible(false);
190 
191  // Override style sheet for progress bar for styles that have a segmented progress bar,
192  // as they make the text unreadable (workaround for issue #1071)
193  // See https://doc.qt.io/qt-5/gallery.html
194  QString curStyle = QApplication::style()->metaObject()->className();
195  if(curStyle == "QWindowsStyle" || curStyle == "QWindowsXPStyle")
196  {
197  progressBar->setStyleSheet("QProgressBar { background-color: #e8e8e8; border: 1px solid grey; border-radius: 7px; padding: 1px; text-align: center; } QProgressBar::chunk { background: QLinearGradient(x1: 0, y1: 0, x2: 1, y2: 0, stop: 0 #FF8000, stop: 1 orange); border-radius: 7px; margin: 0px; }");
198  }
199 
200  statusBar()->addWidget(progressBarLabel);
201  statusBar()->addWidget(progressBar);
202  statusBar()->addPermanentWidget(frameBlocks);
203 
204  // Install event filter to be able to catch status tip events (QEvent::StatusTip)
205  this->installEventFilter(this);
206 
207  // Initially wallet actions should be disabled
208  setWalletActionsEnabled(false);
209 
210  // Subscribe to notifications from core
211  subscribeToCoreSignals();
212 
213  connect(labelProxyIcon, &GUIUtil::ClickableLabel::clicked, [this] {
214  openOptionsDialogWithTab(OptionsDialog::TAB_NETWORK);
215  });
216 
217  connect(labelBlocksIcon, &GUIUtil::ClickableLabel::clicked, this, &BitcoinGUI::showModalOverlay);
219 
220 #ifdef Q_OS_MAC
221  m_app_nap_inhibitor = new CAppNapInhibitor;
222 #endif
223 
225 }
226 
228 {
229  // Unsubscribe from notifications from core
231 
232  QSettings settings;
233  settings.setValue("MainWindowGeometry", saveGeometry());
234  if(trayIcon) // Hide tray icon, as deleting will let it linger until quit (on Ubuntu)
235  trayIcon->hide();
236 #ifdef Q_OS_MAC
237  delete m_app_nap_inhibitor;
238  delete appMenuBar;
240 #endif
241 
242  delete rpcConsole;
243 }
244 
246 {
247  QActionGroup *tabGroup = new QActionGroup(this);
248  connect(modalOverlay, &ModalOverlay::triggered, tabGroup, &QActionGroup::setEnabled);
249 
250  overviewAction = new QAction(platformStyle->SingleColorIcon(":/icons/overview"), tr("&Overview"), this);
251  overviewAction->setStatusTip(tr("Show general overview of wallet"));
252  overviewAction->setToolTip(overviewAction->statusTip());
253  overviewAction->setCheckable(true);
254  overviewAction->setShortcut(QKeySequence(Qt::ALT + Qt::Key_1));
255  tabGroup->addAction(overviewAction);
256 
257  sendCoinsAction = new QAction(platformStyle->SingleColorIcon(":/icons/send"), tr("&Send"), this);
258  sendCoinsAction->setStatusTip(tr("Send coins to a Bitcoin address"));
259  sendCoinsAction->setToolTip(sendCoinsAction->statusTip());
260  sendCoinsAction->setCheckable(true);
261  sendCoinsAction->setShortcut(QKeySequence(Qt::ALT + Qt::Key_2));
262  tabGroup->addAction(sendCoinsAction);
263 
264  receiveCoinsAction = new QAction(platformStyle->SingleColorIcon(":/icons/receiving_addresses"), tr("&Receive"), this);
265  receiveCoinsAction->setStatusTip(tr("Request payments (generates QR codes and bitcoin: URIs)"));
266  receiveCoinsAction->setToolTip(receiveCoinsAction->statusTip());
267  receiveCoinsAction->setCheckable(true);
268  receiveCoinsAction->setShortcut(QKeySequence(Qt::ALT + Qt::Key_3));
269  tabGroup->addAction(receiveCoinsAction);
270 
271  historyAction = new QAction(platformStyle->SingleColorIcon(":/icons/history"), tr("&Transactions"), this);
272  historyAction->setStatusTip(tr("Browse transaction history"));
273  historyAction->setToolTip(historyAction->statusTip());
274  historyAction->setCheckable(true);
275  historyAction->setShortcut(QKeySequence(Qt::ALT + Qt::Key_4));
276  tabGroup->addAction(historyAction);
277 
278 #ifdef ENABLE_WALLET
279  // These showNormalIfMinimized are needed because Send Coins and Receive Coins
280  // can be triggered from the tray menu, and need to show the GUI to be useful.
281  connect(overviewAction, &QAction::triggered, [this]{ showNormalIfMinimized(); });
282  connect(overviewAction, &QAction::triggered, this, &BitcoinGUI::gotoOverviewPage);
283  connect(sendCoinsAction, &QAction::triggered, [this]{ showNormalIfMinimized(); });
284  connect(sendCoinsAction, &QAction::triggered, [this]{ gotoSendCoinsPage(); });
285  connect(receiveCoinsAction, &QAction::triggered, [this]{ showNormalIfMinimized(); });
286  connect(receiveCoinsAction, &QAction::triggered, this, &BitcoinGUI::gotoReceiveCoinsPage);
287  connect(historyAction, &QAction::triggered, [this]{ showNormalIfMinimized(); });
288  connect(historyAction, &QAction::triggered, this, &BitcoinGUI::gotoHistoryPage);
289 #endif // ENABLE_WALLET
290 
291  quitAction = new QAction(tr("E&xit"), this);
292  quitAction->setStatusTip(tr("Quit application"));
293  quitAction->setShortcut(QKeySequence(Qt::CTRL + Qt::Key_Q));
294  quitAction->setMenuRole(QAction::QuitRole);
295  aboutAction = new QAction(tr("&About %1").arg(PACKAGE_NAME), this);
296  aboutAction->setStatusTip(tr("Show information about %1").arg(PACKAGE_NAME));
297  aboutAction->setMenuRole(QAction::AboutRole);
298  aboutAction->setEnabled(false);
299  aboutQtAction = new QAction(tr("About &Qt"), this);
300  aboutQtAction->setStatusTip(tr("Show information about Qt"));
301  aboutQtAction->setMenuRole(QAction::AboutQtRole);
302  optionsAction = new QAction(tr("&Options…"), this);
303  optionsAction->setStatusTip(tr("Modify configuration options for %1").arg(PACKAGE_NAME));
304  optionsAction->setMenuRole(QAction::PreferencesRole);
305  optionsAction->setEnabled(false);
306 
307  encryptWalletAction = new QAction(tr("&Encrypt Wallet…"), this);
308  encryptWalletAction->setStatusTip(tr("Encrypt the private keys that belong to your wallet"));
309  encryptWalletAction->setCheckable(true);
310  backupWalletAction = new QAction(tr("&Backup Wallet…"), this);
311  backupWalletAction->setStatusTip(tr("Backup wallet to another location"));
312  changePassphraseAction = new QAction(tr("&Change Passphrase…"), this);
313  changePassphraseAction->setStatusTip(tr("Change the passphrase used for wallet encryption"));
314  signMessageAction = new QAction(tr("Sign &message…"), this);
315  signMessageAction->setStatusTip(tr("Sign messages with your Bitcoin addresses to prove you own them"));
316  verifyMessageAction = new QAction(tr("&Verify message…"), this);
317  verifyMessageAction->setStatusTip(tr("Verify messages to ensure they were signed with specified Bitcoin addresses"));
318  m_load_psbt_action = new QAction(tr("&Load PSBT from file…"), this);
319  m_load_psbt_action->setStatusTip(tr("Load Partially Signed Bitcoin Transaction"));
320  m_load_psbt_clipboard_action = new QAction(tr("Load PSBT from &clipboard…"), this);
321  m_load_psbt_clipboard_action->setStatusTip(tr("Load Partially Signed Bitcoin Transaction from clipboard"));
322 
323  openRPCConsoleAction = new QAction(tr("Node window"), this);
324  openRPCConsoleAction->setStatusTip(tr("Open node debugging and diagnostic console"));
325  // initially disable the debug window menu item
326  openRPCConsoleAction->setEnabled(false);
327  openRPCConsoleAction->setObjectName("openRPCConsoleAction");
328 
329  usedSendingAddressesAction = new QAction(tr("&Sending addresses"), this);
330  usedSendingAddressesAction->setStatusTip(tr("Show the list of used sending addresses and labels"));
331  usedReceivingAddressesAction = new QAction(tr("&Receiving addresses"), this);
332  usedReceivingAddressesAction->setStatusTip(tr("Show the list of used receiving addresses and labels"));
333 
334  openAction = new QAction(tr("Open &URI…"), this);
335  openAction->setStatusTip(tr("Open a bitcoin: URI"));
336 
337  m_open_wallet_action = new QAction(tr("Open Wallet"), this);
338  m_open_wallet_action->setEnabled(false);
339  m_open_wallet_action->setStatusTip(tr("Open a wallet"));
340  m_open_wallet_menu = new QMenu(this);
341 
342  m_close_wallet_action = new QAction(tr("Close Wallet…"), this);
343  m_close_wallet_action->setStatusTip(tr("Close wallet"));
344 
345  m_create_wallet_action = new QAction(tr("Create Wallet…"), this);
346  m_create_wallet_action->setEnabled(false);
347  m_create_wallet_action->setStatusTip(tr("Create a new wallet"));
348 
349  m_close_all_wallets_action = new QAction(tr("Close All Wallets…"), this);
350  m_close_all_wallets_action->setStatusTip(tr("Close all wallets"));
351 
352  showHelpMessageAction = new QAction(tr("&Command-line options"), this);
353  showHelpMessageAction->setMenuRole(QAction::NoRole);
354  showHelpMessageAction->setStatusTip(tr("Show the %1 help message to get a list with possible Bitcoin command-line options").arg(PACKAGE_NAME));
355 
356  m_mask_values_action = new QAction(tr("&Mask values"), this);
357  m_mask_values_action->setShortcut(QKeySequence(Qt::CTRL + Qt::SHIFT + Qt::Key_M));
358  m_mask_values_action->setStatusTip(tr("Mask the values in the Overview tab"));
359  m_mask_values_action->setCheckable(true);
360 
361  connect(quitAction, &QAction::triggered, this, &BitcoinGUI::quitRequested);
362  connect(aboutAction, &QAction::triggered, this, &BitcoinGUI::aboutClicked);
363  connect(aboutQtAction, &QAction::triggered, qApp, QApplication::aboutQt);
364  connect(optionsAction, &QAction::triggered, this, &BitcoinGUI::optionsClicked);
365  connect(showHelpMessageAction, &QAction::triggered, this, &BitcoinGUI::showHelpMessageClicked);
366  connect(openRPCConsoleAction, &QAction::triggered, this, &BitcoinGUI::showDebugWindow);
367  // prevents an open debug window from becoming stuck/unusable on client shutdown
368  connect(quitAction, &QAction::triggered, rpcConsole, &QWidget::hide);
369 
370 #ifdef ENABLE_WALLET
371  if(walletFrame)
372  {
373  connect(encryptWalletAction, &QAction::triggered, walletFrame, &WalletFrame::encryptWallet);
374  connect(backupWalletAction, &QAction::triggered, walletFrame, &WalletFrame::backupWallet);
375  connect(changePassphraseAction, &QAction::triggered, walletFrame, &WalletFrame::changePassphrase);
376  connect(signMessageAction, &QAction::triggered, [this]{ showNormalIfMinimized(); });
377  connect(signMessageAction, &QAction::triggered, [this]{ gotoSignMessageTab(); });
378  connect(m_load_psbt_action, &QAction::triggered, [this]{ gotoLoadPSBT(); });
379  connect(m_load_psbt_clipboard_action, &QAction::triggered, [this]{ gotoLoadPSBT(true); });
380  connect(verifyMessageAction, &QAction::triggered, [this]{ showNormalIfMinimized(); });
381  connect(verifyMessageAction, &QAction::triggered, [this]{ gotoVerifyMessageTab(); });
384  connect(openAction, &QAction::triggered, this, &BitcoinGUI::openClicked);
385  connect(m_open_wallet_menu, &QMenu::aboutToShow, [this] {
386  m_open_wallet_menu->clear();
387  for (const std::pair<const std::string, bool>& i : m_wallet_controller->listWalletDir()) {
388  const std::string& path = i.first;
389  QString name = path.empty() ? QString("["+tr("default wallet")+"]") : QString::fromStdString(path);
390  // Menu items remove single &. Single & are shown when && is in
391  // the string, but only the first occurrence. So replace only
392  // the first & with &&.
393  name.replace(name.indexOf(QChar('&')), 1, QString("&&"));
394  QAction* action = m_open_wallet_menu->addAction(name);
395 
396  if (i.second) {
397  // This wallet is already loaded
398  action->setEnabled(false);
399  continue;
400  }
401 
402  connect(action, &QAction::triggered, [this, path] {
403  auto activity = new OpenWalletActivity(m_wallet_controller, this);
404  connect(activity, &OpenWalletActivity::opened, this, &BitcoinGUI::setCurrentWallet);
405  activity->open(path);
406  });
407  }
408  if (m_open_wallet_menu->isEmpty()) {
409  QAction* action = m_open_wallet_menu->addAction(tr("No wallets available"));
410  action->setEnabled(false);
411  }
412  });
413  connect(m_close_wallet_action, &QAction::triggered, [this] {
415  });
416  connect(m_create_wallet_action, &QAction::triggered, [this] {
417  auto activity = new CreateWalletActivity(m_wallet_controller, this);
418  connect(activity, &CreateWalletActivity::created, this, &BitcoinGUI::setCurrentWallet);
419  activity->create();
420  });
421  connect(m_close_all_wallets_action, &QAction::triggered, [this] {
423  });
424  connect(m_mask_values_action, &QAction::toggled, this, &BitcoinGUI::setPrivacy);
425  }
426 #endif // ENABLE_WALLET
427 
428  connect(new QShortcut(QKeySequence(Qt::CTRL + Qt::SHIFT + Qt::Key_C), this), &QShortcut::activated, this, &BitcoinGUI::showDebugWindowActivateConsole);
429  connect(new QShortcut(QKeySequence(Qt::CTRL + Qt::SHIFT + Qt::Key_D), this), &QShortcut::activated, this, &BitcoinGUI::showDebugWindow);
430 }
431 
433 {
434 #ifdef Q_OS_MAC
435  // Create a decoupled menu bar on Mac which stays even if the window is closed
436  appMenuBar = new QMenuBar();
437 #else
438  // Get the main window's menu bar on other platforms
439  appMenuBar = menuBar();
440 #endif
441 
442  // Configure the menus
443  QMenu *file = appMenuBar->addMenu(tr("&File"));
444  if(walletFrame)
445  {
446  file->addAction(m_create_wallet_action);
447  file->addAction(m_open_wallet_action);
448  file->addAction(m_close_wallet_action);
449  file->addAction(m_close_all_wallets_action);
450  file->addSeparator();
451  file->addAction(openAction);
452  file->addAction(backupWalletAction);
453  file->addAction(signMessageAction);
454  file->addAction(verifyMessageAction);
455  file->addAction(m_load_psbt_action);
456  file->addAction(m_load_psbt_clipboard_action);
457  file->addSeparator();
458  }
459  file->addAction(quitAction);
460 
461  QMenu *settings = appMenuBar->addMenu(tr("&Settings"));
462  if(walletFrame)
463  {
464  settings->addAction(encryptWalletAction);
465  settings->addAction(changePassphraseAction);
466  settings->addSeparator();
467  settings->addAction(m_mask_values_action);
468  settings->addSeparator();
469  }
470  settings->addAction(optionsAction);
471 
472  QMenu* window_menu = appMenuBar->addMenu(tr("&Window"));
473 
474  QAction* minimize_action = window_menu->addAction(tr("&Minimize"));
475  minimize_action->setShortcut(QKeySequence(Qt::CTRL + Qt::Key_M));
476  connect(minimize_action, &QAction::triggered, [] {
477  QApplication::activeWindow()->showMinimized();
478  });
479  connect(qApp, &QApplication::focusWindowChanged, [minimize_action] (QWindow* window) {
480  minimize_action->setEnabled(window != nullptr && (window->flags() & Qt::Dialog) != Qt::Dialog && window->windowState() != Qt::WindowMinimized);
481  });
482 
483 #ifdef Q_OS_MAC
484  QAction* zoom_action = window_menu->addAction(tr("Zoom"));
485  connect(zoom_action, &QAction::triggered, [] {
486  QWindow* window = qApp->focusWindow();
487  if (window->windowState() != Qt::WindowMaximized) {
488  window->showMaximized();
489  } else {
490  window->showNormal();
491  }
492  });
493 
494  connect(qApp, &QApplication::focusWindowChanged, [zoom_action] (QWindow* window) {
495  zoom_action->setEnabled(window != nullptr);
496  });
497 #endif
498 
499  if (walletFrame) {
500 #ifdef Q_OS_MAC
501  window_menu->addSeparator();
502  QAction* main_window_action = window_menu->addAction(tr("Main Window"));
503  connect(main_window_action, &QAction::triggered, [this] {
504  GUIUtil::bringToFront(this);
505  });
506 #endif
507  window_menu->addSeparator();
508  window_menu->addAction(usedSendingAddressesAction);
509  window_menu->addAction(usedReceivingAddressesAction);
510  }
511 
512  window_menu->addSeparator();
513  for (RPCConsole::TabTypes tab_type : rpcConsole->tabs()) {
514  QAction* tab_action = window_menu->addAction(rpcConsole->tabTitle(tab_type));
515  tab_action->setShortcut(rpcConsole->tabShortcut(tab_type));
516  connect(tab_action, &QAction::triggered, [this, tab_type] {
517  rpcConsole->setTabFocus(tab_type);
518  showDebugWindow();
519  });
520  }
521 
522  QMenu *help = appMenuBar->addMenu(tr("&Help"));
523  help->addAction(showHelpMessageAction);
524  help->addSeparator();
525  help->addAction(aboutAction);
526  help->addAction(aboutQtAction);
527 }
528 
530 {
531  if(walletFrame)
532  {
533  QToolBar *toolbar = addToolBar(tr("Tabs toolbar"));
534  appToolBar = toolbar;
535  toolbar->setMovable(false);
536  toolbar->setToolButtonStyle(Qt::ToolButtonTextBesideIcon);
537  toolbar->addAction(overviewAction);
538  toolbar->addAction(sendCoinsAction);
539  toolbar->addAction(receiveCoinsAction);
540  toolbar->addAction(historyAction);
541  overviewAction->setChecked(true);
542 
543 #ifdef ENABLE_WALLET
544  QWidget *spacer = new QWidget();
545  spacer->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
546  toolbar->addWidget(spacer);
547 
548  m_wallet_selector = new QComboBox();
549  m_wallet_selector->setSizeAdjustPolicy(QComboBox::AdjustToContents);
550  connect(m_wallet_selector, qOverload<int>(&QComboBox::currentIndexChanged), this, &BitcoinGUI::setCurrentWalletBySelectorIndex);
551 
552  m_wallet_selector_label = new QLabel();
553  m_wallet_selector_label->setText(tr("Wallet:") + " ");
555 
558 
559  m_wallet_selector_label_action->setVisible(false);
560  m_wallet_selector_action->setVisible(false);
561 #endif
562  }
563 }
564 
566 {
567  this->clientModel = _clientModel;
568  if(_clientModel)
569  {
570  // Create system tray menu (or setup the dock menu) that late to prevent users from calling actions,
571  // while the client has not yet fully loaded
573 
574  // Keep up to date with client
578  });
580  connect(_clientModel, &ClientModel::networkActiveChanged, this, &BitcoinGUI::setNetworkActive);
581 
582  modalOverlay->setKnownBestHeight(tip_info->header_height, QDateTime::fromSecsSinceEpoch(tip_info->header_time));
583  setNumBlocks(tip_info->block_height, QDateTime::fromSecsSinceEpoch(tip_info->block_time), tip_info->verification_progress, false, SynchronizationState::INIT_DOWNLOAD);
584  connect(_clientModel, &ClientModel::numBlocksChanged, this, &BitcoinGUI::setNumBlocks);
585 
586  // Receive and report messages from client model
587  connect(_clientModel, &ClientModel::message, [this](const QString &title, const QString &message, unsigned int style){
588  this->message(title, message, style);
589  });
590 
591  // Show progress dialog
592  connect(_clientModel, &ClientModel::showProgress, this, &BitcoinGUI::showProgress);
593 
594  rpcConsole->setClientModel(_clientModel, tip_info->block_height, tip_info->block_time, tip_info->verification_progress);
595 
596  updateProxyIcon();
597 
598 #ifdef ENABLE_WALLET
599  if(walletFrame)
600  {
601  walletFrame->setClientModel(_clientModel);
602  }
603 #endif // ENABLE_WALLET
605 
606  OptionsModel* optionsModel = _clientModel->getOptionsModel();
607  if (optionsModel && trayIcon) {
608  // be aware of the tray icon disable state change reported by the OptionsModel object.
609  connect(optionsModel, &OptionsModel::showTrayIconChanged, trayIcon, &QSystemTrayIcon::setVisible);
610 
611  // initialize the disable state of the tray icon with the current value in the model.
612  trayIcon->setVisible(optionsModel->getShowTrayIcon());
613  }
614  } else {
615  if(trayIconMenu)
616  {
617  // Disable context menu on tray icon
618  trayIconMenu->clear();
619  }
620  // Propagate cleared model to child objects
621  rpcConsole->setClientModel(nullptr);
622 #ifdef ENABLE_WALLET
623  if (walletFrame)
624  {
625  walletFrame->setClientModel(nullptr);
626  }
627 #endif // ENABLE_WALLET
629  }
630 }
631 
632 #ifdef ENABLE_WALLET
633 void BitcoinGUI::setWalletController(WalletController* wallet_controller)
634 {
636  assert(wallet_controller);
637 
638  m_wallet_controller = wallet_controller;
639 
640  m_create_wallet_action->setEnabled(true);
641  m_open_wallet_action->setEnabled(true);
643 
644  GUIUtil::ExceptionSafeConnect(wallet_controller, &WalletController::walletAdded, this, &BitcoinGUI::addWallet);
645  connect(wallet_controller, &WalletController::walletRemoved, this, &BitcoinGUI::removeWallet);
646 
647  auto activity = new LoadWalletsActivity(m_wallet_controller, this);
648  activity->load();
649 }
650 
651 WalletController* BitcoinGUI::getWalletController()
652 {
653  return m_wallet_controller;
654 }
655 
656 void BitcoinGUI::addWallet(WalletModel* walletModel)
657 {
658  if (!walletFrame) return;
659 
660  WalletView* wallet_view = new WalletView(walletModel, platformStyle, walletFrame);
661  if (!walletFrame->addView(wallet_view)) return;
662 
663  rpcConsole->addWallet(walletModel);
664  if (m_wallet_selector->count() == 0) {
666  } else if (m_wallet_selector->count() == 1) {
667  m_wallet_selector_label_action->setVisible(true);
668  m_wallet_selector_action->setVisible(true);
669  }
670 
672  connect(wallet_view, &WalletView::transactionClicked, this, &BitcoinGUI::gotoHistoryPage);
673  connect(wallet_view, &WalletView::coinsSent, this, &BitcoinGUI::gotoHistoryPage);
674  connect(wallet_view, &WalletView::message, [this](const QString& title, const QString& message, unsigned int style) {
675  this->message(title, message, style);
676  });
677  connect(wallet_view, &WalletView::encryptionStatusChanged, this, &BitcoinGUI::updateWalletStatus);
678  connect(wallet_view, &WalletView::incomingTransaction, this, &BitcoinGUI::incomingTransaction);
679  connect(this, &BitcoinGUI::setPrivacy, wallet_view, &WalletView::setPrivacy);
680  wallet_view->setPrivacy(isPrivacyModeActivated());
681  const QString display_name = walletModel->getDisplayName();
682  m_wallet_selector->addItem(display_name, QVariant::fromValue(walletModel));
683 }
684 
685 void BitcoinGUI::removeWallet(WalletModel* walletModel)
686 {
687  if (!walletFrame) return;
688 
689  labelWalletHDStatusIcon->hide();
691 
692  int index = m_wallet_selector->findData(QVariant::fromValue(walletModel));
693  m_wallet_selector->removeItem(index);
694  if (m_wallet_selector->count() == 0) {
696  overviewAction->setChecked(true);
697  } else if (m_wallet_selector->count() == 1) {
698  m_wallet_selector_label_action->setVisible(false);
699  m_wallet_selector_action->setVisible(false);
700  }
701  rpcConsole->removeWallet(walletModel);
702  walletFrame->removeWallet(walletModel);
704 }
705 
706 void BitcoinGUI::setCurrentWallet(WalletModel* wallet_model)
707 {
708  if (!walletFrame) return;
709  walletFrame->setCurrentWallet(wallet_model);
710  for (int index = 0; index < m_wallet_selector->count(); ++index) {
711  if (m_wallet_selector->itemData(index).value<WalletModel*>() == wallet_model) {
712  m_wallet_selector->setCurrentIndex(index);
713  break;
714  }
715  }
717 }
718 
719 void BitcoinGUI::setCurrentWalletBySelectorIndex(int index)
720 {
721  WalletModel* wallet_model = m_wallet_selector->itemData(index).value<WalletModel*>();
722  if (wallet_model) setCurrentWallet(wallet_model);
723 }
724 
725 void BitcoinGUI::removeAllWallets()
726 {
727  if(!walletFrame)
728  return;
731 }
732 #endif // ENABLE_WALLET
733 
735 {
736  overviewAction->setEnabled(enabled);
737  sendCoinsAction->setEnabled(enabled);
738  receiveCoinsAction->setEnabled(enabled);
739  historyAction->setEnabled(enabled);
740  encryptWalletAction->setEnabled(enabled);
741  backupWalletAction->setEnabled(enabled);
742  changePassphraseAction->setEnabled(enabled);
743  signMessageAction->setEnabled(enabled);
744  verifyMessageAction->setEnabled(enabled);
745  usedSendingAddressesAction->setEnabled(enabled);
746  usedReceivingAddressesAction->setEnabled(enabled);
747  openAction->setEnabled(enabled);
748  m_close_wallet_action->setEnabled(enabled);
749  m_close_all_wallets_action->setEnabled(enabled);
750 }
751 
753 {
754  assert(QSystemTrayIcon::isSystemTrayAvailable());
755 
756 #ifndef Q_OS_MAC
757  if (QSystemTrayIcon::isSystemTrayAvailable()) {
758  trayIcon = new QSystemTrayIcon(m_network_style->getTrayAndWindowIcon(), this);
759  QString toolTip = tr("%1 client").arg(PACKAGE_NAME) + " " + m_network_style->getTitleAddText();
760  trayIcon->setToolTip(toolTip);
761  }
762 #endif
763 }
764 
766 {
767 #ifndef Q_OS_MAC
768  if (!trayIcon) return;
769 #endif // Q_OS_MAC
770 
771  // Configuration of the tray icon (or Dock icon) menu.
772  QAction* show_hide_action{nullptr};
773 #ifndef Q_OS_MAC
774  // Note: On macOS, the Dock icon's menu already has Show / Hide action.
775  show_hide_action = trayIconMenu->addAction(QString(), this, &BitcoinGUI::toggleHidden);
776  trayIconMenu->addSeparator();
777 #endif // Q_OS_MAC
778 
779  QAction* send_action{nullptr};
780  QAction* receive_action{nullptr};
781  QAction* sign_action{nullptr};
782  QAction* verify_action{nullptr};
783  if (enableWallet) {
784  send_action = trayIconMenu->addAction(sendCoinsAction->text(), sendCoinsAction, &QAction::trigger);
785  receive_action = trayIconMenu->addAction(receiveCoinsAction->text(), receiveCoinsAction, &QAction::trigger);
786  trayIconMenu->addSeparator();
787  sign_action = trayIconMenu->addAction(signMessageAction->text(), signMessageAction, &QAction::trigger);
788  verify_action = trayIconMenu->addAction(verifyMessageAction->text(), verifyMessageAction, &QAction::trigger);
789  trayIconMenu->addSeparator();
790  }
791  QAction* options_action = trayIconMenu->addAction(optionsAction->text(), optionsAction, &QAction::trigger);
792  options_action->setMenuRole(QAction::PreferencesRole);
793  QAction* node_window_action = trayIconMenu->addAction(openRPCConsoleAction->text(), openRPCConsoleAction, &QAction::trigger);
794  QAction* quit_action{nullptr};
795 #ifndef Q_OS_MAC
796  // Note: On macOS, the Dock icon's menu already has Quit action.
797  trayIconMenu->addSeparator();
798  quit_action = trayIconMenu->addAction(quitAction->text(), quitAction, &QAction::trigger);
799 
800  trayIcon->setContextMenu(trayIconMenu.get());
801  connect(trayIcon, &QSystemTrayIcon::activated, [this](QSystemTrayIcon::ActivationReason reason) {
802  if (reason == QSystemTrayIcon::Trigger) {
803  // Click on system tray icon triggers show/hide of the main window
804  toggleHidden();
805  }
806  });
807 #else
808  // Note: On macOS, the Dock icon is used to provide the tray's functionality.
810  connect(dockIconHandler, &MacDockIconHandler::dockIconClicked, [this] {
811  show();
812  activateWindow();
813  });
814  trayIconMenu->setAsDockMenu();
815 #endif // Q_OS_MAC
816 
817  connect(
818  // Using QSystemTrayIcon::Context is not reliable.
819  // See https://bugreports.qt.io/browse/QTBUG-91697
820  trayIconMenu.get(), &QMenu::aboutToShow,
821  [this, show_hide_action, send_action, receive_action, sign_action, verify_action, options_action, node_window_action, quit_action] {
822  if (show_hide_action) show_hide_action->setText(
823  (!isHidden() && !isMinimized() && !GUIUtil::isObscured(this)) ?
824  tr("&Hide") :
825  tr("S&how"));
826  if (QApplication::activeModalWidget()) {
827  for (QAction* a : trayIconMenu.get()->actions()) {
828  a->setEnabled(false);
829  }
830  } else {
831  if (show_hide_action) show_hide_action->setEnabled(true);
832  if (enableWallet) {
833  send_action->setEnabled(sendCoinsAction->isEnabled());
834  receive_action->setEnabled(receiveCoinsAction->isEnabled());
835  sign_action->setEnabled(signMessageAction->isEnabled());
836  verify_action->setEnabled(verifyMessageAction->isEnabled());
837  }
838  options_action->setEnabled(optionsAction->isEnabled());
839  node_window_action->setEnabled(openRPCConsoleAction->isEnabled());
840  if (quit_action) quit_action->setEnabled(true);
841  }
842  });
843 }
844 
846 {
848 }
849 
851 {
852  if(!clientModel)
853  return;
854 
855  auto dlg = new HelpMessageDialog(this, /* about */ true);
857 }
858 
860 {
862  Q_EMIT consoleShown(rpcConsole);
863 }
864 
866 {
868  showDebugWindow();
869 }
870 
872 {
874 }
875 
876 #ifdef ENABLE_WALLET
877 void BitcoinGUI::openClicked()
878 {
879  OpenURIDialog dlg(platformStyle, this);
880  if(dlg.exec())
881  {
882  Q_EMIT receivedURI(dlg.getURI());
883  }
884 }
885 
886 void BitcoinGUI::gotoOverviewPage()
887 {
888  overviewAction->setChecked(true);
890 }
891 
892 void BitcoinGUI::gotoHistoryPage()
893 {
894  historyAction->setChecked(true);
896 }
897 
898 void BitcoinGUI::gotoReceiveCoinsPage()
899 {
900  receiveCoinsAction->setChecked(true);
902 }
903 
904 void BitcoinGUI::gotoSendCoinsPage(QString addr)
905 {
906  sendCoinsAction->setChecked(true);
908 }
909 
910 void BitcoinGUI::gotoSignMessageTab(QString addr)
911 {
913 }
914 
915 void BitcoinGUI::gotoVerifyMessageTab(QString addr)
916 {
918 }
919 void BitcoinGUI::gotoLoadPSBT(bool from_clipboard)
920 {
921  if (walletFrame) walletFrame->gotoLoadPSBT(from_clipboard);
922 }
923 #endif // ENABLE_WALLET
924 
926 {
928  QString icon;
929  switch(count)
930  {
931  case 0: icon = ":/icons/connect_0"; break;
932  case 1: case 2: case 3: icon = ":/icons/connect_1"; break;
933  case 4: case 5: case 6: icon = ":/icons/connect_2"; break;
934  case 7: case 8: case 9: icon = ":/icons/connect_3"; break;
935  default: icon = ":/icons/connect_4"; break;
936  }
937 
938  QString tooltip;
939 
940  if (m_node.getNetworkActive()) {
941  //: A substring of the tooltip.
942  tooltip = tr("%n active connection(s) to Bitcoin network.", "", count);
943  } else {
944  //: A substring of the tooltip.
945  tooltip = tr("Network activity disabled.");
946  icon = ":/icons/network_disabled";
947  }
948 
949  // Don't word-wrap this (fixed-width) tooltip
950  tooltip = QLatin1String("<nobr>") + tooltip + QLatin1String("<br>") +
951  //: A substring of the tooltip. "More actions" are available via the context menu.
952  tr("Click for more actions.") + QLatin1String("</nobr>");
953  connectionsControl->setToolTip(tooltip);
954 
956 }
957 
959 {
961 }
962 
963 void BitcoinGUI::setNetworkActive(bool network_active)
964 {
966  m_network_context_menu->clear();
967  m_network_context_menu->addAction(
968  //: A context menu item. The "Peers tab" is an element of the "Node window".
969  tr("Show Peers tab"),
970  [this] {
972  showDebugWindow();
973  });
974  m_network_context_menu->addAction(
975  network_active ?
976  //: A context menu item.
977  tr("Disable network activity") :
978  //: A context menu item. The network activity was disabled previously.
979  tr("Enable network activity"),
980  [this, new_state = !network_active] { m_node.setNetworkActive(new_state); });
981 }
982 
984 {
985  int64_t headersTipTime = clientModel->getHeaderTipTime();
986  int headersTipHeight = clientModel->getHeaderTipHeight();
987  int estHeadersLeft = (GetTime() - headersTipTime) / Params().GetConsensus().nPowTargetSpacing;
988  if (estHeadersLeft > HEADER_HEIGHT_DELTA_SYNC)
989  progressBarLabel->setText(tr("Syncing Headers (%1%)…").arg(QString::number(100.0 / (headersTipHeight+estHeadersLeft)*headersTipHeight, 'f', 1)));
990 }
991 
993 {
995  return;
996 
997  auto dlg = new OptionsDialog(this, enableWallet);
999  dlg->setCurrentTab(tab);
1000  dlg->setModel(clientModel->getOptionsModel());
1002 }
1003 
1004 void BitcoinGUI::setNumBlocks(int count, const QDateTime& blockDate, double nVerificationProgress, bool header, SynchronizationState sync_state)
1005 {
1006 // Disabling macOS App Nap on initial sync, disk and reindex operations.
1007 #ifdef Q_OS_MAC
1008  if (sync_state == SynchronizationState::POST_INIT) {
1009  m_app_nap_inhibitor->enableAppNap();
1010  } else {
1011  m_app_nap_inhibitor->disableAppNap();
1012  }
1013 #endif
1014 
1015  if (modalOverlay)
1016  {
1017  if (header)
1018  modalOverlay->setKnownBestHeight(count, blockDate);
1019  else
1020  modalOverlay->tipUpdate(count, blockDate, nVerificationProgress);
1021  }
1022  if (!clientModel)
1023  return;
1024 
1025  // Prevent orphan statusbar messages (e.g. hover Quit in main menu, wait until chain-sync starts -> garbled text)
1026  statusBar()->clearMessage();
1027 
1028  // Acquire current block source
1029  enum BlockSource blockSource = clientModel->getBlockSource();
1030  switch (blockSource) {
1031  case BlockSource::NETWORK:
1032  if (header) {
1034  return;
1035  }
1036  progressBarLabel->setText(tr("Synchronizing with network…"));
1038  break;
1039  case BlockSource::DISK:
1040  if (header) {
1041  progressBarLabel->setText(tr("Indexing blocks on disk…"));
1042  } else {
1043  progressBarLabel->setText(tr("Processing blocks on disk…"));
1044  }
1045  break;
1046  case BlockSource::REINDEX:
1047  progressBarLabel->setText(tr("Reindexing blocks on disk…"));
1048  break;
1049  case BlockSource::NONE:
1050  if (header) {
1051  return;
1052  }
1053  progressBarLabel->setText(tr("Connecting to peers…"));
1054  break;
1055  }
1056 
1057  QString tooltip;
1058 
1059  QDateTime currentDate = QDateTime::currentDateTime();
1060  qint64 secs = blockDate.secsTo(currentDate);
1061 
1062  tooltip = tr("Processed %n block(s) of transaction history.", "", count);
1063 
1064  // Set icon state: spinning if catching up, tick otherwise
1065  if (secs < MAX_BLOCK_TIME_GAP) {
1066  tooltip = tr("Up to date") + QString(".<br>") + tooltip;
1067  labelBlocksIcon->setThemedPixmap(QStringLiteral(":/icons/synced"), STATUSBAR_ICONSIZE, STATUSBAR_ICONSIZE);
1068 
1069 #ifdef ENABLE_WALLET
1070  if(walletFrame)
1071  {
1073  modalOverlay->showHide(true, true);
1074  }
1075 #endif // ENABLE_WALLET
1076 
1077  progressBarLabel->setVisible(false);
1078  progressBar->setVisible(false);
1079  }
1080  else
1081  {
1082  QString timeBehindText = GUIUtil::formatNiceTimeOffset(secs);
1083 
1084  progressBarLabel->setVisible(true);
1085  progressBar->setFormat(tr("%1 behind").arg(timeBehindText));
1086  progressBar->setMaximum(1000000000);
1087  progressBar->setValue(nVerificationProgress * 1000000000.0 + 0.5);
1088  progressBar->setVisible(true);
1089 
1090  tooltip = tr("Catching up…") + QString("<br>") + tooltip;
1091  if(count != prevBlocks)
1092  {
1094  QString(":/animation/spinner-%1").arg(spinnerFrame, 3, 10, QChar('0')),
1097  }
1098  prevBlocks = count;
1099 
1100 #ifdef ENABLE_WALLET
1101  if(walletFrame)
1102  {
1105  }
1106 #endif // ENABLE_WALLET
1107 
1108  tooltip += QString("<br>");
1109  tooltip += tr("Last received block was generated %1 ago.").arg(timeBehindText);
1110  tooltip += QString("<br>");
1111  tooltip += tr("Transactions after this will not yet be visible.");
1112  }
1113 
1114  // Don't word-wrap this (fixed-width) tooltip
1115  tooltip = QString("<nobr>") + tooltip + QString("</nobr>");
1116 
1117  labelBlocksIcon->setToolTip(tooltip);
1118  progressBarLabel->setToolTip(tooltip);
1119  progressBar->setToolTip(tooltip);
1120 }
1121 
1122 void BitcoinGUI::message(const QString& title, QString message, unsigned int style, bool* ret, const QString& detailed_message)
1123 {
1124  // Default title. On macOS, the window title is ignored (as required by the macOS Guidelines).
1125  QString strTitle{PACKAGE_NAME};
1126  // Default to information icon
1127  int nMBoxIcon = QMessageBox::Information;
1128  int nNotifyIcon = Notificator::Information;
1129 
1130  QString msgType;
1131  if (!title.isEmpty()) {
1132  msgType = title;
1133  } else {
1134  switch (style) {
1136  msgType = tr("Error");
1137  message = tr("Error: %1").arg(message);
1138  break;
1140  msgType = tr("Warning");
1141  message = tr("Warning: %1").arg(message);
1142  break;
1144  msgType = tr("Information");
1145  // No need to prepend the prefix here.
1146  break;
1147  default:
1148  break;
1149  }
1150  }
1151 
1152  if (!msgType.isEmpty()) {
1153  strTitle += " - " + msgType;
1154  }
1155 
1156  if (style & CClientUIInterface::ICON_ERROR) {
1157  nMBoxIcon = QMessageBox::Critical;
1158  nNotifyIcon = Notificator::Critical;
1159  } else if (style & CClientUIInterface::ICON_WARNING) {
1160  nMBoxIcon = QMessageBox::Warning;
1161  nNotifyIcon = Notificator::Warning;
1162  }
1163 
1164  if (style & CClientUIInterface::MODAL) {
1165  // Check for buttons, use OK as default, if none was supplied
1166  QMessageBox::StandardButton buttons;
1167  if (!(buttons = (QMessageBox::StandardButton)(style & CClientUIInterface::BTN_MASK)))
1168  buttons = QMessageBox::Ok;
1169 
1171  QMessageBox mBox(static_cast<QMessageBox::Icon>(nMBoxIcon), strTitle, message, buttons, this);
1172  mBox.setTextFormat(Qt::PlainText);
1173  mBox.setDetailedText(detailed_message);
1174  int r = mBox.exec();
1175  if (ret != nullptr)
1176  *ret = r == QMessageBox::Ok;
1177  } else {
1178  notificator->notify(static_cast<Notificator::Class>(nNotifyIcon), strTitle, message);
1179  }
1180 }
1181 
1183 {
1184  if (e->type() == QEvent::PaletteChange) {
1185  overviewAction->setIcon(platformStyle->SingleColorIcon(QStringLiteral(":/icons/overview")));
1186  sendCoinsAction->setIcon(platformStyle->SingleColorIcon(QStringLiteral(":/icons/send")));
1187  receiveCoinsAction->setIcon(platformStyle->SingleColorIcon(QStringLiteral(":/icons/receiving_addresses")));
1188  historyAction->setIcon(platformStyle->SingleColorIcon(QStringLiteral(":/icons/history")));
1189  }
1190 
1191  QMainWindow::changeEvent(e);
1192 
1193 #ifndef Q_OS_MAC // Ignored on Mac
1194  if(e->type() == QEvent::WindowStateChange)
1195  {
1197  {
1198  QWindowStateChangeEvent *wsevt = static_cast<QWindowStateChangeEvent*>(e);
1199  if(!(wsevt->oldState() & Qt::WindowMinimized) && isMinimized())
1200  {
1201  QTimer::singleShot(0, this, &BitcoinGUI::hide);
1202  e->ignore();
1203  }
1204  else if((wsevt->oldState() & Qt::WindowMinimized) && !isMinimized())
1205  {
1206  QTimer::singleShot(0, this, &BitcoinGUI::show);
1207  e->ignore();
1208  }
1209  }
1210  }
1211 #endif
1212 }
1213 
1214 void BitcoinGUI::closeEvent(QCloseEvent *event)
1215 {
1216 #ifndef Q_OS_MAC // Ignored on Mac
1218  {
1220  {
1221  // close rpcConsole in case it was open to make some space for the shutdown window
1222  rpcConsole->close();
1223 
1224  Q_EMIT quitRequested();
1225  }
1226  else
1227  {
1228  QMainWindow::showMinimized();
1229  event->ignore();
1230  }
1231  }
1232 #else
1233  QMainWindow::closeEvent(event);
1234 #endif
1235 }
1236 
1237 void BitcoinGUI::showEvent(QShowEvent *event)
1238 {
1239  // enable the debug window when the main window shows up
1240  openRPCConsoleAction->setEnabled(true);
1241  aboutAction->setEnabled(true);
1242  optionsAction->setEnabled(true);
1243 }
1244 
1245 #ifdef ENABLE_WALLET
1246 void BitcoinGUI::incomingTransaction(const QString& date, int unit, const CAmount& amount, const QString& type, const QString& address, const QString& label, const QString& walletName)
1247 {
1248  // On new transaction, make an info balloon
1249  QString msg = tr("Date: %1\n").arg(date) +
1250  tr("Amount: %1\n").arg(BitcoinUnits::formatWithUnit(unit, amount, true));
1251  if (m_node.walletLoader().getWallets().size() > 1 && !walletName.isEmpty()) {
1252  msg += tr("Wallet: %1\n").arg(walletName);
1253  }
1254  msg += tr("Type: %1\n").arg(type);
1255  if (!label.isEmpty())
1256  msg += tr("Label: %1\n").arg(label);
1257  else if (!address.isEmpty())
1258  msg += tr("Address: %1\n").arg(address);
1259  message((amount)<0 ? tr("Sent transaction") : tr("Incoming transaction"),
1261 }
1262 #endif // ENABLE_WALLET
1263 
1264 void BitcoinGUI::dragEnterEvent(QDragEnterEvent *event)
1265 {
1266  // Accept only URIs
1267  if(event->mimeData()->hasUrls())
1268  event->acceptProposedAction();
1269 }
1270 
1271 void BitcoinGUI::dropEvent(QDropEvent *event)
1272 {
1273  if(event->mimeData()->hasUrls())
1274  {
1275  for (const QUrl &uri : event->mimeData()->urls())
1276  {
1277  Q_EMIT receivedURI(uri.toString());
1278  }
1279  }
1280  event->acceptProposedAction();
1281 }
1282 
1283 bool BitcoinGUI::eventFilter(QObject *object, QEvent *event)
1284 {
1285  // Catch status tip events
1286  if (event->type() == QEvent::StatusTip)
1287  {
1288  // Prevent adding text from setStatusTip(), if we currently use the status bar for displaying other stuff
1289  if (progressBarLabel->isVisible() || progressBar->isVisible())
1290  return true;
1291  }
1292  return QMainWindow::eventFilter(object, event);
1293 }
1294 
1295 #ifdef ENABLE_WALLET
1296 bool BitcoinGUI::handlePaymentRequest(const SendCoinsRecipient& recipient)
1297 {
1298  // URI has to be valid
1299  if (walletFrame && walletFrame->handlePaymentRequest(recipient))
1300  {
1302  gotoSendCoinsPage();
1303  return true;
1304  }
1305  return false;
1306 }
1307 
1308 void BitcoinGUI::setHDStatus(bool privkeyDisabled, int hdEnabled)
1309 {
1310  labelWalletHDStatusIcon->setThemedPixmap(privkeyDisabled ? QStringLiteral(":/icons/eye") : hdEnabled ? QStringLiteral(":/icons/hd_enabled") : QStringLiteral(":/icons/hd_disabled"), STATUSBAR_ICONSIZE, STATUSBAR_ICONSIZE);
1311  labelWalletHDStatusIcon->setToolTip(privkeyDisabled ? tr("Private key <b>disabled</b>") : hdEnabled ? tr("HD key generation is <b>enabled</b>") : tr("HD key generation is <b>disabled</b>"));
1312  labelWalletHDStatusIcon->show();
1313 }
1314 
1315 void BitcoinGUI::setEncryptionStatus(int status)
1316 {
1317  switch(status)
1318  {
1320  labelWalletEncryptionIcon->hide();
1321  encryptWalletAction->setChecked(false);
1322  changePassphraseAction->setEnabled(false);
1323  encryptWalletAction->setEnabled(true);
1324  break;
1325  case WalletModel::Unlocked:
1326  labelWalletEncryptionIcon->show();
1327  labelWalletEncryptionIcon->setThemedPixmap(QStringLiteral(":/icons/lock_open"), STATUSBAR_ICONSIZE, STATUSBAR_ICONSIZE);
1328  labelWalletEncryptionIcon->setToolTip(tr("Wallet is <b>encrypted</b> and currently <b>unlocked</b>"));
1329  encryptWalletAction->setChecked(true);
1330  changePassphraseAction->setEnabled(true);
1331  encryptWalletAction->setEnabled(false);
1332  break;
1333  case WalletModel::Locked:
1334  labelWalletEncryptionIcon->show();
1335  labelWalletEncryptionIcon->setThemedPixmap(QStringLiteral(":/icons/lock_closed"), STATUSBAR_ICONSIZE, STATUSBAR_ICONSIZE);
1336  labelWalletEncryptionIcon->setToolTip(tr("Wallet is <b>encrypted</b> and currently <b>locked</b>"));
1337  encryptWalletAction->setChecked(true);
1338  changePassphraseAction->setEnabled(true);
1339  encryptWalletAction->setEnabled(false);
1340  break;
1341  }
1342 }
1343 
1344 void BitcoinGUI::updateWalletStatus()
1345 {
1347 
1348  WalletView * const walletView = walletFrame->currentWalletView();
1349  if (!walletView) {
1350  return;
1351  }
1352  WalletModel * const walletModel = walletView->getWalletModel();
1353  setEncryptionStatus(walletModel->getEncryptionStatus());
1354  setHDStatus(walletModel->wallet().privateKeysDisabled(), walletModel->wallet().hdEnabled());
1355 }
1356 #endif // ENABLE_WALLET
1357 
1359 {
1360  std::string ip_port;
1361  bool proxy_enabled = clientModel->getProxyInfo(ip_port);
1362 
1363  if (proxy_enabled) {
1365  QString ip_port_q = QString::fromStdString(ip_port);
1367  labelProxyIcon->setToolTip(tr("Proxy is <b>enabled</b>: %1").arg(ip_port_q));
1368  } else {
1369  labelProxyIcon->show();
1370  }
1371  } else {
1372  labelProxyIcon->hide();
1373  }
1374 }
1375 
1377 {
1378  QString window_title = PACKAGE_NAME;
1379 #ifdef ENABLE_WALLET
1380  if (walletFrame) {
1381  WalletModel* const wallet_model = walletFrame->currentWalletModel();
1382  if (wallet_model && !wallet_model->getWalletName().isEmpty()) {
1383  window_title += " - " + wallet_model->getDisplayName();
1384  }
1385  }
1386 #endif
1387  if (!m_network_style->getTitleAddText().isEmpty()) {
1388  window_title += " - " + m_network_style->getTitleAddText();
1389  }
1390  setWindowTitle(window_title);
1391 }
1392 
1393 void BitcoinGUI::showNormalIfMinimized(bool fToggleHidden)
1394 {
1395  if(!clientModel)
1396  return;
1397 
1398  if (!isHidden() && !isMinimized() && !GUIUtil::isObscured(this) && fToggleHidden) {
1399  hide();
1400  } else {
1401  GUIUtil::bringToFront(this);
1402  }
1403 }
1404 
1406 {
1407  showNormalIfMinimized(true);
1408 }
1409 
1411 {
1412  if (m_node.shutdownRequested())
1413  {
1414  if(rpcConsole)
1415  rpcConsole->hide();
1416  Q_EMIT quitRequested();
1417  }
1418 }
1419 
1420 void BitcoinGUI::showProgress(const QString &title, int nProgress)
1421 {
1422  if (nProgress == 0) {
1423  progressDialog = new QProgressDialog(title, QString(), 0, 100);
1425  progressDialog->setWindowModality(Qt::ApplicationModal);
1426  progressDialog->setAutoClose(false);
1427  progressDialog->setValue(0);
1428  } else if (nProgress == 100) {
1429  if (progressDialog) {
1430  progressDialog->close();
1431  progressDialog->deleteLater();
1432  progressDialog = nullptr;
1433  }
1434  } else if (progressDialog) {
1435  progressDialog->setValue(nProgress);
1436  }
1437 }
1438 
1440 {
1441  if (modalOverlay && (progressBar->isVisible() || modalOverlay->isLayerVisible()))
1443 }
1444 
1445 static bool ThreadSafeMessageBox(BitcoinGUI* gui, const bilingual_str& message, const std::string& caption, unsigned int style)
1446 {
1447  bool modal = (style & CClientUIInterface::MODAL);
1448  // The SECURE flag has no effect in the Qt GUI.
1449  // bool secure = (style & CClientUIInterface::SECURE);
1450  style &= ~CClientUIInterface::SECURE;
1451  bool ret = false;
1452 
1453  QString detailed_message; // This is original message, in English, for googling and referencing.
1454  if (message.original != message.translated) {
1455  detailed_message = BitcoinGUI::tr("Original message:") + "\n" + QString::fromStdString(message.original);
1456  }
1457 
1458  // In case of modal message, use blocking connection to wait for user to click a button
1459  bool invoked = QMetaObject::invokeMethod(gui, "message",
1460  modal ? GUIUtil::blockingGUIThreadConnection() : Qt::QueuedConnection,
1461  Q_ARG(QString, QString::fromStdString(caption)),
1462  Q_ARG(QString, QString::fromStdString(message.translated)),
1463  Q_ARG(unsigned int, style),
1464  Q_ARG(bool*, &ret),
1465  Q_ARG(QString, detailed_message));
1466  assert(invoked);
1467  return ret;
1468 }
1469 
1471 {
1472  // Connect signals to client
1473  m_handler_message_box = m_node.handleMessageBox(std::bind(ThreadSafeMessageBox, this, std::placeholders::_1, std::placeholders::_2, std::placeholders::_3));
1474  m_handler_question = m_node.handleQuestion(std::bind(ThreadSafeMessageBox, this, std::placeholders::_1, std::placeholders::_3, std::placeholders::_4));
1475 }
1476 
1478 {
1479  // Disconnect signals from client
1480  m_handler_message_box->disconnect();
1481  m_handler_question->disconnect();
1482 }
1483 
1485 {
1487  return m_mask_values_action->isChecked();
1488 }
1489 
1491  : optionsModel(nullptr),
1492  menu(nullptr),
1493  m_platform_style{platformStyle}
1494 {
1495  createContextMenu();
1496  setToolTip(tr("Unit to show amounts in. Click to select another unit."));
1497  QList<BitcoinUnits::Unit> units = BitcoinUnits::availableUnits();
1498  int max_width = 0;
1499  const QFontMetrics fm(font());
1500  for (const BitcoinUnits::Unit unit : units)
1501  {
1502  max_width = qMax(max_width, GUIUtil::TextWidth(fm, BitcoinUnits::longName(unit)));
1503  }
1504  setMinimumSize(max_width, 0);
1505  setAlignment(Qt::AlignRight | Qt::AlignVCenter);
1506  setStyleSheet(QString("QLabel { color : %1 }").arg(m_platform_style->SingleColor().name()));
1507 }
1508 
1511 {
1512  onDisplayUnitsClicked(event->pos());
1513 }
1514 
1516 {
1517  if (e->type() == QEvent::PaletteChange) {
1518  QString style = QString("QLabel { color : %1 }").arg(m_platform_style->SingleColor().name());
1519  if (style != styleSheet()) {
1520  setStyleSheet(style);
1521  }
1522  }
1523 
1524  QLabel::changeEvent(e);
1525 }
1526 
1529 {
1530  menu = new QMenu(this);
1532  menu->addAction(BitcoinUnits::longName(u))->setData(QVariant(u));
1533  }
1534  connect(menu, &QMenu::triggered, this, &UnitDisplayStatusBarControl::onMenuSelection);
1535 }
1536 
1539 {
1540  if (_optionsModel)
1541  {
1542  this->optionsModel = _optionsModel;
1543 
1544  // be aware of a display unit change reported by the OptionsModel object.
1546 
1547  // initialize the display units label with the current value in the model.
1548  updateDisplayUnit(_optionsModel->getDisplayUnit());
1549  }
1550 }
1551 
1554 {
1555  setText(BitcoinUnits::longName(newUnits));
1556 }
1557 
1560 {
1561  QPoint globalPos = mapToGlobal(point);
1562  menu->exec(globalPos);
1563 }
1564 
1567 {
1568  if (action)
1569  {
1570  optionsModel->setDisplayUnit(action->data());
1571  }
1572 }
OptionsDialog
Preferences dialog.
Definition: optionsdialog.h:35
BitcoinGUI::createToolBars
void createToolBars()
Create the toolbars.
Definition: bitcoingui.cpp:529
RPCConsole::TabTypes::CONSOLE
@ CONSOLE
WalletFrame
A container for embedding all wallet-related controls into BitcoinGUI.
Definition: walletframe.h:28
WalletController::walletRemoved
void walletRemoved(WalletModel *wallet_model)
ClientModel::numBlocksChanged
void numBlocksChanged(int count, const QDateTime &blockDate, double nVerificationProgress, bool header, SynchronizationState sync_state)
OpenURIDialog
Definition: openuridialog.h:16
BitcoinGUI::setClientModel
void setClientModel(ClientModel *clientModel=nullptr, interfaces::BlockAndHeaderTipInfo *tip_info=nullptr)
Set the client model.
Definition: bitcoingui.cpp:565
OptionsDialog::TAB_NETWORK
@ TAB_NETWORK
Definition: optionsdialog.h:45
WalletFrame::currentWalletView
WalletView * currentWalletView() const
Definition: walletframe.cpp:274
notificator.h
Notificator::Critical
@ Critical
An error occurred.
Definition: notificator.h:40
BitcoinGUI::trayIcon
QSystemTrayIcon * trayIcon
Definition: bitcoingui.h:168
WalletFrame::createWalletButtonClicked
void createWalletButtonClicked()
OptionsDialog::Tab
Tab
Definition: optionsdialog.h:43
BitcoinGUI::updateProxyIcon
void updateProxyIcon()
Set the proxy-enabled icon as shown in the UI.
Definition: bitcoingui.cpp:1358
UnitDisplayStatusBarControl::mousePressEvent
void mousePressEvent(QMouseEvent *event) override
So that it responds to left-button clicks.
Definition: bitcoingui.cpp:1510
WalletFrame::gotoReceiveCoinsPage
void gotoReceiveCoinsPage()
Switch to receive coins page.
Definition: walletframe.cpp:167
ModalOverlay
Modal overlay to display information about the chain-sync state.
Definition: modaloverlay.h:20
GUIUtil::PopupMenu
void PopupMenu(QMenu *menu, const QPoint &point, QAction *at_action)
Call QMenu::popup() only on supported QT_QPA_PLATFORM.
Definition: guiutil.cpp:931
OptionsModel::getMinimizeOnClose
bool getMinimizeOnClose() const
Definition: optionsmodel.h:88
count
static int count
Definition: tests.c:31
assert
assert(!tx.IsCoinBase())
ClientModel::numConnectionsChanged
void numConnectionsChanged(int count)
WalletFrame::gotoSignMessageTab
void gotoSignMessageTab(QString addr="")
Show Sign/Verify Message dialog and switch to sign message tab.
Definition: walletframe.cpp:181
BitcoinGUI::trayIconMenu
const std::unique_ptr< QMenu > trayIconMenu
Definition: bitcoingui.h:169
GUIUtil::ClickableLabel
Definition: guiutil.h:260
if
if(na.IsAddrV1Compatible())
Definition: deserialize.cpp:227
BitcoinGUI::setWalletActionsEnabled
void setWalletActionsEnabled(bool enabled)
Enable or disable all wallet-related actions.
Definition: bitcoingui.cpp:734
interfaces::Node::handleMessageBox
virtual std::unique_ptr< Handler > handleMessageBox(MessageBoxFn fn)=0
BitcoinGUI::enableWallet
bool enableWallet
Definition: bitcoingui.h:96
ClientModel::message
void message(const QString &title, const QString &message, unsigned int style)
Fired when a message should be reported to the user.
BitcoinGUI::toggleHidden
void toggleHidden()
Simply calls showNormalIfMinimized(true) for use in SLOT() macro.
Definition: bitcoingui.cpp:1405
CClientUIInterface
Signals for UI communication.
Definition: ui_interface.h:24
BitcoinGUI::rpcConsole
RPCConsole * rpcConsole
Definition: bitcoingui.h:171
BitcoinGUI::closeEvent
void closeEvent(QCloseEvent *event) override
Definition: bitcoingui.cpp:1214
WalletView
Definition: walletview.h:33
CAppNapInhibitor
Definition: macos_appnap.h:10
interfaces::Node::getNetworkActive
virtual bool getNetworkActive()=0
Get network active.
WalletModel
Interface to Bitcoin wallet from Qt view code.
Definition: walletmodel.h:52
HelpMessageDialog
"Help message" dialog box
Definition: utilitydialog.h:20
Notificator::notify
void notify(Class cls, const QString &title, const QString &text, const QIcon &icon=QIcon(), int millisTimeout=10000)
Show notification message.
Definition: notificator.cpp:227
BitcoinGUI::receivedURI
void receivedURI(const QString &uri)
Signal raised when a URI was entered or dragged to the GUI.
ClientModel::getNumConnections
int getNumConnections(unsigned int flags=CONNECTIONS_ALL) const
Return number of connections, default is in- and outbound (total)
Definition: clientmodel.cpp:78
BitcoinGUI::showNormalIfMinimized
void showNormalIfMinimized()
Show window if hidden, unminimize when minimized, rise when obscured or show if hidden and fToggleHid...
Definition: bitcoingui.h:304
MAX_BLOCK_TIME_GAP
static constexpr int64_t MAX_BLOCK_TIME_GAP
Maximum gap between node time and block time used for the "Catching up..." mode in GUI.
Definition: chain.h:39
BitcoinGUI::m_wallet_selector_action
QAction * m_wallet_selector_action
Definition: bitcoingui.h:162
BitcoinGUI::m_wallet_selector
QComboBox * m_wallet_selector
Definition: bitcoingui.h:166
BitcoinUnits::formatWithUnit
static QString formatWithUnit(int unit, const CAmount &amount, bool plussign=false, SeparatorStyle separators=SeparatorStyle::STANDARD)
Format as string (with unit)
Definition: bitcoinunits.cpp:150
BitcoinGUI::clientModel
ClientModel * clientModel
Definition: bitcoingui.h:121
PlatformStyle::SingleColorIcon
QIcon SingleColorIcon(const QString &filename) const
Colorize an icon (given filename) with the icon color.
Definition: platformstyle.cpp:105
LoadWalletsActivity
Definition: walletcontroller.h:148
help
static RPCHelpMan help()
Definition: server.cpp:133
BitcoinGUI::createActions
void createActions()
Create the main UI actions.
Definition: bitcoingui.cpp:245
WalletView::getWalletModel
WalletModel * getWalletModel() const noexcept
Definition: walletview.h:45
walletcontroller.h
UnitDisplayStatusBarControl
Definition: bitcoingui.h:318
walletmodel.h
PlatformStyle::SingleColor
QColor SingleColor() const
Definition: platformstyle.cpp:83
bilingual_str
Bilingual messages:
Definition: translation.h:16
utilitydialog.h
interfaces::Node::setNetworkActive
virtual void setNetworkActive(bool active)=0
Set network active.
WalletModel::isWalletEnabled
static bool isWalletEnabled()
Definition: walletmodel.cpp:572
GUIUtil::ClickableProgressBar::clicked
void clicked(const QPoint &point)
Emitted when the progressbar is clicked.
BitcoinGUI::connectionsControl
GUIUtil::ClickableLabel * connectionsControl
Definition: bitcoingui.h:128
ModalOverlay::triggered
void triggered(bool hidden)
BitcoinGUI::dropEvent
void dropEvent(QDropEvent *event) override
Definition: bitcoingui.cpp:1271
m_node
node::NodeContext m_node
Definition: bitcoin-gui.cpp:36
BitcoinGUI::usedSendingAddressesAction
QAction * usedSendingAddressesAction
Definition: bitcoingui.h:140
WalletModel::Unlocked
@ Unlocked
Definition: walletmodel.h:77
ClientModel::getBlockSource
enum BlockSource getBlockSource() const
Returns enum BlockSource of the current importing/syncing state.
Definition: clientmodel.cpp:166
handler.h
BitcoinGUI::m_load_psbt_action
QAction * m_load_psbt_action
Definition: bitcoingui.h:144
BitcoinGUI::quitAction
QAction * quitAction
Definition: bitcoingui.h:138
CClientUIInterface::MSG_ERROR
@ MSG_ERROR
Definition: ui_interface.h:67
CClientUIInterface::ICON_ERROR
@ ICON_ERROR
Definition: ui_interface.h:31
CClientUIInterface::ICON_WARNING
@ ICON_WARNING
Definition: ui_interface.h:30
BitcoinGUI::overviewAction
QAction * overviewAction
Definition: bitcoingui.h:136
BitcoinGUI::progressDialog
QProgressDialog * progressDialog
Definition: bitcoingui.h:132
BlockSource::DISK
@ DISK
WalletController::listWalletDir
std::map< std::string, bool > listWalletDir() const
Returns all wallet names in the wallet dir mapped to whether the wallet is loaded.
Definition: walletcontroller.cpp:66
GetTime
int64_t GetTime()
DEPRECATED Use either GetTimeSeconds (not mockable) or GetTime<T> (mockable)
Definition: time.cpp:26
WalletController::walletAdded
void walletAdded(WalletModel *wallet_model)
BitcoinGUI::m_node
interfaces::Node & m_node
Definition: bitcoingui.h:117
OptionsModel::displayUnitChanged
void displayUnitChanged(int unit)
CChainParams::GetConsensus
const Consensus::Params & GetConsensus() const
Definition: chainparams.h:82
BitcoinGUI::setNetworkActive
void setNetworkActive(bool network_active)
Set network state shown in the UI.
Definition: bitcoingui.cpp:963
NetworkStyle
Definition: networkstyle.h:13
interfaces::BlockAndHeaderTipInfo
Block and header tip information.
Definition: node.h:48
WalletFrame::encryptWallet
void encryptWallet()
Encrypt the wallet.
Definition: walletframe.cpp:232
BitcoinGUI::changeEvent
void changeEvent(QEvent *e) override
Definition: bitcoingui.cpp:1182
GUIUtil::ExceptionSafeConnect
auto ExceptionSafeConnect(Sender sender, Signal signal, Receiver receiver, Slot method, Qt::ConnectionType type=Qt::AutoConnection)
A drop-in replacement of QObject::connect function (see: https://doc.qt.io/qt-5/qobject....
Definition: guiutil.h:392
GUIUtil::bringToFront
void bringToFront(QWidget *w)
Definition: guiutil.cpp:397
WalletView::setPrivacy
void setPrivacy(bool privacy)
WalletFrame::currentWalletSet
void currentWalletSet()
OptionsModel::setDisplayUnit
void setDisplayUnit(const QVariant &value)
Updates current unit in memory, settings and emits displayUnitChanged(newUnit) signal.
Definition: optionsmodel.cpp:568
WalletFrame::changePassphrase
void changePassphrase()
Change encrypted wallet passphrase.
Definition: walletframe.cpp:246
BitcoinGUI::historyAction
QAction * historyAction
Definition: bitcoingui.h:137
chainparams.h
BitcoinGUI::createTrayIconMenu
void createTrayIconMenu()
Create system tray menu (or setup the dock menu)
Definition: bitcoingui.cpp:765
STATUSBAR_ICONSIZE
static const int STATUSBAR_ICONSIZE
Definition: guiconstants.h:23
BitcoinGUI::message
void message(const QString &title, QString message, unsigned int style, bool *ret=nullptr, const QString &detailed_message=QString())
Notify the user of an event from the core network or transaction handling code.
Definition: bitcoingui.cpp:1122
BitcoinGUI::appToolBar
QToolBar * appToolBar
Definition: bitcoingui.h:135
BitcoinGUI::showDebugWindowActivateConsole
void showDebugWindowActivateConsole()
Show debug window and set focus to the console.
Definition: bitcoingui.cpp:865
WalletFrame::message
void message(const QString &title, const QString &message, unsigned int style)
GUIUtil::isObscured
bool isObscured(QWidget *w)
Definition: guiutil.cpp:388
WalletView::incomingTransaction
void incomingTransaction(const QString &date, int unit, const CAmount &amount, const QString &type, const QString &address, const QString &label, const QString &walletName)
Notify that a new transaction appeared.
interfaces::BlockAndHeaderTipInfo::block_time
int64_t block_time
Definition: node.h:51
BitcoinGUI::notificator
Notificator * notificator
Definition: bitcoingui.h:170
MacDockIconHandler::instance
static MacDockIconHandler * instance()
Definition: macdockiconhandler.mm:33
UnitDisplayStatusBarControl::setOptionsModel
void setOptionsModel(OptionsModel *optionsModel)
Lets the control know about the Options Model (and its signals)
Definition: bitcoingui.cpp:1538
MacDockIconHandler::cleanup
static void cleanup()
Definition: macdockiconhandler.mm:40
Consensus::Params::nPowTargetSpacing
int64_t nPowTargetSpacing
Definition: params.h:103
rpcconsole.h
UnitDisplayStatusBarControl::menu
QMenu * menu
Definition: bitcoingui.h:334
RPCConsole::tabShortcut
QKeySequence tabShortcut(TabTypes tab_type) const
Definition: rpcconsole.cpp:1353
OpenWalletActivity
Definition: walletcontroller.h:132
WalletFrame::backupWallet
void backupWallet()
Backup the wallet.
Definition: walletframe.cpp:239
RPCConsole::addWallet
void addWallet(WalletModel *const walletModel)
BitcoinGUI::isPrivacyModeActivated
bool isPrivacyModeActivated() const
Definition: bitcoingui.cpp:1484
BitcoinGUI::showEvent
void showEvent(QShowEvent *event) override
Definition: bitcoingui.cpp:1237
CClientUIInterface::BTN_MASK
@ BTN_MASK
Mask of all available buttons in CClientUIInterface::MessageBoxFlags This needs to be updated,...
Definition: ui_interface.h:55
SendCoinsRecipient
Definition: sendcoinsrecipient.h:19
BitcoinGUI::setPrivacy
void setPrivacy(bool privacy)
OptionsModel
Interface from Qt to configuration data structure for Bitcoin client.
Definition: optionsmodel.h:38
ClientModel::getOptionsModel
OptionsModel * getOptionsModel()
Definition: clientmodel.cpp:183
BitcoinGUI::showProgress
void showProgress(const QString &title, int nProgress)
Show progress dialog e.g.
Definition: bitcoingui.cpp:1420
WalletFrame::addView
bool addView(WalletView *walletView)
Definition: walletframe.cpp:71
WalletModel::wallet
interfaces::Wallet & wallet() const
Definition: walletmodel.h:145
BitcoinGUI::modalOverlay
ModalOverlay * modalOverlay
Definition: bitcoingui.h:173
BitcoinUnits::availableUnits
static QList< Unit > availableUnits()
Get list of units, for drop-down box.
Definition: bitcoinunits.cpp:21
BitcoinGUI::m_network_style
const NetworkStyle *const m_network_style
Definition: bitcoingui.h:186
BitcoinGUI::m_create_wallet_action
QAction * m_create_wallet_action
Definition: bitcoingui.h:156
Notificator
Cross-platform desktop notification client.
Definition: notificator.h:24
GUIUtil::ShowModalDialogAsynchronously
void ShowModalDialogAsynchronously(QDialog *dialog)
Shows a QDialog instance asynchronously, and deletes it on close.
Definition: guiutil.cpp:987
GUIUtil::ThemedLabel
Definition: guiutil.h:241
CClientUIInterface::MODAL
@ MODAL
Force blocking, modal message box dialog (not just OS notification)
Definition: ui_interface.h:59
MacDockIconHandler::dockIconClicked
void dockIconClicked()
BitcoinGUI::m_mask_values_action
QAction * m_mask_values_action
Definition: bitcoingui.h:163
RPCConsole::removeWallet
void removeWallet(WalletModel *const walletModel)
GUIUtil::formatNiceTimeOffset
QString formatNiceTimeOffset(qint64 secs)
Definition: guiutil.cpp:761
BlockSource::REINDEX
@ REINDEX
BitcoinGUI::unsubscribeFromCoreSignals
void unsubscribeFromCoreSignals()
Disconnect core signals from GUI client.
Definition: bitcoingui.cpp:1477
BitcoinGUI::m_close_all_wallets_action
QAction * m_close_all_wallets_action
Definition: bitcoingui.h:160
OpenWalletActivity::opened
void opened(WalletModel *wallet_model)
interfaces::BlockAndHeaderTipInfo::block_height
int block_height
Definition: node.h:50
PACKAGE_NAME
#define PACKAGE_NAME
Definition: bitcoin-config.h:354
BitcoinGUI::showModalOverlay
void showModalOverlay()
Definition: bitcoingui.cpp:1439
WalletFrame::setCurrentWallet
void setCurrentWallet(WalletModel *wallet_model)
Definition: walletframe.cpp:93
GUIUtil::ClickableLabel::clicked
void clicked(const QPoint &point)
Emitted when the label is clicked.
ClientModel::getHeaderTipHeight
int getHeaderTipHeight() const
Definition: clientmodel.cpp:92
OptionsModel::showTrayIconChanged
void showTrayIconChanged(bool)
WalletFrame::usedReceivingAddresses
void usedReceivingAddresses()
Show used receiving addresses.
Definition: walletframe.cpp:267
ClientModel::getProxyInfo
bool getProxyInfo(std::string &ip_port) const
Definition: clientmodel.cpp:330
RPCConsole::setClientModel
void setClientModel(ClientModel *model=nullptr, int bestblock_height=0, int64_t bestblock_date=0, double verification_progress=0.0)
Definition: rpcconsole.cpp:652
node.h
Notificator::Information
@ Information
Informational message.
Definition: notificator.h:38
BitcoinGUI::~BitcoinGUI
~BitcoinGUI()
Definition: bitcoingui.cpp:227
BitcoinGUI::walletFrame
WalletFrame * walletFrame
Definition: bitcoingui.h:122
BlockSource::NETWORK
@ NETWORK
WalletView::message
void message(const QString &title, const QString &message, unsigned int style)
Fired when a message should be reported to the user.
UnitDisplayStatusBarControl::updateDisplayUnit
void updateDisplayUnit(int newUnits)
When Display Units are changed on OptionsModel it will refresh the display text of the control on the...
Definition: bitcoingui.cpp:1553
WalletController
Controller between interfaces::Node, WalletModel instances and the GUI.
Definition: walletcontroller.h:45
NetworkStyle::getTrayAndWindowIcon
const QIcon & getTrayAndWindowIcon() const
Definition: networkstyle.h:21
BitcoinGUI::progressBarLabel
QLabel * progressBarLabel
Definition: bitcoingui.h:130
WalletModel::getEncryptionStatus
EncryptionStatus getEncryptionStatus() const
Definition: walletmodel.cpp:307
createwalletdialog.h
RPCConsole
Local Bitcoin RPC console.
Definition: rpcconsole.h:38
CreateWalletActivity::created
void created(WalletModel *wallet_model)
BitcoinGUI::showHelpMessageAction
QAction * showHelpMessageAction
Definition: bitcoingui.h:155
WalletFrame::currentWalletModel
WalletModel * currentWalletModel() const
Definition: walletframe.cpp:279
WalletModel::Unencrypted
@ Unencrypted
Definition: walletmodel.h:75
GUIUtil::PolishProgressDialog
void PolishProgressDialog(QProgressDialog *dialog)
Definition: guiutil.cpp:875
CAmount
int64_t CAmount
Amount in satoshis (Can be negative)
Definition: amount.h:12
BitcoinGUI::setNumBlocks
void setNumBlocks(int count, const QDateTime &blockDate, double nVerificationProgress, bool headers, SynchronizationState sync_state)
Set number of blocks and last block date shown in the UI.
Definition: bitcoingui.cpp:1004
guiutil.h
WalletModel::getWalletName
QString getWalletName() const
Definition: walletmodel.cpp:577
BitcoinGUI::aboutQtAction
QAction * aboutQtAction
Definition: bitcoingui.h:152
HEADER_HEIGHT_DELTA_SYNC
static constexpr int HEADER_HEIGHT_DELTA_SYNC
The required delta of headers to the estimated number of available headers until we show the IBD prog...
Definition: modaloverlay.h:13
bilingual_str::translated
std::string translated
Definition: translation.h:18
WalletView::encryptionStatusChanged
void encryptionStatusChanged()
Encryption status of wallet changed.
optionsdialog.h
BitcoinGUI::subscribeToCoreSignals
void subscribeToCoreSignals()
Connect core signals to GUI client.
Definition: bitcoingui.cpp:1470
BitcoinGUI::sendCoinsAction
QAction * sendCoinsAction
Definition: bitcoingui.h:139
BitcoinUnits::longName
static QString longName(int unit)
Long name.
Definition: bitcoinunits.cpp:45
CreateWalletActivity
Definition: walletcontroller.h:109
BlockSource::NONE
@ NONE
BitcoinGUI::m_wallet_selector_label
QLabel * m_wallet_selector_label
Definition: bitcoingui.h:165
BitcoinGUI::setNumConnections
void setNumConnections(int count)
Set number of connections shown in the UI.
Definition: bitcoingui.cpp:958
WalletModel::Locked
@ Locked
Definition: walletmodel.h:76
BitcoinGUI::optionsClicked
void optionsClicked()
Show configuration dialog.
Definition: bitcoingui.cpp:845
interfaces::Node::walletLoader
virtual WalletLoader & walletLoader()=0
Get wallet loader.
walletview.h
BitcoinGUI::receiveCoinsAction
QAction * receiveCoinsAction
Definition: bitcoingui.h:147
BitcoinGUI::backupWalletAction
QAction * backupWalletAction
Definition: bitcoingui.h:150
BitcoinGUI::detectShutdown
void detectShutdown()
called by a timer to check if ShutdownRequested() has been set
Definition: bitcoingui.cpp:1410
OptionsDialog::quitOnReset
void quitOnReset()
BitcoinGUI::showHelpMessageClicked
void showHelpMessageClicked()
Show help message dialog.
Definition: bitcoingui.cpp:871
ClientModel::showProgress
void showProgress(const QString &title, int nProgress)
WalletFrame::usedSendingAddresses
void usedSendingAddresses()
Show used sending addresses.
Definition: walletframe.cpp:260
BitcoinGUI::aboutClicked
void aboutClicked()
Show about dialog.
Definition: bitcoingui.cpp:850
interfaces::Node
Top-level interface for a bitcoin node (bitcoind process).
Definition: node.h:68
RPCConsole::tabTitle
QString tabTitle(TabTypes tab_type) const
Definition: rpcconsole.cpp:1348
interfaces::BlockAndHeaderTipInfo::header_time
int64_t header_time
Definition: node.h:53
GUIUtil::HasPixmap
bool HasPixmap(const QLabel *label)
Returns true if pixmap has been set.
Definition: guiutil.cpp:947
bilingual_str::original
std::string original
Definition: translation.h:17
BitcoinGUI::updateNetworkState
void updateNetworkState()
Update UI with latest network info from model.
Definition: bitcoingui.cpp:925
WalletFrame::gotoSendCoinsPage
void gotoSendCoinsPage(QString addr="")
Switch to send coins page.
Definition: walletframe.cpp:174
SPINNER_FRAMES
#define SPINNER_FRAMES
Definition: guiconstants.h:47
interfaces::BlockAndHeaderTipInfo::verification_progress
double verification_progress
Definition: node.h:54
UnitDisplayStatusBarControl::UnitDisplayStatusBarControl
UnitDisplayStatusBarControl(const PlatformStyle *platformStyle)
Definition: bitcoingui.cpp:1490
NetworkStyle::getTitleAddText
const QString & getTitleAddText() const
Definition: networkstyle.h:22
ui_interface.h
ModalOverlay::toggleVisibility
void toggleVisibility()
Definition: modaloverlay.cpp:161
BitcoinGUI::BitcoinGUI
BitcoinGUI(interfaces::Node &node, const PlatformStyle *platformStyle, const NetworkStyle *networkStyle, QWidget *parent=nullptr)
Definition: bitcoingui.cpp:79
platformstyle.h
WalletFrame::gotoLoadPSBT
void gotoLoadPSBT(bool from_clipboard=false)
Load Partially Signed Bitcoin Transaction.
Definition: walletframe.cpp:195
system.h
BitcoinGUI::m_handler_message_box
std::unique_ptr< interfaces::Handler > m_handler_message_box
Definition: bitcoingui.h:119
RPCConsole::TabTypes
TabTypes
Definition: rpcconsole.h:63
ClientModel
Model for Bitcoin network client.
Definition: clientmodel.h:47
BitcoinGUI::labelProxyIcon
GUIUtil::ClickableLabel * labelProxyIcon
Definition: bitcoingui.h:127
WalletFrame::handlePaymentRequest
bool handlePaymentRequest(const SendCoinsRecipient &recipient)
Definition: walletframe.cpp:136
WalletView::outOfSyncWarningClicked
void outOfSyncWarningClicked()
Notify that the out of sync warning icon has been pressed.
BitcoinGUI::openAction
QAction * openAction
Definition: bitcoingui.h:154
WalletController::closeWallet
void closeWallet(WalletModel *wallet_model, QWidget *parent=nullptr)
Definition: walletcontroller.cpp:80
interfaces::BlockAndHeaderTipInfo::header_height
int header_height
Definition: node.h:52
guiconstants.h
walletframe.h
WalletFrame::setClientModel
void setClientModel(ClientModel *clientModel)
Definition: walletframe.cpp:62
SynchronizationState::INIT_DOWNLOAD
@ INIT_DOWNLOAD
interfaces::Node::shutdownRequested
virtual bool shutdownRequested()=0
Return whether shutdown was requested.
BitcoinGUI::eventFilter
bool eventFilter(QObject *object, QEvent *event) override
Definition: bitcoingui.cpp:1283
RPCConsole::setTabFocus
void setTabFocus(enum TabTypes tabType)
set which tab has the focus (is visible)
Definition: rpcconsole.cpp:1343
BitcoinGUI::changePassphraseAction
QAction * changePassphraseAction
Definition: bitcoingui.h:151
WalletView::coinsSent
void coinsSent()
BitcoinGUI::m_open_wallet_menu
QMenu * m_open_wallet_menu
Definition: bitcoingui.h:158
translation.h
BitcoinGUI::progressBar
GUIUtil::ClickableProgressBar * progressBar
Definition: bitcoingui.h:131
interfaces::Wallet::hdEnabled
virtual bool hdEnabled()=0
ModalOverlay::setKnownBestHeight
void setKnownBestHeight(int count, const QDateTime &blockDate)
Definition: modaloverlay.cpp:81
networkstyle.h
CClientUIInterface::MSG_INFORMATION
@ MSG_INFORMATION
Predefined combinations for certain default usage cases.
Definition: ui_interface.h:65
OptionsModel::getDisplayUnit
int getDisplayUnit() const
Definition: optionsmodel.h:89
BitcoinGUI::verifyMessageAction
QAction * verifyMessageAction
Definition: bitcoingui.h:143
OptionsDialog::TAB_MAIN
@ TAB_MAIN
Definition: optionsdialog.h:44
UnitDisplayStatusBarControl::changeEvent
void changeEvent(QEvent *e) override
Definition: bitcoingui.cpp:1515
BitcoinGUI::platformStyle
const PlatformStyle * platformStyle
Definition: bitcoingui.h:185
WalletFrame::gotoVerifyMessageTab
void gotoVerifyMessageTab(QString addr="")
Show Sign/Verify Message dialog and switch to verify message tab.
Definition: walletframe.cpp:188
BitcoinGUI::m_handler_question
std::unique_ptr< interfaces::Handler > m_handler_question
Definition: bitcoingui.h:120
WalletFrame::gotoOverviewPage
void gotoOverviewPage()
Switch to overview (home) page.
Definition: walletframe.cpp:153
BitcoinGUI::labelWalletEncryptionIcon
GUIUtil::ThemedLabel * labelWalletEncryptionIcon
Definition: bitcoingui.h:125
BitcoinGUI::m_close_wallet_action
QAction * m_close_wallet_action
Definition: bitcoingui.h:159
ModalOverlay::showHide
void showHide(bool hide=false, bool userRequested=false)
Definition: modaloverlay.cpp:168
UnitDisplayStatusBarControl::m_platform_style
const PlatformStyle * m_platform_style
Definition: bitcoingui.h:335
ThreadSafeMessageBox
static bool ThreadSafeMessageBox(BitcoinGUI *gui, const bilingual_str &message, const std::string &caption, unsigned int style)
Definition: bitcoingui.cpp:1445
BitcoinUnits::Unit
Unit
Bitcoin units.
Definition: bitcoinunits.h:41
GUIUtil::blockingGUIThreadConnection
Qt::ConnectionType blockingGUIThreadConnection()
Get connection type to call object slot in GUI thread with invokeMethod.
Definition: guiutil.cpp:369
BitcoinGUI::m_load_psbt_clipboard_action
QAction * m_load_psbt_clipboard_action
Definition: bitcoingui.h:145
BitcoinGUI::optionsAction
QAction * optionsAction
Definition: bitcoingui.h:148
Params
const CChainParams & Params()
Return the currently selected parameters.
Definition: chainparams.cpp:561
BitcoinGUI::usedReceivingAddressesAction
QAction * usedReceivingAddressesAction
Definition: bitcoingui.h:141
BitcoinGUI::quitRequested
void quitRequested()
bitcoinunits.h
BitcoinGUI::openOptionsDialogWithTab
void openOptionsDialogWithTab(OptionsDialog::Tab tab)
Open the OptionsDialog on the specified tab index.
Definition: bitcoingui.cpp:992
bitcoingui.h
node
Definition: init.h:22
GUIUtil::TextWidth
int TextWidth(const QFontMetrics &fm, const QString &text)
Returns the distance in pixels appropriate for drawing a subsequent character after text.
Definition: guiutil.cpp:889
BitcoinGUI::unitDisplayControl
UnitDisplayStatusBarControl * unitDisplayControl
Definition: bitcoingui.h:124
BitcoinGUI::helpMessageDialog
HelpMessageDialog * helpMessageDialog
Definition: bitcoingui.h:172
SynchronizationState
SynchronizationState
Current sync state passed to tip changed callbacks.
Definition: validation.h:105
WalletFrame::removeAllWallets
void removeAllWallets()
Definition: walletframe.cpp:128
GUIUtil::handleCloseWindowShortcut
void handleCloseWindowShortcut(QWidget *w)
Definition: guiutil.cpp:415
BitcoinGUI::prevBlocks
int prevBlocks
Keep track of previous number of blocks, to detect progress.
Definition: bitcoingui.h:182
BitcoinGUI::consoleShown
void consoleShown(RPCConsole *console)
Signal raised when RPC console shown.
BitcoinGUI::createMenuBar
void createMenuBar()
Create the menu bar and sub-menus.
Definition: bitcoingui.cpp:432
BitcoinGUI::createTrayIcon
void createTrayIcon()
Create system tray icon and notification.
Definition: bitcoingui.cpp:752
BitcoinGUI::updateWindowTitle
void updateWindowTitle()
Definition: bitcoingui.cpp:1376
BitcoinGUI::m_network_context_menu
QMenu * m_network_context_menu
Definition: bitcoingui.h:175
UnitDisplayStatusBarControl::createContextMenu
void createContextMenu()
Creates context menu, its actions, and wires up all the relevant signals for mouse events.
Definition: bitcoingui.cpp:1528
BitcoinGUI::aboutAction
QAction * aboutAction
Definition: bitcoingui.h:146
BlockSource
BlockSource
Definition: clientmodel.h:32
BitcoinGUI::m_wallet_controller
WalletController * m_wallet_controller
Definition: bitcoingui.h:118
UnitDisplayStatusBarControl::onMenuSelection
void onMenuSelection(QAction *action)
Tells underlying optionsModel to update its current display unit.
Definition: bitcoingui.cpp:1566
optionsmodel.h
BitcoinGUI::labelBlocksIcon
GUIUtil::ClickableLabel * labelBlocksIcon
Definition: bitcoingui.h:129
WalletModel::getDisplayName
QString getDisplayName() const
Definition: walletmodel.cpp:582
BitcoinGUI::updateHeadersSyncProgressLabel
void updateHeadersSyncProgressLabel()
Definition: bitcoingui.cpp:983
WalletFrame::showOutOfSyncWarning
void showOutOfSyncWarning(bool fShow)
Definition: walletframe.cpp:145
GUIUtil::ThemedLabel::setThemedPixmap
void setThemedPixmap(const QString &image_filename, int width, int height)
Definition: guiutil.cpp:828
macdockiconhandler.h
OptionsModel::getMinimizeToTray
bool getMinimizeToTray() const
Definition: optionsmodel.h:87
BitcoinGUI::m_wallet_selector_label_action
QAction * m_wallet_selector_label_action
Definition: bitcoingui.h:161
Notificator::Class
Class
Definition: notificator.h:36
PlatformStyle
Definition: platformstyle.h:13
WalletView::transactionClicked
void transactionClicked()
BitcoinGUI
Bitcoin GUI main class.
Definition: bitcoingui.h:68
WalletFrame::gotoHistoryPage
void gotoHistoryPage()
Switch to history (transactions) page.
Definition: walletframe.cpp:160
interfaces::Node::handleQuestion
virtual std::unique_ptr< Handler > handleQuestion(QuestionFn fn)=0
BitcoinGUI::spinnerFrame
int spinnerFrame
Definition: bitcoingui.h:183
interfaces::Wallet::privateKeysDisabled
virtual bool privateKeysDisabled()=0
ModalOverlay::isLayerVisible
bool isLayerVisible() const
Definition: modaloverlay.h:33
BitcoinGUI::m_open_wallet_action
QAction * m_open_wallet_action
Definition: bitcoingui.h:157
openuridialog.h
WalletController::closeAllWallets
void closeAllWallets(QWidget *parent=nullptr)
Definition: walletcontroller.cpp:96
BitcoinGUI::appMenuBar
QMenuBar * appMenuBar
Definition: bitcoingui.h:134
BitcoinGUI::dragEnterEvent
void dragEnterEvent(QDragEnterEvent *event) override
Definition: bitcoingui.cpp:1264
RPCConsole::tabs
std::vector< TabTypes > tabs() const
Definition: rpcconsole.h:70
BitcoinGUI::encryptWalletAction
QAction * encryptWalletAction
Definition: bitcoingui.h:149
CClientUIInterface::MSG_WARNING
@ MSG_WARNING
Definition: ui_interface.h:66
WalletFrame::removeWallet
void removeWallet(WalletModel *wallet_model)
Definition: walletframe.cpp:119
BitcoinGUI::DEFAULT_UIPLATFORM
static const std::string DEFAULT_UIPLATFORM
Definition: bitcoingui.h:73
BitcoinGUI::openRPCConsoleAction
QAction * openRPCConsoleAction
Definition: bitcoingui.h:153
ModalOverlay::tipUpdate
void tipUpdate(int count, const QDateTime &blockDate, double nVerificationProgress)
Definition: modaloverlay.cpp:90
MacDockIconHandler
macOS-specific Dock icon handler.
Definition: macdockiconhandler.h:12
GUIUtil::ProgressBar
ClickableProgressBar ProgressBar
Definition: guiutil.h:289
SynchronizationState::POST_INIT
@ POST_INIT
ClientModel::networkActiveChanged
void networkActiveChanged(bool networkActive)
clientmodel.h
UnitDisplayStatusBarControl::onDisplayUnitsClicked
void onDisplayUnitsClicked(const QPoint &point)
Shows context menu with Display Unit options by the mouse coordinates.
Definition: bitcoingui.cpp:1559
BitcoinGUI::labelWalletHDStatusIcon
GUIUtil::ThemedLabel * labelWalletHDStatusIcon
Definition: bitcoingui.h:126
OptionsModel::getShowTrayIcon
bool getShowTrayIcon() const
Definition: optionsmodel.h:86
modaloverlay.h
ClientModel::getHeaderTipTime
int64_t getHeaderTipTime() const
Definition: clientmodel.cpp:107
Notificator::Warning
@ Warning
Notify user of potential problem.
Definition: notificator.h:39
BitcoinGUI::signMessageAction
QAction * signMessageAction
Definition: bitcoingui.h:142
interfaces::WalletLoader::getWallets
virtual std::vector< std::unique_ptr< Wallet > > getWallets()=0
Return interfaces for accessing wallets (if any).
BitcoinGUI::showDebugWindow
void showDebugWindow()
Show debug window.
Definition: bitcoingui.cpp:859
RPCConsole::TabTypes::PEERS
@ PEERS
UnitDisplayStatusBarControl::optionsModel
OptionsModel * optionsModel
Definition: bitcoingui.h:333