Dash Core Source Documentation (0.16.0.1)
Find detailed information regarding the Dash Core source code.
•All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
bitcoingui.cpp
Go to the documentation of this file.
245 progressBar->setStyleSheet("QProgressBar { background-color: #F8F8F8; 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 #00CCFF, stop: 1 #33CCFF); border-radius: 7px; margin: 0px; }");
311 QPixmap&& frame = getIcon(strFrame, GUIUtil::ThemedColor::ORANGE, MOVIES_PATH).pixmap(STATUSBAR_ICONSIZE, STATUSBAR_ICONSIZE);
369 labelConnectionsIcon->setPixmap(GUIUtil::getIcon(strImage, color).pixmap(STATUSBAR_ICONSIZE, STATUSBAR_ICONSIZE));
458 connect(privateSendCoinsMenuAction, SIGNAL(triggered()), this, SLOT(gotoPrivateSendCoinsPage()));
472 connect(tabGroup, SIGNAL(buttonToggled(QAbstractButton *, bool)), this, SLOT(highlightTabButton(QAbstractButton *, bool)));
504 signMessageAction->setStatusTip(tr("Sign messages with your Dash addresses to prove you own them"));
506 verifyMessageAction->setStatusTip(tr("Verify messages to ensure they were signed with specified Dash addresses"));
520 // override TextHeuristicRole set by default which confuses this action with application settings
532 usedSendingAddressesAction->setStatusTip(tr("Show the list of used sending addresses and labels"));
534 usedReceivingAddressesAction->setStatusTip(tr("Show the list of used receiving addresses and labels"));
541 showHelpMessageAction->setStatusTip(tr("Show the %1 help message to get a list with possible Dash command-line options").arg(tr(PACKAGE_NAME)));
553 connect(showPrivateSendHelpAction, SIGNAL(triggered()), this, SLOT(showPrivateSendHelpClicked()));
567 connect(rpcConsole, SIGNAL(handleRestart(QStringList)), this, SLOT(handleRestart(QStringList)));
584 connect(usedSendingAddressesAction, SIGNAL(triggered()), walletFrame, SLOT(usedSendingAddresses()));
585 connect(usedReceivingAddressesAction, SIGNAL(triggered()), walletFrame, SLOT(usedReceivingAddresses()));
710 // Create system tray menu (or setup the dock menu) that late to prevent users from calling actions,
742 modalOverlay->setKnownBestHeight(_clientModel->getHeaderTipHeight(), QDateTime::fromTime_t(_clientModel->getHeaderTipTime()));
743 setNumBlocks(_clientModel->getNumBlocks(), _clientModel->getLastBlockDate(), _clientModel->getLastBlockHash(), _clientModel->getVerificationProgress(nullptr), false);
744 connect(_clientModel, SIGNAL(numBlocksChanged(int,QDateTime,QString,double,bool)), this, SLOT(setNumBlocks(int,QDateTime,QString,double,bool)));
746 connect(_clientModel, SIGNAL(additionalDataSyncProgressChanged(double)), this, SLOT(setAdditionalDataSyncProgress(double)));
749 connect(_clientModel, SIGNAL(message(QString,QString,unsigned int)), this, SLOT(message(QString,QString,unsigned int)));
752 connect(_clientModel, SIGNAL(showProgress(QString,int)), this, SLOT(showProgress(QString,int)));
772 connect(optionsModel, SIGNAL(privateSendEnabledChanged()), this, SLOT(updatePrivateSendVisibility()));
861 QString toolTip = tr("%1 client").arg(tr(PACKAGE_NAME)) + " " + networkStyle->getTitleAddText();
1007 GUIUtil::setFont({button}, checked ? GUIUtil::FontWeight::Bold : GUIUtil::FontWeight::Normal, 16);
1081 bool fNetworkBecameActive = (!fNetworkActivePrev && fNetworkActive) || (nCountPrev == 0 && count > 0);
1082 bool fNetworkBecameInactive = (fNetworkActivePrev && !fNetworkActive) || (nCountPrev > 0 && count == 0);
1100 setNumBlocks(clientModel->getNumBlocks(), clientModel->getLastBlockDate(), clientModel->getLastBlockHash(), clientModel->getVerificationProgress(nullptr), false);
1119 labelConnectionsIcon->setPixmap(GUIUtil::getIcon(icon, color).pixmap(STATUSBAR_ICONSIZE, STATUSBAR_ICONSIZE));
1139 progressBarLabel->setText(tr("Syncing Headers (%1%)...").arg(QString::number(100.0 / (headersTipHeight+estHeadersLeft)*headersTipHeight, 'f', 1)));
1147 // Show the progress bar label if the network is active + we are out of sync or we have no connections.
1148 bool fShowProgressBarLabel = clientModel->getNetworkActive() && (!masternodeSync.IsSynced() || clientModel->getNumConnections() == 0);
1149 // Show the progress bar only if the the network active + we are not synced + we have any connection. Unlike with the label
1150 // which gives an info text about the connecting phase there is no reason to show the progress bar if we don't have connections
1152 bool fShowProgressBar = clientModel->getNetworkActive() && !masternodeSync.IsSynced() && clientModel->getNumConnections() > 0;
1166 qobject_cast<QToolBar*>(centralWidget()->layout()->itemAt(0)->widget())->actions()[2]->setVisible(fEnabled);
1185 // Add 30 per button as padding and use minimum 980 which is the minimum required to show all tab's contents
1201 if (qobject_cast<QToolBar*>(centralWidget()->layout()->itemAt(0)->widget())->actions()[i]->isVisible()) {
1209 void BitcoinGUI::setNumBlocks(int count, const QDateTime& blockDate, const QString& blockHash, double nVerificationProgress, bool header)
1236 // Prevent orphan statusbar messages (e.g. hover Quit in main menu, wait until chain-sync starts -> garbled text)
1282 // TODO instead of hiding it forever, we should add meaningful information about MN sync to the overlay
1330 // If masternodeSync.Reset() has been called make sure status bar shows the correct information.
1332 setNumBlocks(clientModel->getNumBlocks(), clientModel->getLastBlockDate(), clientModel->getLastBlockHash(), clientModel->getVerificationProgress(nullptr), false);
1340 // No additional data sync should be happening while blockchain is not synced, nothing to update
1344 // Prevent orphan statusbar messages (e.g. hover Quit in main menu, wait until chain-sync starts -> garbelled text)
1362 labelBlocksIcon->setPixmap(GUIUtil::getIcon("synced", GUIUtil::ThemedColor::GREEN).pixmap(STATUSBAR_ICONSIZE, STATUSBAR_ICONSIZE));
1381 void BitcoinGUI::message(const QString &title, const QString &message, unsigned int style, bool *ret)
1447 if(clientModel && clientModel->getOptionsModel() && clientModel->getOptionsModel()->getMinimizeToTray())
1469 labelBlocksIcon->setPixmap(GUIUtil::getIcon("synced", GUIUtil::ThemedColor::GREEN).pixmap(STATUSBAR_ICONSIZE, STATUSBAR_ICONSIZE));
1514 void BitcoinGUI::incomingTransaction(const QString& date, int unit, const CAmount& amount, const QString& type, const QString& address, const QString& label)
1522 // first TX since we last showed pending messages, let's wait 100ms and then show each individual message
1525 // we seem to have received 10 TXs in 100ms and we can expect even more, so let's pause for 1 sec and
1575 msg += tr("Received Amount: %1\n").arg(BitcoinUnits::formatWithUnit(unit, receivedAmount, true));
1620 // Prevent adding text from setStatusTip(), if we currently use the status bar for displaying other stuff
1643 labelWalletHDStatusIcon->setPixmap(GUIUtil::getIcon("hd_enabled", GUIUtil::ThemedColor::GREEN).pixmap(STATUSBAR_ICONSIZE, STATUSBAR_ICONSIZE));
1655 labelWalletEncryptionIcon->setPixmap(GUIUtil::getIcon("lock_open", GUIUtil::ThemedColor::RED).pixmap(STATUSBAR_ICONSIZE, STATUSBAR_ICONSIZE));
1665 labelWalletEncryptionIcon->setPixmap(GUIUtil::getIcon("lock_open", GUIUtil::ThemedColor::RED).pixmap(STATUSBAR_ICONSIZE, STATUSBAR_ICONSIZE));
1666 labelWalletEncryptionIcon->setToolTip(tr("Wallet is <b>encrypted</b> and currently <b>unlocked</b>"));
1675 labelWalletEncryptionIcon->setPixmap(GUIUtil::getIcon("lock_open", GUIUtil::ThemedColor::ORANGE).pixmap(STATUSBAR_ICONSIZE, STATUSBAR_ICONSIZE));
1676 labelWalletEncryptionIcon->setToolTip(tr("Wallet is <b>encrypted</b> and currently <b>unlocked</b> for mixing only"));
1685 labelWalletEncryptionIcon->setPixmap(GUIUtil::getIcon("lock_closed", GUIUtil::ThemedColor::GREEN).pixmap(STATUSBAR_ICONSIZE, STATUSBAR_ICONSIZE));
1686 labelWalletEncryptionIcon->setToolTip(tr("Wallet is <b>encrypted</b> and currently <b>locked</b>"));
1775 static bool ThreadSafeMessageBox(BitcoinGUI *gui, const std::string& message, const std::string& caption, unsigned int style)
1802 uiInterface.ThreadSafeMessageBox.disconnect(boost::bind(ThreadSafeMessageBox, this, _1, _2, _3));
1803 uiInterface.ThreadSafeQuestion.disconnect(boost::bind(ThreadSafeMessageBox, this, _1, _3, _4));
void unsubscribeFromCoreSignals()
Disconnect core signals from GUI client.
Definition: bitcoingui.cpp:1799
bool handlePaymentRequest(const SendCoinsRecipient &recipient)
Definition: walletframe.cpp:95
bool setCurrentWallet(const QString &name)
Definition: walletframe.cpp:65
Definition: clientmodel.h:31
void setNetworkActive(bool networkActive)
Set network state shown in the UI.
Definition: bitcoingui.cpp:1128
Definition: walletview.h:35
UnitDisplayStatusBarControl * unitDisplayControl
Definition: bitcoingui.h:91
static const QString DEFAULT_WALLET
Display name for default wallet name.
Definition: bitcoingui.h:54
void message(const QString &title, const QString &message, unsigned int style, bool *ret=nullptr)
Notify the user of an event from the core network or transaction handling code.
Definition: bitcoingui.cpp:1381
void receivedURI(const QString &uri)
Signal raised when a URI was entered or dragged to the GUI.
void appearanceChanged()
bool getNetworkActive() const
Return true if network activity in core is enabled.
Definition: clientmodel.cpp:242
void updateNetworkState()
Update UI with latest network info from model.
Definition: bitcoingui.cpp:1061
void showNormalIfMinimized(bool fToggleHidden=false)
Show window if hidden, unminimize when minimized, rise when obscured or show if hidden and fToggleHid...
Definition: bitcoingui.cpp:1711
Definition: clientmodel.h:29
void mousePressEvent(QMouseEvent *event)
So that it responds to left-button clicks.
Definition: bitcoingui.cpp:1838
Definition: rpcconsole.h:59
void setAdditionalDataSyncProgress(double nSyncProgress)
Set additional data sync status shown in the UI.
Definition: bitcoingui.cpp:1325
void setFont(const std::vector< QWidget *> &vecWidgets, FontWeight weight, int nPointSize, bool fItalic)
Workaround to set correct font styles in all themes since there is a bug in macOS which leads to issu...
Definition: guiutil.cpp:1552
Definition: utilitydialog.h:26
Definition: rpcconsole.h:56
Definition: bitcoingui.h:329
static bool ThreadSafeMessageBox(BitcoinGUI *gui, const std::string &message, const std::string &caption, unsigned int style)
Definition: bitcoingui.cpp:1775
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...
Definition: modaloverlay.h:12
void tipUpdate(int count, const QDateTime &blockDate, double nVerificationProgress)
Definition: modaloverlay.cpp:91
Qt::ConnectionType blockingGUIThreadConnection()
Get connection type to call object slot in GUI thread with invokeMethod.
Definition: guiutil.cpp:606
void setWalletActionsEnabled(bool enabled)
Enable or disable all wallet-related actions.
Definition: bitcoingui.cpp:829
Definition: guiutil.h:393
Mask of all available buttons in CClientUIInterface::MessageBoxFlags This needs to be updated...
Definition: ui_interface.h:60
Modal overlay to display information about the chain-sync state.
Definition: modaloverlay.h:19
void setOptionsModel(OptionsModel *optionsModel)
Lets the control know about the Options Model (and its signals)
Definition: bitcoingui.cpp:1857
Definition: macos_appnap.h:10
void handleRestart(QStringList args)
Get restart command-line parameters and request restart.
Definition: bitcoingui.cpp:1814
EncryptionStatus getEncryptionStatus() const
Definition: walletmodel.cpp:479
Force blocking, modal message box dialog (not just OS notification)
Definition: ui_interface.h:64
void showOutOfSyncWarning(bool fShow)
Definition: walletframe.cpp:104
QAction * usedReceivingAddressesAction
Definition: bitcoingui.h:110
Definition: utilitydialog.h:24
Definition: utilitydialog.h:25
void showInfo()
Show debug window and set focus to the appropriate tab.
Definition: bitcoingui.cpp:941
void updateFonts()
Update the font of all widgets where a custom font has been set with GUIUtil::setFont.
Definition: guiutil.cpp:1563
QTimer * timerConnecting
Timer to update the connection icon during connecting phase.
Definition: bitcoingui.h:156
void startSpinner()
Start the spinner animation in the status bar if it's not running and if labelBlocksIcon is visible...
Definition: bitcoingui.cpp:301
void showProgress(const QString &title, int nProgress)
Show progress dialog e.g.
Definition: bitcoingui.cpp:1738
static MacDockIconHandler * instance()
Definition: macdockiconhandler.mm:37
void setDisplayUnit(const QVariant &value)
Updates current unit in memory, settings and emits displayUnitChanged(newUnit) signal.
Definition: optionsmodel.cpp:624
void setClientModel(ClientModel *clientModel)
Definition: walletframe.cpp:36
Definition: ui_interface.h:71
int getNumConnections(unsigned int flags=CONNECTIONS_ALL) const
Return number of connections, default is in- and outbound (total)
Definition: clientmodel.cpp:62
double getVerificationProgress(const CBlockIndex *tip) const
Definition: clientmodel.cpp:184
enum BlockSource getBlockSource() const
Returns enum BlockSource of the current importing/syncing state.
Definition: clientmodel.cpp:223
void setKnownBestHeight(int count, const QDateTime &blockDate)
Definition: modaloverlay.cpp:83
void gotoVerifyMessageTab(QString addr="")
Show Sign/Verify Message dialog and switch to verify message tab.
Definition: walletframe.cpp:162
void notify(Class cls, const QString &title, const QString &text, const QIcon &icon=QIcon(), int millisTimeout=10000)
Show notification message.
Definition: notificator.cpp:234
bool eventFilter(QObject *object, QEvent *event)
Definition: bitcoingui.cpp:1615
bool addWallet(const QString &name, WalletModel *walletModel)
Definition: walletframe.cpp:41
boost::signals2::signal< bool(const std::string &message, const std::string &noninteractive_message, const std::string &caption, unsigned int style), boost::signals2::last_value< bool > > ThreadSafeQuestion
If possible, ask the user a question.
Definition: ui_interface.h:79
void updateDisplayUnit(int newUnits)
When Display Units are changed on OptionsModel it will refresh the display text of the control on the...
Definition: bitcoingui.cpp:1872
QAction * usedSendingAddressesAction
Definition: bitcoingui.h:109
void setTabFocus(enum TabTypes tabType)
set which tab has the focus (is visible)
Definition: rpcconsole.cpp:1353
void createIconMenu(QMenu *pmenu)
Create system tray menu (or setup the dock menu)
Definition: bitcoingui.cpp:868
Definition: walletmodel.h:39
UnitDisplayStatusBarControl()
Definition: bitcoingui.cpp:1820
void setTrayIconVisible(bool)
When hideTrayIcon setting is changed in OptionsModel hide or show the icon accordingly.
Definition: bitcoingui.cpp:1761
QIcon getIcon(const QString &strIcon, const ThemedColor color, const ThemedColor colorAlternative, const QString &strIconPath)
Helper to get an icon colorized with the given color (replaces black) and colorAlternative (replaces ...
Definition: guiutil.cpp:216
void gotoPrivateSendCoinsPage(QString addr="")
Switch to PrivateSend coins page.
Definition: walletframe.cpp:147
void detectShutdown()
called by a timer to check if fRequestShutdown has been set
Definition: bitcoingui.cpp:1728
void dragEnterEvent(QDragEnterEvent *event)
Definition: bitcoingui.cpp:1596
Definition: ui_interface.h:72
void updateProgressBarVisibility()
Definition: bitcoingui.cpp:1142
Definition: clientmodel.h:28
BitcoinGUI(const NetworkStyle *networkStyle, QWidget *parent=0)
Definition: bitcoingui.cpp:83
const QIcon & getTrayAndWindowIcon() const
Definition: networkstyle.h:23
void gotoSignMessageTab(QString addr="")
Show Sign/Verify Message dialog and switch to sign message tab.
Definition: walletframe.cpp:155
bool fEnablePrivateSend
Definition: privatesend-client.h:213
void showHide(bool hide=false, bool userRequested=false)
Definition: modaloverlay.cpp:165
Definition: rpcconsole.h:57
Definition: ui_interface.h:36
void showPrivateSendHelpClicked()
Show PrivateSend help message dialog.
Definition: bitcoingui.cpp:986
static QList< Unit > availableUnits()
Get list of units, for drop-down box.
Definition: bitcoinunits.cpp:19
void trayIconActivated(QSystemTrayIcon::ActivationReason reason)
Handle tray icon clicked.
Definition: bitcoingui.cpp:896
void showBackups()
Show folder with wallet backups in default file browser.
Definition: bitcoingui.cpp:976
Interface from Qt to configuration data structure for Bitcoin client.
Definition: optionsmodel.h:25
const CChainParams & Params()
Return the currently selected parameters.
Definition: chainparams.cpp:947
void setNumBlocks(int count, const QDateTime &blockDate, const QString &blockHash, double nVerificationProgress, bool headers)
Set number of blocks and last block date shown in the UI.
Definition: bitcoingui.cpp:1209
std::string GetArg(const std::string &strArg, const std::string &strDefault) const
Return string argument or default value.
Definition: util.cpp:808
Definition: walletmodel.h:124
Definition: rpcconsole.h:58
Definition: clientmodel.h:30
void toggleHidden()
Simply calls showNormalIfMinimized(true) for use in SLOT() macro.
Definition: bitcoingui.cpp:1723
Definition: rpcconsole.h:60
Definition: networkstyle.h:14
boost::signals2::signal< bool(const std::string &message, const std::string &caption, unsigned int style), boost::signals2::last_value< bool > > ThreadSafeMessageBox
Show message box.
Definition: ui_interface.h:76
void setNumConnections(int count)
Set number of connections shown in the UI.
Definition: bitcoingui.cpp:1123
Definition: walletmodel.h:127
void setNetworkActive(bool active)
Toggle network activity state in core.
Definition: clientmodel.cpp:235
static QString formatWithUnit(int unit, const CAmount &amount, bool plussign=false, SeparatorStyle separators=separatorStandard)
Format as string (with unit)
Definition: bitcoinunits.cpp:162
void createContextMenu()
Creates context menu, its actions, and wires up all the relevant signals for mouse events...
Definition: bitcoingui.cpp:1844
QAction * showPrivateSendHelpAction
Definition: bitcoingui.h:133
const Consensus::Params & GetConsensus() const
Definition: chainparams.h:54
void updateHeadersSyncProgressLabel()
Definition: bitcoingui.cpp:1133
static const std::string DEFAULT_UIPLATFORM
Definition: bitcoingui.h:55
Definition: walletmodel.h:125
A container for embedding all wallet-related controls into BitcoinGUI.
Definition: walletframe.h:28
void onDisplayUnitsClicked(const QPoint &point)
Shows context menu with Display Unit options by the mouse coordinates.
Definition: bitcoingui.cpp:1878
QAction * privateSendCoinsMenuAction
Definition: bitcoingui.h:108
void updatePrivateSendVisibility()
Definition: bitcoingui.cpp:1157
QTimer * timerSpinner
Timer to update the spinner animation in the status bar periodically.
Definition: bitcoingui.h:149
void createTrayIcon(const NetworkStyle *networkStyle)
Create system tray icon and notification.
Definition: bitcoingui.cpp:858
void onMenuSelection(QAction *action)
Tells underlying optionsModel to update its current display unit.
Definition: bitcoingui.cpp:1885
Definition: openuridialog.h:14
Predefined combinations for certain default usage cases.
Definition: ui_interface.h:70
bool fPrivateSendRunning
Definition: privatesend-client.h:214
std::list< IncomingTransactionMessage > incomingTransactions
Definition: bitcoingui.h:170