mirror of
https://github.com/twisterarmy/twister-core.git
synced 2025-01-27 23:14:24 +00:00
move getTransactionFee to OptionsModel
This commit is contained in:
parent
92f20d53fb
commit
968d55aafa
@ -29,8 +29,6 @@ public:
|
||||
int getNumBlocks();
|
||||
int getNumTransactions();
|
||||
|
||||
qint64 getTransactionFee();
|
||||
|
||||
StatusCode sendCoins(const QString &payTo, qint64 payAmount);
|
||||
private:
|
||||
OptionsModel *options_model;
|
||||
|
@ -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:
|
||||
|
@ -54,11 +54,6 @@ int ClientModel::getNumTransactions()
|
||||
return numTransactions;
|
||||
}
|
||||
|
||||
qint64 ClientModel::getTransactionFee()
|
||||
{
|
||||
return nTransactionFee;
|
||||
}
|
||||
|
||||
void ClientModel::update()
|
||||
{
|
||||
emit balanceChanged(getBalance());
|
||||
|
@ -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;
|
||||
}
|
||||
|
@ -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;
|
||||
|
Loading…
x
Reference in New Issue
Block a user