8#include <chainparams.h>
37#include <validation.h>
43#include <QApplication>
46#include <QDragEnterEvent>
52#include <QProgressDialog>
56#include <QStackedWidget>
59#include <QSystemTrayIcon>
69#elif defined(Q_OS_WIN)
79 : QMainWindow(parent),
m_node(
node), trayIconMenu{new QMenu()},
80 config(configIn), platformStyle(_platformStyle),
81 m_network_style(networkStyle) {
83 if (!restoreGeometry(settings.value(
"MainWindowGeometry").toByteArray())) {
85 move(QGuiApplication::primaryScreen()->availableGeometry().center() -
86 frameGeometry().center());
117 setAcceptDrops(
true);
130 if (QSystemTrayIcon::isSystemTrayAvailable()) {
140 statusBar()->setSizeGripEnabled(
false);
143 QFrame *frameBlocks =
new QFrame();
144 frameBlocks->setContentsMargins(0, 0, 0, 0);
145 frameBlocks->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Preferred);
146 QHBoxLayout *frameBlocksLayout =
new QHBoxLayout(frameBlocks);
147 frameBlocksLayout->setContentsMargins(3, 0, 3, 0);
148 frameBlocksLayout->setSpacing(3);
156 frameBlocksLayout->addStretch();
158 frameBlocksLayout->addStretch();
163 frameBlocksLayout->addStretch();
165 frameBlocksLayout->addStretch();
167 frameBlocksLayout->addStretch();
180 QString curStyle = QApplication::style()->metaObject()->className();
181 if (curStyle ==
"QWindowsStyle" || curStyle ==
"QWindowsXPStyle") {
183 "QProgressBar { background-color: #e8e8e8; border: 1px solid grey; "
184 "border-radius: 7px; padding: 1px; text-align: center; } "
185 "QProgressBar::chunk { background: QLinearGradient(x1: 0, y1: 0, "
186 "x2: 1, y2: 0, stop: 0 #FF8000, stop: 1 orange); border-radius: "
187 "7px; margin: 0px; }");
192 statusBar()->addPermanentWidget(frameBlocks);
196 this->installEventFilter(
this);
232 settings.setValue(
"MainWindowGeometry", saveGeometry());
238 delete m_app_nap_inhibitor;
247 QActionGroup *tabGroup =
new QActionGroup(
this);
249 &QActionGroup::setEnabled);
253 tr(
"&Overview"),
this);
254 overviewAction->setStatusTip(tr(
"Show general overview of wallet"));
274 tr(
"&Receive"),
this);
276 tr(
"Request payments (generates QR codes and %1: URIs)")
277 .arg(QString::fromStdString(
290 tr(
"&Transactions"),
this);
291 historyAction->setStatusTip(tr(
"Browse transaction history"));
294 historyAction->setShortcut(QKeySequence(Qt::ALT + Qt::Key_4));
304 &BitcoinGUI::gotoOverviewPage);
308 [
this] { gotoSendCoinsPage(); });
312 [
this] { gotoSendCoinsPage(); });
316 &BitcoinGUI::gotoReceiveCoinsPage);
320 &BitcoinGUI::gotoReceiveCoinsPage);
324 &BitcoinGUI::gotoHistoryPage);
328 quitAction->setStatusTip(tr(
"Quit application"));
329 quitAction->setShortcut(QKeySequence(Qt::CTRL + Qt::Key_Q));
331 aboutAction =
new QAction(tr(
"&About %1").arg(PACKAGE_NAME),
this);
333 tr(
"Show information about %1").arg(PACKAGE_NAME));
337 aboutQtAction->setStatusTip(tr(
"Show information about Qt"));
341 tr(
"Modify configuration options for %1").arg(PACKAGE_NAME));
349 tr(
"Encrypt the private keys that belong to your wallet"));
355 tr(
"Change the passphrase used for wallet encryption"));
358 tr(
"Sign messages with your Bitcoin addresses to prove you own them"));
361 tr(
"Verify messages to ensure they were signed with specified Bitcoin "
365 tr(
"Load Partially Signed Bitcoin Transaction"));
369 tr(
"Open node debugging and diagnostic console"));
376 tr(
"Show the list of used sending addresses and labels"));
378 new QAction(tr(
"&Receiving addresses"),
this);
380 tr(
"Show the list of used receiving addresses and labels"));
382 openAction =
new QAction(tr(
"Open &URI..."),
this);
384 tr(
"Open a %1: URI or payment request")
385 .arg(QString::fromStdString(
406 tr(
"Show the %1 help message to get a list with possible Bitcoin "
407 "command-line options")
412 QKeySequence(Qt::CTRL + Qt::SHIFT + Qt::Key_M));
414 tr(
"Mask the values in the Overview tab"));
417 connect(
quitAction, &QAction::triggered, qApp, QApplication::quit);
419 connect(
aboutQtAction, &QAction::triggered, qApp, QApplication::aboutQt);
443 [
this] { gotoSignMessageTab(); });
447 [
this] { gotoVerifyMessageTab(); });
449 [
this] { gotoLoadPSBT(); });
454 connect(
openAction, &QAction::triggered,
this,
455 &BitcoinGUI::openClicked);
458 for (
const std::pair<const std::string, bool> &i :
460 const std::string &path = i.first;
461 QString name = path.empty()
462 ? QString(
"[" + tr(
"default wallet") +
"]")
463 : QString::fromStdString(path);
467 name.replace(name.indexOf(QChar(
'&')), 1, QString(
"&&"));
468 QAction *action = m_open_wallet_menu->addAction(name);
472 action->setEnabled(false);
476 connect(action, &QAction::triggered, [
this, path] {
480 &BitcoinGUI::setCurrentWallet);
482 &QObject::deleteLater);
483 activity->open(path);
489 action->setEnabled(
false);
499 &BitcoinGUI::setCurrentWallet);
501 &QObject::deleteLater);
511 connect(
new QShortcut(QKeySequence(Qt::CTRL + Qt::SHIFT + Qt::Key_C),
this),
512 &QShortcut::activated,
this,
514 connect(
new QShortcut(QKeySequence(Qt::CTRL + Qt::SHIFT + Qt::Key_D),
this),
529 QMenu *file =
appMenuBar->addMenu(tr(
"&File"));
535 file->addSeparator();
541 file->addSeparator();
545 QMenu *settings =
appMenuBar->addMenu(tr(
"&Settings"));
549 settings->addSeparator();
551 settings->addSeparator();
555 QMenu *window_menu =
appMenuBar->addMenu(tr(
"&Window"));
557 QAction *minimize_action = window_menu->addAction(tr(
"Minimize"));
558 minimize_action->setShortcut(QKeySequence(Qt::CTRL + Qt::Key_M));
559 connect(minimize_action, &QAction::triggered,
560 [] { QApplication::activeWindow()->showMinimized(); });
561 connect(qApp, &QApplication::focusWindowChanged,
562 [minimize_action](QWindow *window) {
563 minimize_action->setEnabled(
565 (window->flags() & Qt::Dialog) != Qt::Dialog &&
566 window->windowState() != Qt::WindowMinimized);
570 QAction *zoom_action = window_menu->addAction(tr(
"Zoom"));
571 connect(zoom_action, &QAction::triggered, [] {
572 QWindow *window = qApp->focusWindow();
573 if (window->windowState() != Qt::WindowMaximized) {
574 window->showMaximized();
576 window->showNormal();
580 connect(qApp, &QApplication::focusWindowChanged,
581 [zoom_action](QWindow *window) {
582 zoom_action->setEnabled(window !=
nullptr);
588 window_menu->addSeparator();
589 QAction *main_window_action = window_menu->addAction(tr(
"Main Window"));
590 connect(main_window_action, &QAction::triggered,
593 window_menu->addSeparator();
598 window_menu->addSeparator();
600 QAction *tab_action =
603 connect(tab_action, &QAction::triggered, [
this, tab_type] {
611 help->addSeparator();
618 QToolBar *toolbar = addToolBar(tr(
"Tabs toolbar"));
620 toolbar->setContextMenuPolicy(Qt::PreventContextMenu);
621 toolbar->setMovable(
false);
622 toolbar->setToolButtonStyle(Qt::ToolButtonTextBesideIcon);
630 QWidget *spacer =
new QWidget();
631 spacer->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
632 toolbar->addWidget(spacer);
637 static_cast<void (QComboBox::*)(
int)
>(
638 &QComboBox::currentIndexChanged),
639 this, &BitcoinGUI::setCurrentWalletBySelectorIndex);
672 QDateTime::fromTime_t(tip_info->
header_time),
false);
682 [
this](
const QString &title,
const QString &
message,
683 unsigned int style) {
736 assert(wallet_controller);
745 &BitcoinGUI::addWallet);
747 &BitcoinGUI::removeWallet);
750 addWallet(wallet_model);
758void BitcoinGUI::addWallet(
WalletModel *walletModel) {
776void BitcoinGUI::removeWallet(
WalletModel *walletModel) {
798void BitcoinGUI::setCurrentWallet(
WalletModel *wallet_model) {
813void BitcoinGUI::setCurrentWalletBySelectorIndex(
int index) {
817 setCurrentWallet(wallet_model);
821void BitcoinGUI::removeAllWallets() {
850 assert(QSystemTrayIcon::isSystemTrayAvailable());
853 if (QSystemTrayIcon::isSystemTrayAvailable()) {
856 QString toolTip = tr(
"%1 client").arg(PACKAGE_NAME) +
" " +
871 connect(
trayIcon, &QSystemTrayIcon::activated,
this,
878 &BitcoinGUI::macosDockIconActivated);
907 if (reason == QSystemTrayIcon::Trigger) {
913void BitcoinGUI::macosDockIconActivated() {
947void BitcoinGUI::openClicked() {
954void BitcoinGUI::gotoOverviewPage() {
961void BitcoinGUI::gotoHistoryPage() {
968void BitcoinGUI::gotoReceiveCoinsPage() {
975void BitcoinGUI::gotoSendCoinsPage(QString addr) {
982void BitcoinGUI::gotoSignMessageTab(QString addr) {
988void BitcoinGUI::gotoVerifyMessageTab(QString addr) {
993void BitcoinGUI::gotoLoadPSBT() {
1005 icon =
":/icons/connect_0";
1010 icon =
":/icons/connect_1";
1015 icon =
":/icons/connect_2";
1020 icon =
":/icons/connect_3";
1023 icon =
":/icons/connect_4";
1030 tooltip = tr(
"%n active connection(s) to Bitcoin network",
"",
count) +
1031 QString(
".<br>") + tr(
"Click to disable network activity.");
1033 tooltip = tr(
"Network activity disabled.") + QString(
"<br>") +
1034 tr(
"Click to enable network activity again.");
1035 icon =
":/icons/network_disabled";
1039 tooltip = QString(
"<nobr>") + tooltip + QString(
"</nobr>");
1057 int estHeadersLeft =
1058 (
GetTime() - headersTipTime) /
1062 tr(
"Syncing Headers (%1%)...")
1063 .arg(QString::number(100.0 /
1064 (headersTipHeight + estHeadersLeft) *
1071 const QDateTime &blockDate) {
1072 int estHeadersLeft = blockDate.secsTo(QDateTime::currentDateTime()) /
1076 tr(
"Pre-syncing Headers (%1%)…")
1077 .arg(QString::number(100.0 / (height + estHeadersLeft) * height,
1094 double nVerificationProgress,
SyncType synctype,
1099 m_app_nap_inhibitor->enableAppNap();
1101 m_app_nap_inhibitor->disableAppNap();
1119 statusBar()->clearMessage();
1123 switch (blockSource) {
1152 QDateTime currentDate = QDateTime::currentDateTime();
1153 qint64 secs = blockDate.secsTo(currentDate);
1155 tooltip = tr(
"Processed %n block(s) of transaction history.",
"",
count);
1159 tooltip = tr(
"Up to date") + QString(
".<br>") + tooltip;
1177 progressBar->setFormat(tr(
"%1 behind").arg(timeBehindText));
1179 progressBar->setValue(nVerificationProgress * 1000000000.0 + 0.5);
1182 tooltip = tr(
"Catching up...") + QString(
"<br>") + tooltip;
1186 ->SingleColorIcon(QString(
":/animation/spinner-%1")
1200 tooltip += QString(
"<br>");
1202 tr(
"Last received block was generated %1 ago.").arg(timeBehindText);
1203 tooltip += QString(
"<br>");
1204 tooltip += tr(
"Transactions after this will not yet be visible.");
1208 tooltip = QString(
"<nobr>") + tooltip + QString(
"</nobr>");
1216 unsigned int style,
bool *ret,
1217 const QString &detailed_message) {
1220 QString strTitle{PACKAGE_NAME};
1222 int nMBoxIcon = QMessageBox::Information;
1226 if (!title.isEmpty()) {
1231 msgType = tr(
"Error");
1235 msgType = tr(
"Warning");
1239 msgType = tr(
"Information");
1247 if (!msgType.isEmpty()) {
1248 strTitle +=
" - " + msgType;
1252 nMBoxIcon = QMessageBox::Critical;
1255 nMBoxIcon = QMessageBox::Warning;
1261 auto buttons =
static_cast<QMessageBox::StandardButton
>(
1264 buttons = QMessageBox::Ok;
1268 QMessageBox mBox(
static_cast<QMessageBox::Icon
>(nMBoxIcon), strTitle,
1270 mBox.setTextFormat(Qt::PlainText);
1271 mBox.setDetailedText(detailed_message);
1272 int r = mBox.exec();
1273 if (ret !=
nullptr) {
1274 *ret = r == QMessageBox::Ok;
1283 QMainWindow::changeEvent(e);
1285 if (e->type() == QEvent::WindowStateChange) {
1288 QWindowStateChangeEvent *wsevt =
1289 static_cast<QWindowStateChangeEvent *
>(e);
1290 if (!(wsevt->oldState() & Qt::WindowMinimized) && isMinimized()) {
1291 QTimer::singleShot(0,
this, &BitcoinGUI::hide);
1293 }
else if ((wsevt->oldState() & Qt::WindowMinimized) &&
1295 QTimer::singleShot(0,
this, &BitcoinGUI::show);
1311 QApplication::quit();
1313 QMainWindow::showMinimized();
1318 QMainWindow::closeEvent(event);
1330void BitcoinGUI::incomingTransaction(
const QString &date,
int unit,
1331 const Amount amount,
const QString &type,
1332 const QString &address,
1333 const QString &label,
1334 const QString &walletName) {
1336 QString msg = tr(
"Date: %1\n").arg(date) +
1340 !walletName.isEmpty()) {
1341 msg += tr(
"Wallet: %1\n").arg(walletName);
1343 msg += tr(
"Type: %1\n").arg(type);
1344 if (!label.isEmpty()) {
1345 msg += tr(
"Label: %1\n").arg(label);
1346 }
else if (!address.isEmpty()) {
1347 msg += tr(
"Address: %1\n").arg(address);
1350 : tr(
"Incoming transaction"),
1357 if (event->mimeData()->hasUrls()) {
1358 event->acceptProposedAction();
1363 if (event->mimeData()->hasUrls()) {
1364 for (
const QUrl &uri : event->mimeData()->urls()) {
1368 event->acceptProposedAction();
1373 if (event->type() == QEvent::StatusTip) {
1380 return QMainWindow::eventFilter(
object, event);
1388 gotoSendCoinsPage();
1394void BitcoinGUI::setHDStatus(
bool privkeyDisabled,
int hdEnabled) {
1397 ->SingleColorIcon(privkeyDisabled ?
":/icons/eye"
1398 : hdEnabled ?
":/icons/hd_enabled"
1399 :
":/icons/hd_disabled")
1402 privkeyDisabled ? tr(
"Private key <b>disabled</b>")
1403 : hdEnabled ? tr(
"HD key generation is <b>enabled</b>")
1404 : tr(
"HD key generation is <b>disabled</b>"));
1410void BitcoinGUI::setEncryptionStatus(
int status) {
1424 tr(
"Wallet is <b>encrypted</b> and currently <b>unlocked</b>"));
1435 tr(
"Wallet is <b>encrypted</b> and currently <b>locked</b>"));
1443void BitcoinGUI::updateWalletStatus() {
1459 std::string ip_port;
1462 if (proxy_enabled) {
1464 QString ip_port_q = QString::fromStdString(ip_port);
1469 tr(
"Proxy is <b>enabled</b>: %1").arg(ip_port_q));
1479 QString window_title = PACKAGE_NAME;
1483 if (wallet_model && !wallet_model->
getWalletName().isEmpty()) {
1491 setWindowTitle(window_title);
1521 if (nProgress == 0) {
1528 }
else if (nProgress == 100) {
1541 trayIcon->setVisible(!fHideTrayIcon);
1553 const std::string &caption,
1554 unsigned int style) {
1561 QString detailed_message;
1563 detailed_message = BitcoinGUI::tr(
"Original message:") +
"\n" +
1564 QString::fromStdString(message.
original);
1569 bool invoked = QMetaObject::invokeMethod(
1572 Q_ARG(QString, QString::fromStdString(caption)),
1573 Q_ARG(QString, QString::fromStdString(message.
translated)),
1574 Q_ARG(
unsigned int, style), Q_ARG(
bool *, &ret),
1575 Q_ARG(QString, detailed_message));
1584 std::placeholders::_2, std::placeholders::_3));
1587 std::placeholders::_3, std::placeholders::_4));
1603 : optionsModel(nullptr), menu(nullptr) {
1605 setToolTip(tr(
"Unit to show amounts in. Click to select another unit."));
1608 const QFontMetrics fm(font());
1610 max_width = qMax(max_width,
1613 setMinimumSize(max_width, 0);
1614 setAlignment(Qt::AlignRight | Qt::AlignVCenter);
1615 setStyleSheet(QString(
"QLabel { color : %1 }")
1627 menu =
new QMenu(
this);
1629 QAction *menuAction =
1631 menuAction->setData(QVariant(u));
1632 menu->addAction(menuAction);
1634 connect(
menu, &QMenu::triggered,
this,
1640 if (_optionsModel) {
1662 QPoint globalPos = mapToGlobal(point);
1663 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.
QAction * receiveCoinsMenuAction
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
QAction * toggleHideAction
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
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 * sendCoinsMenuAction
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.
void trayIconActivated(QSystemTrayIcon::ActivationReason reason)
Handle tray icon clicked.
QAction * signMessageAction
Notificator * notificator
BitcoinGUI(interfaces::Node &node, const Config *, const PlatformStyle *platformStyle, const NetworkStyle *networkStyle, QWidget *parent=nullptr)
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)
void setModel(OptionsModel *model)
void setCurrentTab(OptionsDialog::Tab tab)
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 addWallet(WalletModel *const walletModel)
void removeWallet(WalletModel *const walletModel)
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 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.