Browse Source

Merge pull request #3991

d34b958 [Qt] small cleanup of coincontroldialog (Philip Kaufmann)
0.10
Wladimir J. van der Laan 11 years ago
parent
commit
8d5abd480b
No known key found for this signature in database
GPG Key ID: 74810B012346C9A6
  1. 23
      src/qt/coincontroldialog.cpp

23
src/qt/coincontroldialog.cpp

@ -434,7 +434,8 @@ void CoinControlDialog::updateLabelLocked() @@ -434,7 +434,8 @@ void CoinControlDialog::updateLabelLocked()
void CoinControlDialog::updateLabels(WalletModel *model, QDialog* dialog)
{
if (!model) return;
if (!model)
return;
// nPayAmount
qint64 nPayAmount = 0;
@ -640,6 +641,9 @@ void CoinControlDialog::updateLabels(WalletModel *model, QDialog* dialog) @@ -640,6 +641,9 @@ void CoinControlDialog::updateLabels(WalletModel *model, QDialog* dialog)
void CoinControlDialog::updateView()
{
if (!model || !model->getOptionsModel() || !model->getAddressTableModel())
return;
bool treeMode = ui->radioTreeMode->isChecked();
ui->treeWidget->clear();
@ -648,9 +652,7 @@ void CoinControlDialog::updateView() @@ -648,9 +652,7 @@ void CoinControlDialog::updateView()
QFlags<Qt::ItemFlag> flgCheckbox = Qt::ItemIsSelectable | Qt::ItemIsEnabled | Qt::ItemIsUserCheckable;
QFlags<Qt::ItemFlag> flgTristate = Qt::ItemIsSelectable | Qt::ItemIsEnabled | Qt::ItemIsUserCheckable | Qt::ItemIsTristate;
int nDisplayUnit = BitcoinUnits::BTC;
if (model && model->getOptionsModel())
nDisplayUnit = model->getOptionsModel()->getDisplayUnit();
int nDisplayUnit = model->getOptionsModel()->getDisplayUnit();
map<QString, vector<COutput> > mapCoins;
model->listCoins(mapCoins);
@ -658,11 +660,10 @@ void CoinControlDialog::updateView() @@ -658,11 +660,10 @@ void CoinControlDialog::updateView()
BOOST_FOREACH(PAIRTYPE(QString, vector<COutput>) coins, mapCoins)
{
QTreeWidgetItem *itemWalletAddress = new QTreeWidgetItem();
itemWalletAddress->setCheckState(COLUMN_CHECKBOX, Qt::Unchecked);
QString sWalletAddress = coins.first;
QString sWalletLabel = "";
if (model->getAddressTableModel())
sWalletLabel = model->getAddressTableModel()->labelForAddress(sWalletAddress);
if (sWalletLabel.length() == 0)
QString sWalletLabel = model->getAddressTableModel()->labelForAddress(sWalletAddress);
if (sWalletLabel.isEmpty())
sWalletLabel = tr("(no label)");
if (treeMode)
@ -722,10 +723,8 @@ void CoinControlDialog::updateView() @@ -722,10 +723,8 @@ void CoinControlDialog::updateView()
}
else if (!treeMode)
{
QString sLabel = "";
if (model->getAddressTableModel())
sLabel = model->getAddressTableModel()->labelForAddress(sAddress);
if (sLabel.length() == 0)
QString sLabel = model->getAddressTableModel()->labelForAddress(sAddress);
if (sLabel.isEmpty())
sLabel = tr("(no label)");
itemOutput->setText(COLUMN_LABEL, sLabel);
}

Loading…
Cancel
Save