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  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  sendCoinsMenuAction = new QAction(sendCoinsAction->text(), this);
265  sendCoinsMenuAction->setStatusTip(sendCoinsAction->statusTip());
266  sendCoinsMenuAction->setToolTip(sendCoinsMenuAction->statusTip());
267 
268  receiveCoinsAction = new QAction(platformStyle->SingleColorIcon(":/icons/receiving_addresses"), tr("&Receive"), this);
269  receiveCoinsAction->setStatusTip(tr("Request payments (generates QR codes and bitcoin: URIs)"));
270  receiveCoinsAction->setToolTip(receiveCoinsAction->statusTip());
271  receiveCoinsAction->setCheckable(true);
272  receiveCoinsAction->setShortcut(QKeySequence(Qt::ALT + Qt::Key_3));
273  tabGroup->addAction(receiveCoinsAction);
274 
275  receiveCoinsMenuAction = new QAction(receiveCoinsAction->text(), this);
276  receiveCoinsMenuAction->setStatusTip(receiveCoinsAction->statusTip());
277  receiveCoinsMenuAction->setToolTip(receiveCoinsMenuAction->statusTip());
278 
279  historyAction = new QAction(platformStyle->SingleColorIcon(":/icons/history"), tr("&Transactions"), this);
280  historyAction->setStatusTip(tr("Browse transaction history"));
281  historyAction->setToolTip(historyAction->statusTip());
282  historyAction->setCheckable(true);
283  historyAction->setShortcut(QKeySequence(Qt::ALT + Qt::Key_4));
284  tabGroup->addAction(historyAction);
285 
286 #ifdef ENABLE_WALLET
287  // These showNormalIfMinimized are needed because Send Coins and Receive Coins
288  // can be triggered from the tray menu, and need to show the GUI to be useful.
289  connect(overviewAction, &QAction::triggered, [this]{ showNormalIfMinimized(); });
290  connect(overviewAction, &QAction::triggered, this, &BitcoinGUI::gotoOverviewPage);
291  connect(sendCoinsAction, &QAction::triggered, [this]{ showNormalIfMinimized(); });
292  connect(sendCoinsAction, &QAction::triggered, [this]{ gotoSendCoinsPage(); });
293  connect(sendCoinsMenuAction, &QAction::triggered, [this]{ showNormalIfMinimized(); });
294  connect(sendCoinsMenuAction, &QAction::triggered, [this]{ gotoSendCoinsPage(); });
295  connect(receiveCoinsAction, &QAction::triggered, [this]{ showNormalIfMinimized(); });
296  connect(receiveCoinsAction, &QAction::triggered, this, &BitcoinGUI::gotoReceiveCoinsPage);
297  connect(receiveCoinsMenuAction, &QAction::triggered, [this]{ showNormalIfMinimized(); });
298  connect(receiveCoinsMenuAction, &QAction::triggered, this, &BitcoinGUI::gotoReceiveCoinsPage);
299  connect(historyAction, &QAction::triggered, [this]{ showNormalIfMinimized(); });
300  connect(historyAction, &QAction::triggered, this, &BitcoinGUI::gotoHistoryPage);
301 #endif // ENABLE_WALLET
302 
303  quitAction = new QAction(tr("E&xit"), this);
304  quitAction->setStatusTip(tr("Quit application"));
305  quitAction->setShortcut(QKeySequence(Qt::CTRL + Qt::Key_Q));
306  quitAction->setMenuRole(QAction::QuitRole);
307  aboutAction = new QAction(tr("&About %1").arg(PACKAGE_NAME), this);
308  aboutAction->setStatusTip(tr("Show information about %1").arg(PACKAGE_NAME));
309  aboutAction->setMenuRole(QAction::AboutRole);
310  aboutAction->setEnabled(false);
311  aboutQtAction = new QAction(tr("About &Qt"), this);
312  aboutQtAction->setStatusTip(tr("Show information about Qt"));
313  aboutQtAction->setMenuRole(QAction::AboutQtRole);
314  optionsAction = new QAction(tr("&Options…"), this);
315  optionsAction->setStatusTip(tr("Modify configuration options for %1").arg(PACKAGE_NAME));
316  optionsAction->setMenuRole(QAction::PreferencesRole);
317  optionsAction->setEnabled(false);
318  toggleHideAction = new QAction(tr("&Show / Hide"), this);
319  toggleHideAction->setStatusTip(tr("Show or hide the main Window"));
320 
321  encryptWalletAction = new QAction(tr("&Encrypt Wallet…"), this);
322  encryptWalletAction->setStatusTip(tr("Encrypt the private keys that belong to your wallet"));
323  encryptWalletAction->setCheckable(true);
324  backupWalletAction = new QAction(tr("&Backup Wallet…"), this);
325  backupWalletAction->setStatusTip(tr("Backup wallet to another location"));
326  changePassphraseAction = new QAction(tr("&Change Passphrase…"), this);
327  changePassphraseAction->setStatusTip(tr("Change the passphrase used for wallet encryption"));
328  signMessageAction = new QAction(tr("Sign &message…"), this);
329  signMessageAction->setStatusTip(tr("Sign messages with your Bitcoin addresses to prove you own them"));
330  verifyMessageAction = new QAction(tr("&Verify message…"), this);
331  verifyMessageAction->setStatusTip(tr("Verify messages to ensure they were signed with specified Bitcoin addresses"));
332  m_load_psbt_action = new QAction(tr("&Load PSBT from file…"), this);
333  m_load_psbt_action->setStatusTip(tr("Load Partially Signed Bitcoin Transaction"));
334  m_load_psbt_clipboard_action = new QAction(tr("Load PSBT from &clipboard…"), this);
335  m_load_psbt_clipboard_action->setStatusTip(tr("Load Partially Signed Bitcoin Transaction from clipboard"));
336 
337  openRPCConsoleAction = new QAction(tr("Node window"), this);
338  openRPCConsoleAction->setStatusTip(tr("Open node debugging and diagnostic console"));
339  // initially disable the debug window menu item
340  openRPCConsoleAction->setEnabled(false);
341  openRPCConsoleAction->setObjectName("openRPCConsoleAction");
342 
343  usedSendingAddressesAction = new QAction(tr("&Sending addresses"), this);
344  usedSendingAddressesAction->setStatusTip(tr("Show the list of used sending addresses and labels"));
345  usedReceivingAddressesAction = new QAction(tr("&Receiving addresses"), this);
346  usedReceivingAddressesAction->setStatusTip(tr("Show the list of used receiving addresses and labels"));
347 
348  openAction = new QAction(tr("Open &URI…"), this);
349  openAction->setStatusTip(tr("Open a bitcoin: URI"));
350 
351  m_open_wallet_action = new QAction(tr("Open Wallet"), this);
352  m_open_wallet_action->setEnabled(false);
353  m_open_wallet_action->setStatusTip(tr("Open a wallet"));
354  m_open_wallet_menu = new QMenu(this);
355 
356  m_close_wallet_action = new QAction(tr("Close Wallet…"), this);
357  m_close_wallet_action->setStatusTip(tr("Close wallet"));
358 
359  m_create_wallet_action = new QAction(tr("Create Wallet…"), this);
360  m_create_wallet_action->setEnabled(false);
361  m_create_wallet_action->setStatusTip(tr("Create a new wallet"));
362 
363  m_close_all_wallets_action = new QAction(tr("Close All Wallets…"), this);
364  m_close_all_wallets_action->setStatusTip(tr("Close all wallets"));
365 
366  showHelpMessageAction = new QAction(tr("&Command-line options"), this);
367  showHelpMessageAction->setMenuRole(QAction::NoRole);
368  showHelpMessageAction->setStatusTip(tr("Show the %1 help message to get a list with possible Bitcoin command-line options").arg(PACKAGE_NAME));
369 
370  m_mask_values_action = new QAction(tr("&Mask values"), this);
371  m_mask_values_action->setShortcut(QKeySequence(Qt::CTRL + Qt::SHIFT + Qt::Key_M));
372  m_mask_values_action->setStatusTip(tr("Mask the values in the Overview tab"));
373  m_mask_values_action->setCheckable(true);
374 
375  connect(quitAction, &QAction::triggered, this, &BitcoinGUI::quitRequested);
376  connect(aboutAction, &QAction::triggered, this, &BitcoinGUI::aboutClicked);
377  connect(aboutQtAction, &QAction::triggered, qApp, QApplication::aboutQt);
378  connect(optionsAction, &QAction::triggered, this, &BitcoinGUI::optionsClicked);
379  connect(toggleHideAction, &QAction::triggered, this, &BitcoinGUI::toggleHidden);
380  connect(showHelpMessageAction, &QAction::triggered, this, &BitcoinGUI::showHelpMessageClicked);
381  connect(openRPCConsoleAction, &QAction::triggered, this, &BitcoinGUI::showDebugWindow);
382  // prevents an open debug window from becoming stuck/unusable on client shutdown
383  connect(quitAction, &QAction::triggered, rpcConsole, &QWidget::hide);
384 
385 #ifdef ENABLE_WALLET
386  if(walletFrame)
387  {
388  connect(encryptWalletAction, &QAction::triggered, walletFrame, &WalletFrame::encryptWallet);
389  connect(backupWalletAction, &QAction::triggered, walletFrame, &WalletFrame::backupWallet);
390  connect(changePassphraseAction, &QAction::triggered, walletFrame, &WalletFrame::changePassphrase);
391  connect(signMessageAction, &QAction::triggered, [this]{ showNormalIfMinimized(); });
392  connect(signMessageAction, &QAction::triggered, [this]{ gotoSignMessageTab(); });
393  connect(m_load_psbt_action, &QAction::triggered, [this]{ gotoLoadPSBT(); });
394  connect(m_load_psbt_clipboard_action, &QAction::triggered, [this]{ gotoLoadPSBT(true); });
395  connect(verifyMessageAction, &QAction::triggered, [this]{ showNormalIfMinimized(); });
396  connect(verifyMessageAction, &QAction::triggered, [this]{ gotoVerifyMessageTab(); });
399  connect(openAction, &QAction::triggered, this, &BitcoinGUI::openClicked);
400  connect(m_open_wallet_menu, &QMenu::aboutToShow, [this] {
401  m_open_wallet_menu->clear();
402  for (const std::pair<const std::string, bool>& i : m_wallet_controller->listWalletDir()) {
403  const std::string& path = i.first;
404  QString name = path.empty() ? QString("["+tr("default wallet")+"]") : QString::fromStdString(path);
405  // Menu items remove single &. Single & are shown when && is in
406  // the string, but only the first occurrence. So replace only
407  // the first & with &&.
408  name.replace(name.indexOf(QChar('&')), 1, QString("&&"));
409  QAction* action = m_open_wallet_menu->addAction(name);
410 
411  if (i.second) {
412  // This wallet is already loaded
413  action->setEnabled(false);
414  continue;
415  }
416 
417  connect(action, &QAction::triggered, [this, path] {
418  auto activity = new OpenWalletActivity(m_wallet_controller, this);
419  connect(activity, &OpenWalletActivity::opened, this, &BitcoinGUI::setCurrentWallet);
420  activity->open(path);
421  });
422  }
423  if (m_open_wallet_menu->isEmpty()) {
424  QAction* action = m_open_wallet_menu->addAction(tr("No wallets available"));
425  action->setEnabled(false);
426  }
427  });
428  connect(m_close_wallet_action, &QAction::triggered, [this] {
430  });
431  connect(m_create_wallet_action, &QAction::triggered, [this] {
432  auto activity = new CreateWalletActivity(m_wallet_controller, this);
433  connect(activity, &CreateWalletActivity::created, this, &BitcoinGUI::setCurrentWallet);
434  activity->create();
435  });
436  connect(m_close_all_wallets_action, &QAction::triggered, [this] {
438  });
439  connect(m_mask_values_action, &QAction::toggled, this, &BitcoinGUI::setPrivacy);
440  }
441 #endif // ENABLE_WALLET
442 
443  connect(new QShortcut(QKeySequence(Qt::CTRL + Qt::SHIFT + Qt::Key_C), this), &QShortcut::activated, this, &BitcoinGUI::showDebugWindowActivateConsole);
444  connect(new QShortcut(QKeySequence(Qt::CTRL + Qt::SHIFT + Qt::Key_D), this), &QShortcut::activated, this, &BitcoinGUI::showDebugWindow);
445 }
446 
448 {
449 #ifdef Q_OS_MAC
450  // Create a decoupled menu bar on Mac which stays even if the window is closed
451  appMenuBar = new QMenuBar();
452 #else
453  // Get the main window's menu bar on other platforms
454  appMenuBar = menuBar();
455 #endif
456 
457  // Configure the menus
458  QMenu *file = appMenuBar->addMenu(tr("&File"));
459  if(walletFrame)
460  {
461  file->addAction(m_create_wallet_action);
462  file->addAction(m_open_wallet_action);
463  file->addAction(m_close_wallet_action);
464  file->addAction(m_close_all_wallets_action);
465  file->addSeparator();
466  file->addAction(openAction);
467  file->addAction(backupWalletAction);
468  file->addAction(signMessageAction);
469  file->addAction(verifyMessageAction);
470  file->addAction(m_load_psbt_action);
471  file->addAction(m_load_psbt_clipboard_action);
472  file->addSeparator();
473  }
474  file->addAction(quitAction);
475 
476  QMenu *settings = appMenuBar->addMenu(tr("&Settings"));
477  if(walletFrame)
478  {
479  settings->addAction(encryptWalletAction);
480  settings->addAction(changePassphraseAction);
481  settings->addSeparator();
482  settings->addAction(m_mask_values_action);
483  settings->addSeparator();
484  }
485  settings->addAction(optionsAction);
486 
487  QMenu* window_menu = appMenuBar->addMenu(tr("&Window"));
488 
489  QAction* minimize_action = window_menu->addAction(tr("&Minimize"));
490  minimize_action->setShortcut(QKeySequence(Qt::CTRL + Qt::Key_M));
491  connect(minimize_action, &QAction::triggered, [] {
492  QApplication::activeWindow()->showMinimized();
493  });
494  connect(qApp, &QApplication::focusWindowChanged, [minimize_action] (QWindow* window) {
495  minimize_action->setEnabled(window != nullptr && (window->flags() & Qt::Dialog) != Qt::Dialog && window->windowState() != Qt::WindowMinimized);
496  });
497 
498 #ifdef Q_OS_MAC
499  QAction* zoom_action = window_menu->addAction(tr("Zoom"));
500  connect(zoom_action, &QAction::triggered, [] {
501  QWindow* window = qApp->focusWindow();
502  if (window->windowState() != Qt::WindowMaximized) {
503  window->showMaximized();
504  } else {
505  window->showNormal();
506  }
507  });
508 
509  connect(qApp, &QApplication::focusWindowChanged, [zoom_action] (QWindow* window) {
510  zoom_action->setEnabled(window != nullptr);
511  });
512 #endif
513 
514  if (walletFrame) {
515 #ifdef Q_OS_MAC
516  window_menu->addSeparator();
517  QAction* main_window_action = window_menu->addAction(tr("Main Window"));
518  connect(main_window_action, &QAction::triggered, [this] {
519  GUIUtil::bringToFront(this);
520  });
521 #endif
522  window_menu->addSeparator();
523  window_menu->addAction(usedSendingAddressesAction);
524  window_menu->addAction(usedReceivingAddressesAction);
525  }
526 
527  window_menu->addSeparator();
528  for (RPCConsole::TabTypes tab_type : rpcConsole->tabs()) {
529  QAction* tab_action = window_menu->addAction(rpcConsole->tabTitle(tab_type));
530  tab_action->setShortcut(rpcConsole->tabShortcut(tab_type));
531  connect(tab_action, &QAction::triggered, [this, tab_type] {
532  rpcConsole->setTabFocus(tab_type);
533  showDebugWindow();
534  });
535  }
536 
537  QMenu *help = appMenuBar->addMenu(tr("&Help"));
538  help->addAction(showHelpMessageAction);
539  help->addSeparator();
540  help->addAction(aboutAction);
541  help->addAction(aboutQtAction);
542 }
543 
545 {
546  if(walletFrame)
547  {
548  QToolBar *toolbar = addToolBar(tr("Tabs toolbar"));
549  appToolBar = toolbar;
550  toolbar->setMovable(false);
551  toolbar->setToolButtonStyle(Qt::ToolButtonTextBesideIcon);
552  toolbar->addAction(overviewAction);
553  toolbar->addAction(sendCoinsAction);
554  toolbar->addAction(receiveCoinsAction);
555  toolbar->addAction(historyAction);
556  overviewAction->setChecked(true);
557 
558 #ifdef ENABLE_WALLET
559  QWidget *spacer = new QWidget();
560  spacer->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
561  toolbar->addWidget(spacer);
562 
563  m_wallet_selector = new QComboBox();
564  m_wallet_selector->setSizeAdjustPolicy(QComboBox::AdjustToContents);
565  connect(m_wallet_selector, qOverload<int>(&QComboBox::currentIndexChanged), this, &BitcoinGUI::setCurrentWalletBySelectorIndex);
566 
567  m_wallet_selector_label = new QLabel();
568  m_wallet_selector_label->setText(tr("Wallet:") + " ");
570 
573 
574  m_wallet_selector_label_action->setVisible(false);
575  m_wallet_selector_action->setVisible(false);
576 #endif
577  }
578 }
579 
581 {
582  this->clientModel = _clientModel;
583  if(_clientModel)
584  {
585  // Create system tray menu (or setup the dock menu) that late to prevent users from calling actions,
586  // while the client has not yet fully loaded
588 
589  // Keep up to date with client
593  });
595  connect(_clientModel, &ClientModel::networkActiveChanged, this, &BitcoinGUI::setNetworkActive);
596 
597  modalOverlay->setKnownBestHeight(tip_info->header_height, QDateTime::fromSecsSinceEpoch(tip_info->header_time));
598  setNumBlocks(tip_info->block_height, QDateTime::fromSecsSinceEpoch(tip_info->block_time), tip_info->verification_progress, false, SynchronizationState::INIT_DOWNLOAD);
599  connect(_clientModel, &ClientModel::numBlocksChanged, this, &BitcoinGUI::setNumBlocks);
600 
601  // Receive and report messages from client model
602  connect(_clientModel, &ClientModel::message, [this](const QString &title, const QString &message, unsigned int style){
603  this->message(title, message, style);
604  });
605 
606  // Show progress dialog
607  connect(_clientModel, &ClientModel::showProgress, this, &BitcoinGUI::showProgress);
608 
609  rpcConsole->setClientModel(_clientModel, tip_info->block_height, tip_info->block_time, tip_info->verification_progress);
610 
611  updateProxyIcon();
612 
613 #ifdef ENABLE_WALLET
614  if(walletFrame)
615  {
616  walletFrame->setClientModel(_clientModel);
617  }
618 #endif // ENABLE_WALLET
620 
621  OptionsModel* optionsModel = _clientModel->getOptionsModel();
622  if (optionsModel && trayIcon) {
623  // be aware of the tray icon disable state change reported by the OptionsModel object.
624  connect(optionsModel, &OptionsModel::showTrayIconChanged, trayIcon, &QSystemTrayIcon::setVisible);
625 
626  // initialize the disable state of the tray icon with the current value in the model.
627  trayIcon->setVisible(optionsModel->getShowTrayIcon());
628  }
629  } else {
630  // Disable possibility to show main window via action
631  toggleHideAction->setEnabled(false);
632  if(trayIconMenu)
633  {
634  // Disable context menu on tray icon
635  trayIconMenu->clear();
636  }
637  // Propagate cleared model to child objects
638  rpcConsole->setClientModel(nullptr);
639 #ifdef ENABLE_WALLET
640  if (walletFrame)
641  {
642  walletFrame->setClientModel(nullptr);
643  }
644 #endif // ENABLE_WALLET
646  }
647 }
648 
649 #ifdef ENABLE_WALLET
650 void BitcoinGUI::setWalletController(WalletController* wallet_controller)
651 {
653  assert(wallet_controller);
654 
655  m_wallet_controller = wallet_controller;
656 
657  m_create_wallet_action->setEnabled(true);
658  m_open_wallet_action->setEnabled(true);
660 
661  GUIUtil::ExceptionSafeConnect(wallet_controller, &WalletController::walletAdded, this, &BitcoinGUI::addWallet);
662  connect(wallet_controller, &WalletController::walletRemoved, this, &BitcoinGUI::removeWallet);
663 
664  auto activity = new LoadWalletsActivity(m_wallet_controller, this);
665  activity->load();
666 }
667 
668 WalletController* BitcoinGUI::getWalletController()
669 {
670  return m_wallet_controller;
671 }
672 
673 void BitcoinGUI::addWallet(WalletModel* walletModel)
674 {
675  if (!walletFrame) return;
676 
677  WalletView* wallet_view = new WalletView(walletModel, platformStyle, walletFrame);
678  if (!walletFrame->addView(wallet_view)) return;
679 
680  rpcConsole->addWallet(walletModel);
681  if (m_wallet_selector->count() == 0) {
683  } else if (m_wallet_selector->count() == 1) {
684  m_wallet_selector_label_action->setVisible(true);
685  m_wallet_selector_action->setVisible(true);
686  }
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(this, &BitcoinGUI::setPrivacy, wallet_view, &WalletView::setPrivacy);
697  wallet_view->setPrivacy(isPrivacyModeActivated());
698  const QString display_name = walletModel->getDisplayName();
699  m_wallet_selector->addItem(display_name, QVariant::fromValue(walletModel));
700 }
701 
702 void BitcoinGUI::removeWallet(WalletModel* walletModel)
703 {
704  if (!walletFrame) return;
705 
706  labelWalletHDStatusIcon->hide();
708 
709  int index = m_wallet_selector->findData(QVariant::fromValue(walletModel));
710  m_wallet_selector->removeItem(index);
711  if (m_wallet_selector->count() == 0) {
713  overviewAction->setChecked(true);
714  } else if (m_wallet_selector->count() == 1) {
715  m_wallet_selector_label_action->setVisible(false);
716  m_wallet_selector_action->setVisible(false);
717  }
718  rpcConsole->removeWallet(walletModel);
719  walletFrame->removeWallet(walletModel);
721 }
722 
723 void BitcoinGUI::setCurrentWallet(WalletModel* wallet_model)
724 {
725  if (!walletFrame) return;
726  walletFrame->setCurrentWallet(wallet_model);
727  for (int index = 0; index < m_wallet_selector->count(); ++index) {
728  if (m_wallet_selector->itemData(index).value<WalletModel*>() == wallet_model) {
729  m_wallet_selector->setCurrentIndex(index);
730  break;
731  }
732  }
734 }
735 
736 void BitcoinGUI::setCurrentWalletBySelectorIndex(int index)
737 {
738  WalletModel* wallet_model = m_wallet_selector->itemData(index).value<WalletModel*>();
739  if (wallet_model) setCurrentWallet(wallet_model);
740 }
741 
742 void BitcoinGUI::removeAllWallets()
743 {
744  if(!walletFrame)
745  return;
748 }
749 #endif // ENABLE_WALLET
750 
752 {
753  overviewAction->setEnabled(enabled);
754  sendCoinsAction->setEnabled(enabled);
755  sendCoinsMenuAction->setEnabled(enabled);
756  receiveCoinsAction->setEnabled(enabled);
757  receiveCoinsMenuAction->setEnabled(enabled);
758  historyAction->setEnabled(enabled);
759  encryptWalletAction->setEnabled(enabled);
760  backupWalletAction->setEnabled(enabled);
761  changePassphraseAction->setEnabled(enabled);
762  signMessageAction->setEnabled(enabled);
763  verifyMessageAction->setEnabled(enabled);
764  usedSendingAddressesAction->setEnabled(enabled);
765  usedReceivingAddressesAction->setEnabled(enabled);
766  openAction->setEnabled(enabled);
767  m_close_wallet_action->setEnabled(enabled);
768  m_close_all_wallets_action->setEnabled(enabled);
769 }
770 
772 {
773  assert(QSystemTrayIcon::isSystemTrayAvailable());
774 
775 #ifndef Q_OS_MAC
776  if (QSystemTrayIcon::isSystemTrayAvailable()) {
777  trayIcon = new QSystemTrayIcon(m_network_style->getTrayAndWindowIcon(), this);
778  QString toolTip = tr("%1 client").arg(PACKAGE_NAME) + " " + m_network_style->getTitleAddText();
779  trayIcon->setToolTip(toolTip);
780  }
781 #endif
782 }
783 
785 {
786 #ifndef Q_OS_MAC
787  // return if trayIcon is unset (only on non-macOSes)
788  if (!trayIcon)
789  return;
790 
791  trayIcon->setContextMenu(trayIconMenu.get());
792  connect(trayIcon, &QSystemTrayIcon::activated, this, &BitcoinGUI::trayIconActivated);
793 #else
794  // Note: On macOS, the Dock icon is used to provide the tray's functionality.
796  connect(dockIconHandler, &MacDockIconHandler::dockIconClicked, this, &BitcoinGUI::macosDockIconActivated);
797  trayIconMenu->setAsDockMenu();
798 #endif
799 
800  // Configuration of the tray icon (or Dock icon) menu
801 #ifndef Q_OS_MAC
802  // Note: On macOS, the Dock icon's menu already has Show / Hide action.
803  trayIconMenu->addAction(toggleHideAction);
804  trayIconMenu->addSeparator();
805 #endif
806  if (enableWallet) {
807  trayIconMenu->addAction(sendCoinsMenuAction);
809  trayIconMenu->addSeparator();
810  trayIconMenu->addAction(signMessageAction);
811  trayIconMenu->addAction(verifyMessageAction);
812  trayIconMenu->addSeparator();
813  }
814  trayIconMenu->addAction(optionsAction);
816 #ifndef Q_OS_MAC // This is built-in on macOS
817  trayIconMenu->addSeparator();
818  trayIconMenu->addAction(quitAction);
819 #endif
820 }
821 
822 #ifndef Q_OS_MAC
823 void BitcoinGUI::trayIconActivated(QSystemTrayIcon::ActivationReason reason)
824 {
825  if(reason == QSystemTrayIcon::Trigger)
826  {
827  // Click on system tray icon triggers show/hide of the main window
828  toggleHidden();
829  }
830 }
831 #else
832 void BitcoinGUI::macosDockIconActivated()
833 {
834  show();
835  activateWindow();
836 }
837 #endif
838 
840 {
842 }
843 
845 {
846  if(!clientModel)
847  return;
848 
849  auto dlg = new HelpMessageDialog(this, /* about */ true);
851 }
852 
854 {
856  Q_EMIT consoleShown(rpcConsole);
857 }
858 
860 {
862  showDebugWindow();
863 }
864 
866 {
868 }
869 
870 #ifdef ENABLE_WALLET
871 void BitcoinGUI::openClicked()
872 {
873  OpenURIDialog dlg(platformStyle, this);
874  if(dlg.exec())
875  {
876  Q_EMIT receivedURI(dlg.getURI());
877  }
878 }
879 
880 void BitcoinGUI::gotoOverviewPage()
881 {
882  overviewAction->setChecked(true);
884 }
885 
886 void BitcoinGUI::gotoHistoryPage()
887 {
888  historyAction->setChecked(true);
890 }
891 
892 void BitcoinGUI::gotoReceiveCoinsPage()
893 {
894  receiveCoinsAction->setChecked(true);
896 }
897 
898 void BitcoinGUI::gotoSendCoinsPage(QString addr)
899 {
900  sendCoinsAction->setChecked(true);
902 }
903 
904 void BitcoinGUI::gotoSignMessageTab(QString addr)
905 {
907 }
908 
909 void BitcoinGUI::gotoVerifyMessageTab(QString addr)
910 {
912 }
913 void BitcoinGUI::gotoLoadPSBT(bool from_clipboard)
914 {
915  if (walletFrame) walletFrame->gotoLoadPSBT(from_clipboard);
916 }
917 #endif // ENABLE_WALLET
918 
920 {
922  QString icon;
923  switch(count)
924  {
925  case 0: icon = ":/icons/connect_0"; break;
926  case 1: case 2: case 3: icon = ":/icons/connect_1"; break;
927  case 4: case 5: case 6: icon = ":/icons/connect_2"; break;
928  case 7: case 8: case 9: icon = ":/icons/connect_3"; break;
929  default: icon = ":/icons/connect_4"; break;
930  }
931 
932  QString tooltip;
933 
934  if (m_node.getNetworkActive()) {
935  //: A substring of the tooltip.
936  tooltip = tr("%n active connection(s) to Bitcoin network.", "", count);
937  } else {
938  //: A substring of the tooltip.
939  tooltip = tr("Network activity disabled.");
940  icon = ":/icons/network_disabled";
941  }
942 
943  // Don't word-wrap this (fixed-width) tooltip
944  tooltip = QLatin1String("<nobr>") + tooltip + QLatin1String("<br>") +
945  //: A substring of the tooltip. "More actions" are available via the context menu.
946  tr("Click for more actions.") + QLatin1String("</nobr>");
947  connectionsControl->setToolTip(tooltip);
948 
950 }
951 
953 {
955 }
956 
957 void BitcoinGUI::setNetworkActive(bool network_active)
958 {
960  m_network_context_menu->clear();
961  m_network_context_menu->addAction(
962  //: A context menu item. The "Peers tab" is an element of the "Node window".
963  tr("Show Peers tab"),
964  [this] {
966  showDebugWindow();
967  });
968  m_network_context_menu->addAction(
969  network_active ?
970  //: A context menu item.
971  tr("Disable network activity") :
972  //: A context menu item. The network activity was disabled previously.
973  tr("Enable network activity"),
974  [this, new_state = !network_active] { m_node.setNetworkActive(new_state); });
975 }
976 
978 {
979  int64_t headersTipTime = clientModel->getHeaderTipTime();
980  int headersTipHeight = clientModel->getHeaderTipHeight();
981  int estHeadersLeft = (GetTime() - headersTipTime) / Params().GetConsensus().nPowTargetSpacing;
982  if (estHeadersLeft > HEADER_HEIGHT_DELTA_SYNC)
983  progressBarLabel->setText(tr("Syncing Headers (%1%)…").arg(QString::number(100.0 / (headersTipHeight+estHeadersLeft)*headersTipHeight, 'f', 1)));
984 }
985 
987 {
989  return;
990 
991  auto dlg = new OptionsDialog(this, enableWallet);
993  dlg->setCurrentTab(tab);
994  dlg->setModel(clientModel->getOptionsModel());
996 }
997 
998 void BitcoinGUI::setNumBlocks(int count, const QDateTime& blockDate, double nVerificationProgress, bool header, SynchronizationState sync_state)
999 {
1000 // Disabling macOS App Nap on initial sync, disk and reindex operations.
1001 #ifdef Q_OS_MAC
1002  if (sync_state == SynchronizationState::POST_INIT) {
1003  m_app_nap_inhibitor->enableAppNap();
1004  } else {
1005  m_app_nap_inhibitor->disableAppNap();
1006  }
1007 #endif
1008 
1009  if (modalOverlay)
1010  {
1011  if (header)
1012  modalOverlay->setKnownBestHeight(count, blockDate);
1013  else
1014  modalOverlay->tipUpdate(count, blockDate, nVerificationProgress);
1015  }
1016  if (!clientModel)
1017  return;
1018 
1019  // Prevent orphan statusbar messages (e.g. hover Quit in main menu, wait until chain-sync starts -> garbled text)
1020  statusBar()->clearMessage();
1021 
1022  // Acquire current block source
1023  enum BlockSource blockSource = clientModel->getBlockSource();
1024  switch (blockSource) {
1025  case BlockSource::NETWORK:
1026  if (header) {
1028  return;
1029  }
1030  progressBarLabel->setText(tr("Synchronizing with network…"));
1032  break;
1033  case BlockSource::DISK:
1034  if (header) {
1035  progressBarLabel->setText(tr("Indexing blocks on disk…"));
1036  } else {
1037  progressBarLabel->setText(tr("Processing blocks on disk…"));
1038  }
1039  break;
1040  case BlockSource::REINDEX:
1041  progressBarLabel->setText(tr("Reindexing blocks on disk…"));
1042  break;
1043  case BlockSource::NONE:
1044  if (header) {
1045  return;
1046  }
1047  progressBarLabel->setText(tr("Connecting to peers…"));
1048  break;
1049  }
1050 
1051  QString tooltip;
1052 
1053  QDateTime currentDate = QDateTime::currentDateTime();
1054  qint64 secs = blockDate.secsTo(currentDate);
1055 
1056  tooltip = tr("Processed %n block(s) of transaction history.", "", count);
1057 
1058  // Set icon state: spinning if catching up, tick otherwise
1059  if (secs < MAX_BLOCK_TIME_GAP) {
1060  tooltip = tr("Up to date") + QString(".<br>") + tooltip;
1061  labelBlocksIcon->setThemedPixmap(QStringLiteral(":/icons/synced"), STATUSBAR_ICONSIZE, STATUSBAR_ICONSIZE);
1062 
1063 #ifdef ENABLE_WALLET
1064  if(walletFrame)
1065  {
1067  modalOverlay->showHide(true, true);
1068  }
1069 #endif // ENABLE_WALLET
1070 
1071  progressBarLabel->setVisible(false);
1072  progressBar->setVisible(false);
1073  }
1074  else
1075  {
1076  QString timeBehindText = GUIUtil::formatNiceTimeOffset(secs);
1077 
1078  progressBarLabel->setVisible(true);
1079  progressBar->setFormat(tr("%1 behind").arg(timeBehindText));
1080  progressBar->setMaximum(1000000000);
1081  progressBar->setValue(nVerificationProgress * 1000000000.0 + 0.5);
1082  progressBar->setVisible(true);
1083 
1084  tooltip = tr("Catching up…") + QString("<br>") + tooltip;
1085  if(count != prevBlocks)
1086  {
1088  QString(":/animation/spinner-%1").arg(spinnerFrame, 3, 10, QChar('0')),
1091  }
1092  prevBlocks = count;
1093 
1094 #ifdef ENABLE_WALLET
1095  if(walletFrame)
1096  {
1099  }
1100 #endif // ENABLE_WALLET
1101 
1102  tooltip += QString("<br>");
1103  tooltip += tr("Last received block was generated %1 ago.").arg(timeBehindText);
1104  tooltip += QString("<br>");
1105  tooltip += tr("Transactions after this will not yet be visible.");
1106  }
1107 
1108  // Don't word-wrap this (fixed-width) tooltip
1109  tooltip = QString("<nobr>") + tooltip + QString("</nobr>");
1110 
1111  labelBlocksIcon->setToolTip(tooltip);
1112  progressBarLabel->setToolTip(tooltip);
1113  progressBar->setToolTip(tooltip);
1114 }
1115 
1116 void BitcoinGUI::message(const QString& title, QString message, unsigned int style, bool* ret, const QString& detailed_message)
1117 {
1118  // Default title. On macOS, the window title is ignored (as required by the macOS Guidelines).
1119  QString strTitle{PACKAGE_NAME};
1120  // Default to information icon
1121  int nMBoxIcon = QMessageBox::Information;
1122  int nNotifyIcon = Notificator::Information;
1123 
1124  QString msgType;
1125  if (!title.isEmpty()) {
1126  msgType = title;
1127  } else {
1128  switch (style) {
1130  msgType = tr("Error");
1131  message = tr("Error: %1").arg(message);
1132  break;
1134  msgType = tr("Warning");
1135  message = tr("Warning: %1").arg(message);
1136  break;
1138  msgType = tr("Information");
1139  // No need to prepend the prefix here.
1140  break;
1141  default:
1142  break;
1143  }
1144  }
1145 
1146  if (!msgType.isEmpty()) {
1147  strTitle += " - " + msgType;
1148  }
1149 
1150  if (style & CClientUIInterface::ICON_ERROR) {
1151  nMBoxIcon = QMessageBox::Critical;
1152  nNotifyIcon = Notificator::Critical;
1153  } else if (style & CClientUIInterface::ICON_WARNING) {
1154  nMBoxIcon = QMessageBox::Warning;
1155  nNotifyIcon = Notificator::Warning;
1156  }
1157 
1158  if (style & CClientUIInterface::MODAL) {
1159  // Check for buttons, use OK as default, if none was supplied
1160  QMessageBox::StandardButton buttons;
1161  if (!(buttons = (QMessageBox::StandardButton)(style & CClientUIInterface::BTN_MASK)))
1162  buttons = QMessageBox::Ok;
1163 
1165  QMessageBox mBox(static_cast<QMessageBox::Icon>(nMBoxIcon), strTitle, message, buttons, this);
1166  mBox.setTextFormat(Qt::PlainText);
1167  mBox.setDetailedText(detailed_message);
1168  int r = mBox.exec();
1169  if (ret != nullptr)
1170  *ret = r == QMessageBox::Ok;
1171  } else {
1172  notificator->notify(static_cast<Notificator::Class>(nNotifyIcon), strTitle, message);
1173  }
1174 }
1175 
1177 {
1178  if (e->type() == QEvent::PaletteChange) {
1179  overviewAction->setIcon(platformStyle->SingleColorIcon(QStringLiteral(":/icons/overview")));
1180  sendCoinsAction->setIcon(platformStyle->SingleColorIcon(QStringLiteral(":/icons/send")));
1181  receiveCoinsAction->setIcon(platformStyle->SingleColorIcon(QStringLiteral(":/icons/receiving_addresses")));
1182  historyAction->setIcon(platformStyle->SingleColorIcon(QStringLiteral(":/icons/history")));
1183  }
1184 
1185  QMainWindow::changeEvent(e);
1186 
1187 #ifndef Q_OS_MAC // Ignored on Mac
1188  if(e->type() == QEvent::WindowStateChange)
1189  {
1191  {
1192  QWindowStateChangeEvent *wsevt = static_cast<QWindowStateChangeEvent*>(e);
1193  if(!(wsevt->oldState() & Qt::WindowMinimized) && isMinimized())
1194  {
1195  QTimer::singleShot(0, this, &BitcoinGUI::hide);
1196  e->ignore();
1197  }
1198  else if((wsevt->oldState() & Qt::WindowMinimized) && !isMinimized())
1199  {
1200  QTimer::singleShot(0, this, &BitcoinGUI::show);
1201  e->ignore();
1202  }
1203  }
1204  }
1205 #endif
1206 }
1207 
1208 void BitcoinGUI::closeEvent(QCloseEvent *event)
1209 {
1210 #ifndef Q_OS_MAC // Ignored on Mac
1212  {
1214  {
1215  // close rpcConsole in case it was open to make some space for the shutdown window
1216  rpcConsole->close();
1217 
1218  Q_EMIT quitRequested();
1219  }
1220  else
1221  {
1222  QMainWindow::showMinimized();
1223  event->ignore();
1224  }
1225  }
1226 #else
1227  QMainWindow::closeEvent(event);
1228 #endif
1229 }
1230 
1231 void BitcoinGUI::showEvent(QShowEvent *event)
1232 {
1233  // enable the debug window when the main window shows up
1234  openRPCConsoleAction->setEnabled(true);
1235  aboutAction->setEnabled(true);
1236  optionsAction->setEnabled(true);
1237 }
1238 
1239 #ifdef ENABLE_WALLET
1240 void BitcoinGUI::incomingTransaction(const QString& date, int unit, const CAmount& amount, const QString& type, const QString& address, const QString& label, const QString& walletName)
1241 {
1242  // On new transaction, make an info balloon
1243  QString msg = tr("Date: %1\n").arg(date) +
1244  tr("Amount: %1\n").arg(BitcoinUnits::formatWithUnit(unit, amount, true));
1245  if (m_node.walletClient().getWallets().size() > 1 && !walletName.isEmpty()) {
1246  msg += tr("Wallet: %1\n").arg(walletName);
1247  }
1248  msg += tr("Type: %1\n").arg(type);
1249  if (!label.isEmpty())
1250  msg += tr("Label: %1\n").arg(label);
1251  else if (!address.isEmpty())
1252  msg += tr("Address: %1\n").arg(address);
1253  message((amount)<0 ? tr("Sent transaction") : tr("Incoming transaction"),
1255 }
1256 #endif // ENABLE_WALLET
1257 
1258 void BitcoinGUI::dragEnterEvent(QDragEnterEvent *event)
1259 {
1260  // Accept only URIs
1261  if(event->mimeData()->hasUrls())
1262  event->acceptProposedAction();
1263 }
1264 
1265 void BitcoinGUI::dropEvent(QDropEvent *event)
1266 {
1267  if(event->mimeData()->hasUrls())
1268  {
1269  for (const QUrl &uri : event->mimeData()->urls())
1270  {
1271  Q_EMIT receivedURI(uri.toString());
1272  }
1273  }
1274  event->acceptProposedAction();
1275 }
1276 
1277 bool BitcoinGUI::eventFilter(QObject *object, QEvent *event)
1278 {
1279  // Catch status tip events
1280  if (event->type() == QEvent::StatusTip)
1281  {
1282  // Prevent adding text from setStatusTip(), if we currently use the status bar for displaying other stuff
1283  if (progressBarLabel->isVisible() || progressBar->isVisible())
1284  return true;
1285  }
1286  return QMainWindow::eventFilter(object, event);
1287 }
1288 
1289 #ifdef ENABLE_WALLET
1290 bool BitcoinGUI::handlePaymentRequest(const SendCoinsRecipient& recipient)
1291 {
1292  // URI has to be valid
1293  if (walletFrame && walletFrame->handlePaymentRequest(recipient))
1294  {
1296  gotoSendCoinsPage();
1297  return true;
1298  }
1299  return false;
1300 }
1301 
1302 void BitcoinGUI::setHDStatus(bool privkeyDisabled, int hdEnabled)
1303 {
1304  labelWalletHDStatusIcon->setThemedPixmap(privkeyDisabled ? QStringLiteral(":/icons/eye") : hdEnabled ? QStringLiteral(":/icons/hd_enabled") : QStringLiteral(":/icons/hd_disabled"), STATUSBAR_ICONSIZE, STATUSBAR_ICONSIZE);
1305  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>"));
1306  labelWalletHDStatusIcon->show();
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 {
1341 
1342  WalletView * const walletView = walletFrame->currentWalletView();
1343  if (!walletView) {
1344  return;
1345  }
1346  WalletModel * const walletModel = walletView->getWalletModel();
1347  setEncryptionStatus(walletModel->getEncryptionStatus());
1348  setHDStatus(walletModel->wallet().privateKeysDisabled(), walletModel->wallet().hdEnabled());
1349 }
1350 #endif // ENABLE_WALLET
1351 
1353 {
1354  std::string ip_port;
1355  bool proxy_enabled = clientModel->getProxyInfo(ip_port);
1356 
1357  if (proxy_enabled) {
1359  QString ip_port_q = QString::fromStdString(ip_port);
1361  labelProxyIcon->setToolTip(tr("Proxy is <b>enabled</b>: %1").arg(ip_port_q));
1362  } else {
1363  labelProxyIcon->show();
1364  }
1365  } else {
1366  labelProxyIcon->hide();
1367  }
1368 }
1369 
1371 {
1372  QString window_title = PACKAGE_NAME;
1373 #ifdef ENABLE_WALLET
1374  if (walletFrame) {
1375  WalletModel* const wallet_model = walletFrame->currentWalletModel();
1376  if (wallet_model && !wallet_model->getWalletName().isEmpty()) {
1377  window_title += " - " + wallet_model->getDisplayName();
1378  }
1379  }
1380 #endif
1381  if (!m_network_style->getTitleAddText().isEmpty()) {
1382  window_title += " - " + m_network_style->getTitleAddText();
1383  }
1384  setWindowTitle(window_title);
1385 }
1386 
1387 void BitcoinGUI::showNormalIfMinimized(bool fToggleHidden)
1388 {
1389  if(!clientModel)
1390  return;
1391 
1392  if (!isHidden() && !isMinimized() && !GUIUtil::isObscured(this) && fToggleHidden) {
1393  hide();
1394  } else {
1395  GUIUtil::bringToFront(this);
1396  }
1397 }
1398 
1400 {
1401  showNormalIfMinimized(true);
1402 }
1403 
1405 {
1406  if (m_node.shutdownRequested())
1407  {
1408  if(rpcConsole)
1409  rpcConsole->hide();
1410  Q_EMIT quitRequested();
1411  }
1412 }
1413 
1414 void BitcoinGUI::showProgress(const QString &title, int nProgress)
1415 {
1416  if (nProgress == 0) {
1417  progressDialog = new QProgressDialog(title, QString(), 0, 100);
1419  progressDialog->setWindowModality(Qt::ApplicationModal);
1420  progressDialog->setAutoClose(false);
1421  progressDialog->setValue(0);
1422  } else if (nProgress == 100) {
1423  if (progressDialog) {
1424  progressDialog->close();
1425  progressDialog->deleteLater();
1426  progressDialog = nullptr;
1427  }
1428  } else if (progressDialog) {
1429  progressDialog->setValue(nProgress);
1430  }
1431 }
1432 
1434 {
1435  if (modalOverlay && (progressBar->isVisible() || modalOverlay->isLayerVisible()))
1437 }
1438 
1439 static bool ThreadSafeMessageBox(BitcoinGUI* gui, const bilingual_str& message, const std::string& caption, unsigned int style)
1440 {
1441  bool modal = (style & CClientUIInterface::MODAL);
1442  // The SECURE flag has no effect in the Qt GUI.
1443  // bool secure = (style & CClientUIInterface::SECURE);
1444  style &= ~CClientUIInterface::SECURE;
1445  bool ret = false;
1446 
1447  QString detailed_message; // This is original message, in English, for googling and referencing.
1448  if (message.original != message.translated) {
1449  detailed_message = BitcoinGUI::tr("Original message:") + "\n" + QString::fromStdString(message.original);
1450  }
1451 
1452  // In case of modal message, use blocking connection to wait for user to click a button
1453  bool invoked = QMetaObject::invokeMethod(gui, "message",
1454  modal ? GUIUtil::blockingGUIThreadConnection() : Qt::QueuedConnection,
1455  Q_ARG(QString, QString::fromStdString(caption)),
1456  Q_ARG(QString, QString::fromStdString(message.translated)),
1457  Q_ARG(unsigned int, style),
1458  Q_ARG(bool*, &ret),
1459  Q_ARG(QString, detailed_message));
1460  assert(invoked);
1461  return ret;
1462 }
1463 
1465 {
1466  // Connect signals to client
1467  m_handler_message_box = m_node.handleMessageBox(std::bind(ThreadSafeMessageBox, this, std::placeholders::_1, std::placeholders::_2, std::placeholders::_3));
1468  m_handler_question = m_node.handleQuestion(std::bind(ThreadSafeMessageBox, this, std::placeholders::_1, std::placeholders::_3, std::placeholders::_4));
1469 }
1470 
1472 {
1473  // Disconnect signals from client
1474  m_handler_message_box->disconnect();
1475  m_handler_question->disconnect();
1476 }
1477 
1479 {
1481  return m_mask_values_action->isChecked();
1482 }
1483 
1485  : optionsModel(nullptr),
1486  menu(nullptr),
1487  m_platform_style{platformStyle}
1488 {
1489  createContextMenu();
1490  setToolTip(tr("Unit to show amounts in. Click to select another unit."));
1491  QList<BitcoinUnits::Unit> units = BitcoinUnits::availableUnits();
1492  int max_width = 0;
1493  const QFontMetrics fm(font());
1494  for (const BitcoinUnits::Unit unit : units)
1495  {
1496  max_width = qMax(max_width, GUIUtil::TextWidth(fm, BitcoinUnits::longName(unit)));
1497  }
1498  setMinimumSize(max_width, 0);
1499  setAlignment(Qt::AlignRight | Qt::AlignVCenter);
1500  setStyleSheet(QString("QLabel { color : %1 }").arg(m_platform_style->SingleColor().name()));
1501 }
1502 
1505 {
1506  onDisplayUnitsClicked(event->pos());
1507 }
1508 
1510 {
1511  if (e->type() == QEvent::PaletteChange) {
1512  QString style = QString("QLabel { color : %1 }").arg(m_platform_style->SingleColor().name());
1513  if (style != styleSheet()) {
1514  setStyleSheet(style);
1515  }
1516  }
1517 
1518  QLabel::changeEvent(e);
1519 }
1520 
1523 {
1524  menu = new QMenu(this);
1526  menu->addAction(BitcoinUnits::longName(u))->setData(QVariant(u));
1527  }
1528  connect(menu, &QMenu::triggered, this, &UnitDisplayStatusBarControl::onMenuSelection);
1529 }
1530 
1533 {
1534  if (_optionsModel)
1535  {
1536  this->optionsModel = _optionsModel;
1537 
1538  // be aware of a display unit change reported by the OptionsModel object.
1540 
1541  // initialize the display units label with the current value in the model.
1542  updateDisplayUnit(_optionsModel->getDisplayUnit());
1543  }
1544 }
1545 
1548 {
1549  setText(BitcoinUnits::longName(newUnits));
1550 }
1551 
1554 {
1555  QPoint globalPos = mapToGlobal(point);
1556  menu->exec(globalPos);
1557 }
1558 
1561 {
1562  if (action)
1563  {
1564  optionsModel->setDisplayUnit(action->data());
1565  }
1566 }
OptionsDialog
Preferences dialog.
Definition: optionsdialog.h:35
BitcoinGUI::createToolBars
void createToolBars()
Create the toolbars.
Definition: bitcoingui.cpp:544
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:580
OptionsDialog::TAB_NETWORK
@ TAB_NETWORK
Definition: optionsdialog.h:45
WalletFrame::currentWalletView
WalletView * currentWalletView() const
Definition: walletframe.cpp:271
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:1352
UnitDisplayStatusBarControl::mousePressEvent
void mousePressEvent(QMouseEvent *event) override
So that it responds to left-button clicks.
Definition: bitcoingui.cpp:1504
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:164
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:924
OptionsModel::getMinimizeOnClose
bool getMinimizeOnClose() const
Definition: optionsmodel.h:87
count
static int count
Definition: tests.c:41
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:178
BitcoinGUI::trayIconMenu
const std::unique_ptr< QMenu > trayIconMenu
Definition: bitcoingui.h:172
GUIUtil::ClickableLabel
Definition: guiutil.h:260
BitcoinGUI::setWalletActionsEnabled
void setWalletActionsEnabled(bool enabled)
Enable or disable all wallet-related actions.
Definition: bitcoingui.cpp:751
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:1399
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:1208
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.
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:314
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: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
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:328
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:568
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
ModalOverlay::triggered
void triggered(bool hidden)
BitcoinGUI::dropEvent
void dropEvent(QDropEvent *event) override
Definition: bitcoingui.cpp:1265
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:60
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:957
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:229
BitcoinGUI::changeEvent
void changeEvent(QEvent *e) override
Definition: bitcoingui.cpp:1176
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:391
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:557
WalletFrame::changePassphrase
void changePassphrase()
Change encrypted wallet passphrase.
Definition: walletframe.cpp:243
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:784
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:1116
BitcoinGUI::appToolBar
QToolBar * appToolBar
Definition: bitcoingui.h:135
BitcoinGUI::showDebugWindowActivateConsole
void showDebugWindowActivateConsole()
Show debug window and set focus to the console.
Definition: bitcoingui.cpp:859
WalletFrame::message
void message(const QString &title, const QString &message, unsigned int style)
GUIUtil::isObscured
bool isObscured(QWidget *w)
Definition: guiutil.cpp:382
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:1532
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:344
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:1348
OpenWalletActivity
Definition: walletcontroller.h:132
WalletFrame::backupWallet
void backupWallet()
Backup the wallet.
Definition: walletframe.cpp:236
RPCConsole::addWallet
void addWallet(WalletModel *const walletModel)
BitcoinGUI::isPrivacyModeActivated
bool isPrivacyModeActivated() const
Definition: bitcoingui.cpp:1478
BitcoinGUI::showEvent
void showEvent(QShowEvent *event) override
Definition: bitcoingui.cpp:1231
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:182
BitcoinGUI::showProgress
void showProgress(const QString &title, int nProgress)
Show progress dialog e.g.
Definition: bitcoingui.cpp:1414
WalletFrame::addView
bool addView(WalletView *walletView)
Definition: walletframe.cpp:68
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:21
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:241
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:754
BlockSource::REINDEX
@ REINDEX
BitcoinGUI::unsubscribeFromCoreSignals
void unsubscribeFromCoreSignals()
Disconnect core signals from GUI client.
Definition: bitcoingui.cpp:1471
BitcoinGUI::m_close_all_wallets_action
QAction * m_close_all_wallets_action
Definition: bitcoingui.h:163
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:362
BitcoinGUI::showModalOverlay
void showModalOverlay()
Definition: bitcoingui.cpp:1433
WalletFrame::setCurrentWallet
void setCurrentWallet(WalletModel *wallet_model)
Definition: walletframe.cpp:90
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:264
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:649
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
m_node
NodeContext m_node
Definition: bitcoin-gui.cpp:36
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:1547
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:276
WalletModel::Unencrypted
@ Unencrypted
Definition: walletmodel.h:74
GUIUtil::PolishProgressDialog
void PolishProgressDialog(QProgressDialog *dialog)
Definition: guiutil.cpp:868
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:998
guiutil.h
WalletModel::getWalletName
QString getWalletName() const
Definition: walletmodel.cpp:573
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:1464
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:168
BitcoinGUI::setNumConnections
void setNumConnections(int count)
Set number of connections shown in the UI.
Definition: bitcoingui.cpp:952
WalletModel::Locked
@ Locked
Definition: walletmodel.h:75
BitcoinGUI::optionsClicked
void optionsClicked()
Show configuration dialog.
Definition: bitcoingui.cpp:839
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:1404
OptionsDialog::quitOnReset
void quitOnReset()
BitcoinGUI::showHelpMessageClicked
void showHelpMessageClicked()
Show help message dialog.
Definition: bitcoingui.cpp:865
ClientModel::showProgress
void showProgress(const QString &title, int nProgress)
WalletFrame::usedSendingAddresses
void usedSendingAddresses()
Show used sending addresses.
Definition: walletframe.cpp:257
BitcoinGUI::aboutClicked
void aboutClicked()
Show about dialog.
Definition: bitcoingui.cpp:844
interfaces::Node
Top-level interface for a bitcoin node (bitcoind process).
Definition: node.h:64
RPCConsole::tabTitle
QString tabTitle(TabTypes tab_type) const
Definition: rpcconsole.cpp:1343
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:940
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:919
WalletFrame::gotoSendCoinsPage
void gotoSendCoinsPage(QString addr="")
Switch to send coins page.
Definition: walletframe.cpp:171
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:1484
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:192
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:133
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:74
interfaces::BlockAndHeaderTipInfo::header_height
int header_height
Definition: node.h:48
guiconstants.h
walletframe.h
WalletFrame::setClientModel
void setClientModel(ClientModel *clientModel)
Definition: walletframe.cpp:59
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:1277
RPCConsole::setTabFocus
void setTabFocus(enum TabTypes tabType)
set which tab has the focus (is visible)
Definition: rpcconsole.cpp:1338
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:88
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:1509
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:185
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:150
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:345
ThreadSafeMessageBox
static bool ThreadSafeMessageBox(BitcoinGUI *gui, const bilingual_str &message, const std::string &caption, unsigned int style)
Definition: bitcoingui.cpp:1439
BitcoinGUI::trayIconActivated
void trayIconActivated(QSystemTrayIcon::ActivationReason reason)
Handle tray icon clicked.
Definition: bitcoingui.cpp:823
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:363
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:561
BitcoinGUI::usedReceivingAddressesAction
QAction * usedReceivingAddressesAction
Definition: bitcoingui.h:142
BitcoinGUI::quitRequested
void quitRequested()
bitcoinunits.h
BitcoinGUI::openOptionsDialogWithTab
void openOptionsDialogWithTab(OptionsDialog::Tab tab)
Open the OptionsDialog on the specified tab index.
Definition: bitcoingui.cpp:986
bitcoingui.h
node
Definition: interfaces.cpp:68
GUIUtil::ShowModalDialogAndDeleteOnClose
void ShowModalDialogAndDeleteOnClose(QDialog *dialog)
Shows a QDialog instance asynchronously, and deletes it on close.
Definition: guiutil.cpp:980
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:882
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:93
WalletFrame::removeAllWallets
void removeAllWallets()
Definition: walletframe.cpp:125
GUIUtil::handleCloseWindowShortcut
void handleCloseWindowShortcut(QWidget *w)
Definition: guiutil.cpp:409
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:447
BitcoinGUI::createTrayIcon
void createTrayIcon()
Create system tray icon and notification.
Definition: bitcoingui.cpp:771
BitcoinGUI::updateWindowTitle
void updateWindowTitle()
Definition: bitcoingui.cpp:1370
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:1522
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:1560
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:578
BitcoinGUI::updateHeadersSyncProgressLabel
void updateHeadersSyncProgressLabel()
Definition: bitcoingui.cpp:977
WalletFrame::showOutOfSyncWarning
void showOutOfSyncWarning(bool fShow)
Definition: walletframe.cpp:142
GUIUtil::ThemedLabel::setThemedPixmap
void setThemedPixmap(const QString &image_filename, int width, int height)
Definition: guiutil.cpp:821
macdockiconhandler.h
OptionsModel::getMinimizeToTray
bool getMinimizeToTray() const
Definition: optionsmodel.h:86
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:157
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:90
BitcoinGUI::appMenuBar
QMenuBar * appMenuBar
Definition: bitcoingui.h:134
BitcoinGUI::dragEnterEvent
void dragEnterEvent(QDragEnterEvent *event) override
Definition: bitcoingui.cpp:1258
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:116
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: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:1553
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:85
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:853
RPCConsole::TabTypes::PEERS
@ PEERS
UnitDisplayStatusBarControl::optionsModel
OptionsModel * optionsModel
Definition: bitcoingui.h:343