Bitcoin Core  0.15.99
P2P Digital Currency
Public Slots | Signals | Public Member Functions | Public Attributes | Static Public Attributes | Protected Member Functions | Private Member Functions | Private Attributes | List of all members
BitcoinGUI Class Reference

Bitcoin GUI main class. More...

#include <bitcoingui.h>

Inheritance diagram for BitcoinGUI:
[legend]
Collaboration diagram for BitcoinGUI:
[legend]

Public Slots

void setNumConnections (int count)
 Set number of connections shown in the UI. More...
 
void setNetworkActive (bool networkActive)
 Set network state shown in the UI. More...
 
void setNumBlocks (int count, const QDateTime &blockDate, double nVerificationProgress, bool headers)
 Set number of blocks and last block date shown in the UI. More...
 
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. More...
 
void optionsClicked ()
 Show configuration dialog. More...
 
void aboutClicked ()
 Show about dialog. More...
 
void showDebugWindow ()
 Show debug window. More...
 
void showDebugWindowActivateConsole ()
 Show debug window and set focus to the console. More...
 
void showHelpMessageClicked ()
 Show help message dialog. More...
 
void trayIconActivated (QSystemTrayIcon::ActivationReason reason)
 Handle tray icon clicked. More...
 
void showNormalIfMinimized ()
 Show window if hidden, unminimize when minimized, rise when obscured or show if hidden and fToggleHidden is true. More...
 
void showNormalIfMinimized (bool fToggleHidden)
 
void toggleHidden ()
 Simply calls showNormalIfMinimized(true) for use in SLOT() macro. More...
 
void detectShutdown ()
 called by a timer to check if ShutdownRequested() has been set More...
 
void showProgress (const QString &title, int nProgress)
 Show progress dialog e.g. More...
 
void setTrayIconVisible (bool)
 When hideTrayIcon setting is changed in OptionsModel hide or show the icon accordingly. More...
 
void showModalOverlay ()
 

Signals

void receivedURI (const QString &uri)
 Signal raised when a URI was entered or dragged to the GUI. More...
 

Public Member Functions

 BitcoinGUI (interfaces::Node &node, const PlatformStyle *platformStyle, const NetworkStyle *networkStyle, QWidget *parent=0)
 
 ~BitcoinGUI ()
 
void setClientModel (ClientModel *clientModel)
 Set the client model. More...
 

Public Attributes

bool enableWallet = false
 

Static Public Attributes

static const std::string DEFAULT_UIPLATFORM
 

Protected Member Functions

void changeEvent (QEvent *e)
 
void closeEvent (QCloseEvent *event)
 
void showEvent (QShowEvent *event)
 
void dragEnterEvent (QDragEnterEvent *event)
 
void dropEvent (QDropEvent *event)
 
bool eventFilter (QObject *object, QEvent *event)
 

Private Member Functions

void createActions ()
 Create the main UI actions. More...
 
void createMenuBar ()
 Create the menu bar and sub-menus. More...
 
void createToolBars ()
 Create the toolbars. More...
 
void createTrayIcon (const NetworkStyle *networkStyle)
 Create system tray icon and notification. More...
 
void createTrayIconMenu ()
 Create system tray menu (or setup the dock menu) More...
 
void setWalletActionsEnabled (bool enabled)
 Enable or disable all wallet-related actions. More...
 
void subscribeToCoreSignals ()
 Connect core signals to GUI client. More...
 
void unsubscribeFromCoreSignals ()
 Disconnect core signals from GUI client. More...
 
void updateNetworkState ()
 Update UI with latest network info from model. More...
 
void updateHeadersSyncProgressLabel ()
 
void openOptionsDialogWithTab (OptionsDialog::Tab tab)
 Open the OptionsDialog on the specified tab index. More...
 
void updateProxyIcon ()
 Set the proxy-enabled icon as shown in the UI. More...
 

Private Attributes

interfaces::Nodem_node
 
std::unique_ptr< interfaces::Handlerm_handler_message_box
 
std::unique_ptr< interfaces::Handlerm_handler_question
 
ClientModelclientModel = nullptr
 
WalletFramewalletFrame = nullptr
 
UnitDisplayStatusBarControlunitDisplayControl = nullptr
 
QLabel * labelWalletEncryptionIcon = nullptr
 
QLabel * labelWalletHDStatusIcon = nullptr
 
GUIUtil::ClickableLabellabelProxyIcon = nullptr
 
GUIUtil::ClickableLabelconnectionsControl = nullptr
 
GUIUtil::ClickableLabellabelBlocksIcon = nullptr
 
QLabel * progressBarLabel = nullptr
 
GUIUtil::ClickableProgressBarprogressBar = nullptr
 
QProgressDialog * progressDialog = nullptr
 
QMenuBar * appMenuBar = nullptr
 
QToolBar * appToolBar = nullptr
 
QAction * overviewAction = nullptr
 
QAction * historyAction = nullptr
 
QAction * quitAction = nullptr
 
QAction * sendCoinsAction = nullptr
 
QAction * sendCoinsMenuAction = nullptr
 
QAction * usedSendingAddressesAction = nullptr
 
QAction * usedReceivingAddressesAction = nullptr
 
QAction * signMessageAction = nullptr
 
QAction * verifyMessageAction = nullptr
 
QAction * aboutAction = nullptr
 
QAction * receiveCoinsAction = nullptr
 
QAction * receiveCoinsMenuAction = nullptr
 
QAction * optionsAction = nullptr
 
QAction * toggleHideAction = nullptr
 
QAction * encryptWalletAction = nullptr
 
QAction * backupWalletAction = nullptr
 
QAction * changePassphraseAction = nullptr
 
QAction * aboutQtAction = nullptr
 
QAction * openRPCConsoleAction = nullptr
 
QAction * openAction = nullptr
 
QAction * showHelpMessageAction = nullptr
 
QAction * m_wallet_selector_label_action = nullptr
 
QAction * m_wallet_selector_action = nullptr
 
QLabel * m_wallet_selector_label = nullptr
 
QComboBox * m_wallet_selector = nullptr
 
QSystemTrayIcon * trayIcon = nullptr
 
QMenu * trayIconMenu = nullptr
 
Notificatornotificator = nullptr
 
RPCConsolerpcConsole = nullptr
 
HelpMessageDialoghelpMessageDialog = nullptr
 
ModalOverlaymodalOverlay = nullptr
 
int prevBlocks = 0
 Keep track of previous number of blocks, to detect progress. More...
 
int spinnerFrame = 0
 
const PlatformStyleplatformStyle
 

Detailed Description

Bitcoin GUI main class.

This class represents the main window of the Bitcoin UI. It communicates with both the client and wallet models to give the user an up-to-date view of the current core state.

Definition at line 59 of file bitcoingui.h.

Constructor & Destructor Documentation

◆ BitcoinGUI()

BitcoinGUI::BitcoinGUI ( interfaces::Node node,
const PlatformStyle platformStyle,
const NetworkStyle networkStyle,
QWidget *  parent = 0 
)
explicit

Definition at line 73 of file bitcoingui.cpp.

Here is the call graph for this function:

◆ ~BitcoinGUI()

BitcoinGUI::~BitcoinGUI ( )

Definition at line 216 of file bitcoingui.cpp.

Here is the call graph for this function:

Member Function Documentation

◆ aboutClicked

void BitcoinGUI::aboutClicked ( )
slot

Show about dialog.

Definition at line 655 of file bitcoingui.cpp.

Here is the caller graph for this function:

◆ changeEvent()

void BitcoinGUI::changeEvent ( QEvent *  e)
protected

Definition at line 957 of file bitcoingui.cpp.

Here is the call graph for this function:

◆ closeEvent()

void BitcoinGUI::closeEvent ( QCloseEvent *  event)
protected

Definition at line 981 of file bitcoingui.cpp.

Here is the call graph for this function:

◆ createActions()

void BitcoinGUI::createActions ( )
private

Create the main UI actions.

Definition at line 233 of file bitcoingui.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ createMenuBar()

void BitcoinGUI::createMenuBar ( )
private

Create the menu bar and sub-menus.

Definition at line 365 of file bitcoingui.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ createToolBars()

void BitcoinGUI::createToolBars ( )
private

Create the toolbars.

Definition at line 410 of file bitcoingui.cpp.

Here is the caller graph for this function:

◆ createTrayIcon()

void BitcoinGUI::createTrayIcon ( const NetworkStyle networkStyle)
private

Create system tray icon and notification.

Definition at line 586 of file bitcoingui.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ createTrayIconMenu()

void BitcoinGUI::createTrayIconMenu ( )
private

Create system tray menu (or setup the dock menu)

Definition at line 599 of file bitcoingui.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ detectShutdown

void BitcoinGUI::detectShutdown ( )
slot

called by a timer to check if ShutdownRequested() has been set

Definition at line 1176 of file bitcoingui.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ dragEnterEvent()

void BitcoinGUI::dragEnterEvent ( QDragEnterEvent *  event)
protected

Definition at line 1031 of file bitcoingui.cpp.

◆ dropEvent()

void BitcoinGUI::dropEvent ( QDropEvent *  event)
protected

Definition at line 1038 of file bitcoingui.cpp.

◆ eventFilter()

bool BitcoinGUI::eventFilter ( QObject *  object,
QEvent *  event 
)
protected

Definition at line 1050 of file bitcoingui.cpp.

Here is the call graph for this function:

◆ message

void BitcoinGUI::message ( const QString &  title,
const QString &  message,
unsigned int  style,
bool *  ret = nullptr 
)
slot

Notify the user of an event from the core network or transaction handling code.

Parameters
[in]titlethe message box / notification title
[in]messagethe displayed text
[in]stylemodality and style definitions (icon and used buttons - buttons only for message boxes)
See also
CClientUIInterface::MessageBoxFlags
Parameters
[in]retpointer to a bool that will be modified to whether Ok was clicked (modal only)

Definition at line 897 of file bitcoingui.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ openOptionsDialogWithTab()

void BitcoinGUI::openOptionsDialogWithTab ( OptionsDialog::Tab  tab)
private

Open the OptionsDialog on the specified tab index.

Definition at line 776 of file bitcoingui.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ optionsClicked

void BitcoinGUI::optionsClicked ( )
slot

Show configuration dialog.

Definition at line 650 of file bitcoingui.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ receivedURI

void BitcoinGUI::receivedURI ( const QString &  uri)
signal

Signal raised when a URI was entered or dragged to the GUI.

Here is the caller graph for this function:

◆ setClientModel()

void BitcoinGUI::setClientModel ( ClientModel clientModel)

Set the client model.

The client model represents the part of the core that communicates with the P2P network, and is wallet-agnostic.

Definition at line 446 of file bitcoingui.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ setNetworkActive

void BitcoinGUI::setNetworkActive ( bool  networkActive)
slot

Set network state shown in the UI.

Definition at line 762 of file bitcoingui.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ setNumBlocks

void BitcoinGUI::setNumBlocks ( int  count,
const QDateTime &  blockDate,
double  nVerificationProgress,
bool  headers 
)
slot

Set number of blocks and last block date shown in the UI.

Definition at line 787 of file bitcoingui.cpp.

Here is the caller graph for this function:

◆ setNumConnections

void BitcoinGUI::setNumConnections ( int  count)
slot

Set number of connections shown in the UI.

Definition at line 757 of file bitcoingui.cpp.

Here is the caller graph for this function:

◆ setTrayIconVisible

void BitcoinGUI::setTrayIconVisible ( bool  fHideTrayIcon)
slot

When hideTrayIcon setting is changed in OptionsModel hide or show the icon accordingly.

Definition at line 1209 of file bitcoingui.cpp.

Here is the caller graph for this function:

◆ setWalletActionsEnabled()

void BitcoinGUI::setWalletActionsEnabled ( bool  enabled)
private

Enable or disable all wallet-related actions.

Definition at line 568 of file bitcoingui.cpp.

Here is the caller graph for this function:

◆ showDebugWindow

void BitcoinGUI::showDebugWindow ( )
slot

Show debug window.

Definition at line 664 of file bitcoingui.cpp.

Here is the caller graph for this function:

◆ showDebugWindowActivateConsole

void BitcoinGUI::showDebugWindowActivateConsole ( )
slot

Show debug window and set focus to the console.

Definition at line 672 of file bitcoingui.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ showEvent()

void BitcoinGUI::showEvent ( QShowEvent *  event)
protected

Definition at line 1004 of file bitcoingui.cpp.

Here is the call graph for this function:

◆ showHelpMessageClicked

void BitcoinGUI::showHelpMessageClicked ( )
slot

Show help message dialog.

Definition at line 678 of file bitcoingui.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ showModalOverlay

void BitcoinGUI::showModalOverlay ( )
slot

Definition at line 1217 of file bitcoingui.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ showNormalIfMinimized [1/2]

void BitcoinGUI::showNormalIfMinimized ( )
inlineslot

Show window if hidden, unminimize when minimized, rise when obscured or show if hidden and fToggleHidden is true.

Definition at line 266 of file bitcoingui.h.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ showNormalIfMinimized [2/2]

void BitcoinGUI::showNormalIfMinimized ( bool  fToggleHidden)
slot

Definition at line 1146 of file bitcoingui.cpp.

Here is the call graph for this function:

◆ showProgress

void BitcoinGUI::showProgress ( const QString &  title,
int  nProgress 
)
slot

Show progress dialog e.g.

for verifychain

Definition at line 1186 of file bitcoingui.cpp.

Here is the caller graph for this function:

◆ subscribeToCoreSignals()

void BitcoinGUI::subscribeToCoreSignals ( )
private

Connect core signals to GUI client.

Definition at line 1243 of file bitcoingui.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ toggleHidden

void BitcoinGUI::toggleHidden ( )
slot

Simply calls showNormalIfMinimized(true) for use in SLOT() macro.

Definition at line 1171 of file bitcoingui.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ trayIconActivated

void BitcoinGUI::trayIconActivated ( QSystemTrayIcon::ActivationReason  reason)
slot

Handle tray icon clicked.

Definition at line 640 of file bitcoingui.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ unsubscribeFromCoreSignals()

void BitcoinGUI::unsubscribeFromCoreSignals ( )
private

Disconnect core signals from GUI client.

Definition at line 1250 of file bitcoingui.cpp.

Here is the caller graph for this function:

◆ updateHeadersSyncProgressLabel()

void BitcoinGUI::updateHeadersSyncProgressLabel ( )
private

Definition at line 767 of file bitcoingui.cpp.

Here is the call graph for this function:

◆ updateNetworkState()

void BitcoinGUI::updateNetworkState ( )
private

Update UI with latest network info from model.

Definition at line 728 of file bitcoingui.cpp.

Here is the caller graph for this function:

◆ updateProxyIcon()

void BitcoinGUI::updateProxyIcon ( )
private

Set the proxy-enabled icon as shown in the UI.

Definition at line 1128 of file bitcoingui.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

Member Data Documentation

◆ aboutAction

QAction* BitcoinGUI::aboutAction = nullptr
private

Definition at line 121 of file bitcoingui.h.

◆ aboutQtAction

QAction* BitcoinGUI::aboutQtAction = nullptr
private

Definition at line 129 of file bitcoingui.h.

◆ appMenuBar

QMenuBar* BitcoinGUI::appMenuBar = nullptr
private

Definition at line 110 of file bitcoingui.h.

◆ appToolBar

QToolBar* BitcoinGUI::appToolBar = nullptr
private

Definition at line 111 of file bitcoingui.h.

◆ backupWalletAction

QAction* BitcoinGUI::backupWalletAction = nullptr
private

Definition at line 127 of file bitcoingui.h.

◆ changePassphraseAction

QAction* BitcoinGUI::changePassphraseAction = nullptr
private

Definition at line 128 of file bitcoingui.h.

◆ clientModel

ClientModel* BitcoinGUI::clientModel = nullptr
private

Definition at line 97 of file bitcoingui.h.

◆ connectionsControl

GUIUtil::ClickableLabel* BitcoinGUI::connectionsControl = nullptr
private

Definition at line 104 of file bitcoingui.h.

◆ DEFAULT_UIPLATFORM

const std::string BitcoinGUI::DEFAULT_UIPLATFORM
static
Initial value:
=
"other"

Definition at line 64 of file bitcoingui.h.

◆ enableWallet

bool BitcoinGUI::enableWallet = false

Definition at line 83 of file bitcoingui.h.

◆ encryptWalletAction

QAction* BitcoinGUI::encryptWalletAction = nullptr
private

Definition at line 126 of file bitcoingui.h.

◆ helpMessageDialog

HelpMessageDialog* BitcoinGUI::helpMessageDialog = nullptr
private

Definition at line 143 of file bitcoingui.h.

◆ historyAction

QAction* BitcoinGUI::historyAction = nullptr
private

Definition at line 113 of file bitcoingui.h.

◆ labelBlocksIcon

GUIUtil::ClickableLabel* BitcoinGUI::labelBlocksIcon = nullptr
private

Definition at line 105 of file bitcoingui.h.

◆ labelProxyIcon

GUIUtil::ClickableLabel* BitcoinGUI::labelProxyIcon = nullptr
private

Definition at line 103 of file bitcoingui.h.

◆ labelWalletEncryptionIcon

QLabel* BitcoinGUI::labelWalletEncryptionIcon = nullptr
private

Definition at line 101 of file bitcoingui.h.

◆ labelWalletHDStatusIcon

QLabel* BitcoinGUI::labelWalletHDStatusIcon = nullptr
private

Definition at line 102 of file bitcoingui.h.

◆ m_handler_message_box

std::unique_ptr<interfaces::Handler> BitcoinGUI::m_handler_message_box
private

Definition at line 95 of file bitcoingui.h.

◆ m_handler_question

std::unique_ptr<interfaces::Handler> BitcoinGUI::m_handler_question
private

Definition at line 96 of file bitcoingui.h.

◆ m_node

interfaces::Node& BitcoinGUI::m_node
private

Definition at line 94 of file bitcoingui.h.

◆ m_wallet_selector

QComboBox* BitcoinGUI::m_wallet_selector = nullptr
private

Definition at line 137 of file bitcoingui.h.

◆ m_wallet_selector_action

QAction* BitcoinGUI::m_wallet_selector_action = nullptr
private

Definition at line 134 of file bitcoingui.h.

◆ m_wallet_selector_label

QLabel* BitcoinGUI::m_wallet_selector_label = nullptr
private

Definition at line 136 of file bitcoingui.h.

◆ m_wallet_selector_label_action

QAction* BitcoinGUI::m_wallet_selector_label_action = nullptr
private

Definition at line 133 of file bitcoingui.h.

◆ modalOverlay

ModalOverlay* BitcoinGUI::modalOverlay = nullptr
private

Definition at line 144 of file bitcoingui.h.

◆ notificator

Notificator* BitcoinGUI::notificator = nullptr
private

Definition at line 141 of file bitcoingui.h.

◆ openAction

QAction* BitcoinGUI::openAction = nullptr
private

Definition at line 131 of file bitcoingui.h.

◆ openRPCConsoleAction

QAction* BitcoinGUI::openRPCConsoleAction = nullptr
private

Definition at line 130 of file bitcoingui.h.

◆ optionsAction

QAction* BitcoinGUI::optionsAction = nullptr
private

Definition at line 124 of file bitcoingui.h.

◆ overviewAction

QAction* BitcoinGUI::overviewAction = nullptr
private

Definition at line 112 of file bitcoingui.h.

◆ platformStyle

const PlatformStyle* BitcoinGUI::platformStyle
private

Definition at line 150 of file bitcoingui.h.

◆ prevBlocks

int BitcoinGUI::prevBlocks = 0
private

Keep track of previous number of blocks, to detect progress.

Definition at line 147 of file bitcoingui.h.

◆ progressBar

GUIUtil::ClickableProgressBar* BitcoinGUI::progressBar = nullptr
private

Definition at line 107 of file bitcoingui.h.

◆ progressBarLabel

QLabel* BitcoinGUI::progressBarLabel = nullptr
private

Definition at line 106 of file bitcoingui.h.

◆ progressDialog

QProgressDialog* BitcoinGUI::progressDialog = nullptr
private

Definition at line 108 of file bitcoingui.h.

◆ quitAction

QAction* BitcoinGUI::quitAction = nullptr
private

Definition at line 114 of file bitcoingui.h.

◆ receiveCoinsAction

QAction* BitcoinGUI::receiveCoinsAction = nullptr
private

Definition at line 122 of file bitcoingui.h.

◆ receiveCoinsMenuAction

QAction* BitcoinGUI::receiveCoinsMenuAction = nullptr
private

Definition at line 123 of file bitcoingui.h.

◆ rpcConsole

RPCConsole* BitcoinGUI::rpcConsole = nullptr
private

Definition at line 142 of file bitcoingui.h.

◆ sendCoinsAction

QAction* BitcoinGUI::sendCoinsAction = nullptr
private

Definition at line 115 of file bitcoingui.h.

◆ sendCoinsMenuAction

QAction* BitcoinGUI::sendCoinsMenuAction = nullptr
private

Definition at line 116 of file bitcoingui.h.

◆ showHelpMessageAction

QAction* BitcoinGUI::showHelpMessageAction = nullptr
private

Definition at line 132 of file bitcoingui.h.

◆ signMessageAction

QAction* BitcoinGUI::signMessageAction = nullptr
private

Definition at line 119 of file bitcoingui.h.

◆ spinnerFrame

int BitcoinGUI::spinnerFrame = 0
private

Definition at line 148 of file bitcoingui.h.

◆ toggleHideAction

QAction* BitcoinGUI::toggleHideAction = nullptr
private

Definition at line 125 of file bitcoingui.h.

◆ trayIcon

QSystemTrayIcon* BitcoinGUI::trayIcon = nullptr
private

Definition at line 139 of file bitcoingui.h.

◆ trayIconMenu

QMenu* BitcoinGUI::trayIconMenu = nullptr
private

Definition at line 140 of file bitcoingui.h.

◆ unitDisplayControl

UnitDisplayStatusBarControl* BitcoinGUI::unitDisplayControl = nullptr
private

Definition at line 100 of file bitcoingui.h.

◆ usedReceivingAddressesAction

QAction* BitcoinGUI::usedReceivingAddressesAction = nullptr
private

Definition at line 118 of file bitcoingui.h.

◆ usedSendingAddressesAction

QAction* BitcoinGUI::usedSendingAddressesAction = nullptr
private

Definition at line 117 of file bitcoingui.h.

◆ verifyMessageAction

QAction* BitcoinGUI::verifyMessageAction = nullptr
private

Definition at line 120 of file bitcoingui.h.

◆ walletFrame

WalletFrame* BitcoinGUI::walletFrame = nullptr
private

Definition at line 98 of file bitcoingui.h.


The documentation for this class was generated from the following files: