PRCYCoin  2.0.0.7rc1
P2P Digital Currency
Classes | Typedefs | Functions
GUIUtil Namespace Reference

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

Classes

class  DHMSTableWidgetItem
 Extension to QTableWidgetItem that facilitates proper ordering for "DHMS" strings (primarily used in the masternode's "active" listing). More...
 
class  TableViewLastColumnResizingFixer
 Makes a QTableView last column feel as if it was being resized from its left border. More...
 
class  ToolTipEventFilter
 Qt event filter that intercepts ToolTipChange events, and replaces the tooltip with a rich text representation if needed. More...
 
class  ToolTipToRichTextFilter
 

Typedefs

typedef QProgressBar ProgressBar
 

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, const CAmount &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...
 
QVariant getEntryData (QAbstractItemView *view, int column, int role)
 Return a field of the currently selected entry as a QString. 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 bringToFront (QWidget *w)
 
bool openFile (fs::path path, bool isTextFile)
 
bool openDebugLogfile ()
 
bool openConfigfile ()
 
bool openMNConfigfile ()
 
bool showDataDir ()
 
void showQtDir ()
 
bool showBackups ()
 
bool GetStartOnSystemStartup ()
 
bool SetStartOnSystemStartup (bool fAutoStart)
 
void saveWindowGeometry (const QString &strSetting, QWidget *parent)
 Save window size and position. More...
 
void HideDisabledWidgets (QVector< QWidget * > widgets)
 
void restoreWindowGeometry (const QString &strSetting, const QSize &defaultSizeIn, QWidget *parent)
 Restore window size and position. More...
 
QString loadStyleSheet ()
 Load global CSS theme. More...
 
void refreshStyleSheet ()
 Refresh App theme. More...
 
void setWindowless (QWidget *widget)
 Hideframes for pop up widgets. More...
 
void disableTooltips (QWidget *widget)
 Disable tooltips. More...
 
void prompt (QString message)
 
void colorCalendarWidgetWeekends (QCalendarWidget *widget, QColor color)
 Change the color of weekends on calendar widget *Defaults to Red. More...
 
void setClipboard (const QString &str)
 
fs::path qstringToBoostPath (const QString &path)
 
QString boostPathToQString (const fs::path &path)
 
QString formatDurationStr (int secs)
 
QString formatServicesStr (quint64 mask)
 
QString formatPingTime (double dPingTime)
 
QString formatTimeOffset (int64_t nTimeOffset)
 
QString formatBytes (uint64_t bytes)
 
bool isExternal (QString theme)
 Check whether a theme is not build-in. More...
 

Detailed Description

Utility functions used by the PRCY Qt UI.

Typedef Documentation

◆ ProgressBar

typedef QProgressBar GUIUtil::ProgressBar

Definition at line 268 of file guiutil.h.

Function Documentation

◆ bitcoinAddressFont()

QFont GUIUtil::bitcoinAddressFont ( )

Definition at line 81 of file guiutil.cpp.

Here is the caller graph for this function:

◆ blockingGUIThreadConnection()

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 304 of file guiutil.cpp.

◆ boostPathToQString()

QString GUIUtil::boostPathToQString ( const fs::path &  path)

Definition at line 799 of file guiutil.cpp.

Here is the caller graph for this function:

◆ bringToFront()

void GUIUtil::bringToFront ( QWidget *  w)

Definition at line 325 of file guiutil.cpp.

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

◆ checkPoint()

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

Definition at line 313 of file guiutil.cpp.

Here is the caller graph for this function:

◆ colorCalendarWidgetWeekends()

void GUIUtil::colorCalendarWidgetWeekends ( QCalendarWidget *  widget,
QColor  color 
)

Change the color of weekends on calendar widget *Defaults to Red.

Definition at line 770 of file guiutil.cpp.

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

◆ copyEntryData()

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 215 of file guiutil.cpp.

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

◆ dateTimeStr() [1/2]

QString GUIUtil::dateTimeStr ( const QDateTime &  date)

Definition at line 70 of file guiutil.cpp.

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

◆ dateTimeStr() [2/2]

QString GUIUtil::dateTimeStr ( qint64  nTime)

Definition at line 76 of file guiutil.cpp.

Here is the call graph for this function:

◆ disableTooltips()

void GUIUtil::disableTooltips ( QWidget *  widget)

Disable tooltips.

Definition at line 758 of file guiutil.cpp.

◆ formatBitcoinURI()

QString GUIUtil::formatBitcoinURI ( const SendCoinsRecipient info)

Definition at line 167 of file guiutil.cpp.

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

◆ formatBytes()

QString GUIUtil::formatBytes ( uint64_t  bytes)

Definition at line 862 of file guiutil.cpp.

Here is the caller graph for this function:

◆ formatDurationStr()

QString GUIUtil::formatDurationStr ( int  secs)

Definition at line 804 of file guiutil.cpp.

Here is the caller graph for this function:

◆ formatPingTime()

QString GUIUtil::formatPingTime ( double  dPingTime)

Definition at line 852 of file guiutil.cpp.

Here is the caller graph for this function:

◆ formatServicesStr()

QString GUIUtil::formatServicesStr ( quint64  mask)

Definition at line 824 of file guiutil.cpp.

Here is the caller graph for this function:

◆ formatTimeOffset()

QString GUIUtil::formatTimeOffset ( int64_t  nTimeOffset)

Definition at line 857 of file guiutil.cpp.

Here is the caller graph for this function:

◆ getEntryData()

QVariant GUIUtil::getEntryData ( QAbstractItemView *  view,
int  column,
int  role 
)

Return a field of the currently selected entry as a QString.

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 227 of file guiutil.cpp.

Here is the caller graph for this function:

◆ getOpenFileName()

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 277 of file guiutil.cpp.

◆ getSaveFileName()

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 239 of file guiutil.cpp.

Here is the caller graph for this function:

◆ GetStartOnSystemStartup()

bool GUIUtil::GetStartOnSystemStartup ( )

Definition at line 683 of file guiutil.cpp.

Here is the caller graph for this function:

◆ HideDisabledWidgets()

void GUIUtil::HideDisabledWidgets ( QVector< QWidget * >  widgets)

Definition at line 698 of file guiutil.cpp.

◆ HtmlEscape() [1/2]

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

Definition at line 200 of file guiutil.cpp.

Here is the caller graph for this function:

◆ HtmlEscape() [2/2]

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

Definition at line 210 of file guiutil.cpp.

Here is the call graph for this function:

◆ isDust()

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

Definition at line 192 of file guiutil.cpp.

Here is the call graph for this function:

◆ isExternal()

bool GUIUtil::isExternal ( QString  theme)

Check whether a theme is not build-in.

◆ isObscured()

bool GUIUtil::isObscured ( QWidget *  w)

Definition at line 320 of file guiutil.cpp.

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

◆ loadStyleSheet()

QString GUIUtil::loadStyleSheet ( )

Load global CSS theme.

Definition at line 721 of file guiutil.cpp.

Here is the caller graph for this function:

◆ openConfigfile()

bool GUIUtil::openConfigfile ( )

Definition at line 364 of file guiutil.cpp.

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

◆ openDebugLogfile()

bool GUIUtil::openDebugLogfile ( )

Definition at line 359 of file guiutil.cpp.

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

◆ openFile()

bool GUIUtil::openFile ( fs::path  path,
bool  isTextFile 
)

Definition at line 344 of file guiutil.cpp.

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

◆ openMNConfigfile()

bool GUIUtil::openMNConfigfile ( )

Definition at line 369 of file guiutil.cpp.

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

◆ parseBitcoinURI() [1/2]

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

Definition at line 104 of file guiutil.cpp.

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

◆ parseBitcoinURI() [2/2]

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

Definition at line 154 of file guiutil.cpp.

Here is the call graph for this function:

◆ prompt()

void GUIUtil::prompt ( QString  message)

Definition at line 761 of file guiutil.cpp.

Here is the call graph for this function:

◆ qstringToBoostPath()

fs::path GUIUtil::qstringToBoostPath ( const QString &  path)

Definition at line 794 of file guiutil.cpp.

Here is the caller graph for this function:

◆ refreshStyleSheet()

void GUIUtil::refreshStyleSheet ( )

Refresh App theme.

Definition at line 742 of file guiutil.cpp.

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

◆ restoreWindowGeometry()

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

Restore window size and position.

Definition at line 704 of file guiutil.cpp.

Here is the caller graph for this function:

◆ saveWindowGeometry()

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

Save window size and position.

Definition at line 691 of file guiutil.cpp.

Here is the caller graph for this function:

◆ setClipboard()

void GUIUtil::setClipboard ( const QString &  str)

Definition at line 785 of file guiutil.cpp.

Here is the caller graph for this function:

◆ SetStartOnSystemStartup()

bool GUIUtil::SetStartOnSystemStartup ( bool  fAutoStart)

Definition at line 687 of file guiutil.cpp.

Here is the caller graph for this function:

◆ setupAddressWidget()

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

Definition at line 86 of file guiutil.cpp.

Here is the caller graph for this function:

◆ setupAmountWidget()

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

Definition at line 95 of file guiutil.cpp.

◆ setWindowless()

void GUIUtil::setWindowless ( QWidget *  widget)

Hideframes for pop up widgets.

Needed for border-radius on pop up widgets

Definition at line 750 of file guiutil.cpp.

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

◆ showBackups()

bool GUIUtil::showBackups ( )

Definition at line 390 of file guiutil.cpp.

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

◆ showDataDir()

bool GUIUtil::showDataDir ( )

Definition at line 374 of file guiutil.cpp.

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

◆ showQtDir()

void GUIUtil::showQtDir ( )

Definition at line 384 of file guiutil.cpp.

Here is the caller graph for this function: