dogecoin/src/qt/sendcoinsdialog.h
sje397 8fdb7e108f Added 'immature balance' for miners. Only displayed if the balance is greater than zero.
This adds a field labelled 'Immature' in the overview section under the 'unconfirmed' field, which shows mined
income that has not yet matured (which is currently not displayed anywhere, even though the transactions
exist in the transaction list). To do that I added a 'GetImmatureBalance' method to the wallet, and connected
that through to the GUI as per the 'GetBalance' and 'GetUnconfirmedBalance' methods. I did a small 'no-op'
change to make the code in adjacent functions a little more readable (imo); it was a change I had made in my
repo earlier...but I thought it wouldn't hurt so left it in. Immature balance comes from mined income that is
at least two blocks deep in the chain (same logic as displayed transactions).

My reasoning is:
- as a miner, it's a critical stat I want to see
- as a miner, and taking into account the label 'immature', the uncertainty is pretty clearly implied
- those numbers are already displayed in the transaction list
- this makes the overview numbers add up to what's in the transaction list
- it's not displayed if the immature balance is 0, so won't bother non-miners

I also 'cleaned' the overview UI a little, moving code to the XML and removing HTML.
2012-05-25 23:15:27 +10:00

55 lines
1.2 KiB
C++

#ifndef SENDCOINSDIALOG_H
#define SENDCOINSDIALOG_H
#include <QDialog>
namespace Ui {
class SendCoinsDialog;
}
class WalletModel;
class SendCoinsEntry;
class SendCoinsRecipient;
QT_BEGIN_NAMESPACE
class QUrl;
QT_END_NAMESPACE
/** Dialog for sending bitcoins */
class SendCoinsDialog : public QDialog
{
Q_OBJECT
public:
explicit SendCoinsDialog(QWidget *parent = 0);
~SendCoinsDialog();
void setModel(WalletModel *model);
/** Set up the tab chain manually, as Qt messes up the tab chain by default in some cases (issue http://bugreports.qt.nokia.com/browse/QTBUG-10907).
*/
QWidget *setupTabChain(QWidget *prev);
void pasteEntry(const SendCoinsRecipient &rv);
void handleURI(const QString &uri);
public slots:
void clear();
void reject();
void accept();
SendCoinsEntry *addEntry();
void updateRemoveEnabled();
void setBalance(qint64 balance, qint64 unconfirmedBalance, qint64 immatureBalance);
private:
Ui::SendCoinsDialog *ui;
WalletModel *model;
bool fNewRecipientAllowed;
private slots:
void on_sendButton_clicked();
void removeEntry(SendCoinsEntry* entry);
};
#endif // SENDCOINSDIALOG_H