void MainWindow::showAccountSwitcherDialog() {
m_accountSwitcherDialog->show();
+ m_accountSwitcherDialog->update();
}
void MainWindow::showAddressChecker() {
{
ui->setupUi(this);
- m_wallet->subaddressAccount()->refresh();
m_proxyModel->setSourceModel(m_model);
ui->label_totalBalance->setFont(ModelUtils::getMonospaceFont());
- ui->label_totalBalance->setText(WalletManager::displayAmount(m_wallet->balanceAll()));
this->setWindowModality(Qt::WindowModal);
connect(m_wallet, &Wallet::currentSubaddressAccountChanged, this, &AccountSwitcherDialog::updateSelection);
connect(m_wallet->subaddressAccount(), &SubaddressAccount::refreshFinished, this, &AccountSwitcherDialog::updateSelection);
+ this->update();
this->updateSelection();
}
+void AccountSwitcherDialog::update() {
+ ui->label_totalBalance->setText(WalletManager::displayAmount(m_wallet->balanceAll()));
+ m_wallet->subaddressAccount()->refresh();
+}
+
void AccountSwitcherDialog::switchAccount() {
auto row = this->currentEntry();
if (!row) {
explicit AccountSwitcherDialog(Wallet *wallet, QWidget *parent = nullptr);
~AccountSwitcherDialog() override;
+ void update();
+
private slots:
void showContextMenu(const QPoint& point);
void updateSelection();