34 #endif // ENABLE_WALLET 37 #include <validation.h> 42 #include <QApplication> 45 #include <QDragEnterEvent> 46 #include <QListWidget> 49 #include <QMessageBox> 51 #include <QProgressDialog> 55 #include <QStackedWidget> 58 #include <QSystemTrayIcon> 62 #include <QVBoxLayout> 68 #elif defined(Q_OS_WIN) 78 : QMainWindow(parent),
m_node(node), trayIconMenu{
new QMenu()},
82 if (!restoreGeometry(settings.value(
"MainWindowGeometry").toByteArray())) {
84 move(QGuiApplication::primaryScreen()->availableGeometry().center() -
85 frameGeometry().center());
90 #endif // ENABLE_WALLET 103 #endif // ENABLE_WALLET 114 setAcceptDrops(
true);
127 if (QSystemTrayIcon::isSystemTrayAvailable()) {
137 statusBar()->setSizeGripEnabled(
false);
140 QFrame *frameBlocks =
new QFrame();
141 frameBlocks->setContentsMargins(0, 0, 0, 0);
142 frameBlocks->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Preferred);
143 QHBoxLayout *frameBlocksLayout =
new QHBoxLayout(frameBlocks);
144 frameBlocksLayout->setContentsMargins(3, 0, 3, 0);
145 frameBlocksLayout->setSpacing(3);
153 frameBlocksLayout->addStretch();
155 frameBlocksLayout->addStretch();
160 frameBlocksLayout->addStretch();
162 frameBlocksLayout->addStretch();
164 frameBlocksLayout->addStretch();
177 QString curStyle = QApplication::style()->metaObject()->className();
178 if (curStyle ==
"QWindowsStyle" || curStyle ==
"QWindowsXPStyle") {
180 "QProgressBar { background-color: #e8e8e8; border: 1px solid grey; " 181 "border-radius: 7px; padding: 1px; text-align: center; } " 182 "QProgressBar::chunk { background: QLinearGradient(x1: 0, y1: 0, " 183 "x2: 1, y2: 0, stop: 0 #FF8000, stop: 1 orange); border-radius: " 184 "7px; margin: 0px; }");
189 statusBar()->addPermanentWidget(frameBlocks);
193 this->installEventFilter(
this);
228 settings.setValue(
"MainWindowGeometry", saveGeometry());
234 delete m_app_nap_inhibitor;
243 QActionGroup *tabGroup =
new QActionGroup(
this);
247 tr(
"&Overview"),
this);
248 overviewAction->setStatusTip(tr(
"Show general overview of wallet"));
268 tr(
"&Receive"),
this);
270 tr(
"Request payments (generates QR codes and %1: URIs)")
271 .arg(QString::fromStdString(
284 tr(
"&Transactions"),
this);
285 historyAction->setStatusTip(tr(
"Browse transaction history"));
288 historyAction->setShortcut(QKeySequence(Qt::ALT + Qt::Key_4));
298 &BitcoinGUI::gotoOverviewPage);
302 [
this] { gotoSendCoinsPage(); });
306 [
this] { gotoSendCoinsPage(); });
310 &BitcoinGUI::gotoReceiveCoinsPage);
314 &BitcoinGUI::gotoReceiveCoinsPage);
318 &BitcoinGUI::gotoHistoryPage);
319 #endif // ENABLE_WALLET 322 quitAction->setStatusTip(tr(
"Quit application"));
323 quitAction->setShortcut(QKeySequence(Qt::CTRL + Qt::Key_Q));
325 aboutAction =
new QAction(tr(
"&About %1").arg(PACKAGE_NAME),
this);
327 tr(
"Show information about %1").arg(PACKAGE_NAME));
331 aboutQtAction->setStatusTip(tr(
"Show information about Qt"));
335 tr(
"Modify configuration options for %1").arg(PACKAGE_NAME));
343 tr(
"Encrypt the private keys that belong to your wallet"));
349 tr(
"Change the passphrase used for wallet encryption"));
352 tr(
"Sign messages with your Bitcoin addresses to prove you own them"));
355 tr(
"Verify messages to ensure they were signed with specified Bitcoin " 359 tr(
"Load Partially Signed Bitcoin Transaction"));
363 tr(
"Open node debugging and diagnostic console"));
370 tr(
"Show the list of used sending addresses and labels"));
372 new QAction(tr(
"&Receiving addresses"),
this);
374 tr(
"Show the list of used receiving addresses and labels"));
376 openAction =
new QAction(tr(
"Open &URI..."),
this);
378 tr(
"Open a %1: URI or payment request")
379 .arg(QString::fromStdString(
397 tr(
"Show the %1 help message to get a list with possible Bitcoin " 398 "command-line options")
401 connect(
quitAction, &QAction::triggered, qApp, QApplication::quit);
403 connect(
aboutQtAction, &QAction::triggered, qApp, QApplication::aboutQt);
427 [
this] { gotoSignMessageTab(); });
431 [
this] { gotoVerifyMessageTab(); });
433 [
this] { gotoLoadPSBT(); });
438 connect(
openAction, &QAction::triggered,
this,
439 &BitcoinGUI::openClicked);
442 for (
const std::pair<const std::string, bool> &i :
444 const std::string &path = i.first;
445 QString
name = path.empty()
446 ? QString(
"[" + tr(
"default wallet") +
"]")
447 : QString::fromStdString(path);
451 name.replace(name.indexOf(QChar(
'&')), 1, QString(
"&&"));
456 action->setEnabled(
false);
460 connect(action, &QAction::triggered, [
this, path] {
465 &BitcoinGUI::setCurrentWallet);
467 &QObject::deleteLater);
468 activity->open(path);
474 action->setEnabled(
false);
485 &BitcoinGUI::setCurrentWallet);
487 &QObject::deleteLater);
491 #endif // ENABLE_WALLET 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"));
516 file->addSeparator();
522 file->addSeparator();
526 QMenu *settings =
appMenuBar->addMenu(tr(
"&Settings"));
530 settings->addSeparator();
534 QMenu *window_menu =
appMenuBar->addMenu(tr(
"&Window"));
536 QAction *minimize_action = window_menu->addAction(tr(
"Minimize"));
537 minimize_action->setShortcut(QKeySequence(Qt::CTRL + Qt::Key_M));
538 connect(minimize_action, &QAction::triggered,
539 [] { QApplication::activeWindow()->showMinimized(); });
540 connect(qApp, &QApplication::focusWindowChanged,
541 [minimize_action](QWindow *window) {
542 minimize_action->setEnabled(
544 (window->flags() & Qt::Dialog) != Qt::Dialog &&
545 window->windowState() != Qt::WindowMinimized);
549 QAction *zoom_action = window_menu->addAction(tr(
"Zoom"));
550 connect(zoom_action, &QAction::triggered, [] {
551 QWindow *window = qApp->focusWindow();
552 if (window->windowState() != Qt::WindowMaximized) {
553 window->showMaximized();
555 window->showNormal();
559 connect(qApp, &QApplication::focusWindowChanged,
560 [zoom_action](QWindow *window) {
561 zoom_action->setEnabled(window !=
nullptr);
567 window_menu->addSeparator();
568 QAction *main_window_action = window_menu->addAction(tr(
"Main Window"));
569 connect(main_window_action, &QAction::triggered,
572 window_menu->addSeparator();
577 window_menu->addSeparator();
579 QAction *tab_action =
582 connect(tab_action, &QAction::triggered, [
this, tab_type] {
590 help->addSeparator();
597 QToolBar *toolbar = addToolBar(tr(
"Tabs toolbar"));
599 toolbar->setContextMenuPolicy(Qt::PreventContextMenu);
600 toolbar->setMovable(
false);
601 toolbar->setToolButtonStyle(Qt::ToolButtonTextBesideIcon);
609 QWidget *spacer =
new QWidget();
610 spacer->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
611 toolbar->addWidget(spacer);
616 static_cast<void (QComboBox::*)(
int)
>(
617 &QComboBox::currentIndexChanged),
618 this, &BitcoinGUI::setCurrentWalletBySelectorIndex);
660 [
this](
const QString &title,
const QString &
message,
661 unsigned int style) {
662 this->
message(title, message, style);
677 #endif // ENABLE_WALLET 704 #endif // ENABLE_WALLET 712 assert(wallet_controller);
721 &BitcoinGUI::addWallet);
723 &BitcoinGUI::removeWallet);
726 addWallet(wallet_model);
730 void BitcoinGUI::addWallet(
WalletModel *walletModel) {
747 void BitcoinGUI::removeWallet(
WalletModel *walletModel) {
768 void BitcoinGUI::setCurrentWallet(
WalletModel *wallet_model) {
783 void BitcoinGUI::setCurrentWalletBySelectorIndex(
int index) {
787 setCurrentWallet(wallet_model);
791 void BitcoinGUI::removeAllWallets() {
798 #endif // ENABLE_WALLET 819 assert(QSystemTrayIcon::isSystemTrayAvailable());
822 if (QSystemTrayIcon::isSystemTrayAvailable()) {
825 QString toolTip = tr(
"%1 client").arg(PACKAGE_NAME) +
" " +
840 connect(
trayIcon, &QSystemTrayIcon::activated,
this,
847 &BitcoinGUI::macosDockIconActivated);
876 if (reason == QSystemTrayIcon::Trigger) {
882 void BitcoinGUI::macosDockIconActivated() {
916 void BitcoinGUI::openClicked() {
923 void BitcoinGUI::gotoOverviewPage() {
930 void BitcoinGUI::gotoHistoryPage() {
937 void BitcoinGUI::gotoReceiveCoinsPage() {
944 void BitcoinGUI::gotoSendCoinsPage(QString addr) {
951 void BitcoinGUI::gotoSignMessageTab(QString addr) {
957 void BitcoinGUI::gotoVerifyMessageTab(QString addr) {
962 void BitcoinGUI::gotoLoadPSBT() {
967 #endif // ENABLE_WALLET 974 icon =
":/icons/connect_0";
979 icon =
":/icons/connect_1";
984 icon =
":/icons/connect_2";
989 icon =
":/icons/connect_3";
992 icon =
":/icons/connect_4";
999 tooltip = tr(
"%n active connection(s) to Bitcoin network",
"", count) +
1000 QString(
".<br>") + tr(
"Click to disable network activity.");
1002 tooltip = tr(
"Network activity disabled.") + QString(
"<br>") +
1003 tr(
"Click to enable network activity again.");
1004 icon =
":/icons/network_disabled";
1008 tooltip = QString(
"<nobr>") + tooltip + QString(
"</nobr>");
1026 int estHeadersLeft =
1027 (
GetTime() - headersTipTime) /
1031 tr(
"Syncing Headers (%1%)...")
1032 .arg(QString::number(100.0 /
1033 (headersTipHeight + estHeadersLeft) *
1051 double nVerificationProgress,
bool header,
1056 m_app_nap_inhibitor->enableAppNap();
1058 m_app_nap_inhibitor->disableAppNap();
1075 statusBar()->clearMessage();
1079 switch (blockSource) {
1108 QDateTime currentDate = QDateTime::currentDateTime();
1109 qint64 secs = blockDate.secsTo(currentDate);
1111 tooltip = tr(
"Processed %n block(s) of transaction history.",
"", count);
1115 tooltip = tr(
"Up to date") + QString(
".<br>") + tooltip;
1120 #ifdef ENABLE_WALLET 1125 #endif // ENABLE_WALLET 1133 progressBar->setFormat(tr(
"%1 behind").arg(timeBehindText));
1135 progressBar->setValue(nVerificationProgress * 1000000000.0 + 0.5);
1138 tooltip = tr(
"Catching up...") + QString(
"<br>") + tooltip;
1142 ->SingleColorIcon(QString(
":/movies/spinner-%1")
1149 #ifdef ENABLE_WALLET 1154 #endif // ENABLE_WALLET 1156 tooltip += QString(
"<br>");
1158 tr(
"Last received block was generated %1 ago.").arg(timeBehindText);
1159 tooltip += QString(
"<br>");
1160 tooltip += tr(
"Transactions after this will not yet be visible.");
1164 tooltip = QString(
"<nobr>") + tooltip + QString(
"</nobr>");
1172 unsigned int style,
bool *ret,
1173 const QString &detailed_message) {
1176 QString strTitle{PACKAGE_NAME};
1178 int nMBoxIcon = QMessageBox::Information;
1182 if (!title.isEmpty()) {
1187 msgType = tr(
"Error");
1188 message = tr(
"Error: %1").arg(message);
1191 msgType = tr(
"Warning");
1192 message = tr(
"Warning: %1").arg(message);
1195 msgType = tr(
"Information");
1203 if (!msgType.isEmpty()) {
1204 strTitle +=
" - " + msgType;
1208 nMBoxIcon = QMessageBox::Critical;
1211 nMBoxIcon = QMessageBox::Warning;
1217 QMessageBox::StandardButton buttons;
1218 if (!(buttons = (QMessageBox::StandardButton)(
1220 buttons = QMessageBox::Ok;
1224 QMessageBox mBox(static_cast<QMessageBox::Icon>(nMBoxIcon), strTitle,
1225 message, buttons,
this);
1226 mBox.setTextFormat(Qt::PlainText);
1227 mBox.setDetailedText(detailed_message);
1228 int r = mBox.exec();
1229 if (ret !=
nullptr) {
1230 *ret = r == QMessageBox::Ok;
1239 QMainWindow::changeEvent(e);
1240 #ifndef Q_OS_MAC // Ignored on Mac 1241 if (e->type() == QEvent::WindowStateChange) {
1244 QWindowStateChangeEvent *wsevt =
1245 static_cast<QWindowStateChangeEvent *
>(e);
1246 if (!(wsevt->oldState() & Qt::WindowMinimized) && isMinimized()) {
1247 QTimer::singleShot(0,
this, &BitcoinGUI::hide);
1249 }
else if ((wsevt->oldState() & Qt::WindowMinimized) &&
1251 QTimer::singleShot(0,
this, &BitcoinGUI::show);
1260 #ifndef Q_OS_MAC // Ignored on Mac 1267 QApplication::quit();
1269 QMainWindow::showMinimized();
1274 QMainWindow::closeEvent(event);
1285 #ifdef ENABLE_WALLET 1286 void BitcoinGUI::incomingTransaction(
const QString &date,
int unit,
1287 const Amount amount,
const QString &type,
1288 const QString &address,
1289 const QString &label,
1290 const QString &walletName) {
1292 QString msg = tr(
"Date: %1\n").arg(date) +
1296 msg += tr(
"Wallet: %1\n").arg(walletName);
1298 msg += tr(
"Type: %1\n").arg(type);
1299 if (!label.isEmpty()) {
1300 msg += tr(
"Label: %1\n").arg(label);
1301 }
else if (!address.isEmpty()) {
1302 msg += tr(
"Address: %1\n").arg(address);
1305 : tr(
"Incoming transaction"),
1308 #endif // ENABLE_WALLET 1312 if (event->mimeData()->hasUrls()) {
1313 event->acceptProposedAction();
1318 if (event->mimeData()->hasUrls()) {
1319 for (
const QUrl &uri : event->mimeData()->urls()) {
1323 event->acceptProposedAction();
1328 if (event->type() == QEvent::StatusTip) {
1335 return QMainWindow::eventFilter(
object, event);
1338 #ifdef ENABLE_WALLET 1343 gotoSendCoinsPage();
1349 void BitcoinGUI::setHDStatus(
bool privkeyDisabled,
int hdEnabled) {
1352 ->SingleColorIcon(privkeyDisabled
1354 : hdEnabled ?
":/icons/hd_enabled" 1355 :
":/icons/hd_disabled")
1359 ? tr(
"Private key <b>disabled</b>")
1360 : hdEnabled ? tr(
"HD key generation is <b>enabled</b>")
1361 : tr(
"HD key generation is <b>disabled</b>"));
1367 void BitcoinGUI::setEncryptionStatus(
int status) {
1381 tr(
"Wallet is <b>encrypted</b> and currently <b>unlocked</b>"));
1393 tr(
"Wallet is <b>encrypted</b> and currently <b>locked</b>"));
1402 void BitcoinGUI::updateWalletStatus() {
1415 #endif // ENABLE_WALLET 1418 std::string ip_port;
1421 if (proxy_enabled) {
1423 QString ip_port_q = QString::fromStdString(ip_port);
1428 tr(
"Proxy is <b>enabled</b>: %1").arg(ip_port_q));
1438 QString window_title = PACKAGE_NAME;
1439 #ifdef ENABLE_WALLET 1442 if (wallet_model && !wallet_model->
getWalletName().isEmpty()) {
1450 setWindowTitle(window_title);
1480 if (nProgress == 0) {
1487 }
else if (nProgress == 100) {
1500 trayIcon->setVisible(!fHideTrayIcon);
1512 const std::string &caption,
1513 unsigned int style) {
1520 QString detailed_message;
1522 detailed_message = BitcoinGUI::tr(
"Original message:") +
"\n" +
1523 QString::fromStdString(message.
original);
1528 bool invoked = QMetaObject::invokeMethod(
1531 Q_ARG(QString, QString::fromStdString(caption)),
1532 Q_ARG(QString, QString::fromStdString(message.
translated)),
1533 Q_ARG(
unsigned int, style), Q_ARG(
bool *, &ret),
1534 Q_ARG(QString, detailed_message));
1543 std::placeholders::_2, std::placeholders::_3));
1546 std::placeholders::_3, std::placeholders::_4));
1557 : optionsModel(nullptr), menu(nullptr) {
1559 setToolTip(tr(
"Unit to show amounts in. Click to select another unit."));
1562 const QFontMetrics fm(font());
1564 max_width = qMax(max_width,
1567 setMinimumSize(max_width, 0);
1568 setAlignment(Qt::AlignRight | Qt::AlignVCenter);
1569 setStyleSheet(QString(
"QLabel { color : %1 }")
1581 menu =
new QMenu(
this);
1583 QAction *menuAction =
1585 menuAction->setData(QVariant(u));
1586 menu->addAction(menuAction);
1588 connect(
menu, &QMenu::triggered,
this,
1594 if (_optionsModel) {
1616 QPoint globalPos = mapToGlobal(point);
1617 menu->exec(globalPos);
virtual bool privateKeysDisabled()=0
void subscribeToCoreSignals()
Connect core signals to GUI client.
void unsubscribeFromCoreSignals()
Disconnect core signals from GUI client.
void showEvent(QShowEvent *event) override
bool handlePaymentRequest(const SendCoinsRecipient &recipient)
static UniValue help(Config &config, const JSONRPCRequest &jsonRequest)
static QString formatWithUnit(int unit, const Amount amount, bool plussign=false, SeparatorStyle separators=separatorStandard)
Format as string (with unit)
void message(const QString &title, const QString &message, unsigned int style)
Fired when a message should be reported to the user.
void setNetworkActive(bool networkActive)
Set network state shown in the UI.
void addWallet(WalletModel *const walletModel)
WalletModel * currentWalletModel() const
QAction * receiveCoinsAction
UnitDisplayStatusBarControl * unitDisplayControl
int getNumConnections(NumConnections flags=CONNECTIONS_ALL) const
Return number of connections, default is in- and outbound (total)
Local Bitcoin RPC console.
Unit
Bitcoin units (Bitcoin Cash unit work the same as Bitoin).
interfaces::Wallet & wallet() const
static constexpr Amount zero()
QAction * signMessageAction
void receivedURI(const QString &uri)
Signal raised when a URI was entered or dragged to the GUI.
SynchronizationState
Current sync state passed to tip changed callbacks.
virtual bool getNetworkActive()=0
Get network active.
void updateNetworkState()
Update UI with latest network info from model.
QLabel * labelWalletHDStatusIcon
void showNormalIfMinimized()
Show window if hidden, unminimize when minimized, rise when obscured or show if hidden and fToggleHid...
UnitDisplayStatusBarControl(const PlatformStyle *platformStyle)
QProgressDialog * progressDialog
static bool isWalletEnabled()
void hideTrayIconChanged(bool)
void consoleShown(RPCConsole *console)
Signal raised when RPC console shown.
void createTrayIcon()
Create system tray icon and notification.
void showDebugWindow()
Show debug window.
GUIUtil::ClickableLabel * labelProxyIcon
virtual double getVerificationProgress()=0
Get verification progress.
ClientModel * clientModel
void createToolBars()
Create the toolbars.
int TextWidth(const QFontMetrics &fm, const QString &text)
Returns the distance in pixels appropriate for drawing a subsequent character after text...
void setCurrentWallet(WalletModel *wallet_model)
QAction * m_load_psbt_action
ModalOverlay * modalOverlay
void createTrayIconMenu()
Create system tray menu (or setup the dock menu)
QAction * m_wallet_selector_action
void opened(WalletModel *wallet_model)
QAction * verifyMessageAction
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...
QAction * m_open_wallet_action
BitcoinGUI(interfaces::Node &node, const Config *, const PlatformStyle *platformStyle, const NetworkStyle *networkStyle, QWidget *parent=nullptr)
void usedReceivingAddresses()
Show used receiving addresses.
QAction * m_close_wallet_action
static bool ThreadSafeMessageBox(BitcoinGUI *gui, const bilingual_str &message, const std::string &caption, unsigned int style)
void tipUpdate(int count, const QDateTime &blockDate, double nVerificationProgress)
Qt::ConnectionType blockingGUIThreadConnection()
Get connection type to call object slot in GUI thread with invokeMethod.
void setWalletActionsEnabled(bool enabled)
Enable or disable all wallet-related actions.
void networkActiveChanged(bool networkActive)
Controller between interfaces::Node, WalletModel instances and the GUI.
OptionsModel * getOptionsModel()
void encryptWallet(bool status)
Encrypt the wallet.
QMenu * m_open_wallet_menu
macOS-specific Dock icon handler.
Mask of all available buttons in CClientUIInterface::MessageBoxFlags This needs to be updated...
bool isLayerVisible() const
HelpMessageDialog * helpMessageDialog
QLabel * progressBarLabel
QSystemTrayIcon * trayIcon
void numBlocksChanged(int count, const QDateTime &blockDate, double nVerificationProgress, bool header, SynchronizationState sync_state)
virtual std::vector< std::unique_ptr< Wallet > > getWallets()=0
Return interfaces for accessing wallets (if any).
QAction * showHelpMessageAction
Notify user of potential problem.
Modal overlay to display information about the chain-sync state.
const QString & getTitleAddText() const
void changeEvent(QEvent *e) override
static QString longName(int unit)
Long name.
void numConnectionsChanged(int count)
Signals for UI communication.
GUIUtil::ClickableLabel * connectionsControl
QAction * backupWalletAction
virtual const CChainParams & GetChainParams() const =0
void setOptionsModel(OptionsModel *optionsModel)
Lets the control know about the Options Model (and its signals)
void dropEvent(QDropEvent *event) override
void bringToFront(QWidget *w)
std::map< std::string, bool > listWalletDir() const
Returns all wallet names in the wallet dir mapped to whether the wallet is loaded.
QString tabTitle(TabTypes tab_type) const
void openOptionsDialogWithTab(OptionsDialog::Tab tab)
Open the OptionsDialog on the specified tab index.
EncryptionStatus getEncryptionStatus() const
int getDisplayUnit() const
virtual std::unique_ptr< Handler > handleMessageBox(MessageBoxFn fn)=0
Force blocking, modal message box dialog (not just OS notification)
void showOutOfSyncWarning(bool fShow)
void setClientModel(ClientModel *model)
void gotoHistoryPage()
Switch to history (transactions) page.
QAction * usedReceivingAddressesAction
void setClientModel(ClientModel *clientModel)
Set the client model.
WalletModel * getWalletModel()
const NetworkStyle *const m_network_style
WalletController * m_wallet_controller
void gotoOverviewPage()
Switch to overview (home) page.
const PlatformStyle * platformStyle
QAction * toggleHideAction
virtual bool hdEnabled()=0
void showProgress(const QString &title, int nProgress)
Show progress dialog e.g.
static MacDockIconHandler * instance()
void setDisplayUnit(const QVariant &value)
Updates current unit in memory, settings and emits displayUnitChanged(newUnit) signal.
void setClientModel(ClientModel *clientModel)
bool isObscured(QWidget *w)
QAction * m_wallet_selector_label_action
OptionsModel * optionsModel
void created(WalletModel *wallet_model)
QLabel * m_wallet_selector_label
enum BlockSource getBlockSource() const
Returns enum BlockSource of the current importing/syncing state.
void setKnownBestHeight(int count, const QDateTime &blockDate)
void optionsClicked()
Show configuration dialog.
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.
void closeWallet(WalletModel *wallet_model, QWidget *parent=nullptr)
void gotoVerifyMessageTab(QString addr="")
Show Sign/Verify Message dialog and switch to verify message tab.
void notify(Class cls, const QString &title, const QString &text, const QIcon &icon=QIcon(), int millisTimeout=10000)
Show notification message.
WalletFrame * walletFrame
void updateDisplayUnit(int newUnits)
When Display Units are changed on OptionsModel it will refresh the display text of the control on the...
WalletView * currentWalletView() const
QAction * usedSendingAddressesAction
void setTabFocus(enum TabTypes tabType)
set which tab has the focus (is visible)
int64_t nPowTargetSpacing
void setTrayIconVisible(bool)
When hideTrayIcon setting is changed in OptionsModel hide or show the icon accordingly.
void setModel(OptionsModel *model)
QAction * openRPCConsoleAction
std::vector< TabTypes > tabs() const
void detectShutdown()
called by a timer to check if ShutdownRequested() has been set
Cross-platform desktop notification client.
void clicked(const QPoint &point)
Emitted when the label is clicked.
QLabel * labelWalletEncryptionIcon
GUIUtil::ClickableLabel * labelBlocksIcon
void setCurrentTab(OptionsDialog::Tab tab)
GUIUtil::ClickableProgressBar * progressBar
void showHelpMessageClicked()
Show help message dialog.
QString getWalletName() const
void walletAdded(WalletModel *wallet_model)
Notificator * notificator
void displayUnitChanged(int unit)
void PolishProgressDialog(QProgressDialog *dialog)
void changePassphrase()
Change encrypted wallet passphrase.
Model for Bitcoin network client.
const QIcon & getTrayAndWindowIcon() const
void mousePressEvent(QMouseEvent *event) override
So that it responds to left-button clicks.
QAction * receiveCoinsMenuAction
ClickableProgressBar ProgressBar
void gotoSignMessageTab(QString addr="")
Show Sign/Verify Message dialog and switch to sign message tab.
virtual bool shutdownRequested()=0
Return whether shutdown was requested.
QAction * sendCoinsAction
void showHide(bool hide=false, bool userRequested=false)
QAction * m_create_wallet_action
QKeySequence tabShortcut(TabTypes tab_type) const
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 requestedSyncWarningInfo()
Notify that the user has requested more information about the out-of-sync warning.
static QList< Unit > availableUnits()
Get list of units, for drop-down box.
void trayIconActivated(QSystemTrayIcon::ActivationReason reason)
Handle tray icon clicked.
void gotoLoadPSBT()
Load Partially Signed Bitcoin Transaction.
bool getMinimizeOnClose() const
void updateProxyIcon()
Set the proxy-enabled icon as shown in the UI.
QAction * changePassphraseAction
virtual int64_t getLastBlockTime()=0
Get last block time.
void gotoSendCoinsPage(QString addr="")
Switch to send coins page.
virtual std::unique_ptr< Handler > handleQuestion(QuestionFn fn)=0
void gotoReceiveCoinsPage()
Switch to receive coins page.
std::vector< WalletModel * > getOpenWallets() const
Returns wallet models currently open.
const std::unique_ptr< QMenu > trayIconMenu
Interface from Qt to configuration data structure for Bitcoin client.
std::unique_ptr< interfaces::Handler > m_handler_question
bool getMinimizeToTray() const
Interface to Bitcoin wallet from Qt view code.
QAction * sendCoinsMenuAction
bool eventFilter(QObject *object, QEvent *event) override
int prevBlocks
Keep track of previous number of blocks, to detect progress.
void toggleHidden()
Simply calls showNormalIfMinimized(true) for use in SLOT() macro.
interfaces::Node & m_node
void walletRemoved(WalletModel *wallet_model)
void removeWallet(WalletModel *const walletModel)
const std::string & CashAddrPrefix() const
bool addWallet(WalletModel *walletModel)
void setNumConnections(int count)
Set number of connections shown in the UI.
QString getDisplayName() const
"Help message" dialog box
void backupWallet()
Backup the wallet.
void closeEvent(QCloseEvent *event) override
QComboBox * m_wallet_selector
void clicked(const QPoint &point)
Emitted when the progressbar is clicked.
virtual int getNumBlocks()=0
Get num blocks.
QString formatNiceTimeOffset(qint64 secs)
void createContextMenu()
Creates context menu, its actions, and wires up all the relevant signals for mouse events...
void showDebugWindowActivateConsole()
Show debug window and set focus to the console.
void createActions()
Create the main UI actions.
QAction * encryptWalletAction
void aboutClicked()
Show about dialog.
const Consensus::Params & GetConsensus() const
void removeWallet(WalletModel *wallet_model)
int getHeaderTipHeight() const
void updateHeadersSyncProgressLabel()
int64_t GetTime()
Return system time (or mocked time, if set)
static const std::string DEFAULT_UIPLATFORM
virtual void setNetworkActive(bool active)=0
Set network active.
int64_t getHeaderTipTime() const
Top-level interface for a bitcoin node (bitcoind process).
static constexpr int64_t MAX_BLOCK_TIME_GAP
Maximum gap between node time and block time used for the "Catching up..." mode in GUI...
A container for embedding all wallet-related controls into BitcoinGUI.
void showProgress(const QString &title, int nProgress)
void usedSendingAddresses()
Show used sending addresses.
bool getHideTrayIcon() const
void onDisplayUnitsClicked(const QPoint &point)
Shows context menu with Display Unit options by the mouse coordinates.
void createMenuBar()
Create the menu bar and sub-menus.
void onMenuSelection(QAction *action)
Tells underlying optionsModel to update its current display unit.
std::unique_ptr< interfaces::Handler > m_handler_message_box
Predefined combinations for certain default usage cases.
void dragEnterEvent(QDragEnterEvent *event) override
bool getProxyInfo(std::string &ip_port) const