 |
Bitcoin Core
22.99.0
P2P Digital Currency
|
Go to the documentation of this file.
27 #endif // ENABLE_WALLET
41 #include <validation.h>
44 #include <QApplication>
48 #include <QDragEnterEvent>
49 #include <QListWidget>
52 #include <QMessageBox>
54 #include <QProgressDialog>
58 #include <QStackedWidget>
61 #include <QSystemTrayIcon>
65 #include <QVBoxLayout>
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);
96 #endif // ENABLE_WALLET
97 QApplication::setWindowIcon(m_network_style->getTrayAndWindowIcon());
98 setWindowIcon(m_network_style->getTrayAndWindowIcon());
107 walletFrame =
new WalletFrame(_platformStyle,
this);
112 connect(walletFrame, &
WalletFrame::message, [
this](
const QString& title,
const QString& message,
unsigned int style) {
113 this->message(title, message, style);
116 setCentralWidget(walletFrame);
118 #endif // ENABLE_WALLET
123 setCentralWidget(rpcConsole);
124 Q_EMIT consoleShown(rpcConsole);
127 modalOverlay =
new ModalOverlay(enableWallet, this->centralWidget());
130 setAcceptDrops(
true);
143 if (QSystemTrayIcon::isSystemTrayAvailable()) {
146 notificator =
new Notificator(QApplication::applicationName(), trayIcon,
this);
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();
170 frameBlocksLayout->addWidget(unitDisplayControl);
171 frameBlocksLayout->addStretch();
172 frameBlocksLayout->addWidget(labelWalletEncryptionIcon);
173 labelWalletEncryptionIcon->hide();
174 frameBlocksLayout->addWidget(labelWalletHDStatusIcon);
175 labelWalletHDStatusIcon->hide();
177 frameBlocksLayout->addWidget(labelProxyIcon);
178 frameBlocksLayout->addStretch();
179 frameBlocksLayout->addWidget(connectionsControl);
180 frameBlocksLayout->addStretch();
181 frameBlocksLayout->addWidget(labelBlocksIcon);
182 frameBlocksLayout->addStretch();
185 progressBarLabel =
new QLabel();
186 progressBarLabel->setVisible(
false);
188 progressBar->setAlignment(Qt::AlignCenter);
189 progressBar->setVisible(
false);
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; }");
200 statusBar()->addWidget(progressBarLabel);
201 statusBar()->addWidget(progressBar);
202 statusBar()->addPermanentWidget(frameBlocks);
205 this->installEventFilter(
this);
208 setWalletActionsEnabled(
false);
211 subscribeToCoreSignals();
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"));
265 receiveCoinsAction->setStatusTip(tr(
"Request payments (generates QR codes and bitcoin: URIs)"));
272 historyAction->setStatusTip(tr(
"Browse transaction history"));
275 historyAction->setShortcut(QKeySequence(Qt::ALT + Qt::Key_4));
282 connect(
overviewAction, &QAction::triggered,
this, &BitcoinGUI::gotoOverviewPage);
284 connect(
sendCoinsAction, &QAction::triggered, [
this]{ gotoSendCoinsPage(); });
286 connect(
receiveCoinsAction, &QAction::triggered,
this, &BitcoinGUI::gotoReceiveCoinsPage);
288 connect(
historyAction, &QAction::triggered,
this, &BitcoinGUI::gotoHistoryPage);
289 #endif // ENABLE_WALLET
292 quitAction->setStatusTip(tr(
"Quit application"));
293 quitAction->setShortcut(QKeySequence(Qt::CTRL + Qt::Key_Q));
300 aboutQtAction->setStatusTip(tr(
"Show information about Qt"));
308 encryptWalletAction->setStatusTip(tr(
"Encrypt the private keys that belong to your wallet"));
315 signMessageAction->setStatusTip(tr(
"Sign messages with your Bitcoin addresses to prove you own them"));
317 verifyMessageAction->setStatusTip(tr(
"Verify messages to ensure they were signed with specified Bitcoin addresses"));
334 openAction =
new QAction(tr(
"Open &URI…"),
this);
335 openAction->setStatusTip(tr(
"Open a bitcoin: URI"));
363 connect(
aboutQtAction, &QAction::triggered, qApp, QApplication::aboutQt);
377 connect(
signMessageAction, &QAction::triggered, [
this]{ gotoSignMessageTab(); });
384 connect(
openAction, &QAction::triggered,
this, &BitcoinGUI::openClicked);
388 const std::string& path = i.first;
389 QString name = path.empty() ? QString(
"["+tr(
"default wallet")+
"]") : QString::fromStdString(path);
393 name.replace(name.indexOf(QChar(
'&')), 1, QString(
"&&"));
394 QAction* action = m_open_wallet_menu->addAction(name);
398 action->setEnabled(false);
402 connect(action, &QAction::triggered, [
this, path] {
405 activity->open(path);
410 action->setEnabled(
false);
426 #endif // ENABLE_WALLET
429 connect(
new QShortcut(QKeySequence(Qt::CTRL + Qt::SHIFT + Qt::Key_D),
this), &QShortcut::activated,
this, &
BitcoinGUI::showDebugWindow);
443 QMenu *file =
appMenuBar->addMenu(tr(
"&File"));
450 file->addSeparator();
457 file->addSeparator();
461 QMenu *settings =
appMenuBar->addMenu(tr(
"&Settings"));
466 settings->addSeparator();
468 settings->addSeparator();
472 QMenu* window_menu =
appMenuBar->addMenu(tr(
"&Window"));
474 QAction* minimize_action = window_menu->addAction(tr(
"&Minimize"));
475 minimize_action->setShortcut(QKeySequence(Qt::CTRL + Qt::Key_M));
476 connect(minimize_action, &QAction::triggered, [] {
477 QApplication::activeWindow()->showMinimized();
479 connect(qApp, &QApplication::focusWindowChanged, [minimize_action] (QWindow* window) {
480 minimize_action->setEnabled(window !=
nullptr && (window->flags() & Qt::Dialog) != Qt::Dialog && window->windowState() != Qt::WindowMinimized);
484 QAction* zoom_action = window_menu->addAction(tr(
"Zoom"));
485 connect(zoom_action, &QAction::triggered, [] {
486 QWindow* window = qApp->focusWindow();
487 if (window->windowState() != Qt::WindowMaximized) {
488 window->showMaximized();
490 window->showNormal();
494 connect(qApp, &QApplication::focusWindowChanged, [zoom_action] (QWindow* window) {
495 zoom_action->setEnabled(window !=
nullptr);
501 window_menu->addSeparator();
502 QAction* main_window_action = window_menu->addAction(tr(
"Main Window"));
503 connect(main_window_action, &QAction::triggered, [
this] {
507 window_menu->addSeparator();
512 window_menu->addSeparator();
516 connect(tab_action, &QAction::triggered, [
this, tab_type] {
524 help->addSeparator();
533 QToolBar *toolbar = addToolBar(tr(
"Tabs toolbar"));
535 toolbar->setMovable(
false);
536 toolbar->setToolButtonStyle(Qt::ToolButtonTextBesideIcon);
544 QWidget *spacer =
new QWidget();
545 spacer->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
546 toolbar->addWidget(spacer);
550 connect(
m_wallet_selector, qOverload<int>(&QComboBox::currentIndexChanged),
this, &BitcoinGUI::setCurrentWalletBySelectorIndex);
603 #endif // ENABLE_WALLET
627 #endif // ENABLE_WALLET
636 assert(wallet_controller);
656 void BitcoinGUI::addWallet(
WalletModel* walletModel)
685 void BitcoinGUI::removeWallet(
WalletModel* walletModel)
706 void BitcoinGUI::setCurrentWallet(
WalletModel* wallet_model)
719 void BitcoinGUI::setCurrentWalletBySelectorIndex(
int index)
722 if (wallet_model) setCurrentWallet(wallet_model);
725 void BitcoinGUI::removeAllWallets()
732 #endif // ENABLE_WALLET
754 assert(QSystemTrayIcon::isSystemTrayAvailable());
757 if (QSystemTrayIcon::isSystemTrayAvailable()) {
772 QAction* show_hide_action{
nullptr};
779 QAction* send_action{
nullptr};
780 QAction* receive_action{
nullptr};
781 QAction* sign_action{
nullptr};
782 QAction* verify_action{
nullptr};
792 options_action->setMenuRole(QAction::PreferencesRole);
794 QAction* quit_action{
nullptr};
801 connect(
trayIcon, &QSystemTrayIcon::activated, [
this](QSystemTrayIcon::ActivationReason reason) {
802 if (reason == QSystemTrayIcon::Trigger) {
821 [
this, show_hide_action, send_action, receive_action, sign_action, verify_action, options_action, node_window_action, quit_action] {
822 if (show_hide_action) show_hide_action->setText(
823 (!isHidden() && !isMinimized() && !GUIUtil::isObscured(this)) ?
826 if (QApplication::activeModalWidget()) {
827 for (QAction* a : trayIconMenu.get()->actions()) {
828 a->setEnabled(false);
831 if (show_hide_action) show_hide_action->setEnabled(true);
833 send_action->setEnabled(sendCoinsAction->isEnabled());
834 receive_action->setEnabled(receiveCoinsAction->isEnabled());
835 sign_action->setEnabled(signMessageAction->isEnabled());
836 verify_action->setEnabled(verifyMessageAction->isEnabled());
840 if (quit_action) quit_action->setEnabled(
true);
877 void BitcoinGUI::openClicked()
886 void BitcoinGUI::gotoOverviewPage()
892 void BitcoinGUI::gotoHistoryPage()
898 void BitcoinGUI::gotoReceiveCoinsPage()
904 void BitcoinGUI::gotoSendCoinsPage(QString addr)
910 void BitcoinGUI::gotoSignMessageTab(QString addr)
915 void BitcoinGUI::gotoVerifyMessageTab(QString addr)
919 void BitcoinGUI::gotoLoadPSBT(
bool from_clipboard)
923 #endif // ENABLE_WALLET
931 case 0: icon =
":/icons/connect_0";
break;
932 case 1:
case 2:
case 3: icon =
":/icons/connect_1";
break;
933 case 4:
case 5:
case 6: icon =
":/icons/connect_2";
break;
934 case 7:
case 8:
case 9: icon =
":/icons/connect_3";
break;
935 default: icon =
":/icons/connect_4";
break;
942 tooltip = tr(
"%n active connection(s) to Bitcoin network.",
"",
count);
945 tooltip = tr(
"Network activity disabled.");
946 icon =
":/icons/network_disabled";
950 tooltip = QLatin1String(
"<nobr>") + tooltip + QLatin1String(
"<br>") +
952 tr(
"Click for more actions.") + QLatin1String(
"</nobr>");
969 tr(
"Show Peers tab"),
977 tr(
"Disable network activity") :
979 tr(
"Enable network activity"),
989 progressBarLabel->setText(tr(
"Syncing Headers (%1%)…").arg(QString::number(100.0 / (headersTipHeight+estHeadersLeft)*headersTipHeight,
'f', 1)));
999 dlg->setCurrentTab(tab);
1009 m_app_nap_inhibitor->enableAppNap();
1011 m_app_nap_inhibitor->disableAppNap();
1026 statusBar()->clearMessage();
1030 switch (blockSource) {
1059 QDateTime currentDate = QDateTime::currentDateTime();
1060 qint64 secs = blockDate.secsTo(currentDate);
1062 tooltip = tr(
"Processed %n block(s) of transaction history.",
"",
count);
1066 tooltip = tr(
"Up to date") + QString(
".<br>") + tooltip;
1069 #ifdef ENABLE_WALLET
1075 #endif // ENABLE_WALLET
1085 progressBar->setFormat(tr(
"%1 behind").arg(timeBehindText));
1087 progressBar->setValue(nVerificationProgress * 1000000000.0 + 0.5);
1090 tooltip = tr(
"Catching up…") + QString(
"<br>") + tooltip;
1094 QString(
":/animation/spinner-%1").arg(
spinnerFrame, 3, 10, QChar(
'0')),
1100 #ifdef ENABLE_WALLET
1106 #endif // ENABLE_WALLET
1108 tooltip += QString(
"<br>");
1109 tooltip += tr(
"Last received block was generated %1 ago.").arg(timeBehindText);
1110 tooltip += QString(
"<br>");
1111 tooltip += tr(
"Transactions after this will not yet be visible.");
1115 tooltip = QString(
"<nobr>") + tooltip + QString(
"</nobr>");
1122 void BitcoinGUI::message(
const QString& title, QString message,
unsigned int style,
bool* ret,
const QString& detailed_message)
1127 int nMBoxIcon = QMessageBox::Information;
1131 if (!title.isEmpty()) {
1136 msgType = tr(
"Error");
1140 msgType = tr(
"Warning");
1144 msgType = tr(
"Information");
1152 if (!msgType.isEmpty()) {
1153 strTitle +=
" - " + msgType;
1157 nMBoxIcon = QMessageBox::Critical;
1160 nMBoxIcon = QMessageBox::Warning;
1166 QMessageBox::StandardButton buttons;
1168 buttons = QMessageBox::Ok;
1171 QMessageBox mBox(
static_cast<QMessageBox::Icon
>(nMBoxIcon), strTitle,
message, buttons,
this);
1172 mBox.setTextFormat(Qt::PlainText);
1173 mBox.setDetailedText(detailed_message);
1174 int r = mBox.exec();
1176 *ret = r == QMessageBox::Ok;
1184 if (e->type() == QEvent::PaletteChange) {
1191 QMainWindow::changeEvent(e);
1193 #ifndef Q_OS_MAC // Ignored on Mac
1194 if(e->type() == QEvent::WindowStateChange)
1198 QWindowStateChangeEvent *wsevt =
static_cast<QWindowStateChangeEvent*
>(e);
1199 if(!(wsevt->oldState() & Qt::WindowMinimized) && isMinimized())
1201 QTimer::singleShot(0,
this, &BitcoinGUI::hide);
1204 else if((wsevt->oldState() & Qt::WindowMinimized) && !isMinimized())
1206 QTimer::singleShot(0,
this, &BitcoinGUI::show);
1216 #ifndef Q_OS_MAC // Ignored on Mac
1228 QMainWindow::showMinimized();
1233 QMainWindow::closeEvent(event);
1245 #ifdef ENABLE_WALLET
1246 void BitcoinGUI::incomingTransaction(
const QString& date,
int unit,
const CAmount& amount,
const QString& type,
const QString& address,
const QString& label,
const QString& walletName)
1249 QString msg = tr(
"Date: %1\n").arg(date) +
1252 msg += tr(
"Wallet: %1\n").arg(walletName);
1254 msg += tr(
"Type: %1\n").arg(type);
1255 if (!label.isEmpty())
1256 msg += tr(
"Label: %1\n").arg(label);
1257 else if (!address.isEmpty())
1258 msg += tr(
"Address: %1\n").arg(address);
1259 message((amount)<0 ? tr(
"Sent transaction") : tr(
"Incoming transaction"),
1262 #endif // ENABLE_WALLET
1267 if(event->mimeData()->hasUrls())
1268 event->acceptProposedAction();
1273 if(event->mimeData()->hasUrls())
1275 for (
const QUrl &uri : event->mimeData()->urls())
1280 event->acceptProposedAction();
1286 if (event->type() == QEvent::StatusTip)
1292 return QMainWindow::eventFilter(
object, event);
1295 #ifdef ENABLE_WALLET
1302 gotoSendCoinsPage();
1308 void BitcoinGUI::setHDStatus(
bool privkeyDisabled,
int hdEnabled)
1311 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>"));
1315 void BitcoinGUI::setEncryptionStatus(
int status)
1344 void BitcoinGUI::updateWalletStatus()
1356 #endif // ENABLE_WALLET
1360 std::string ip_port;
1363 if (proxy_enabled) {
1365 QString ip_port_q = QString::fromStdString(ip_port);
1367 labelProxyIcon->setToolTip(tr(
"Proxy is <b>enabled</b>: %1").arg(ip_port_q));
1379 #ifdef ENABLE_WALLET
1382 if (wallet_model && !wallet_model->
getWalletName().isEmpty()) {
1390 setWindowTitle(window_title);
1422 if (nProgress == 0) {
1428 }
else if (nProgress == 100) {
1453 QString detailed_message;
1455 detailed_message = BitcoinGUI::tr(
"Original message:") +
"\n" + QString::fromStdString(message.
original);
1459 bool invoked = QMetaObject::invokeMethod(gui,
"message",
1461 Q_ARG(QString, QString::fromStdString(caption)),
1462 Q_ARG(QString, QString::fromStdString(message.
translated)),
1463 Q_ARG(
unsigned int, style),
1465 Q_ARG(QString, detailed_message));
1491 : optionsModel(nullptr),
1493 m_platform_style{platformStyle}
1495 createContextMenu();
1496 setToolTip(tr(
"Unit to show amounts in. Click to select another unit."));
1499 const QFontMetrics fm(font());
1504 setMinimumSize(max_width, 0);
1505 setAlignment(Qt::AlignRight | Qt::AlignVCenter);
1506 setStyleSheet(QString(
"QLabel { color : %1 }").arg(m_platform_style->SingleColor().name()));
1517 if (e->type() == QEvent::PaletteChange) {
1519 if (style != styleSheet()) {
1520 setStyleSheet(style);
1524 QLabel::changeEvent(e);
1530 menu =
new QMenu(
this);
1561 QPoint globalPos = mapToGlobal(point);
1562 menu->exec(globalPos);
void createToolBars()
Create the toolbars.
A container for embedding all wallet-related controls into BitcoinGUI.
void walletRemoved(WalletModel *wallet_model)
void numBlocksChanged(int count, const QDateTime &blockDate, double nVerificationProgress, bool header, SynchronizationState sync_state)
void setClientModel(ClientModel *clientModel=nullptr, interfaces::BlockAndHeaderTipInfo *tip_info=nullptr)
Set the client model.
WalletView * currentWalletView() const
@ Critical
An error occurred.
QSystemTrayIcon * trayIcon
void createWalletButtonClicked()
void updateProxyIcon()
Set the proxy-enabled icon as shown in the UI.
void mousePressEvent(QMouseEvent *event) override
So that it responds to left-button clicks.
void gotoReceiveCoinsPage()
Switch to receive coins page.
Modal overlay to display information about the chain-sync state.
void PopupMenu(QMenu *menu, const QPoint &point, QAction *at_action)
Call QMenu::popup() only on supported QT_QPA_PLATFORM.
bool getMinimizeOnClose() const
void numConnectionsChanged(int count)
void gotoSignMessageTab(QString addr="")
Show Sign/Verify Message dialog and switch to sign message tab.
const std::unique_ptr< QMenu > trayIconMenu
if(na.IsAddrV1Compatible())
void setWalletActionsEnabled(bool enabled)
Enable or disable all wallet-related actions.
virtual std::unique_ptr< Handler > handleMessageBox(MessageBoxFn fn)=0
void message(const QString &title, const QString &message, unsigned int style)
Fired when a message should be reported to the user.
void toggleHidden()
Simply calls showNormalIfMinimized(true) for use in SLOT() macro.
Signals for UI communication.
void closeEvent(QCloseEvent *event) override
virtual bool getNetworkActive()=0
Get network active.
Interface to Bitcoin wallet from Qt view code.
"Help message" dialog box
void notify(Class cls, const QString &title, const QString &text, const QIcon &icon=QIcon(), int millisTimeout=10000)
Show notification message.
void receivedURI(const QString &uri)
Signal raised when a URI was entered or dragged to the GUI.
int getNumConnections(unsigned int flags=CONNECTIONS_ALL) const
Return number of connections, default is in- and outbound (total)
void showNormalIfMinimized()
Show window if hidden, unminimize when minimized, rise when obscured or show if hidden and fToggleHid...
static constexpr int64_t MAX_BLOCK_TIME_GAP
Maximum gap between node time and block time used for the "Catching up..." mode in GUI.
QAction * m_wallet_selector_action
QComboBox * m_wallet_selector
static QString formatWithUnit(int unit, const CAmount &amount, bool plussign=false, SeparatorStyle separators=SeparatorStyle::STANDARD)
Format as string (with unit)
ClientModel * clientModel
void createActions()
Create the main UI actions.
WalletModel * getWalletModel() const noexcept
virtual void setNetworkActive(bool active)=0
Set network active.
static bool isWalletEnabled()
void clicked(const QPoint &point)
Emitted when the progressbar is clicked.
GUIUtil::ClickableLabel * connectionsControl
void triggered(bool hidden)
void dropEvent(QDropEvent *event) override
QAction * usedSendingAddressesAction
enum BlockSource getBlockSource() const
Returns enum BlockSource of the current importing/syncing state.
QAction * m_load_psbt_action
QProgressDialog * progressDialog
std::map< std::string, bool > listWalletDir() const
Returns all wallet names in the wallet dir mapped to whether the wallet is loaded.
int64_t GetTime()
DEPRECATED Use either GetTimeSeconds (not mockable) or GetTime<T> (mockable)
void walletAdded(WalletModel *wallet_model)
interfaces::Node & m_node
void displayUnitChanged(int unit)
const Consensus::Params & GetConsensus() const
void setNetworkActive(bool network_active)
Set network state shown in the UI.
Block and header tip information.
void encryptWallet()
Encrypt the wallet.
void changeEvent(QEvent *e) override
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 bringToFront(QWidget *w)
void setPrivacy(bool privacy)
void setDisplayUnit(const QVariant &value)
Updates current unit in memory, settings and emits displayUnitChanged(newUnit) signal.
void changePassphrase()
Change encrypted wallet passphrase.
void createTrayIconMenu()
Create system tray menu (or setup the dock menu)
static const int STATUSBAR_ICONSIZE
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 showDebugWindowActivateConsole()
Show debug window and set focus to the console.
void message(const QString &title, const QString &message, unsigned int style)
bool isObscured(QWidget *w)
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.
Notificator * notificator
static MacDockIconHandler * instance()
void setOptionsModel(OptionsModel *optionsModel)
Lets the control know about the Options Model (and its signals)
int64_t nPowTargetSpacing
QKeySequence tabShortcut(TabTypes tab_type) const
void backupWallet()
Backup the wallet.
void addWallet(WalletModel *const walletModel)
bool isPrivacyModeActivated() const
void showEvent(QShowEvent *event) override
@ BTN_MASK
Mask of all available buttons in CClientUIInterface::MessageBoxFlags This needs to be updated,...
void setPrivacy(bool privacy)
Interface from Qt to configuration data structure for Bitcoin client.
OptionsModel * getOptionsModel()
void showProgress(const QString &title, int nProgress)
Show progress dialog e.g.
bool addView(WalletView *walletView)
interfaces::Wallet & wallet() const
ModalOverlay * modalOverlay
static QList< Unit > availableUnits()
Get list of units, for drop-down box.
const NetworkStyle *const m_network_style
QAction * m_create_wallet_action
Cross-platform desktop notification client.
void ShowModalDialogAsynchronously(QDialog *dialog)
Shows a QDialog instance asynchronously, and deletes it on close.
@ MODAL
Force blocking, modal message box dialog (not just OS notification)
QAction * m_mask_values_action
void removeWallet(WalletModel *const walletModel)
QString formatNiceTimeOffset(qint64 secs)
void unsubscribeFromCoreSignals()
Disconnect core signals from GUI client.
QAction * m_close_all_wallets_action
void opened(WalletModel *wallet_model)
void setCurrentWallet(WalletModel *wallet_model)
void clicked(const QPoint &point)
Emitted when the label is clicked.
int getHeaderTipHeight() const
void showTrayIconChanged(bool)
void usedReceivingAddresses()
Show used receiving addresses.
bool getProxyInfo(std::string &ip_port) const
void setClientModel(ClientModel *model=nullptr, int bestblock_height=0, int64_t bestblock_date=0, double verification_progress=0.0)
@ Information
Informational message.
WalletFrame * walletFrame
void message(const QString &title, const QString &message, unsigned int style)
Fired when a message should be reported to the user.
void updateDisplayUnit(int newUnits)
When Display Units are changed on OptionsModel it will refresh the display text of the control on the...
Controller between interfaces::Node, WalletModel instances and the GUI.
const QIcon & getTrayAndWindowIcon() const
QLabel * progressBarLabel
EncryptionStatus getEncryptionStatus() const
Local Bitcoin RPC console.
void created(WalletModel *wallet_model)
QAction * showHelpMessageAction
WalletModel * currentWalletModel() const
void PolishProgressDialog(QProgressDialog *dialog)
int64_t CAmount
Amount in satoshis (Can be negative)
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.
QString getWalletName() const
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...
void encryptionStatusChanged()
Encryption status of wallet changed.
void subscribeToCoreSignals()
Connect core signals to GUI client.
QAction * sendCoinsAction
static QString longName(int unit)
Long name.
QLabel * m_wallet_selector_label
void setNumConnections(int count)
Set number of connections shown in the UI.
void optionsClicked()
Show configuration dialog.
virtual WalletLoader & walletLoader()=0
Get wallet loader.
QAction * receiveCoinsAction
QAction * backupWalletAction
void detectShutdown()
called by a timer to check if ShutdownRequested() has been set
void showHelpMessageClicked()
Show help message dialog.
void showProgress(const QString &title, int nProgress)
void usedSendingAddresses()
Show used sending addresses.
void aboutClicked()
Show about dialog.
Top-level interface for a bitcoin node (bitcoind process).
QString tabTitle(TabTypes tab_type) const
bool HasPixmap(const QLabel *label)
Returns true if pixmap has been set.
void updateNetworkState()
Update UI with latest network info from model.
void gotoSendCoinsPage(QString addr="")
Switch to send coins page.
double verification_progress
UnitDisplayStatusBarControl(const PlatformStyle *platformStyle)
const QString & getTitleAddText() const
BitcoinGUI(interfaces::Node &node, const PlatformStyle *platformStyle, const NetworkStyle *networkStyle, QWidget *parent=nullptr)
void gotoLoadPSBT(bool from_clipboard=false)
Load Partially Signed Bitcoin Transaction.
std::unique_ptr< interfaces::Handler > m_handler_message_box
Model for Bitcoin network client.
GUIUtil::ClickableLabel * labelProxyIcon
bool handlePaymentRequest(const SendCoinsRecipient &recipient)
void outOfSyncWarningClicked()
Notify that the out of sync warning icon has been pressed.
void closeWallet(WalletModel *wallet_model, QWidget *parent=nullptr)
void setClientModel(ClientModel *clientModel)
virtual bool shutdownRequested()=0
Return whether shutdown was requested.
bool eventFilter(QObject *object, QEvent *event) override
void setTabFocus(enum TabTypes tabType)
set which tab has the focus (is visible)
QAction * changePassphraseAction
QMenu * m_open_wallet_menu
GUIUtil::ClickableProgressBar * progressBar
virtual bool hdEnabled()=0
void setKnownBestHeight(int count, const QDateTime &blockDate)
@ MSG_INFORMATION
Predefined combinations for certain default usage cases.
int getDisplayUnit() const
QAction * verifyMessageAction
void changeEvent(QEvent *e) override
const PlatformStyle * platformStyle
void gotoVerifyMessageTab(QString addr="")
Show Sign/Verify Message dialog and switch to verify message tab.
std::unique_ptr< interfaces::Handler > m_handler_question
void gotoOverviewPage()
Switch to overview (home) page.
GUIUtil::ThemedLabel * labelWalletEncryptionIcon
QAction * m_close_wallet_action
void showHide(bool hide=false, bool userRequested=false)
const PlatformStyle * m_platform_style
static bool ThreadSafeMessageBox(BitcoinGUI *gui, const bilingual_str &message, const std::string &caption, unsigned int style)
Qt::ConnectionType blockingGUIThreadConnection()
Get connection type to call object slot in GUI thread with invokeMethod.
QAction * m_load_psbt_clipboard_action
const CChainParams & Params()
Return the currently selected parameters.
QAction * usedReceivingAddressesAction
void openOptionsDialogWithTab(OptionsDialog::Tab tab)
Open the OptionsDialog on the specified tab index.
int TextWidth(const QFontMetrics &fm, const QString &text)
Returns the distance in pixels appropriate for drawing a subsequent character after text.
UnitDisplayStatusBarControl * unitDisplayControl
HelpMessageDialog * helpMessageDialog
SynchronizationState
Current sync state passed to tip changed callbacks.
void handleCloseWindowShortcut(QWidget *w)
int prevBlocks
Keep track of previous number of blocks, to detect progress.
void consoleShown(RPCConsole *console)
Signal raised when RPC console shown.
void createMenuBar()
Create the menu bar and sub-menus.
void createTrayIcon()
Create system tray icon and notification.
QMenu * m_network_context_menu
void createContextMenu()
Creates context menu, its actions, and wires up all the relevant signals for mouse events.
WalletController * m_wallet_controller
void onMenuSelection(QAction *action)
Tells underlying optionsModel to update its current display unit.
GUIUtil::ClickableLabel * labelBlocksIcon
QString getDisplayName() const
void updateHeadersSyncProgressLabel()
void showOutOfSyncWarning(bool fShow)
void setThemedPixmap(const QString &image_filename, int width, int height)
bool getMinimizeToTray() const
QAction * m_wallet_selector_label_action
void transactionClicked()
void gotoHistoryPage()
Switch to history (transactions) page.
virtual std::unique_ptr< Handler > handleQuestion(QuestionFn fn)=0
virtual bool privateKeysDisabled()=0
bool isLayerVisible() const
QAction * m_open_wallet_action
void closeAllWallets(QWidget *parent=nullptr)
void dragEnterEvent(QDragEnterEvent *event) override
std::vector< TabTypes > tabs() const
QAction * encryptWalletAction
void removeWallet(WalletModel *wallet_model)
static const std::string DEFAULT_UIPLATFORM
QAction * openRPCConsoleAction
void tipUpdate(int count, const QDateTime &blockDate, double nVerificationProgress)
macOS-specific Dock icon handler.
ClickableProgressBar ProgressBar
void networkActiveChanged(bool networkActive)
void onDisplayUnitsClicked(const QPoint &point)
Shows context menu with Display Unit options by the mouse coordinates.
GUIUtil::ThemedLabel * labelWalletHDStatusIcon
bool getShowTrayIcon() const
int64_t getHeaderTipTime() const
@ Warning
Notify user of potential problem.
QAction * signMessageAction
virtual std::vector< std::unique_ptr< Wallet > > getWallets()=0
Return interfaces for accessing wallets (if any).
void showDebugWindow()
Show debug window.
OptionsModel * optionsModel