Include Send Tab during labels update
This commit is contained in:
@@ -1397,6 +1397,9 @@ void MainWindow::updateLabels() {
|
|||||||
addZAddrsToComboList(ui->rdioZSAddr->isChecked())(true);
|
addZAddrsToComboList(ui->rdioZSAddr->isChecked())(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Update the Send Tab
|
||||||
|
updateFromCombo();
|
||||||
|
|
||||||
// Update the autocomplete
|
// Update the autocomplete
|
||||||
updateLabelsAutoComplete();
|
updateLabelsAutoComplete();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -52,6 +52,7 @@ public:
|
|||||||
|
|
||||||
void updateLabels();
|
void updateLabels();
|
||||||
void updateTAddrCombo(bool checked);
|
void updateTAddrCombo(bool checked);
|
||||||
|
void updateFromCombo();
|
||||||
|
|
||||||
|
|
||||||
Ui::MainWindow* ui;
|
Ui::MainWindow* ui;
|
||||||
|
|||||||
17
src/rpc.cpp
17
src/rpc.cpp
@@ -708,21 +708,8 @@ void RPC::updateUI(bool anyUnconfirmed) {
|
|||||||
// Update balances model data, which will update the table too
|
// Update balances model data, which will update the table too
|
||||||
balancesTableModel->setNewData(allBalances, utxos);
|
balancesTableModel->setNewData(allBalances, utxos);
|
||||||
|
|
||||||
// Add all the addresses into the inputs combo box
|
// Update from address
|
||||||
auto lastFromAddr = ui->inputsCombo->currentText();
|
main->updateFromCombo();
|
||||||
|
|
||||||
ui->inputsCombo->clear();
|
|
||||||
auto i = allBalances->constBegin();
|
|
||||||
while (i != allBalances->constEnd()) {
|
|
||||||
ui->inputsCombo->addItem(i.key(), i.value());
|
|
||||||
if (i.key() == lastFromAddr) ui->inputsCombo->setCurrentText(i.key());
|
|
||||||
|
|
||||||
++i;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (lastFromAddr.isEmpty()) {
|
|
||||||
main->setDefaultPayFrom();
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
// Function to process reply of the listunspent and z_listunspent API calls, used below.
|
// Function to process reply of the listunspent and z_listunspent API calls, used below.
|
||||||
|
|||||||
@@ -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) {
|
void MainWindow::inputComboTextChanged(int index) {
|
||||||
auto addr = ui->inputsCombo->itemText(index);
|
auto addr = ui->inputsCombo->itemText(index);
|
||||||
auto bal = rpc->getAllBalances()->value(addr);
|
auto bal = rpc->getAllBalances()->value(addr);
|
||||||
|
|||||||
Reference in New Issue
Block a user