8#include <chainparams.h>
37#include <validation.h>
43#include <QActionGroup>
44#include <QApplication>
47#include <QDragEnterEvent>
48#include <QKeySequence>
54#include <QProgressDialog>
58#include <QStackedWidget>
61#include <QSystemTrayIcon>
71#elif defined(Q_OS_WIN)
81 : QMainWindow(parent),
m_node(
node), trayIconMenu{new QMenu()},
82 config(configIn), platformStyle(_platformStyle),
83 m_network_style(networkStyle) {
85 if (!restoreGeometry(settings.value(
"MainWindowGeometry").toByteArray())) {
87 move(QGuiApplication::primaryScreen()->availableGeometry().center() -
88 frameGeometry().center());
119 setAcceptDrops(
true);
132 if (QSystemTrayIcon::isSystemTrayAvailable()) {
142 statusBar()->setSizeGripEnabled(
false);
145 QFrame *frameBlocks =
new QFrame();
146 frameBlocks->setContentsMargins(0, 0, 0, 0);
147 frameBlocks->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Preferred);
148 QHBoxLayout *frameBlocksLayout =
new QHBoxLayout(frameBlocks);
149 frameBlocksLayout->setContentsMargins(3, 0, 3, 0);
150 frameBlocksLayout->setSpacing(3);
158 frameBlocksLayout->addStretch();
160 frameBlocksLayout->addStretch();
165 frameBlocksLayout->addStretch();
167 frameBlocksLayout->addStretch();
169 frameBlocksLayout->addStretch();
182 QString curStyle = QApplication::style()->metaObject()->className();
183 if (curStyle ==
"QWindowsStyle" || curStyle ==
"QWindowsXPStyle") {
185 "QProgressBar { background-color: #e8e8e8; border: 1px solid grey; "
186 "border-radius: 7px; padding: 1px; text-align: center; } "
187 "QProgressBar::chunk { background: QLinearGradient(x1: 0, y1: 0, "
188 "x2: 1, y2: 0, stop: 0 #FF8000, stop: 1 orange); border-radius: "
189 "7px; margin: 0px; }");
194 statusBar()->addPermanentWidget(frameBlocks);
198 this->installEventFilter(
this);
234 settings.setValue(
"MainWindowGeometry", saveGeometry());
240 delete m_app_nap_inhibitor;
249 QActionGroup *tabGroup =
new QActionGroup(
this);
251 &QActionGroup::setEnabled);
255 tr(
"&Overview"),
this);
256 overviewAction->setStatusTip(tr(
"Show general overview of wallet"));
259 overviewAction->setShortcut(QKeySequence(QStringLiteral(
"Alt+1")));
272 tr(
"&Receive"),
this);
274 tr(
"Request payments (generates QR codes and %1: URIs)")
275 .arg(QString::fromStdString(
284 tr(
"&Transactions"),
this);
285 historyAction->setStatusTip(tr(
"Browse transaction history"));
288 historyAction->setShortcut(QKeySequence(QStringLiteral(
"Alt+4")));
298 &BitcoinGUI::gotoOverviewPage);
302 [
this] { gotoSendCoinsPage(); });
306 &BitcoinGUI::gotoReceiveCoinsPage);
310 &BitcoinGUI::gotoHistoryPage);
314 quitAction->setStatusTip(tr(
"Quit application"));
315 quitAction->setShortcut(QKeySequence(tr(
"Ctrl+Q")));
317 aboutAction =
new QAction(tr(
"&About %1").arg(PACKAGE_NAME),
this);
319 tr(
"Show information about %1").arg(PACKAGE_NAME));
323 aboutQtAction->setStatusTip(tr(
"Show information about Qt"));
327 tr(
"Modify configuration options for %1").arg(PACKAGE_NAME));
333 tr(
"Encrypt the private keys that belong to your wallet"));
339 tr(
"Change the passphrase used for wallet encryption"));
342 tr(
"Sign messages with your Bitcoin addresses to prove you own them"));
345 tr(
"Verify messages to ensure they were signed with specified Bitcoin "
349 tr(
"Load Partially Signed Bitcoin Transaction"));
353 tr(
"Open node debugging and diagnostic console"));
360 tr(
"Show the list of used sending addresses and labels"));
362 new QAction(tr(
"&Receiving addresses"),
this);
364 tr(
"Show the list of used receiving addresses and labels"));
366 openAction =
new QAction(tr(
"Open &URI..."),
this);
368 tr(
"Open a %1: URI or payment request")
369 .arg(QString::fromStdString(
390 tr(
"Show the %1 help message to get a list with possible Bitcoin "
391 "command-line options")
396 QKeySequence(Qt::CTRL | Qt::SHIFT | Qt::Key_M));
398 tr(
"Mask the values in the Overview tab"));
403 connect(
aboutQtAction, &QAction::triggered, qApp, QApplication::aboutQt);
425 [
this] { gotoSignMessageTab(); });
429 [
this] { gotoVerifyMessageTab(); });
431 [
this] { gotoLoadPSBT(); });
436 connect(
openAction, &QAction::triggered,
this,
437 &BitcoinGUI::openClicked);
440 for (
const std::pair<const std::string, bool> &i :
442 const std::string &path = i.first;
443 QString name = path.empty()
444 ? QString(
"[" + tr(
"default wallet") +
"]")
445 : QString::fromStdString(path);
449 name.replace(name.indexOf(QChar(
'&')), 1, QString(
"&&"));
450 QAction *action = m_open_wallet_menu->addAction(name);
454 action->setEnabled(false);
458 connect(action, &QAction::triggered, [
this, path] {
462 &BitcoinGUI::setCurrentWallet);
464 &QObject::deleteLater);
465 activity->open(path);
471 action->setEnabled(
false);
481 &BitcoinGUI::setCurrentWallet);
483 &QObject::deleteLater);
493 connect(
new QShortcut(QKeySequence(Qt::CTRL | Qt::SHIFT | Qt::Key_C),
this),
494 &QShortcut::activated,
this,
496 connect(
new QShortcut(QKeySequence(Qt::CTRL | Qt::SHIFT | Qt::Key_D),
this),
511 QMenu *file =
appMenuBar->addMenu(tr(
"&File"));
517 file->addSeparator();
523 file->addSeparator();
527 QMenu *settings =
appMenuBar->addMenu(tr(
"&Settings"));
531 settings->addSeparator();
533 settings->addSeparator();
537 QMenu *window_menu =
appMenuBar->addMenu(tr(
"&Window"));
539 QAction *minimize_action = window_menu->addAction(tr(
"Minimize"));
540 minimize_action->setShortcut(QKeySequence(tr(
"Ctrl+M")));
541 connect(minimize_action, &QAction::triggered,
542 [] { QApplication::activeWindow()->showMinimized(); });
543 connect(qApp, &QApplication::focusWindowChanged,
544 [minimize_action](QWindow *window) {
545 minimize_action->setEnabled(
547 (window->flags() & Qt::Dialog) != Qt::Dialog &&
548 window->windowState() != Qt::WindowMinimized);
552 QAction *zoom_action = window_menu->addAction(tr(
"Zoom"));
553 connect(zoom_action, &QAction::triggered, [] {
554 QWindow *window = qApp->focusWindow();
555 if (window->windowState() != Qt::WindowMaximized) {
556 window->showMaximized();
558 window->showNormal();
562 connect(qApp, &QApplication::focusWindowChanged,
563 [zoom_action](QWindow *window) {
564 zoom_action->setEnabled(window !=
nullptr);
570 window_menu->addSeparator();
571 QAction *main_window_action = window_menu->addAction(tr(
"Main Window"));
572 connect(main_window_action, &QAction::triggered,
575 window_menu->addSeparator();
580 window_menu->addSeparator();
582 QAction *tab_action =
585 connect(tab_action, &QAction::triggered, [
this, tab_type] {
593 help->addSeparator();
600 QToolBar *toolbar = addToolBar(tr(
"Tabs toolbar"));
602 toolbar->setContextMenuPolicy(Qt::PreventContextMenu);
603 toolbar->setMovable(
false);
604 toolbar->setToolButtonStyle(Qt::ToolButtonTextBesideIcon);
612 QWidget *spacer =
new QWidget();
613 spacer->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
614 toolbar->addWidget(spacer);
619 static_cast<void (QComboBox::*)(
int)
>(
620 &QComboBox::currentIndexChanged),
621 this, &BitcoinGUI::setCurrentWalletBySelectorIndex);
654 QDateTime::fromSecsSinceEpoch(tip_info->
header_time),
657 QDateTime::fromSecsSinceEpoch(tip_info->
block_time),
665 [
this](
const QString &title,
const QString &
message,
666 unsigned int style) {
717 assert(wallet_controller);
726 &BitcoinGUI::addWallet);
728 &BitcoinGUI::removeWallet);
731 addWallet(wallet_model);
739void BitcoinGUI::addWallet(
WalletModel *walletModel) {
757void BitcoinGUI::removeWallet(
WalletModel *walletModel) {
779void BitcoinGUI::setCurrentWallet(
WalletModel *wallet_model) {
794void BitcoinGUI::setCurrentWalletBySelectorIndex(
int index) {
798 setCurrentWallet(wallet_model);
802void BitcoinGUI::removeAllWallets() {
829 assert(QSystemTrayIcon::isSystemTrayAvailable());
832 if (QSystemTrayIcon::isSystemTrayAvailable()) {
835 QString toolTip = tr(
"%1 client").arg(PACKAGE_NAME) +
" " +
850 QAction *show_hide_action{
nullptr};
858 QAction *send_action{
nullptr};
859 QAction *receive_action{
nullptr};
860 QAction *sign_action{
nullptr};
861 QAction *verify_action{
nullptr};
877 options_action->setMenuRole(QAction::PreferencesRole);
880 QAction *quit_action{
nullptr};
888 connect(
trayIcon, &QSystemTrayIcon::activated,
889 [
this](QSystemTrayIcon::ActivationReason reason) {
890 if (reason == QSystemTrayIcon::Trigger) {
911 [
this, show_hide_action, send_action, receive_action, sign_action,
912 verify_action, options_action, node_window_action, quit_action] {
913 if (show_hide_action) {
914 show_hide_action->setText((!isHidden() && !isMinimized() &&
915 !GUIUtil::isObscured(this))
919 if (QApplication::activeModalWidget()) {
921 a->setEnabled(false);
924 if (show_hide_action) {
925 show_hide_action->setEnabled(
true);
934 node_window_action->setEnabled(
937 quit_action->setEnabled(
true);
971void BitcoinGUI::openClicked() {
978void BitcoinGUI::gotoOverviewPage() {
985void BitcoinGUI::gotoHistoryPage() {
992void BitcoinGUI::gotoReceiveCoinsPage() {
999void BitcoinGUI::gotoSendCoinsPage(QString addr) {
1006void BitcoinGUI::gotoSignMessageTab(QString addr) {
1012void BitcoinGUI::gotoVerifyMessageTab(QString addr) {
1017void BitcoinGUI::gotoLoadPSBT() {
1033 icon =
":/icons/connect_0";
1038 icon =
":/icons/connect_1";
1043 icon =
":/icons/connect_2";
1048 icon =
":/icons/connect_3";
1051 icon =
":/icons/connect_4";
1058 tooltip = tr(
"%n active connection(s) to Bitcoin network",
"",
count) +
1059 QString(
".<br>") + tr(
"Click to disable network activity.");
1061 tooltip = tr(
"Network activity disabled.") + QString(
"<br>") +
1062 tr(
"Click to enable network activity again.");
1063 icon =
":/icons/network_disabled";
1067 tooltip = QString(
"<nobr>") + tooltip + QString(
"</nobr>");
1085 int estHeadersLeft =
1086 (
GetTime() - headersTipTime) /
1090 tr(
"Syncing Headers (%1%)...")
1091 .arg(QString::number(100.0 /
1092 (headersTipHeight + estHeadersLeft) *
1099 const QDateTime &blockDate) {
1100 int estHeadersLeft = blockDate.secsTo(QDateTime::currentDateTime()) /
1104 tr(
"Pre-syncing Headers (%1%)…")
1105 .arg(QString::number(100.0 / (height + estHeadersLeft) * height,
1117 dlg->setCurrentTab(tab);
1123 double nVerificationProgress,
SyncType synctype,
1128 m_app_nap_inhibitor->enableAppNap();
1130 m_app_nap_inhibitor->disableAppNap();
1148 statusBar()->clearMessage();
1152 switch (blockSource) {
1181 QDateTime currentDate = QDateTime::currentDateTime();
1182 qint64 secs = blockDate.secsTo(currentDate);
1184 tooltip = tr(
"Processed %n block(s) of transaction history.",
"",
count);
1188 tooltip = tr(
"Up to date") + QString(
".<br>") + tooltip;
1206 progressBar->setFormat(tr(
"%1 behind").arg(timeBehindText));
1208 progressBar->setValue(nVerificationProgress * 1000000000.0 + 0.5);
1211 tooltip = tr(
"Catching up...") + QString(
"<br>") + tooltip;
1215 ->SingleColorIcon(QString(
":/animation/spinner-%1")
1229 tooltip += QString(
"<br>");
1231 tr(
"Last received block was generated %1 ago.").arg(timeBehindText);
1232 tooltip += QString(
"<br>");
1233 tooltip += tr(
"Transactions after this will not yet be visible.");
1237 tooltip = QString(
"<nobr>") + tooltip + QString(
"</nobr>");
1245 unsigned int style,
bool *ret,
1246 const QString &detailed_message) {
1249 QString strTitle{PACKAGE_NAME};
1251 int nMBoxIcon = QMessageBox::Information;
1255 if (!title.isEmpty()) {
1260 msgType = tr(
"Error");
1264 msgType = tr(
"Warning");
1268 msgType = tr(
"Information");
1276 if (!msgType.isEmpty()) {
1277 strTitle +=
" - " + msgType;
1281 nMBoxIcon = QMessageBox::Critical;
1284 nMBoxIcon = QMessageBox::Warning;
1290 auto buttons =
static_cast<QMessageBox::StandardButton
>(
1293 buttons = QMessageBox::Ok;
1297 QMessageBox mBox(
static_cast<QMessageBox::Icon
>(nMBoxIcon), strTitle,
1299 mBox.setTextFormat(Qt::PlainText);
1300 mBox.setDetailedText(detailed_message);
1301 int r = mBox.exec();
1302 if (ret !=
nullptr) {
1303 *ret = r == QMessageBox::Ok;
1312 QMainWindow::changeEvent(e);
1314 if (e->type() == QEvent::WindowStateChange) {
1317 QWindowStateChangeEvent *wsevt =
1318 static_cast<QWindowStateChangeEvent *
>(e);
1319 if (!(wsevt->oldState() & Qt::WindowMinimized) && isMinimized()) {
1320 QTimer::singleShot(0,
this, &BitcoinGUI::hide);
1322 }
else if ((wsevt->oldState() & Qt::WindowMinimized) &&
1324 QTimer::singleShot(0,
this, &BitcoinGUI::show);
1342 QMainWindow::showMinimized();
1347 QMainWindow::closeEvent(event);
1359void BitcoinGUI::incomingTransaction(
const QString &date,
int unit,
1360 const Amount amount,
const QString &type,
1361 const QString &address,
1362 const QString &label,
1363 const QString &walletName) {
1365 QString msg = tr(
"Date: %1\n").arg(date) +
1369 !walletName.isEmpty()) {
1370 msg += tr(
"Wallet: %1\n").arg(walletName);
1372 msg += tr(
"Type: %1\n").arg(type);
1373 if (!label.isEmpty()) {
1374 msg += tr(
"Label: %1\n").arg(label);
1375 }
else if (!address.isEmpty()) {
1376 msg += tr(
"Address: %1\n").arg(address);
1379 : tr(
"Incoming transaction"),
1386 if (event->mimeData()->hasUrls()) {
1387 event->acceptProposedAction();
1392 if (event->mimeData()->hasUrls()) {
1393 for (
const QUrl &uri : event->mimeData()->urls()) {
1397 event->acceptProposedAction();
1402 if (event->type() == QEvent::StatusTip) {
1409 return QMainWindow::eventFilter(
object, event);
1417 gotoSendCoinsPage();
1423void BitcoinGUI::setHDStatus(
bool privkeyDisabled,
int hdEnabled) {
1426 ->SingleColorIcon(privkeyDisabled ?
":/icons/eye"
1427 : hdEnabled ?
":/icons/hd_enabled"
1428 :
":/icons/hd_disabled")
1431 privkeyDisabled ? tr(
"Private key <b>disabled</b>")
1432 : hdEnabled ? tr(
"HD key generation is <b>enabled</b>")
1433 : tr(
"HD key generation is <b>disabled</b>"));
1439void BitcoinGUI::setEncryptionStatus(
int status) {
1453 tr(
"Wallet is <b>encrypted</b> and currently <b>unlocked</b>"));
1464 tr(
"Wallet is <b>encrypted</b> and currently <b>locked</b>"));
1472void BitcoinGUI::updateWalletStatus() {
1488 std::string ip_port;
1491 if (proxy_enabled) {
1493 QString ip_port_q = QString::fromStdString(ip_port);
1498 tr(
"Proxy is <b>enabled</b>: %1").arg(ip_port_q));
1508 QString window_title = PACKAGE_NAME;
1512 if (wallet_model && !wallet_model->
getWalletName().isEmpty()) {
1520 setWindowTitle(window_title);
1550 if (nProgress == 0) {
1557 }
else if (nProgress == 100) {
1570 trayIcon->setVisible(!fHideTrayIcon);
1582 const std::string &caption,
1583 unsigned int style) {
1590 QString detailed_message;
1592 detailed_message = BitcoinGUI::tr(
"Original message:") +
"\n" +
1593 QString::fromStdString(message.
original);
1598 bool invoked = QMetaObject::invokeMethod(
1601 Q_ARG(QString, QString::fromStdString(caption)),
1602 Q_ARG(QString, QString::fromStdString(message.
translated)),
1603 Q_ARG(
unsigned int, style), Q_ARG(
bool *, &ret),
1604 Q_ARG(QString, detailed_message));
1613 std::placeholders::_2, std::placeholders::_3));
1616 std::placeholders::_3, std::placeholders::_4));
1632 : optionsModel(nullptr), menu(nullptr) {
1634 setToolTip(tr(
"Unit to show amounts in. Click to select another unit."));
1637 const QFontMetrics fm(font());
1639 max_width = qMax(max_width,
1642 setMinimumSize(max_width, 0);
1643 setAlignment(Qt::AlignRight | Qt::AlignVCenter);
1644 setStyleSheet(QString(
"QLabel { color : %1 }")
1656 menu =
new QMenu(
this);
1658 QAction *menuAction =
1660 menuAction->setData(QVariant(u));
1661 menu->addAction(menuAction);
1663 connect(
menu, &QMenu::triggered,
this,
1669 if (_optionsModel) {
1691 QPoint globalPos = mapToGlobal(point);
1692 menu->exec(globalPos);
static bool ThreadSafeMessageBox(BitcoinGUI *gui, const bilingual_str &message, const std::string &caption, unsigned int style)
static constexpr int64_t MAX_BLOCK_TIME_GAP
Maximum gap between node time and block time used for the "Catching up..." mode in GUI.
const CChainParams & Params()
Return the currently selected parameters.
void updateHeadersPresyncProgressLabel(int64_t height, const QDateTime &blockDate)
GUIUtil::ClickableProgressBar * progressBar
QAction * m_close_all_wallets_action
void showEvent(QShowEvent *event) override
QLabel * progressBarLabel
QAction * m_open_wallet_action
static const std::string DEFAULT_UIPLATFORM
void setNumBlocks(int count, const QDateTime &blockDate, double nVerificationProgress, SyncType synctype, SynchronizationState sync_state)
Set number of blocks and last block date shown in the UI.
void setClientModel(ClientModel *clientModel=nullptr, interfaces::BlockAndHeaderTipInfo *tip_info=nullptr)
Set the client model.
GUIUtil::ClickableLabel * connectionsControl
void receivedURI(const QString &uri)
Signal raised when a URI was entered or dragged to the GUI.
ModalOverlay * modalOverlay
QAction * changePassphraseAction
void openOptionsDialogWithTab(OptionsDialog::Tab tab)
Open the OptionsDialog on the specified tab index.
int prevBlocks
Keep track of previous number of blocks, to detect progress.
QAction * openRPCConsoleAction
const NetworkStyle *const m_network_style
void changeEvent(QEvent *e) override
GUIUtil::ClickableLabel * labelProxyIcon
void optionsClicked()
Show configuration dialog.
bool eventFilter(QObject *object, QEvent *event) override
QMenu * m_open_wallet_menu
void createTrayIcon()
Create system tray icon and notification.
void setPrivacy(bool privacy)
QProgressDialog * progressDialog
std::unique_ptr< interfaces::Handler > m_handler_message_box
WalletFrame * walletFrame
void updateProxyIcon()
Set the proxy-enabled icon as shown in the UI.
QAction * receiveCoinsAction
const std::unique_ptr< QMenu > trayIconMenu
QAction * usedSendingAddressesAction
void unsubscribeFromCoreSignals()
Disconnect core signals from GUI client.
void closeEvent(QCloseEvent *event) override
QAction * verifyMessageAction
void createTrayIconMenu()
Create system tray menu (or setup the dock menu)
HelpMessageDialog * helpMessageDialog
void aboutClicked()
Show about dialog.
void toggleHidden()
Simply calls showNormalIfMinimized(true) for use in SLOT() macro.
QAction * encryptWalletAction
void updateNetworkState()
Update UI with latest network info from model.
void createActions()
Create the main UI actions.
void showDebugWindow()
Show debug window.
QAction * m_mask_values_action
void consoleShown(RPCConsole *console)
Signal raised when RPC console shown.
bool isPrivacyModeActivated() const
void showDebugWindowActivateConsole()
Show debug window and set focus to the console.
void dropEvent(QDropEvent *event) override
void showProgress(const QString &title, int nProgress)
Show progress dialog e.g.
QAction * usedReceivingAddressesAction
void subscribeToCoreSignals()
Connect core signals to GUI client.
void createToolBars()
Create the toolbars.
QAction * m_wallet_selector_action
UnitDisplayStatusBarControl * unitDisplayControl
void setWalletActionsEnabled(bool enabled)
Enable or disable all wallet-related actions.
const PlatformStyle * platformStyle
void dragEnterEvent(QDragEnterEvent *event) override
QAction * m_close_wallet_action
BitcoinGUI(interfaces::Node &node, const Config &, const PlatformStyle *platformStyle, const NetworkStyle *networkStyle, QWidget *parent=nullptr)
QLabel * labelWalletEncryptionIcon
GUIUtil::ClickableLabel * labelBlocksIcon
interfaces::Node & m_node
QAction * m_create_wallet_action
QAction * m_load_psbt_action
void detectShutdown()
called by a timer to check if ShutdownRequested() has been set
QAction * m_wallet_selector_label_action
WalletController * m_wallet_controller
QAction * backupWalletAction
QAction * showHelpMessageAction
QComboBox * m_wallet_selector
QLabel * m_wallet_selector_label
void showNormalIfMinimized()
Show window if hidden, unminimize when minimized, rise when obscured or show if hidden and fToggleHid...
ClientModel * clientModel
void updateHeadersSyncProgressLabel()
void setTrayIconVisible(bool)
When hideTrayIcon setting is changed in OptionsModel hide or show the icon accordingly.
void createMenuBar()
Create the menu bar and sub-menus.
QSystemTrayIcon * trayIcon
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.
void showHelpMessageClicked()
Show help message dialog.
QAction * sendCoinsAction
QLabel * labelWalletHDStatusIcon
void setNumConnections(int count)
Set number of connections shown in the UI.
QAction * signMessageAction
Notificator * notificator
std::unique_ptr< interfaces::Handler > m_handler_question
void setNetworkActive(bool networkActive)
Set network state shown in the UI.
static QString formatWithUnit(int unit, const Amount amount, bool plussign=false, SeparatorStyle separators=SeparatorStyle::STANDARD)
Format as string (with unit)
static QString longName(int unit)
Long name.
static QList< Unit > availableUnits()
Get list of units, for drop-down box.
Unit
Currency units Please add only sensible ones.
const Consensus::Params & GetConsensus() const
const std::string & CashAddrPrefix() const
Signals for UI communication.
@ BTN_MASK
Mask of all available buttons in CClientUIInterface::MessageBoxFlags This needs to be updated,...
@ MSG_INFORMATION
Predefined combinations for certain default usage cases.
@ MODAL
Force blocking, modal message box dialog (not just OS notification)
Model for Bitcoin network client.
void showProgress(const QString &title, int nProgress)
int getHeaderTipHeight() const
int getNumConnections(NumConnections flags=CONNECTIONS_ALL) const
Return number of connections, default is in- and outbound (total)
void message(const QString &title, const QString &message, unsigned int style)
Fired when a message should be reported to the user.
void numConnectionsChanged(int count)
BlockSource getBlockSource() const
Returns the block source of the current importing/syncing state.
int64_t getHeaderTipTime() const
void numBlocksChanged(int count, const QDateTime &blockDate, double nVerificationProgress, SyncType header, SynchronizationState sync_state)
OptionsModel * getOptionsModel()
bool getProxyInfo(std::string &ip_port) const
void networkActiveChanged(bool networkActive)
virtual const CChainParams & GetChainParams() const =0
void created(WalletModel *wallet_model)
void clicked(const QPoint &point)
Emitted when the label is clicked.
void clicked(const QPoint &point)
Emitted when the progressbar is clicked.
"Help message" dialog box
macOS-specific Dock icon handler.
static MacDockIconHandler * instance()
Modal overlay to display information about the chain-sync state.
void showHide(bool hide=false, bool userRequested=false)
void tipUpdate(int count, const QDateTime &blockDate, double nVerificationProgress)
void triggered(bool hidden)
bool isLayerVisible() const
void setKnownBestHeight(int count, const QDateTime &blockDate, bool presync)
const QIcon & getTrayAndWindowIcon() const
const QString & getTitleAddText() const
Cross-platform desktop notification client.
@ Information
Informational message.
@ Critical
An error occurred.
@ Warning
Notify user of potential problem.
void notify(Class cls, const QString &title, const QString &text, const QIcon &icon=QIcon(), int millisTimeout=10000)
Show notification message.
void opened(WalletModel *wallet_model)
Interface from Qt to configuration data structure for Bitcoin client.
int getDisplayUnit() const
void setDisplayUnit(const QVariant &value)
Updates current unit in memory, settings and emits displayUnitChanged(newUnit) signal.
void displayUnitChanged(int unit)
bool getMinimizeToTray() const
bool getMinimizeOnClose() const
bool getHideTrayIcon() const
void hideTrayIconChanged(bool)
Local Bitcoin RPC console.
std::vector< TabTypes > tabs() const
QString tabTitle(TabTypes tab_type) const
QKeySequence tabShortcut(TabTypes tab_type) const
void setClientModel(ClientModel *model=nullptr, int bestblock_height=0, int64_t bestblock_date=0, double verification_progress=0.0)
void setTabFocus(enum TabTypes tabType)
set which tab has the focus (is visible)
void mousePressEvent(QMouseEvent *event) override
So that it responds to left-button clicks.
void updateDisplayUnit(int newUnits)
When Display Units are changed on OptionsModel it will refresh the display text of the control on the...
void createContextMenu()
Creates context menu, its actions, and wires up all the relevant signals for mouse events.
OptionsModel * optionsModel
UnitDisplayStatusBarControl(const PlatformStyle *platformStyle)
void onMenuSelection(QAction *action)
Tells underlying optionsModel to update its current display unit.
void setOptionsModel(OptionsModel *optionsModel)
Lets the control know about the Options Model (and its signals)
void onDisplayUnitsClicked(const QPoint &point)
Shows context menu with Display Unit options by the mouse coordinates.
Controller between interfaces::Node, WalletModel instances and the GUI.
void walletAdded(WalletModel *wallet_model)
void closeAllWallets(QWidget *parent=nullptr)
std::map< std::string, bool > listWalletDir() const
Returns all wallet names in the wallet dir mapped to whether the wallet is loaded.
std::vector< WalletModel * > getOpenWallets() const
Returns wallet models currently open.
void walletRemoved(WalletModel *wallet_model)
void closeWallet(WalletModel *wallet_model, QWidget *parent=nullptr)
A container for embedding all wallet-related controls into BitcoinGUI.
bool addWallet(WalletModel *walletModel)
void changePassphrase()
Change encrypted wallet passphrase.
void requestedSyncWarningInfo()
Notify that the user has requested more information about the out-of-sync warning.
WalletModel * currentWalletModel() const
void gotoHistoryPage()
Switch to history (transactions) page.
void gotoSignMessageTab(QString addr="")
Show Sign/Verify Message dialog and switch to sign message tab.
WalletView * currentWalletView() const
void gotoOverviewPage()
Switch to overview (home) page.
void gotoSendCoinsPage(QString addr="")
Switch to send coins page.
void removeWallet(WalletModel *wallet_model)
void setClientModel(ClientModel *clientModel)
void backupWallet()
Backup the wallet.
void usedSendingAddresses()
Show used sending addresses.
void encryptWallet()
Encrypt the wallet.
void gotoLoadPSBT()
Load Partially Signed Bitcoin Transaction.
void usedReceivingAddresses()
Show used receiving addresses.
void setCurrentWallet(WalletModel *wallet_model)
bool handlePaymentRequest(const SendCoinsRecipient &recipient)
void showOutOfSyncWarning(bool fShow)
void gotoReceiveCoinsPage()
Switch to receive coins page.
void gotoVerifyMessageTab(QString addr="")
Show Sign/Verify Message dialog and switch to verify message tab.
Interface to Bitcoin wallet from Qt view code.
EncryptionStatus getEncryptionStatus() const
interfaces::Wallet & wallet() const
QString getDisplayName() const
static bool isWalletEnabled()
QString getWalletName() const
WalletModel * getWalletModel()
Top-level interface for a bitcoin node (bitcoind process).
virtual void setNetworkActive(bool active)=0
Set network active.
virtual std::unique_ptr< Handler > handleMessageBox(MessageBoxFn fn)=0
virtual bool getNetworkActive()=0
Get network active.
virtual std::unique_ptr< Handler > handleQuestion(QuestionFn fn)=0
virtual WalletClient & walletClient()=0
Get wallet client.
virtual bool shutdownRequested()=0
Return whether shutdown was requested.
virtual std::vector< std::unique_ptr< Wallet > > getWallets()=0
Return interfaces for accessing wallets (if any).
virtual bool hdEnabled()=0
virtual bool privateKeysDisabled()=0
static const int STATUSBAR_ICONSIZE
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...
bool isObscured(QWidget *w)
Qt::ConnectionType blockingGUIThreadConnection()
Get connection type to call object slot in GUI thread with invokeMethod.
void ShowModalDialogAsynchronously(QDialog *dialog)
Shows a QDialog instance asynchronously, and deletes it on close.
void handleCloseWindowShortcut(QWidget *w)
void PolishProgressDialog(QProgressDialog *dialog)
ClickableProgressBar ProgressBar
void bringToFront(QWidget *w)
QString formatNiceTimeOffset(qint64 secs)
int TextWidth(const QFontMetrics &fm, const QString &text)
Returns the distance in pixels appropriate for drawing a subsequent character after text.
static constexpr Amount zero() noexcept
int64_t nPowTargetSpacing
Block and header tip information.
double verification_progress
int64_t GetTime()
DEPRECATED Use either ClockType::now() or Now<TimePointType>() if a cast is needed.
SynchronizationState
Current sync state passed to tip changed callbacks.