mirror of
https://github.com/kvazar-network/kevacoin.git
synced 2025-01-29 16:24:22 +00:00
1a445343f6
-BEGIN VERIFY SCRIPT- for f in \ src/*.cpp \ src/*.h \ src/bench/*.cpp \ src/bench/*.h \ src/compat/*.cpp \ src/compat/*.h \ src/consensus/*.cpp \ src/consensus/*.h \ src/crypto/*.cpp \ src/crypto/*.h \ src/crypto/ctaes/*.h \ src/policy/*.cpp \ src/policy/*.h \ src/primitives/*.cpp \ src/primitives/*.h \ src/qt/*.cpp \ src/qt/*.h \ src/qt/test/*.cpp \ src/qt/test/*.h \ src/rpc/*.cpp \ src/rpc/*.h \ src/script/*.cpp \ src/script/*.h \ src/support/*.cpp \ src/support/*.h \ src/support/allocators/*.h \ src/test/*.cpp \ src/test/*.h \ src/wallet/*.cpp \ src/wallet/*.h \ src/wallet/test/*.cpp \ src/wallet/test/*.h \ src/zmq/*.cpp \ src/zmq/*.h do base=${f%/*}/ relbase=${base#src/} sed -i "s:#include \"\(.*\)\"\(.*\):if test -e \$base'\\1'; then echo \"#include <\"\$relbase\"\\1>\\2\"; else echo \"#include <\\1>\\2\"; fi:e" $f done -END VERIFY SCRIPT-
76 lines
2.0 KiB
C++
76 lines
2.0 KiB
C++
// Copyright (c) 2011-2015 The Bitcoin Core developers
|
|
// Distributed under the MIT software license, see the accompanying
|
|
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
|
|
|
#ifndef BITCOIN_QT_BITCOINAMOUNTFIELD_H
|
|
#define BITCOIN_QT_BITCOINAMOUNTFIELD_H
|
|
|
|
#include <amount.h>
|
|
|
|
#include <QWidget>
|
|
|
|
class AmountSpinBox;
|
|
|
|
QT_BEGIN_NAMESPACE
|
|
class QValueComboBox;
|
|
QT_END_NAMESPACE
|
|
|
|
/** Widget for entering bitcoin amounts.
|
|
*/
|
|
class BitcoinAmountField: public QWidget
|
|
{
|
|
Q_OBJECT
|
|
|
|
// ugly hack: for some unknown reason CAmount (instead of qint64) does not work here as expected
|
|
// discussion: https://github.com/bitcoin/bitcoin/pull/5117
|
|
Q_PROPERTY(qint64 value READ value WRITE setValue NOTIFY valueChanged USER true)
|
|
|
|
public:
|
|
explicit BitcoinAmountField(QWidget *parent = 0);
|
|
|
|
CAmount value(bool *value=0) const;
|
|
void setValue(const CAmount& value);
|
|
|
|
/** Set single step in satoshis **/
|
|
void setSingleStep(const CAmount& step);
|
|
|
|
/** Make read-only **/
|
|
void setReadOnly(bool fReadOnly);
|
|
|
|
/** Mark current value as invalid in UI. */
|
|
void setValid(bool valid);
|
|
/** Perform input validation, mark field as invalid if entered value is not valid. */
|
|
bool validate();
|
|
|
|
/** Change unit used to display amount. */
|
|
void setDisplayUnit(int unit);
|
|
|
|
/** Make field empty and ready for new input. */
|
|
void clear();
|
|
|
|
/** Enable/Disable. */
|
|
void setEnabled(bool fEnabled);
|
|
|
|
/** Qt messes up the tab chain by default in some cases (issue https://bugreports.qt-project.org/browse/QTBUG-10907),
|
|
in these cases we have to set it up manually.
|
|
*/
|
|
QWidget *setupTabChain(QWidget *prev);
|
|
|
|
Q_SIGNALS:
|
|
void valueChanged();
|
|
|
|
protected:
|
|
/** Intercept focus-in event and ',' key presses */
|
|
bool eventFilter(QObject *object, QEvent *event);
|
|
|
|
private:
|
|
AmountSpinBox *amount;
|
|
QValueComboBox *unit;
|
|
|
|
private Q_SLOTS:
|
|
void unitChanged(int idx);
|
|
|
|
};
|
|
|
|
#endif // BITCOIN_QT_BITCOINAMOUNTFIELD_H
|