41#include <validation.h> 
   44#include <QApplication> 
   48#include <QDragEnterEvent> 
   54#include <QProgressDialog> 
   58#include <QStackedWidget> 
   61#include <QSystemTrayIcon> 
   72#elif defined(Q_OS_WIN) 
   82    trayIconMenu{new QMenu()},
 
   83    platformStyle(_platformStyle),
 
   84    m_network_style(networkStyle)
 
   87    if (!restoreGeometry(settings.value(
"MainWindowGeometry").toByteArray())) {
 
   89        move(QGuiApplication::primaryScreen()->availableGeometry().center() - frameGeometry().center());
 
   92    setContextMenuPolicy(Qt::PreventContextMenu);
 
  130    setAcceptDrops(
true);
 
  143    if (QSystemTrayIcon::isSystemTrayAvailable()) {
 
  152    statusBar()->setSizeGripEnabled(
false);
 
  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);
 
  169        frameBlocksLayout->addStretch();
 
  171        frameBlocksLayout->addStretch();
 
  178    frameBlocksLayout->addStretch();
 
  180    frameBlocksLayout->addStretch();
 
  182    frameBlocksLayout->addStretch();
 
  194    QString curStyle = QApplication::style()->metaObject()->className();
 
  195    if(curStyle == 
"QWindowsStyle" || curStyle == 
"QWindowsXPStyle")
 
  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; }");
 
  202    statusBar()->addPermanentWidget(frameBlocks);
 
  205    this->installEventFilter(
this);
 
  233    settings.setValue(
"MainWindowGeometry", saveGeometry());
 
  237    delete m_app_nap_inhibitor;
 
  247    QActionGroup *tabGroup = 
new QActionGroup(
this);
 
  251    overviewAction->setStatusTip(tr(
"Show general overview of wallet"));
 
  269    receiveCoinsAction->setStatusTip(tr(
"Request payments (generates QR codes and bitcoin: URIs)"));
 
  280    historyAction->setStatusTip(tr(
"Browse transaction history"));
 
  283    historyAction->setShortcut(QKeySequence(Qt::ALT + Qt::Key_4));
 
  290    connect(
overviewAction, &QAction::triggered, 
this, &BitcoinGUI::gotoOverviewPage);
 
  292    connect(
sendCoinsAction, &QAction::triggered, [
this]{ gotoSendCoinsPage(); });
 
  296    connect(
receiveCoinsAction, &QAction::triggered, 
this, &BitcoinGUI::gotoReceiveCoinsPage);
 
  300    connect(
historyAction, &QAction::triggered, 
this, &BitcoinGUI::gotoHistoryPage);
 
  304    quitAction->setStatusTip(tr(
"Quit application"));
 
  305    quitAction->setShortcut(QKeySequence(Qt::CTRL + Qt::Key_Q));
 
  312    aboutQtAction->setStatusTip(tr(
"Show information about Qt"));
 
  322    encryptWalletAction->setStatusTip(tr(
"Encrypt the private keys that belong to your wallet"));
 
  329    signMessageAction->setStatusTip(tr(
"Sign messages with your Bitcoin addresses to prove you own them"));
 
  331    verifyMessageAction->setStatusTip(tr(
"Verify messages to ensure they were signed with specified Bitcoin addresses"));
 
  348    openAction = 
new QAction(tr(
"Open &URI…"), 
this);
 
  349    openAction->setStatusTip(tr(
"Open a bitcoin: URI"));
 
  377    connect(
aboutQtAction, &QAction::triggered, qApp, QApplication::aboutQt);
 
  392        connect(
signMessageAction, &QAction::triggered, [
this]{ gotoSignMessageTab(); });
 
  399        connect(
openAction, &QAction::triggered, 
this, &BitcoinGUI::openClicked);
 
  403                const std::string& path = i.first;
 
  404                QString name = path.empty() ? QString(
"["+tr(
"default wallet")+
"]") : QString::fromStdString(path);
 
  408                name.replace(name.indexOf(QChar(
'&')), 1, QString(
"&&"));
 
  409                QAction* action = m_open_wallet_menu->addAction(name);
 
  413                    action->setEnabled(false);
 
  417                connect(action, &QAction::triggered, [
this, path] {
 
  420                    activity->open(path);
 
  425                action->setEnabled(
false);
 
  444    connect(
new QShortcut(QKeySequence(Qt::CTRL + Qt::SHIFT + Qt::Key_D), 
this), &QShortcut::activated, 
this, &
BitcoinGUI::showDebugWindow);
 
  458    QMenu *file = 
appMenuBar->addMenu(tr(
"&File"));
 
  465        file->addSeparator();
 
  472        file->addSeparator();
 
  476    QMenu *settings = 
appMenuBar->addMenu(tr(
"&Settings"));
 
  481        settings->addSeparator();
 
  483        settings->addSeparator();
 
  487    QMenu* window_menu = 
appMenuBar->addMenu(tr(
"&Window"));
 
  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();
 
  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);
 
  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();
 
  505            window->showNormal();
 
  509    connect(qApp, &QApplication::focusWindowChanged, [zoom_action] (QWindow* window) {
 
  510        zoom_action->setEnabled(window != 
nullptr);
 
  516        window_menu->addSeparator();
 
  517        QAction* main_window_action = window_menu->addAction(tr(
"Main Window"));
 
  518        connect(main_window_action, &QAction::triggered, [
this] {
 
  522        window_menu->addSeparator();
 
  527    window_menu->addSeparator();
 
  531        connect(tab_action, &QAction::triggered, [
this, tab_type] {
 
  539    help->addSeparator();
 
  548        QToolBar *toolbar = addToolBar(tr(
"Tabs toolbar"));
 
  550        toolbar->setMovable(
false);
 
  551        toolbar->setToolButtonStyle(Qt::ToolButtonTextBesideIcon);
 
  559        QWidget *spacer = 
new QWidget();
 
  560        spacer->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
 
  561        toolbar->addWidget(spacer);
 
  565        connect(
m_wallet_selector, qOverload<int>(&QComboBox::currentIndexChanged), 
this, &BitcoinGUI::setCurrentWalletBySelectorIndex);
 
  653    assert(wallet_controller);
 
  673void BitcoinGUI::addWallet(
WalletModel* walletModel)
 
  702void BitcoinGUI::removeWallet(
WalletModel* walletModel)
 
  723void BitcoinGUI::setCurrentWallet(
WalletModel* wallet_model)
 
  736void BitcoinGUI::setCurrentWalletBySelectorIndex(
int index)
 
  739    if (wallet_model) setCurrentWallet(wallet_model);
 
  742void BitcoinGUI::removeAllWallets()
 
  773    assert(QSystemTrayIcon::isSystemTrayAvailable());
 
  776    if (QSystemTrayIcon::isSystemTrayAvailable()) {
 
  825    if(reason == QSystemTrayIcon::Trigger)
 
  832void BitcoinGUI::macosDockIconActivated()
 
  871void BitcoinGUI::openClicked()
 
  880void BitcoinGUI::gotoOverviewPage()
 
  886void BitcoinGUI::gotoHistoryPage()
 
  892void BitcoinGUI::gotoReceiveCoinsPage()
 
  898void BitcoinGUI::gotoSendCoinsPage(QString addr)
 
  904void BitcoinGUI::gotoSignMessageTab(QString addr)
 
  909void BitcoinGUI::gotoVerifyMessageTab(QString addr)
 
  913void BitcoinGUI::gotoLoadPSBT(
bool from_clipboard)
 
  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;
 
  936        tooltip = tr(
"%n active connection(s) to Bitcoin network.", 
"", 
count);
 
  939        tooltip = tr(
"Network activity disabled.");
 
  940        icon = 
":/icons/network_disabled";
 
  944    tooltip = QLatin1String(
"<nobr>") + tooltip + QLatin1String(
"<br>") +
 
  946              tr(
"Click for more actions.") + QLatin1String(
"</nobr>");
 
  963        tr(
"Show Peers tab"),
 
  971            tr(
"Disable network activity") :
 
  973            tr(
"Enable network activity"),
 
  983        progressBarLabel->setText(tr(
"Syncing Headers (%1%)…").arg(QString::number(100.0 / (headersTipHeight+estHeadersLeft)*headersTipHeight, 
'f', 1)));
 
  993    dlg->setCurrentTab(tab);
 
 1003        m_app_nap_inhibitor->enableAppNap();
 
 1005        m_app_nap_inhibitor->disableAppNap();
 
 1020    statusBar()->clearMessage();
 
 1024    switch (blockSource) {
 
 1053    QDateTime currentDate = QDateTime::currentDateTime();
 
 1054    qint64 secs = blockDate.secsTo(currentDate);
 
 1056    tooltip = tr(
"Processed %n block(s) of transaction history.", 
"", 
count);
 
 1060        tooltip = tr(
"Up to date") + QString(
".<br>") + tooltip;
 
 1079        progressBar->setFormat(tr(
"%1 behind").arg(timeBehindText));
 
 1081        progressBar->setValue(nVerificationProgress * 1000000000.0 + 0.5);
 
 1084        tooltip = tr(
"Catching up…") + QString(
"<br>") + tooltip;
 
 1088                QString(
":/animation/spinner-%1").arg(
spinnerFrame, 3, 10, QChar(
'0')),
 
 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.");
 
 1109    tooltip = QString(
"<nobr>") + tooltip + QString(
"</nobr>");
 
 1116void BitcoinGUI::message(
const QString& title, QString message, 
unsigned int style, 
bool* ret, 
const QString& detailed_message)
 
 1121    int nMBoxIcon = QMessageBox::Information;
 
 1125    if (!title.isEmpty()) {
 
 1130            msgType = tr(
"Error");
 
 1134            msgType = tr(
"Warning");
 
 1138            msgType = tr(
"Information");
 
 1146    if (!msgType.isEmpty()) {
 
 1147        strTitle += 
" - " + msgType;
 
 1151        nMBoxIcon = QMessageBox::Critical;
 
 1154        nMBoxIcon = QMessageBox::Warning;
 
 1160        QMessageBox::StandardButton buttons;
 
 1162            buttons = QMessageBox::Ok;
 
 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();
 
 1170            *ret = r == QMessageBox::Ok;
 
 1178    if (e->type() == QEvent::PaletteChange) {
 
 1185    QMainWindow::changeEvent(e);
 
 1188    if(e->type() == QEvent::WindowStateChange)
 
 1192            QWindowStateChangeEvent *wsevt = 
static_cast<QWindowStateChangeEvent*
>(e);
 
 1193            if(!(wsevt->oldState() & Qt::WindowMinimized) && isMinimized())
 
 1195                QTimer::singleShot(0, 
this, &BitcoinGUI::hide);
 
 1198            else if((wsevt->oldState() & Qt::WindowMinimized) && !isMinimized())
 
 1200                QTimer::singleShot(0, 
this, &BitcoinGUI::show);
 
 1222            QMainWindow::showMinimized();
 
 1227    QMainWindow::closeEvent(event);
 
 1240void BitcoinGUI::incomingTransaction(
const QString& date, 
int unit, 
const CAmount& amount, 
const QString& type, 
const QString& address, 
const QString& label, 
const QString& walletName)
 
 1243    QString msg = tr(
"Date: %1\n").arg(date) +
 
 1246        msg += tr(
"Wallet: %1\n").arg(walletName);
 
 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"),
 
 1261    if(event->mimeData()->hasUrls())
 
 1262        event->acceptProposedAction();
 
 1267    if(event->mimeData()->hasUrls())
 
 1269        for (
const QUrl &uri : event->mimeData()->urls())
 
 1274    event->acceptProposedAction();
 
 1280    if (event->type() == QEvent::StatusTip)
 
 1286    return QMainWindow::eventFilter(
object, event);
 
 1296        gotoSendCoinsPage();
 
 1302void BitcoinGUI::setHDStatus(
bool privkeyDisabled, 
int hdEnabled)
 
 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>"));
 
 1309void BitcoinGUI::setEncryptionStatus(
int status)
 
 1338void BitcoinGUI::updateWalletStatus()
 
 1354    std::string ip_port;
 
 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));
 
 1376        if (wallet_model && !wallet_model->
getWalletName().isEmpty()) {
 
 1384    setWindowTitle(window_title);
 
 1416    if (nProgress == 0) {
 
 1422    } 
else if (nProgress == 100) {
 
 1447    QString detailed_message; 
 
 1449        detailed_message = BitcoinGUI::tr(
"Original message:") + 
"\n" + QString::fromStdString(message.
original);
 
 1453    bool invoked = QMetaObject::invokeMethod(gui, 
"message",
 
 1455                               Q_ARG(QString, QString::fromStdString(caption)),
 
 1456                               Q_ARG(QString, QString::fromStdString(message.
translated)),
 
 1457                               Q_ARG(
unsigned int, style),
 
 1459                               Q_ARG(QString, detailed_message));
 
 1485    : optionsModel(nullptr),
 
 1487      m_platform_style{platformStyle}
 
 1490    setToolTip(tr(
"Unit to show amounts in. Click to select another unit."));
 
 1493    const QFontMetrics fm(font());
 
 1498    setMinimumSize(max_width, 0);
 
 1499    setAlignment(Qt::AlignRight | Qt::AlignVCenter);
 
 1511    if (e->type() == QEvent::PaletteChange) {
 
 1513        if (style != styleSheet()) {
 
 1514            setStyleSheet(style);
 
 1518    QLabel::changeEvent(e);
 
 1524    menu = 
new QMenu(
this);
 
 1555    QPoint globalPos = mapToGlobal(point);
 
 1556    menu->exec(globalPos);
 
int64_t CAmount
Amount in satoshis (Can be negative)
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.
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 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
GUIUtil::ThemedLabel * labelWalletEncryptionIcon
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.
QAction * m_load_psbt_clipboard_action
void setNetworkActive(bool network_active)
Set network state shown in the UI.
void setPrivacy(bool privacy)
QProgressDialog * progressDialog
BitcoinGUI(interfaces::Node &node, const PlatformStyle *platformStyle, const NetworkStyle *networkStyle, QWidget *parent=nullptr)
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
GUIUtil::ClickableLabel * labelBlocksIcon
interfaces::Node & m_node
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.
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
QMenu * m_network_context_menu
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 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
void setNumConnections(int count)
Set number of connections shown in the UI.
void trayIconActivated(QSystemTrayIcon::ActivationReason reason)
Handle tray icon clicked.
QAction * signMessageAction
GUIUtil::ThemedLabel * labelWalletHDStatusIcon
Notificator * notificator
std::unique_ptr< interfaces::Handler > m_handler_question
static QString longName(int unit)
Long name.
static QString formatWithUnit(int unit, const CAmount &amount, bool plussign=false, SeparatorStyle separators=SeparatorStyle::STANDARD)
Format as string (with unit)
static QList< Unit > availableUnits()
Get list of units, for drop-down box.
const Consensus::Params & GetConsensus() 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
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)
void numBlocksChanged(int count, const QDateTime &blockDate, double nVerificationProgress, bool header, SynchronizationState sync_state)
int64_t getHeaderTipTime() const
int getNumConnections(unsigned int flags=CONNECTIONS_ALL) const
Return number of connections, default is in- and outbound (total)
enum BlockSource getBlockSource() const
Returns enum BlockSource of the current importing/syncing state.
OptionsModel * getOptionsModel()
bool getProxyInfo(std::string &ip_port) const
void networkActiveChanged(bool networkActive)
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.
void setThemedPixmap(const QString &image_filename, int width, int height)
"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 setKnownBestHeight(int count, const QDateTime &blockDate)
void tipUpdate(int count, const QDateTime &blockDate, double nVerificationProgress)
void triggered(bool hidden)
bool isLayerVisible() const
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)
void showTrayIconChanged(bool)
bool getMinimizeToTray() const
bool getShowTrayIcon() const
bool getMinimizeOnClose() const
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 changeEvent(QEvent *e) override
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.
const PlatformStyle * m_platform_style
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.
void walletRemoved(WalletModel *wallet_model)
void closeWallet(WalletModel *wallet_model, QWidget *parent=nullptr)
A container for embedding all wallet-related controls into BitcoinGUI.
bool addView(WalletView *walletView)
void changePassphrase()
Change encrypted wallet passphrase.
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 createWalletButtonClicked()
void encryptWallet()
Encrypt the wallet.
void usedReceivingAddresses()
Show used receiving addresses.
void message(const QString &title, const QString &message, unsigned int style)
void setCurrentWallet(WalletModel *wallet_model)
bool handlePaymentRequest(const SendCoinsRecipient &recipient)
void gotoLoadPSBT(bool from_clipboard=false)
Load Partially Signed Bitcoin Transaction.
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
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.
void outOfSyncWarningClicked()
Notify that the out of sync warning icon has been pressed.
WalletModel * getWalletModel() const noexcept
void message(const QString &title, const QString &message, unsigned int style)
Fired when a message should be reported to the user.
void transactionClicked()
void setPrivacy(bool privacy)
void encryptionStatusChanged()
Encryption status of wallet changed.
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 PopupMenu(QMenu *menu, const QPoint &point, QAction *at_action)
Call QMenu::popup() only on supported QT_QPA_PLATFORM.
void handleCloseWindowShortcut(QWidget *w)
void PolishProgressDialog(QProgressDialog *dialog)
ClickableProgressBar ProgressBar
void bringToFront(QWidget *w)
bool HasPixmap(const QLabel *label)
Returns true if pixmap has been set.
QString formatNiceTimeOffset(qint64 secs)
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....
void ShowModalDialogAndDeleteOnClose(QDialog *dialog)
Shows a QDialog instance asynchronously, and deletes it on close.
int TextWidth(const QFontMetrics &fm, const QString &text)
Returns the distance in pixels appropriate for drawing a subsequent character after text.
int64_t nPowTargetSpacing
Block and header tip information.
double verification_progress
int64_t GetTime()
DEPRECATED Use either GetTimeSeconds (not mockable) or GetTime<T> (mockable)
SynchronizationState
Current sync state passed to tip changed callbacks.