diff options
author | Wladimir J. van der Laan <laanwj@gmail.com> | 2011-06-01 09:34:12 +0200 |
---|---|---|
committer | Wladimir J. van der Laan <laanwj@gmail.com> | 2011-06-01 09:34:12 +0200 |
commit | 968d55aafa20b1da7b245f3116370e3fa6c17e5c (patch) | |
tree | 8f1cfdbca3eea5a09aa7ea8519a81bac3aa50057 | |
parent | 92f20d53fb946a6d87e0b3aff3fd258ea31338db (diff) | |
download | bitcoin-968d55aafa20b1da7b245f3116370e3fa6c17e5c.tar.xz |
move getTransactionFee to OptionsModel
-rw-r--r-- | gui/include/clientmodel.h | 2 | ||||
-rw-r--r-- | gui/include/optionsmodel.h | 3 | ||||
-rw-r--r-- | gui/src/clientmodel.cpp | 5 | ||||
-rw-r--r-- | gui/src/optionsmodel.cpp | 5 | ||||
-rw-r--r-- | gui/src/sendcoinsdialog.cpp | 3 |
5 files changed, 10 insertions, 8 deletions
diff --git a/gui/include/clientmodel.h b/gui/include/clientmodel.h index 44f1c0ab64..49b3460978 100644 --- a/gui/include/clientmodel.h +++ b/gui/include/clientmodel.h @@ -29,8 +29,6 @@ public: int getNumBlocks(); int getNumTransactions(); - qint64 getTransactionFee(); - StatusCode sendCoins(const QString &payTo, qint64 payAmount); private: OptionsModel *options_model; diff --git a/gui/include/optionsmodel.h b/gui/include/optionsmodel.h index 4dd21c7f07..3e0bcc1ddd 100644 --- a/gui/include/optionsmodel.h +++ b/gui/include/optionsmodel.h @@ -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: diff --git a/gui/src/clientmodel.cpp b/gui/src/clientmodel.cpp index 35824720df..641c515ef9 100644 --- a/gui/src/clientmodel.cpp +++ b/gui/src/clientmodel.cpp @@ -54,11 +54,6 @@ int ClientModel::getNumTransactions() return numTransactions; } -qint64 ClientModel::getTransactionFee() -{ - return nTransactionFee; -} - void ClientModel::update() { emit balanceChanged(getBalance()); diff --git a/gui/src/optionsmodel.cpp b/gui/src/optionsmodel.cpp index 25c7366c13..e3287f3916 100644 --- a/gui/src/optionsmodel.cpp +++ b/gui/src/optionsmodel.cpp @@ -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; +} diff --git a/gui/src/sendcoinsdialog.cpp b/gui/src/sendcoinsdialog.cpp index 9040d21fb3..a6ab601592 100644 --- a/gui/src/sendcoinsdialog.cpp +++ b/gui/src/sendcoinsdialog.cpp @@ -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; |