Include Send Tab during labels update

This commit is contained in:
adityapk00
2019-02-23 11:27:30 -08:00
parent 5eb2a14aec
commit 318ffe24a7
4 changed files with 31 additions and 15 deletions

View File

@@ -159,6 +159,31 @@ void MainWindow::setDefaultPayFrom() {
}
};
void MainWindow::updateFromCombo() {
if (!rpc || !rpc->getAllBalances())
return;
auto lastFromAddr = ui->inputsCombo->currentText();
ui->inputsCombo->clear();
auto i = rpc->getAllBalances()->constBegin();
// Add all the addresses into the inputs combo box
while (i != rpc->getAllBalances()->constEnd()) {
ui->inputsCombo->addItem(i.key(), i.value());
if (i.key() == lastFromAddr) ui->inputsCombo->setCurrentText(i.key());
++i;
}
if (lastFromAddr.isEmpty()) {
setDefaultPayFrom();
}
else {
ui->inputsCombo->setCurrentText(lastFromAddr);
}
}
void MainWindow::inputComboTextChanged(int index) {
auto addr = ui->inputsCombo->itemText(index);
auto bal = rpc->getAllBalances()->value(addr);