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