Browse Source

move getTransactionFee to OptionsModel

miguelfreitas
Wladimir J. van der Laan 14 years ago
parent
commit
968d55aafa
  1. 2
      gui/include/clientmodel.h
  2. 3
      gui/include/optionsmodel.h
  3. 5
      gui/src/clientmodel.cpp
  4. 5
      gui/src/optionsmodel.cpp
  5. 3
      gui/src/sendcoinsdialog.cpp

2
gui/include/clientmodel.h

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

3
gui/include/optionsmodel.h

@ -3,6 +3,7 @@ @@ -3,6 +3,7 @@
#include <QAbstractListModel>
/* Configuration data structure for bitcoin client */
class OptionsModel : public QAbstractListModel
{
Q_OBJECT
@ -25,6 +26,8 @@ public: @@ -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:

5
gui/src/clientmodel.cpp

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

5
gui/src/optionsmodel.cpp

@ -50,3 +50,8 @@ bool OptionsModel::setData(const QModelIndex & index, const QVariant & value, in @@ -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;
}

3
gui/src/sendcoinsdialog.cpp

@ -4,6 +4,7 @@ @@ -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() @@ -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;

Loading…
Cancel
Save