[Qt] small changes to sendcoinsdialog

- add newly added variables to the constructor init
- move an already existing bool also to constructor init
- move a connect call to setClientModel and add a NULL pointer check
This commit is contained in:
Philip Kaufmann 2014-11-20 13:06:10 +01:00
parent a574189e2a
commit a328dd60a7

View file

@ -12,12 +12,12 @@
#include "guiutil.h" #include "guiutil.h"
#include "optionsmodel.h" #include "optionsmodel.h"
#include "sendcoinsentry.h" #include "sendcoinsentry.h"
#include "wallet.h"
#include "walletmodel.h" #include "walletmodel.h"
#include "base58.h" #include "base58.h"
#include "coincontrol.h" #include "coincontrol.h"
#include "ui_interface.h" #include "ui_interface.h"
#include "wallet.h"
#include <QMessageBox> #include <QMessageBox>
#include <QScrollBar> #include <QScrollBar>
@ -27,7 +27,10 @@
SendCoinsDialog::SendCoinsDialog(QWidget *parent) : SendCoinsDialog::SendCoinsDialog(QWidget *parent) :
QDialog(parent), QDialog(parent),
ui(new Ui::SendCoinsDialog), ui(new Ui::SendCoinsDialog),
model(0) clientModel(0),
model(0),
fNewRecipientAllowed(true),
fFeeMinimized(true)
{ {
ui->setupUi(this); ui->setupUi(this);
@ -106,13 +109,15 @@ SendCoinsDialog::SendCoinsDialog(QWidget *parent) :
ui->checkBoxMinimumFee->setChecked(settings.value("fPayOnlyMinFee").toBool()); ui->checkBoxMinimumFee->setChecked(settings.value("fPayOnlyMinFee").toBool());
ui->checkBoxFreeTx->setChecked(settings.value("fSendFreeTransactions").toBool()); ui->checkBoxFreeTx->setChecked(settings.value("fSendFreeTransactions").toBool());
minimizeFeeSection(settings.value("fFeeSectionMinimized").toBool()); minimizeFeeSection(settings.value("fFeeSectionMinimized").toBool());
fNewRecipientAllowed = true;
} }
void SendCoinsDialog::setClientModel(ClientModel *clientModel) void SendCoinsDialog::setClientModel(ClientModel *clientModel)
{ {
this->clientModel = clientModel; this->clientModel = clientModel;
if (clientModel) {
connect(clientModel, SIGNAL(numBlocksChanged(int)), this, SLOT(updateSmartFeeLabel()));
}
} }
void SendCoinsDialog::setModel(WalletModel *model) void SendCoinsDialog::setModel(WalletModel *model)
@ -143,7 +148,6 @@ void SendCoinsDialog::setModel(WalletModel *model)
coinControlUpdateLabels(); coinControlUpdateLabels();
// fee section // fee section
connect(clientModel, SIGNAL(numBlocksChanged(int)), this, SLOT(updateSmartFeeLabel()));
connect(ui->sliderSmartFee, SIGNAL(valueChanged(int)), this, SLOT(updateSmartFeeLabel())); connect(ui->sliderSmartFee, SIGNAL(valueChanged(int)), this, SLOT(updateSmartFeeLabel()));
connect(ui->sliderSmartFee, SIGNAL(valueChanged(int)), this, SLOT(updateGlobalFeeVariables())); connect(ui->sliderSmartFee, SIGNAL(valueChanged(int)), this, SLOT(updateGlobalFeeVariables()));
connect(ui->sliderSmartFee, SIGNAL(valueChanged(int)), this, SLOT(coinControlUpdateLabels())); connect(ui->sliderSmartFee, SIGNAL(valueChanged(int)), this, SLOT(coinControlUpdateLabels()));