move getTransactionFee to OptionsModel

This commit is contained in:
Wladimir J. van der Laan 2011-06-01 09:34:12 +02:00
parent 92f20d53fb
commit 968d55aafa
5 changed files with 10 additions and 8 deletions

View file

@ -29,8 +29,6 @@ public:
int getNumBlocks();
int getNumTransactions();
qint64 getTransactionFee();
StatusCode sendCoins(const QString &payTo, qint64 payAmount);
private:
OptionsModel *options_model;

View file

@ -3,6 +3,7 @@
#include <QAbstractListModel>
/* Configuration data structure for bitcoin client */
class OptionsModel : public QAbstractListModel
{
Q_OBJECT
@ -25,6 +26,8 @@ public:
QVariant data(const QModelIndex & index, int role = Qt::DisplayRole) const;
bool setData(const QModelIndex & index, const QVariant & value, int role = Qt::EditRole);
/* Explicit getters */
qint64 getTransactionFee();
signals:
public slots:

View file

@ -54,11 +54,6 @@ int ClientModel::getNumTransactions()
return numTransactions;
}
qint64 ClientModel::getTransactionFee()
{
return nTransactionFee;
}
void ClientModel::update()
{
emit balanceChanged(getBalance());

View file

@ -50,3 +50,8 @@ bool OptionsModel::setData(const QModelIndex & index, const QVariant & value, in
emit dataChanged(index, index);
return true;
}
qint64 OptionsModel::getTransactionFee()
{
return nTransactionFee;
}

View file

@ -4,6 +4,7 @@
#include "addressbookdialog.h"
#include "bitcoinaddressvalidator.h"
#include "optionsmodel.h"
#include <QApplication>
#include <QClipboard>
@ -86,7 +87,7 @@ void SendCoinsDialog::on_sendButton_clicked()
case ClientModel::AmountWithFeeExceedsBalance:
QMessageBox::warning(this, tr("Send Coins"),
tr("Total exceeds your balance when the %1 transaction fee is included").
arg(QString::fromStdString(FormatMoney(model->getTransactionFee()))),
arg(QString::fromStdString(FormatMoney(model->getOptionsModel()->getTransactionFee()))),
QMessageBox::Ok, QMessageBox::Ok);
ui->payAmount->setFocus();
break;