5 #if defined(HAVE_CONFIG_H) 31 #endif // ENABLE_WALLET 38 #include <chainparams.h> 44 #include <validation.h> 49 #include <QActionGroup> 50 #include <QApplication> 54 #include <QDragEnterEvent> 55 #include <QInputDialog> 56 #include <QKeySequence> 57 #include <QListWidget> 60 #include <QMessageBox> 62 #include <QProgressDialog> 66 #include <QStackedWidget> 69 #include <QSystemTrayIcon> 73 #include <QVBoxLayout> 78 #if defined(Q_OS_MACOS) 80 #elif defined(Q_OS_WIN) 90 trayIconMenu{
new QMenu()},
91 platformStyle(_platformStyle),
92 m_network_style(networkStyle)
95 if (!restoreGeometry(settings.value(
"MainWindowGeometry").toByteArray())) {
97 move(QGuiApplication::primaryScreen()->availableGeometry().center() - frameGeometry().center());
100 setContextMenuPolicy(Qt::PreventContextMenu);
104 #endif // ENABLE_WALLET 105 QApplication::setWindowIcon(m_network_style->getTrayAndWindowIcon());
106 setWindowIcon(m_network_style->getTrayAndWindowIcon());
115 walletFrame =
new WalletFrame(_platformStyle,
this);
117 connect(walletFrame, &
WalletFrame::message, [
this](
const QString& title,
const QString& message,
unsigned int style) {
118 this->message(title, message, style);
121 setCentralWidget(walletFrame);
123 #endif // ENABLE_WALLET 128 setCentralWidget(rpcConsole);
129 Q_EMIT consoleShown(rpcConsole);
132 modalOverlay =
new ModalOverlay(enableWallet, this->centralWidget());
135 setAcceptDrops(
true);
148 if (QSystemTrayIcon::isSystemTrayAvailable()) {
151 notificator =
new Notificator(QApplication::applicationName(), trayIcon,
this);
157 statusBar()->setSizeGripEnabled(
false);
160 QFrame *frameBlocks =
new QFrame();
161 frameBlocks->setContentsMargins(0,0,0,0);
162 frameBlocks->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Preferred);
163 QHBoxLayout *frameBlocksLayout =
new QHBoxLayout(frameBlocks);
164 frameBlocksLayout->setContentsMargins(3,0,3,0);
165 frameBlocksLayout->setSpacing(3);
174 frameBlocksLayout->addStretch();
175 frameBlocksLayout->addWidget(unitDisplayControl);
176 frameBlocksLayout->addStretch();
177 frameBlocksLayout->addWidget(labelWalletEncryptionIcon);
178 labelWalletEncryptionIcon->hide();
179 frameBlocksLayout->addWidget(labelWalletHDStatusIcon);
180 labelWalletHDStatusIcon->hide();
182 frameBlocksLayout->addWidget(labelProxyIcon);
183 frameBlocksLayout->addStretch();
184 frameBlocksLayout->addWidget(connectionsControl);
185 frameBlocksLayout->addStretch();
186 frameBlocksLayout->addWidget(labelBlocksIcon);
187 frameBlocksLayout->addStretch();
190 progressBarLabel =
new QLabel();
191 progressBarLabel->setVisible(
false);
193 progressBar->setAlignment(Qt::AlignCenter);
194 progressBar->setVisible(
false);
199 QString curStyle = QApplication::style()->metaObject()->className();
200 if(curStyle ==
"QWindowsStyle" || curStyle ==
"QWindowsXPStyle")
202 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; }");
205 statusBar()->addWidget(progressBarLabel);
206 statusBar()->addWidget(progressBar);
207 statusBar()->addPermanentWidget(frameBlocks);
210 this->installEventFilter(
this);
213 setWalletActionsEnabled(
false);
216 subscribeToCoreSignals();
238 settings.setValue(
"MainWindowGeometry", saveGeometry());
242 delete m_app_nap_inhibitor;
251 QActionGroup *tabGroup =
new QActionGroup(
this);
255 overviewAction->setStatusTip(tr(
"Show general overview of wallet"));
258 overviewAction->setShortcut(QKeySequence(QStringLiteral(
"Alt+1")));
269 receiveCoinsAction->setStatusTip(tr(
"Request payments (generates QR codes and bitcoin: URIs)"));
276 historyAction->setStatusTip(tr(
"Browse transaction history"));
279 historyAction->setShortcut(QKeySequence(QStringLiteral(
"Alt+4")));
286 connect(
overviewAction, &QAction::triggered,
this, &BitcoinGUI::gotoOverviewPage);
288 connect(
sendCoinsAction, &QAction::triggered, [
this]{ gotoSendCoinsPage(); });
290 connect(
receiveCoinsAction, &QAction::triggered,
this, &BitcoinGUI::gotoReceiveCoinsPage);
292 connect(
historyAction, &QAction::triggered,
this, &BitcoinGUI::gotoHistoryPage);
293 #endif // ENABLE_WALLET 296 quitAction->setStatusTip(tr(
"Quit application"));
297 quitAction->setShortcut(QKeySequence(tr(
"Ctrl+Q")));
304 aboutQtAction->setStatusTip(tr(
"Show information about Qt"));
312 encryptWalletAction->setStatusTip(tr(
"Encrypt the private keys that belong to your wallet"));
319 signMessageAction->setStatusTip(tr(
"Sign messages with your Bitcoin addresses to prove you own them"));
321 verifyMessageAction->setStatusTip(tr(
"Verify messages to ensure they were signed with specified Bitcoin addresses"));
338 openAction =
new QAction(tr(
"Open &URI…"),
this);
339 openAction->setStatusTip(tr(
"Open a bitcoin: URI"));
377 connect(
aboutQtAction, &QAction::triggered, qApp, QApplication::aboutQt);
391 connect(
signMessageAction, &QAction::triggered, [
this]{ gotoSignMessageTab(); });
398 connect(
openAction, &QAction::triggered,
this, &BitcoinGUI::openClicked);
402 const std::string& path = i.first;
403 QString
name = path.empty() ? QString(
"["+tr(
"default wallet")+
"]") : QString::fromStdString(path);
407 name.replace(
name.indexOf(QChar(
'&')), 1, QString(
"&&"));
412 action->setEnabled(
false);
416 connect(action, &QAction::triggered, [
this, path] {
420 activity->open(path);
425 action->setEnabled(
false);
430 QString name_data_file = tr(
"Wallet Data");
433 QString title_windows = tr(
"Load Wallet Backup");
435 QString backup_file =
GUIUtil::getOpenFileName(
this, title_windows, QString(), name_data_file + QLatin1String(
" (*.dat)"),
nullptr);
436 if (backup_file.isEmpty())
return;
441 QString title = tr(
"Restore Wallet");
443 QString label = tr(
"Wallet Name");
444 QString wallet_name = QInputDialog::getText(
this, title, label, QLineEdit::Normal,
"", &wallet_name_ok);
445 if (!wallet_name_ok || wallet_name.isEmpty())
return;
452 activity->restore(backup_file_path, wallet_name.toStdString());
469 #endif // ENABLE_WALLET 472 connect(
new QShortcut(QKeySequence(Qt::CTRL | Qt::SHIFT | Qt::Key_D),
this), &QShortcut::activated,
this, &
BitcoinGUI::showDebugWindow);
480 QMenu *file =
appMenuBar->addMenu(tr(
"&File"));
488 file->addSeparator();
491 file->addSeparator();
497 file->addSeparator();
501 QMenu *settings =
appMenuBar->addMenu(tr(
"&Settings"));
506 settings->addSeparator();
508 settings->addSeparator();
512 QMenu* window_menu =
appMenuBar->addMenu(tr(
"&Window"));
514 QAction* minimize_action = window_menu->addAction(tr(
"&Minimize"));
515 minimize_action->setShortcut(QKeySequence(tr(
"Ctrl+M")));
516 connect(minimize_action, &QAction::triggered, [] {
517 QApplication::activeWindow()->showMinimized();
519 connect(qApp, &QApplication::focusWindowChanged,
this, [minimize_action] (QWindow* window) {
520 minimize_action->setEnabled(window !=
nullptr && (window->flags() & Qt::Dialog) != Qt::Dialog && window->windowState() != Qt::WindowMinimized);
524 QAction* zoom_action = window_menu->addAction(tr(
"Zoom"));
525 connect(zoom_action, &QAction::triggered, [] {
526 QWindow* window = qApp->focusWindow();
527 if (window->windowState() != Qt::WindowMaximized) {
528 window->showMaximized();
530 window->showNormal();
534 connect(qApp, &QApplication::focusWindowChanged,
this, [zoom_action] (QWindow* window) {
535 zoom_action->setEnabled(window !=
nullptr);
541 window_menu->addSeparator();
542 QAction* main_window_action = window_menu->addAction(tr(
"Main Window"));
543 connect(main_window_action, &QAction::triggered, [
this] {
547 window_menu->addSeparator();
552 window_menu->addSeparator();
556 connect(tab_action, &QAction::triggered, [
this, tab_type] {
564 help->addSeparator();
573 QToolBar *toolbar = addToolBar(tr(
"Tabs toolbar"));
575 toolbar->setMovable(
false);
576 toolbar->setToolButtonStyle(Qt::ToolButtonTextBesideIcon);
584 QWidget *spacer =
new QWidget();
585 spacer->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
586 toolbar->addWidget(spacer);
590 connect(
m_wallet_selector, qOverload<int>(&QComboBox::currentIndexChanged),
this, &BitcoinGUI::setCurrentWalletBySelectorIndex);
643 #endif // ENABLE_WALLET 670 #endif // ENABLE_WALLET 678 void BitcoinGUI::enableHistoryAction(
bool privacy)
686 void BitcoinGUI::setWalletController(
WalletController* wallet_controller,
bool show_loading_minimized)
689 assert(wallet_controller);
700 connect(wallet_controller, &WalletController::destroyed,
this, [
this] {
706 activity->load(show_loading_minimized);
714 void BitcoinGUI::addWallet(
WalletModel* walletModel)
740 enableHistoryAction(privacy);
745 void BitcoinGUI::removeWallet(
WalletModel* walletModel)
766 void BitcoinGUI::setCurrentWallet(
WalletModel* wallet_model)
780 void BitcoinGUI::setCurrentWalletBySelectorIndex(
int index)
783 if (wallet_model) setCurrentWallet(wallet_model);
786 void BitcoinGUI::removeAllWallets()
793 #endif // ENABLE_WALLET 816 assert(QSystemTrayIcon::isSystemTrayAvailable());
819 if (QSystemTrayIcon::isSystemTrayAvailable()) {
834 QAction* show_hide_action{
nullptr};
841 QAction* send_action{
nullptr};
842 QAction* receive_action{
nullptr};
843 QAction* sign_action{
nullptr};
844 QAction* verify_action{
nullptr};
854 options_action->setMenuRole(QAction::PreferencesRole);
856 QAction* quit_action{
nullptr};
863 connect(
trayIcon, &QSystemTrayIcon::activated, [
this](QSystemTrayIcon::ActivationReason reason) {
864 if (reason == QSystemTrayIcon::Trigger) {
884 [
this, show_hide_action, send_action, receive_action, sign_action, verify_action, options_action, node_window_action, quit_action] {
887 if (show_hide_action) show_hide_action->setText(
891 if (QApplication::activeModalWidget()) {
893 a->setEnabled(
false);
896 if (show_hide_action) show_hide_action->setEnabled(
true);
905 if (quit_action) quit_action->setEnabled(
true);
942 void BitcoinGUI::openClicked()
951 void BitcoinGUI::gotoOverviewPage()
957 void BitcoinGUI::gotoHistoryPage()
963 void BitcoinGUI::gotoReceiveCoinsPage()
969 void BitcoinGUI::gotoSendCoinsPage(QString addr)
975 void BitcoinGUI::gotoSignMessageTab(QString addr)
980 void BitcoinGUI::gotoVerifyMessageTab(QString addr)
984 void BitcoinGUI::gotoLoadPSBT(
bool from_clipboard)
988 #endif // ENABLE_WALLET 997 case 0: icon =
":/icons/connect_0";
break;
998 case 1:
case 2:
case 3: icon =
":/icons/connect_1";
break;
999 case 4:
case 5:
case 6: icon =
":/icons/connect_2";
break;
1000 case 7:
case 8:
case 9: icon =
":/icons/connect_3";
break;
1001 default: icon =
":/icons/connect_4";
break;
1008 tooltip = tr(
"%n active connection(s) to Bitcoin network.",
"",
count);
1011 tooltip = tr(
"Network activity disabled.");
1012 icon =
":/icons/network_disabled";
1016 tooltip = QLatin1String(
"<nobr>") + tooltip + QLatin1String(
"<br>") +
1018 tr(
"Click for more actions.") + QLatin1String(
"</nobr>");
1035 tr(
"Show Peers tab"),
1043 tr(
"Disable network activity") :
1045 tr(
"Enable network activity"),
1055 progressBarLabel->setText(tr(
"Syncing Headers (%1%)…").arg(QString::number(100.0 / (headersTipHeight+estHeadersLeft)*headersTipHeight,
'f', 1)));
1062 progressBarLabel->setText(tr(
"Pre-syncing Headers (%1%)…").arg(QString::number(100.0 / (height+estHeadersLeft)*height,
'f', 1)));
1072 dlg->setCurrentTab(tab);
1083 m_app_nap_inhibitor->enableAppNap();
1085 m_app_nap_inhibitor->disableAppNap();
1100 statusBar()->clearMessage();
1104 switch (blockSource) {
1133 QDateTime currentDate = QDateTime::currentDateTime();
1134 qint64 secs = blockDate.secsTo(currentDate);
1136 tooltip = tr(
"Processed %n block(s) of transaction history.",
"",
count);
1140 tooltip = tr(
"Up to date") + QString(
".<br>") + tooltip;
1143 #ifdef ENABLE_WALLET 1149 #endif // ENABLE_WALLET 1159 progressBar->setFormat(tr(
"%1 behind").arg(timeBehindText));
1161 progressBar->setValue(nVerificationProgress * 1000000000.0 + 0.5);
1164 tooltip = tr(
"Catching up…") + QString(
"<br>") + tooltip;
1168 QString(
":/animation/spinner-%1").arg(
spinnerFrame, 3, 10, QChar(
'0')),
1174 #ifdef ENABLE_WALLET 1180 #endif // ENABLE_WALLET 1182 tooltip += QString(
"<br>");
1183 tooltip += tr(
"Last received block was generated %1 ago.").arg(timeBehindText);
1184 tooltip += QString(
"<br>");
1185 tooltip += tr(
"Transactions after this will not yet be visible.");
1189 tooltip = QString(
"<nobr>") + tooltip + QString(
"</nobr>");
1198 #ifdef ENABLE_WALLET 1201 message(tr(
"Error creating wallet"), tr(
"Cannot create new wallet, the software was compiled without sqlite support (required for descriptor wallets)"),
CClientUIInterface::MSG_ERROR);
1203 #endif // USE_SQLITE 1208 #endif // ENABLE_WALLET 1211 void BitcoinGUI::message(
const QString& title, QString message,
unsigned int style,
bool*
ret,
const QString& detailed_message)
1216 int nMBoxIcon = QMessageBox::Information;
1220 if (!title.isEmpty()) {
1225 msgType = tr(
"Error");
1229 msgType = tr(
"Warning");
1233 msgType = tr(
"Information");
1241 if (!msgType.isEmpty()) {
1242 strTitle +=
" - " + msgType;
1246 nMBoxIcon = QMessageBox::Critical;
1249 nMBoxIcon = QMessageBox::Warning;
1255 QMessageBox::StandardButton buttons;
1257 buttons = QMessageBox::Ok;
1260 QMessageBox mBox(static_cast<QMessageBox::Icon>(nMBoxIcon), strTitle,
message, buttons,
this);
1261 mBox.setTextFormat(Qt::PlainText);
1262 mBox.setDetailedText(detailed_message);
1263 int r = mBox.exec();
1265 *
ret = r == QMessageBox::Ok;
1273 if (e->type() == QEvent::PaletteChange) {
1280 QMainWindow::changeEvent(e);
1282 #ifndef Q_OS_MACOS // Ignored on Mac 1283 if(e->type() == QEvent::WindowStateChange)
1287 QWindowStateChangeEvent *wsevt =
static_cast<QWindowStateChangeEvent*
>(e);
1288 if(!(wsevt->oldState() & Qt::WindowMinimized) && isMinimized())
1290 QTimer::singleShot(0,
this, &BitcoinGUI::hide);
1293 else if((wsevt->oldState() & Qt::WindowMinimized) && !isMinimized())
1295 QTimer::singleShot(0,
this, &BitcoinGUI::show);
1305 #ifndef Q_OS_MACOS // Ignored on Mac 1317 QMainWindow::showMinimized();
1322 QMainWindow::closeEvent(event);
1334 #ifdef ENABLE_WALLET 1335 void BitcoinGUI::incomingTransaction(
const QString& date,
BitcoinUnit unit,
const CAmount& amount,
const QString& type,
const QString& address,
const QString& label,
const QString& walletName)
1338 QString
msg = tr(
"Date: %1\n").arg(date) +
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);
1348 message((amount)<0 ? tr(
"Sent transaction") : tr(
"Incoming transaction"),
1351 #endif // ENABLE_WALLET 1356 if(event->mimeData()->hasUrls())
1357 event->acceptProposedAction();
1362 if(event->mimeData()->hasUrls())
1364 for (
const QUrl &uri : event->mimeData()->urls())
1369 event->acceptProposedAction();
1375 if (event->type() == QEvent::StatusTip)
1381 return QMainWindow::eventFilter(
object, event);
1384 #ifdef ENABLE_WALLET 1391 gotoSendCoinsPage();
1397 void BitcoinGUI::setHDStatus(
bool privkeyDisabled,
int hdEnabled)
1400 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>"));
1404 void BitcoinGUI::setEncryptionStatus(
int status)
1439 void BitcoinGUI::updateWalletStatus()
1451 #endif // ENABLE_WALLET 1455 std::string ip_port;
1458 if (proxy_enabled) {
1460 QString ip_port_q = QString::fromStdString(ip_port);
1462 labelProxyIcon->setToolTip(tr(
"Proxy is <b>enabled</b>: %1").arg(ip_port_q));
1474 #ifdef ENABLE_WALLET 1477 if (wallet_model && !wallet_model->
getWalletName().isEmpty()) {
1485 setWindowTitle(window_title);
1517 if (nProgress == 0) {
1523 }
else if (nProgress == 100) {
1548 QString detailed_message;
1550 detailed_message = BitcoinGUI::tr(
"Original message:") +
"\n" + QString::fromStdString(message.
original);
1554 bool invoked = QMetaObject::invokeMethod(gui,
"message",
1556 Q_ARG(QString, QString::fromStdString(caption)),
1557 Q_ARG(QString, QString::fromStdString(message.
translated)),
1558 Q_ARG(
unsigned int, style),
1560 Q_ARG(QString, detailed_message));
1586 : m_platform_style{platformStyle}
1588 createContextMenu();
1589 setToolTip(tr(
"Unit to show amounts in. Click to select another unit."));
1592 const QFontMetrics fm(font());
1596 setMinimumSize(max_width, 0);
1597 setAlignment(Qt::AlignRight | Qt::AlignVCenter);
1598 setStyleSheet(QString(
"QLabel { color : %1 }").arg(m_platform_style->SingleColor().name()));
1609 if (e->type() == QEvent::PaletteChange) {
1611 if (style != styleSheet()) {
1612 setStyleSheet(style);
1616 QLabel::changeEvent(e);
1622 menu =
new QMenu(
this);
1653 QPoint globalPos = mapToGlobal(point);
1654 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)
void message(const QString &title, const QString &message, unsigned int style)
Fired when a message should be reported to the user.
static path PathFromString(const std::string &string)
Convert byte string to path object.
WalletModel * currentWalletModel() const
Predefined combinations for certain default usage cases.
static QList< Unit > availableUnits()
Get list of units, for drop-down box.
QAction * receiveCoinsAction
UnitDisplayStatusBarControl * unitDisplayControl
Local Bitcoin RPC console.
interfaces::Wallet & wallet() const
QAction * m_mask_values_action
QAction * signMessageAction
void setThemedPixmap(const QString &image_filename, int width, int height)
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.
QString getOpenFileName(QWidget *parent, const QString &caption, const QString &dir, const QString &filter, QString *selectedSuffixOut)
Get open filename, convenience wrapper for QFileDialog::getOpenFileName.
virtual bool getNetworkActive()=0
Get network active.
void updateNetworkState()
Update UI with latest network info from model.
void showNormalIfMinimized()
Show window if hidden, unminimize when minimized, rise when obscured or show if hidden and fToggleHid...
UnitDisplayStatusBarControl(const PlatformStyle *platformStyle)
void createWalletButtonClicked()
QProgressDialog * progressDialog
static bool isWalletEnabled()
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
void PopupMenu(QMenu *menu, const QPoint &point, QAction *at_action)
Call QMenu::popup() only on supported QT_QPA_PLATFORM.
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
void closeAllWallets(QWidget *parent=nullptr)
void setClientModel(ClientModel *model=nullptr, int bestblock_height=0, int64_t bestblock_date=0, double verification_progress=0.0)
ModalOverlay * modalOverlay
void createTrayIconMenu()
Create system tray menu (or setup the dock menu)
QAction * m_wallet_selector_action
QAction * m_migrate_wallet_action
void opened(WalletModel *wallet_model)
QAction * verifyMessageAction
void setPrivacy(bool privacy)
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
void triggered(bool hidden)
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)
Mask of all available buttons in CClientUIInterface::MessageBoxFlags This needs to be updated...
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 updateHeadersPresyncProgressLabel(int64_t height, const QDateTime &blockDate)
void setWalletActionsEnabled(bool enabled)
Enable or disable all wallet-related actions.
void networkActiveChanged(bool networkActive)
BitcoinUnit getDisplayUnit() const
void setClientModel(ClientModel *clientModel=nullptr, interfaces::BlockAndHeaderTipInfo *tip_info=nullptr)
Set the client model.
Controller between interfaces::Node, WalletModel instances and the GUI.
OptionsModel * getOptionsModel()
bool getShowTrayIcon() const
QMenu * m_open_wallet_menu
macOS-specific Dock icon handler.
void outOfSyncWarningClicked()
Notify that the out of sync warning icon has been pressed.
bool isLayerVisible() const
virtual bool isLegacy()=0
Return whether is a legacy wallet.
HelpMessageDialog * helpMessageDialog
QLabel * progressBarLabel
QSystemTrayIcon * trayIcon
QAction * showHelpMessageAction
void ShowModalDialogAsynchronously(QDialog *dialog)
Shows a QDialog instance asynchronously, and deletes it on close.
Notify user of potential problem.
Modal overlay to display information about the chain-sync state.
bool isPrivacyModeActivated() const
void changeEvent(QEvent *e) override
const QString & getTitleAddText() const
void changeEvent(QEvent *e) override
void numConnectionsChanged(int count)
void setNetworkActive(bool network_active)
Set network state shown in the UI.
Signals for UI communication.
GUIUtil::ClickableLabel * connectionsControl
QAction * backupWalletAction
QAction * m_load_psbt_clipboard_action
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
static QString formatWithUnit(Unit unit, const CAmount &amount, bool plussign=false, SeparatorStyle separators=SeparatorStyle::STANDARD)
Format as string (with unit)
Force blocking, modal message box dialog (not just OS notification)
void openOptionsDialogWithTab(OptionsDialog::Tab tab)
Open the OptionsDialog on the specified tab index.
EncryptionStatus getEncryptionStatus() const
virtual std::unique_ptr< Handler > handleMessageBox(MessageBoxFn fn)=0
void showOutOfSyncWarning(bool fShow)
void gotoHistoryPage()
Switch to history (transactions) page.
QAction * usedReceivingAddressesAction
int64_t CAmount
Amount in satoshis (Can be negative)
const NetworkStyle *const m_network_style
WalletController * m_wallet_controller
void gotoOverviewPage()
Switch to overview (home) page.
BlockSource getBlockSource() const
Returns the block source of the current importing/syncing state.
const PlatformStyle * platformStyle
void displayUnitChanged(BitcoinUnit unit)
virtual bool hdEnabled()=0
void showProgress(const QString &title, int nProgress)
Show progress dialog e.g.
static MacDockIconHandler * instance()
void setClientModel(ClientModel *clientModel)
bool isObscured(QWidget *w)
QAction * m_wallet_selector_label_action
int getNumConnections(unsigned int flags=CONNECTIONS_ALL) const
Return number of connections, default is in- and outbound (total)
OptionsModel * optionsModel
void created(WalletModel *wallet_model)
QLabel * m_wallet_selector_label
void optionsClicked()
Show configuration dialog.
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 closeWallet(WalletModel *wallet_model, QWidget *parent=nullptr)
void gotoVerifyMessageTab(QString addr="")
Show Sign/Verify Message dialog and switch to verify message tab.
void incomingTransaction(const QString &date, BitcoinUnit unit, const CAmount &amount, const QString &type, const QString &address, const QString &label, const QString &walletName)
Notify that a new transaction appeared.
bool HasPixmap(const QLabel *label)
Returns true if pixmap has been set.
void handleCloseWindowShortcut(QWidget *w)
void notify(Class cls, const QString &title, const QString &text, const QIcon &icon=QIcon(), int millisTimeout=10000)
Show notification message.
WalletFrame * walletFrame
WalletView * currentWalletView() const
QAction * usedSendingAddressesAction
void setTabFocus(enum TabTypes tabType)
set which tab has the focus (is visible)
int64_t nPowTargetSpacing
BitcoinGUI(interfaces::Node &node, const PlatformStyle *platformStyle, const NetworkStyle *networkStyle, QWidget *parent=nullptr)
void updateDisplayUnit(BitcoinUnit newUnits)
When Display Units are changed on OptionsModel it will refresh the display text of the control on the...
void message(const QString &title, const QString &message, unsigned int style)
Fired when a message should be reported to the user.
void numBlocksChanged(int count, const QDateTime &blockDate, double nVerificationProgress, SyncType header, SynchronizationState sync_state)
QVariant getOption(OptionID option, const std::string &suffix="") const
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.html#connect-3), that guaranties that all exceptions are handled within the slot.
QAction * openRPCConsoleAction
QAction * m_close_all_wallets_action
std::vector< TabTypes > tabs() const
void detectShutdown()
called by a timer to check if shutdown has been requested
void migrated(WalletModel *wallet_model)
Cross-platform desktop notification client.
void clicked(const QPoint &point)
Emitted when the label is clicked.
Block and header tip information.
void setKnownBestHeight(int count, const QDateTime &blockDate, bool presync)
GUIUtil::ClickableLabel * labelBlocksIcon
GUIUtil::ClickableProgressBar * progressBar
void showHelpMessageClicked()
Show help message dialog.
QString getWalletName() const
void walletAdded(WalletModel *wallet_model)
void message(const QString &title, const QString &message, unsigned int style)
Notificator * notificator
void PolishProgressDialog(QProgressDialog *dialog)
void changePassphrase()
Change encrypted wallet passphrase.
Model for Bitcoin network client.
void restored(WalletModel *wallet_model)
const QIcon & getTrayAndWindowIcon() const
void mousePressEvent(QMouseEvent *event) override
So that it responds to left-button clicks.
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.
virtual std::vector< std::unique_ptr< Wallet > > getWallets()=0
Return interfaces for accessing wallets (if any).
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 encryptionStatusChanged()
Encryption status of wallet changed.
double verification_progress
bool getMinimizeOnClose() const
void updateProxyIcon()
Set the proxy-enabled icon as shown in the UI.
QAction * changePassphraseAction
void gotoSendCoinsPage(QString addr="")
Switch to send coins page.
virtual std::unique_ptr< Handler > handleQuestion(QuestionFn fn)=0
void encryptWallet()
Encrypt the wallet.
void gotoReceiveCoinsPage()
Switch to receive coins page.
const std::unique_ptr< QMenu > trayIconMenu
QMenu * m_network_context_menu
void setPrivacy(bool privacy)
Interface from Qt to configuration data structure for Bitcoin client.
std::unique_ptr< interfaces::Handler > m_handler_question
const CChainParams & Params()
Return the currently selected parameters.
bool getMinimizeToTray() const
Interface to Bitcoin wallet from Qt view code.
virtual WalletLoader & walletLoader()=0
Get wallet loader.
QAction * m_restore_wallet_action
bool eventFilter(QObject *object, QEvent *event) override
WalletModel * getWalletModel() const noexcept
int prevBlocks
Keep track of previous number of blocks, to detect progress.
void toggleHidden()
Simply calls showNormalIfMinimized(true)
interfaces::Node & m_node
void walletRemoved(WalletModel *wallet_model)
GUIUtil::ThemedLabel * labelWalletEncryptionIcon
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
bool addView(WalletView *walletView)
void clicked(const QPoint &point)
Emitted when the progressbar is clicked.
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
const PlatformStyle * m_platform_style
void createWallet()
Launch the wallet creation modal (no-op if wallet is not compiled)
void removeWallet(WalletModel *wallet_model)
int getHeaderTipHeight() const
void updateHeadersSyncProgressLabel()
void gotoLoadPSBT(bool from_clipboard=false)
Load Partially Signed Bitcoin Transaction.
int64_t GetTime()
DEPRECATED, see GetTime.
static const std::string DEFAULT_UIPLATFORM
static QString longName(Unit unit)
Long name.
virtual void setNetworkActive(bool active)=0
Set network active.
int64_t getHeaderTipTime() const
GUIUtil::ThemedLabel * labelWalletHDStatusIcon
Top-level interface for a bitcoin node (bitcoind process).
void transactionClicked()
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.
void setDisplayUnit(const QVariant &new_unit)
Updates current unit in memory, settings and emits displayUnitChanged(new_unit) signal.
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
void showTrayIconChanged(bool)
void dragEnterEvent(QDragEnterEvent *event) override
bool getProxyInfo(std::string &ip_port) const