diff options
Diffstat (limited to 'src/qt/guiutil.h')
-rw-r--r-- | src/qt/guiutil.h | 29 |
1 files changed, 23 insertions, 6 deletions
diff --git a/src/qt/guiutil.h b/src/qt/guiutil.h index 8472700f48..ddff2de4c4 100644 --- a/src/qt/guiutil.h +++ b/src/qt/guiutil.h @@ -1,19 +1,23 @@ +// Copyright (c) 2011-2013 The Bitcoin developers +// Distributed under the MIT/X11 software license, see the accompanying +// file COPYING or http://www.opensource.org/licenses/mit-license.php. + #ifndef GUIUTIL_H #define GUIUTIL_H -#include <QString> -#include <QObject> #include <QMessageBox> +#include <QObject> +#include <QString> class SendCoinsRecipient; QT_BEGIN_NAMESPACE +class QAbstractItemView; +class QDateTime; class QFont; class QLineEdit; -class QWidget; -class QDateTime; class QUrl; -class QAbstractItemView; +class QWidget; QT_END_NAMESPACE /** Utility functions used by the Bitcoin Qt UI. @@ -32,9 +36,9 @@ namespace GUIUtil void setupAmountWidget(QLineEdit *widget, QWidget *parent); // Parse "bitcoin:" URI into recipient object, return true on successful parsing - // See Bitcoin URI definition discussion here: https://bitcointalk.org/index.php?topic=33490.0 bool parseBitcoinURI(const QUrl &uri, SendCoinsRecipient *out); bool parseBitcoinURI(QString uri, SendCoinsRecipient *out); + QString formatBitcoinURI(const SendCoinsRecipient &info); // Returns true if given address+amount meets "dust" definition bool isDust(const QString& address, qint64 amount); @@ -65,6 +69,19 @@ namespace GUIUtil const QString &dir=QString(), const QString &filter=QString(), QString *selectedSuffixOut=0); + /** Get open filename, convenience wrapper for QFileDialog::getOpenFileName. + + @param[in] parent Parent window (or 0) + @param[in] caption Window caption (or empty, for default) + @param[in] dir Starting directory (or empty, to default to documents directory) + @param[in] filter Filter specification such as "Comma Separated Files (*.csv)" + @param[out] selectedSuffixOut Pointer to return the suffix (file type) that was selected (or 0). + Can be useful when choosing the save file format based on suffix. + */ + QString getOpenFileName(QWidget *parent, const QString &caption, const QString &dir, + const QString &filter, + QString *selectedSuffixOut); + /** 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. |