Master Core  v0.0.9 - 2abfd2849db8ba7a83957c64eb976b406713c123
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
Public Slots | Signals | Public Member Functions | Static Public Attributes | Protected Member Functions | Private Slots | Private Member Functions | Private Attributes | List of all members
BitcoinGUI Class Reference

Bitcoin GUI main class. More...

#include <bitcoingui.h>

+ Inheritance diagram for BitcoinGUI:
+ Collaboration diagram for BitcoinGUI:

Public Slots

void setNumConnections (int count)
 Set number of connections shown in the UI. More...
 
void setNumBlocks (int count)
 Set number of blocks shown in the UI. More...
 
void message (const QString &title, const QString &message, unsigned int style, bool *ret=NULL)
 Notify the user of an event from the core network or transaction handling code. More...
 

Signals

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

Public Member Functions

 BitcoinGUI (bool fIsTestnet=false, QWidget *parent=0)
 
 ~BitcoinGUI ()
 
void setClientModel (ClientModel *clientModel)
 Set the client model. More...
 

Static Public Attributes

static const QString DEFAULT_WALLET = "~Default"
 

Protected Member Functions

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

Private Slots

void optionsClicked ()
 Show configuration dialog. More...
 
void aboutClicked ()
 Show about dialog. More...
 
void showHelpMessageClicked ()
 Show help message dialog. More...
 
void trayIconActivated (QSystemTrayIcon::ActivationReason reason)
 Handle tray icon clicked. More...
 
void showNormalIfMinimized (bool fToggleHidden=false)
 Show window if hidden, unminimize when minimized, rise when obscured or show if hidden and fToggleHidden is true. More...
 
void toggleHidden ()
 Simply calls showNormalIfMinimized(true) for use in SLOT() macro. More...
 
void detectShutdown ()
 called by a timer to check if fRequestShutdown has been set More...
 

Private Member Functions

void createActions (bool fIsTestnet)
 Create the main UI actions. More...
 
void createMenuBar ()
 Create the menu bar and sub-menus. More...
 
void createToolBars ()
 Create the toolbars. More...
 
void createTrayIcon (bool fIsTestnet)
 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...
 

Private Attributes

ClientModelclientModel
 
WalletFramewalletFrame
 
QLabellabelEncryptionIcon
 
QLabellabelConnectionsIcon
 
QLabellabelBlocksIcon
 
QLabelprogressBarLabel
 
QProgressBar * progressBar
 
QMenuBar * appMenuBar
 
QAction * overviewAction
 
QAction * balancesAction
 
QAction * historyAction
 
QAction * quitAction
 
QAction * sendCoinsAction
 
QAction * usedSendingAddressesAction
 
QAction * usedReceivingAddressesAction
 
QAction * signMessageAction
 
QAction * verifyMessageAction
 
QAction * aboutAction
 
QAction * receiveCoinsAction
 
QAction * optionsAction
 
QAction * toggleHideAction
 
QAction * encryptWalletAction
 
QAction * backupWalletAction
 
QAction * changePassphraseAction
 
QAction * aboutQtAction
 
QAction * openRPCConsoleAction
 
QAction * openAction
 
QAction * showHelpMessageAction
 
QSystemTrayIcon * trayIcon
 
Notificatornotificator
 
RPCConsolerpcConsole
 
int prevBlocks
 Keep track of previous number of blocks, to detect progress. More...
 
int spinnerFrame
 

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 35 of file bitcoingui.h.

Constructor & Destructor Documentation

BitcoinGUI::BitcoinGUI ( bool  fIsTestnet = false,
QWidget parent = 0 
)
explicit
BitcoinGUI::~BitcoinGUI ( )

Definition at line 204 of file bitcoingui.cpp.

References appMenuBar, MacDockIconHandler::instance(), GUIUtil::saveWindowGeometry(), MacDockIconHandler::setMainWindow(), trayIcon, and unsubscribeFromCoreSignals().

+ Here is the call graph for this function:

Member Function Documentation

void BitcoinGUI::aboutClicked ( )
privateslot

Show about dialog.

Definition at line 554 of file bitcoingui.cpp.

References clientModel, and AboutDialog::setModel().

Referenced by createActions().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void BitcoinGUI::changeEvent ( QEvent *  e)
protected

Definition at line 807 of file bitcoingui.cpp.

References clientModel, OptionsModel::getMinimizeToTray(), and ClientModel::getOptionsModel().

+ Here is the call graph for this function:

void BitcoinGUI::closeEvent ( QCloseEvent *  event)
protected

Definition at line 826 of file bitcoingui.cpp.

References clientModel, OptionsModel::getMinimizeOnClose(), OptionsModel::getMinimizeToTray(), and ClientModel::getOptionsModel().

+ Here is the call graph for this function:

void BitcoinGUI::createActions ( bool  fIsTestnet)
private

Create the main UI actions.

Definition at line 218 of file bitcoingui.cpp.

References aboutAction, aboutClicked(), aboutQtAction, backupWalletAction, balancesAction, changePassphraseAction, encryptWalletAction, historyAction, openAction, openRPCConsoleAction, optionsAction, optionsClicked(), overviewAction, quitAction, receiveCoinsAction, sendCoinsAction, showHelpMessageAction, showHelpMessageClicked(), showNormalIfMinimized(), signMessageAction, toggleHidden(), toggleHideAction, usedReceivingAddressesAction, usedSendingAddressesAction, verifyMessageAction, and walletFrame.

Referenced by BitcoinGUI().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void BitcoinGUI::createMenuBar ( )
private

Create the menu bar and sub-menus.

Definition at line 343 of file bitcoingui.cpp.

References aboutAction, aboutQtAction, appMenuBar, backupWalletAction, changePassphraseAction, encryptWalletAction, help(), openAction, openRPCConsoleAction, optionsAction, quitAction, showHelpMessageAction, signMessageAction, usedReceivingAddressesAction, usedSendingAddressesAction, verifyMessageAction, and walletFrame.

Referenced by BitcoinGUI().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void BitcoinGUI::createToolBars ( )
private

Create the toolbars.

Definition at line 388 of file bitcoingui.cpp.

References balancesAction, historyAction, overviewAction, receiveCoinsAction, sendCoinsAction, and walletFrame.

Referenced by BitcoinGUI().

+ Here is the caller graph for this function:

void BitcoinGUI::createTrayIcon ( bool  fIsTestnet)
private

Create system tray icon and notification.

Definition at line 474 of file bitcoingui.cpp.

References notificator, and trayIcon.

Referenced by BitcoinGUI().

+ Here is the caller graph for this function:

void BitcoinGUI::createTrayIconMenu ( )
private

Create system tray menu (or setup the dock menu)

Definition at line 496 of file bitcoingui.cpp.

References MacDockIconHandler::dockMenu(), MacDockIconHandler::instance(), openRPCConsoleAction, optionsAction, quitAction, receiveCoinsAction, sendCoinsAction, MacDockIconHandler::setMainWindow(), signMessageAction, toggleHideAction, trayIcon, trayIconActivated(), and verifyMessageAction.

Referenced by setClientModel().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void BitcoinGUI::detectShutdown ( )
privateslot

called by a timer to check if fRequestShutdown has been set

Definition at line 959 of file bitcoingui.cpp.

References rpcConsole, and ShutdownRequested().

+ Here is the call graph for this function:

void BitcoinGUI::dragEnterEvent ( QDragEnterEvent *  event)
protected

Definition at line 857 of file bitcoingui.cpp.

void BitcoinGUI::dropEvent ( QDropEvent *  event)
protected

Definition at line 864 of file bitcoingui.cpp.

References receivedURI().

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

Definition at line 876 of file bitcoingui.cpp.

References progressBar, and progressBarLabel.

void BitcoinGUI::message ( const QString &  title,
const QString &  message,
unsigned int  style,
bool *  ret = NULL 
)
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 744 of file bitcoingui.cpp.

References CClientUIInterface::BTN_MASK, Notificator::Critical, CClientUIInterface::ICON_ERROR, CClientUIInterface::ICON_WARNING, Notificator::Information, CClientUIInterface::MODAL, CClientUIInterface::MSG_ERROR, CClientUIInterface::MSG_INFORMATION, CClientUIInterface::MSG_WARNING, CClientUIInterface::NOSHOWGUI, notificator, Notificator::notify(), showNormalIfMinimized(), and Notificator::Warning.

Referenced by setClientModel().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void BitcoinGUI::optionsClicked ( )
privateslot

Show configuration dialog.

Definition at line 544 of file bitcoingui.cpp.

References clientModel, ClientModel::getOptionsModel(), and OptionsDialog::setModel().

Referenced by createActions().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

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

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

Definition at line 168 of file moc_bitcoingui.cpp.

Referenced by dropEvent().

+ Here is the caller graph for this function:

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 403 of file bitcoingui.cpp.

References clientModel, createTrayIconMenu(), ClientModel::getNumBlocks(), ClientModel::getNumConnections(), message(), rpcConsole, RPCConsole::setClientModel(), WalletFrame::setClientModel(), setNumBlocks(), setNumConnections(), and walletFrame.

Referenced by BitcoinApplication::initializeResult(), and BitcoinApplication::requestShutdown().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void BitcoinGUI::setNumBlocks ( int  count)
slot

Set number of blocks shown in the UI.

Definition at line 637 of file bitcoingui.cpp.

References BLOCK_SOURCE_DISK, BLOCK_SOURCE_NETWORK, BLOCK_SOURCE_NONE, BLOCK_SOURCE_REINDEX, clientModel, ClientModel::getBlockSource(), ClientModel::getLastBlockDate(), ClientModel::getVerificationProgress(), labelBlocksIcon, prevBlocks, progressBar, progressBarLabel, WalletFrame::showOutOfSyncWarning(), SPINNER_FRAMES, spinnerFrame, STATUSBAR_ICONSIZE, and walletFrame.

Referenced by setClientModel().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void BitcoinGUI::setNumConnections ( int  count)
slot

Set number of connections shown in the UI.

Definition at line 622 of file bitcoingui.cpp.

References labelConnectionsIcon, and STATUSBAR_ICONSIZE.

Referenced by setClientModel().

+ Here is the caller graph for this function:

void BitcoinGUI::setWalletActionsEnabled ( bool  enabled)
private

Enable or disable all wallet-related actions.

Definition at line 457 of file bitcoingui.cpp.

References backupWalletAction, balancesAction, changePassphraseAction, encryptWalletAction, historyAction, openAction, overviewAction, receiveCoinsAction, sendCoinsAction, signMessageAction, usedReceivingAddressesAction, usedSendingAddressesAction, and verifyMessageAction.

Referenced by BitcoinGUI().

+ Here is the caller graph for this function:

void BitcoinGUI::showHelpMessageClicked ( )
privateslot

Show help message dialog.

Definition at line 564 of file bitcoingui.cpp.

References help().

Referenced by createActions().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void BitcoinGUI::showNormalIfMinimized ( bool  fToggleHidden = false)
privateslot

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

Definition at line 932 of file bitcoingui.cpp.

References GUIUtil::isObscured().

Referenced by createActions(), message(), and toggleHidden().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void BitcoinGUI::subscribeToCoreSignals ( )
private

Connect core signals to GUI client.

Definition at line 983 of file bitcoingui.cpp.

References CClientUIInterface::ThreadSafeMessageBox, ThreadSafeMessageBox(), and uiInterface.

Referenced by BitcoinGUI().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void BitcoinGUI::toggleHidden ( )
privateslot

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

Definition at line 954 of file bitcoingui.cpp.

References showNormalIfMinimized().

Referenced by createActions().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

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

Handle tray icon clicked.

Definition at line 534 of file bitcoingui.cpp.

References toggleHideAction.

Referenced by createTrayIconMenu().

+ Here is the caller graph for this function:

void BitcoinGUI::unsubscribeFromCoreSignals ( )
private

Disconnect core signals from GUI client.

Definition at line 989 of file bitcoingui.cpp.

References CClientUIInterface::ThreadSafeMessageBox, ThreadSafeMessageBox(), and uiInterface.

Referenced by ~BitcoinGUI().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

Member Data Documentation

QAction* BitcoinGUI::aboutAction
private

Definition at line 87 of file bitcoingui.h.

Referenced by createActions(), and createMenuBar().

QAction* BitcoinGUI::aboutQtAction
private

Definition at line 94 of file bitcoingui.h.

Referenced by createActions(), and createMenuBar().

QMenuBar* BitcoinGUI::appMenuBar
private

Definition at line 77 of file bitcoingui.h.

Referenced by createMenuBar(), and ~BitcoinGUI().

QAction* BitcoinGUI::backupWalletAction
private

Definition at line 92 of file bitcoingui.h.

Referenced by createActions(), createMenuBar(), and setWalletActionsEnabled().

QAction* BitcoinGUI::balancesAction
private

Definition at line 79 of file bitcoingui.h.

Referenced by createActions(), createToolBars(), and setWalletActionsEnabled().

QAction* BitcoinGUI::changePassphraseAction
private

Definition at line 93 of file bitcoingui.h.

Referenced by createActions(), createMenuBar(), and setWalletActionsEnabled().

ClientModel* BitcoinGUI::clientModel
private
const QString BitcoinGUI::DEFAULT_WALLET = "~Default"
static

Definition at line 40 of file bitcoingui.h.

QAction* BitcoinGUI::encryptWalletAction
private

Definition at line 91 of file bitcoingui.h.

Referenced by createActions(), createMenuBar(), and setWalletActionsEnabled().

QAction* BitcoinGUI::historyAction
private

Definition at line 80 of file bitcoingui.h.

Referenced by createActions(), createToolBars(), and setWalletActionsEnabled().

QLabel* BitcoinGUI::labelBlocksIcon
private

Definition at line 73 of file bitcoingui.h.

Referenced by BitcoinGUI(), and setNumBlocks().

QLabel* BitcoinGUI::labelConnectionsIcon
private

Definition at line 72 of file bitcoingui.h.

Referenced by BitcoinGUI(), and setNumConnections().

QLabel* BitcoinGUI::labelEncryptionIcon
private

Definition at line 71 of file bitcoingui.h.

Referenced by BitcoinGUI().

Notificator* BitcoinGUI::notificator
private

Definition at line 100 of file bitcoingui.h.

Referenced by createTrayIcon(), and message().

QAction* BitcoinGUI::openAction
private

Definition at line 96 of file bitcoingui.h.

Referenced by createActions(), createMenuBar(), and setWalletActionsEnabled().

QAction* BitcoinGUI::openRPCConsoleAction
private

Definition at line 95 of file bitcoingui.h.

Referenced by BitcoinGUI(), createActions(), createMenuBar(), and createTrayIconMenu().

QAction* BitcoinGUI::optionsAction
private

Definition at line 89 of file bitcoingui.h.

Referenced by createActions(), createMenuBar(), and createTrayIconMenu().

QAction* BitcoinGUI::overviewAction
private

Definition at line 78 of file bitcoingui.h.

Referenced by createActions(), createToolBars(), and setWalletActionsEnabled().

int BitcoinGUI::prevBlocks
private

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

Definition at line 104 of file bitcoingui.h.

Referenced by setNumBlocks().

QProgressBar* BitcoinGUI::progressBar
private

Definition at line 75 of file bitcoingui.h.

Referenced by BitcoinGUI(), eventFilter(), and setNumBlocks().

QLabel* BitcoinGUI::progressBarLabel
private

Definition at line 74 of file bitcoingui.h.

Referenced by BitcoinGUI(), eventFilter(), and setNumBlocks().

QAction* BitcoinGUI::quitAction
private

Definition at line 81 of file bitcoingui.h.

Referenced by BitcoinGUI(), createActions(), createMenuBar(), and createTrayIconMenu().

QAction* BitcoinGUI::receiveCoinsAction
private
RPCConsole* BitcoinGUI::rpcConsole
private

Definition at line 101 of file bitcoingui.h.

Referenced by BitcoinGUI(), detectShutdown(), and setClientModel().

QAction* BitcoinGUI::sendCoinsAction
private
QAction* BitcoinGUI::showHelpMessageAction
private

Definition at line 97 of file bitcoingui.h.

Referenced by createActions(), and createMenuBar().

QAction* BitcoinGUI::signMessageAction
private
int BitcoinGUI::spinnerFrame
private

Definition at line 105 of file bitcoingui.h.

Referenced by setNumBlocks().

QAction* BitcoinGUI::toggleHideAction
private

Definition at line 90 of file bitcoingui.h.

Referenced by createActions(), createTrayIconMenu(), and trayIconActivated().

QSystemTrayIcon* BitcoinGUI::trayIcon
private

Definition at line 99 of file bitcoingui.h.

Referenced by createTrayIcon(), createTrayIconMenu(), and ~BitcoinGUI().

QAction* BitcoinGUI::usedReceivingAddressesAction
private

Definition at line 84 of file bitcoingui.h.

Referenced by createActions(), createMenuBar(), and setWalletActionsEnabled().

QAction* BitcoinGUI::usedSendingAddressesAction
private

Definition at line 83 of file bitcoingui.h.

Referenced by createActions(), createMenuBar(), and setWalletActionsEnabled().

QAction* BitcoinGUI::verifyMessageAction
private
WalletFrame* BitcoinGUI::walletFrame
private

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