Master Core  v0.0.9 - 2abfd2849db8ba7a83957c64eb976b406713c123
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
Classes | Functions
GUIUtil Namespace Reference

Utility functions used by the Bitcoin Qt UI. More...

Classes

class  TableViewLastColumnResizingFixer
 Makes a QTableView last column feel as if it was being resized from its left border. More...
 
class  ToolTipToRichTextFilter
 

Functions

QString dateTimeStr (const QDateTime &date)
 
QString dateTimeStr (qint64 nTime)
 
QFont bitcoinAddressFont ()
 
void setupAddressWidget (QValidatedLineEdit *widget, QWidget *parent)
 
void setupAmountWidget (QLineEdit *widget, QWidget *parent)
 
bool parseBitcoinURI (const QUrl &uri, SendCoinsRecipient *out)
 
bool parseBitcoinURI (QString uri, SendCoinsRecipient *out)
 
QString formatBitcoinURI (const SendCoinsRecipient &info)
 
bool isDust (const QString &address, qint64 amount)
 
QString HtmlEscape (const QString &str, bool fMultiLine)
 
QString HtmlEscape (const std::string &str, bool fMultiLine)
 
void copyEntryData (QAbstractItemView *view, int column, int role=Qt::EditRole)
 Copy a field of the currently selected entry of a view to the clipboard. More...
 
QString getSaveFileName (QWidget *parent, const QString &caption, const QString &dir, const QString &filter, QString *selectedSuffixOut)
 Get save filename, mimics QFileDialog::getSaveFileName, except that it appends a default suffix when no suffix is provided by the user. More...
 
QString getOpenFileName (QWidget *parent, const QString &caption, const QString &dir, const QString &filter, QString *selectedSuffixOut)
 Get open filename, convenience wrapper for QFileDialog::getOpenFileName. More...
 
Qt::ConnectionType blockingGUIThreadConnection ()
 Get connection type to call object slot in GUI thread with invokeMethod. More...
 
bool checkPoint (const QPoint &p, const QWidget *w)
 
bool isObscured (QWidget *w)
 
void openDebugLogfile ()
 
void SubstituteFonts ()
 Qt event filter that intercepts ToolTipChange events, and replaces the tooltip with a rich text representation if needed. More...
 
bool GetStartOnSystemStartup ()
 
bool SetStartOnSystemStartup (bool fAutoStart)
 
void saveWindowGeometry (const QString &strSetting, QWidget *parent)
 Save window size and position. More...
 
void restoreWindowGeometry (const QString &strSetting, const QSize &defaultSizeIn, QWidget *parent)
 Restore window size and position. More...
 
void setClipboard (const QString &str)
 
boost::filesystem::path qstringToBoostPath (const QString &path)
 
QString boostPathToQString (const boost::filesystem::path &path)
 

Detailed Description

Utility functions used by the Bitcoin Qt UI.

Function Documentation

QFont GUIUtil::bitcoinAddressFont ( )

Definition at line 83 of file guiutil.cpp.

Referenced by AddressTableModel::data(), HelpMessageDialog::HelpMessageDialog(), SendCoinsEntry::SendCoinsEntry(), setupAddressWidget(), and SignVerifyMessageDialog::SignVerifyMessageDialog().

+ Here is the caller graph for this function:

Qt::ConnectionType GUIUtil::blockingGUIThreadConnection ( )

Get connection type to call object slot in GUI thread with invokeMethod.

The call will be blocking.

Returns
If called from the GUI thread, return a Qt::DirectConnection. If called from another thread, return a Qt::BlockingQueuedConnection.

Definition at line 339 of file guiutil.cpp.

Referenced by ThreadSafeMessageBox().

+ Here is the caller graph for this function:

QString GUIUtil::boostPathToQString ( const boost::filesystem::path &  path)

Definition at line 778 of file guiutil.cpp.

Referenced by Intro::getDefaultDataDirectory(), and openDebugLogfile().

+ Here is the caller graph for this function:

bool GUIUtil::checkPoint ( const QPoint &  p,
const QWidget w 
)

Definition at line 351 of file guiutil.cpp.

Referenced by isObscured().

+ Here is the caller graph for this function:

void GUIUtil::copyEntryData ( QAbstractItemView *  view,
int  column,
int  role = Qt::EditRole 
)

Copy a field of the currently selected entry of a view to the clipboard.

Does nothing if nothing is selected.

Parameters
[in]columnData column to extract from the model
[in]roleData role to extract from the model
See also
TransactionView::copyLabel, TransactionView::copyAmount, TransactionView::copyAddress

Definition at line 241 of file guiutil.cpp.

References setClipboard().

Referenced by TransactionView::copyAddress(), TransactionView::copyAmount(), TransactionView::copyLabel(), TransactionView::copyTxID(), AddressBookPage::on_copyAddress_clicked(), and AddressBookPage::onCopyLabelAction().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

QString GUIUtil::dateTimeStr ( const QDateTime &  date)

Definition at line 73 of file guiutil.cpp.

Referenced by RecentRequestsTableModel::data(), dateTimeStr(), TransactionTableModel::formatTxDate(), TransactionDesc::FormatTxStatus(), TransactionTableModel::formatTxStatus(), TxViewDelegate::paint(), TransactionDesc::toHTML(), and CoinControlDialog::updateView().

+ Here is the caller graph for this function:

QString GUIUtil::dateTimeStr ( qint64  nTime)

Definition at line 78 of file guiutil.cpp.

References dateTimeStr().

+ Here is the call graph for this function:

QString GUIUtil::formatBitcoinURI ( const SendCoinsRecipient info)

Definition at line 186 of file guiutil.cpp.

References SendCoinsRecipient::address, SendCoinsRecipient::amount, BitcoinUnits::BTC, BitcoinUnits::format(), SendCoinsRecipient::label, and SendCoinsRecipient::message.

Referenced by ReceiveRequestDialog::on_btnCopyURI_clicked(), and ReceiveRequestDialog::update().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

QString GUIUtil::getOpenFileName ( QWidget parent,
const QString &  caption,
const QString &  dir,
const QString &  filter,
QString *  selectedSuffixOut 
)

Get open filename, convenience wrapper for QFileDialog::getOpenFileName.

Parameters
[in]parentParent window (or 0)
[in]captionWindow caption (or empty, for default)
[in]dirStarting directory (or empty, to default to documents directory)
[in]filterFilter specification such as "Comma Separated Files (*.csv)"
[out]selectedSuffixOutPointer to return the suffix (file type) that was selected (or 0). Can be useful when choosing the save file format based on suffix.

Definition at line 304 of file guiutil.cpp.

Referenced by OpenURIDialog::on_selectFileButton_clicked().

+ Here is the caller graph for this function:

QString GUIUtil::getSaveFileName ( QWidget parent,
const QString &  caption,
const QString &  dir,
const QString &  filter,
QString *  selectedSuffixOut 
)

Get save filename, mimics QFileDialog::getSaveFileName, except that it appends a default suffix when no suffix is provided by the user.

Parameters
[in]parentParent window (or 0)
[in]captionWindow caption (or empty, for default)
[in]dirStarting directory (or empty, to default to documents directory)
[in]filterFilter specification such as "Comma Separated Files (*.csv)"
[out]selectedSuffixOutPointer to return the suffix (file type) that was selected (or 0). Can be useful when choosing the save file format based on suffix.

Definition at line 254 of file guiutil.cpp.

Referenced by WalletView::backupWallet(), TransactionView::exportClicked(), AddressBookPage::on_exportButton_clicked(), and QRImageWidget::saveImage().

+ Here is the caller graph for this function:

bool GUIUtil::GetStartOnSystemStartup ( )

Definition at line 727 of file guiutil.cpp.

Referenced by OptionsModel::data(), and OptionsModel::Reset().

+ Here is the caller graph for this function:

QString GUIUtil::HtmlEscape ( const QString &  str,
bool  fMultiLine 
)

Definition at line 222 of file guiutil.cpp.

Referenced by GUIUtil::ToolTipToRichTextFilter::eventFilter(), HtmlEscape(), RPCConsole::message(), PaymentServer::netRequestFinished(), SendCoinsDialog::on_sendButton_clicked(), PaymentServer::processPaymentRequest(), TransactionDesc::toHTML(), and ReceiveRequestDialog::update().

+ Here is the caller graph for this function:

QString GUIUtil::HtmlEscape ( const std::string &  str,
bool  fMultiLine 
)

Definition at line 236 of file guiutil.cpp.

References HtmlEscape().

+ Here is the call graph for this function:

bool GUIUtil::isDust ( const QString &  address,
qint64  amount 
)

Definition at line 214 of file guiutil.cpp.

References CTxOut::IsDust(), CTransaction::nMinRelayTxFee, and CScript::SetDestination().

Referenced by SendCoinsEntry::validate().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

bool GUIUtil::isObscured ( QWidget w)

Definition at line 358 of file guiutil.cpp.

References checkPoint().

Referenced by BitcoinGUI::showNormalIfMinimized().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void GUIUtil::openDebugLogfile ( )

Definition at line 367 of file guiutil.cpp.

References boostPathToQString(), and GetDataDir().

Referenced by RPCConsole::on_openDebugLogfileButton_clicked().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

bool GUIUtil::parseBitcoinURI ( const QUrl &  uri,
SendCoinsRecipient out 
)

Definition at line 115 of file guiutil.cpp.

References SendCoinsRecipient::address, SendCoinsRecipient::amount, BitcoinUnits::BTC, SendCoinsRecipient::label, SendCoinsRecipient::message, and BitcoinUnits::parse().

Referenced by OpenURIDialog::accept(), PaymentServer::handleURIOrFile(), PaymentServer::ipcParseCommandLine(), and parseBitcoinURI().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

bool GUIUtil::parseBitcoinURI ( QString  uri,
SendCoinsRecipient out 
)

Definition at line 172 of file guiutil.cpp.

References parseBitcoinURI().

+ Here is the call graph for this function:

boost::filesystem::path GUIUtil::qstringToBoostPath ( const QString &  path)

Definition at line 773 of file guiutil.cpp.

Referenced by FreespaceChecker::check(), and Intro::pickDataDirectory().

+ Here is the caller graph for this function:

void GUIUtil::restoreWindowGeometry ( const QString &  strSetting,
const QSize &  defaultSize,
QWidget parent 
)

Restore window size and position.

Definition at line 739 of file guiutil.cpp.

Referenced by BitcoinGUI::BitcoinGUI(), HelpMessageDialog::HelpMessageDialog(), OptionsDialog::OptionsDialog(), and RPCConsole::RPCConsole().

+ Here is the caller graph for this function:

void GUIUtil::saveWindowGeometry ( const QString &  strSetting,
QWidget parent 
)

Save window size and position.

Definition at line 732 of file guiutil.cpp.

Referenced by BitcoinGUI::~BitcoinGUI(), HelpMessageDialog::~HelpMessageDialog(), OptionsDialog::~OptionsDialog(), and RPCConsole::~RPCConsole().

+ Here is the caller graph for this function:

void GUIUtil::setClipboard ( const QString &  str)
bool GUIUtil::SetStartOnSystemStartup ( bool  fAutoStart)

Definition at line 728 of file guiutil.cpp.

Referenced by OptionsModel::Reset(), and OptionsModel::setData().

+ Here is the caller graph for this function:

void GUIUtil::setupAddressWidget ( QValidatedLineEdit widget,
QWidget parent 
)

Definition at line 94 of file guiutil.cpp.

References bitcoinAddressFont(), and QValidatedLineEdit::setCheckValidator().

Referenced by EditAddressDialog::EditAddressDialog(), SendCoinsDialog::SendCoinsDialog(), SendCoinsEntry::SendCoinsEntry(), and SignVerifyMessageDialog::SignVerifyMessageDialog().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void GUIUtil::setupAmountWidget ( QLineEdit widget,
QWidget parent 
)

Definition at line 106 of file guiutil.cpp.

void GUIUtil::SubstituteFonts ( )

Qt event filter that intercepts ToolTipChange events, and replaces the tooltip with a rich text representation if needed.

This assures that Qt can word-wrap long tooltip messages. Tooltips longer than the provided size threshold (in characters) are wrapped.

Definition at line 382 of file guiutil.cpp.

Referenced by main().

+ Here is the caller graph for this function: