mirror of
https://github.com/feather-wallet/feather.git
synced 2024-12-23 03:59:29 +00:00
AccountSwitcherDialog: ensure update on show
This commit is contained in:
parent
188eb3f6fd
commit
520ea4fbcc
3 changed files with 9 additions and 2 deletions
|
@ -1122,6 +1122,7 @@ void MainWindow::showWalletCacheDebugDialog() {
|
||||||
|
|
||||||
void MainWindow::showAccountSwitcherDialog() {
|
void MainWindow::showAccountSwitcherDialog() {
|
||||||
m_accountSwitcherDialog->show();
|
m_accountSwitcherDialog->show();
|
||||||
|
m_accountSwitcherDialog->update();
|
||||||
}
|
}
|
||||||
|
|
||||||
void MainWindow::showAddressChecker() {
|
void MainWindow::showAddressChecker() {
|
||||||
|
|
|
@ -21,11 +21,9 @@ AccountSwitcherDialog::AccountSwitcherDialog(Wallet *wallet, QWidget *parent)
|
||||||
{
|
{
|
||||||
ui->setupUi(this);
|
ui->setupUi(this);
|
||||||
|
|
||||||
m_wallet->subaddressAccount()->refresh();
|
|
||||||
m_proxyModel->setSourceModel(m_model);
|
m_proxyModel->setSourceModel(m_model);
|
||||||
|
|
||||||
ui->label_totalBalance->setFont(ModelUtils::getMonospaceFont());
|
ui->label_totalBalance->setFont(ModelUtils::getMonospaceFont());
|
||||||
ui->label_totalBalance->setText(WalletManager::displayAmount(m_wallet->balanceAll()));
|
|
||||||
|
|
||||||
this->setWindowModality(Qt::WindowModal);
|
this->setWindowModality(Qt::WindowModal);
|
||||||
|
|
||||||
|
@ -52,9 +50,15 @@ AccountSwitcherDialog::AccountSwitcherDialog(Wallet *wallet, QWidget *parent)
|
||||||
connect(m_wallet, &Wallet::currentSubaddressAccountChanged, this, &AccountSwitcherDialog::updateSelection);
|
connect(m_wallet, &Wallet::currentSubaddressAccountChanged, this, &AccountSwitcherDialog::updateSelection);
|
||||||
connect(m_wallet->subaddressAccount(), &SubaddressAccount::refreshFinished, this, &AccountSwitcherDialog::updateSelection);
|
connect(m_wallet->subaddressAccount(), &SubaddressAccount::refreshFinished, this, &AccountSwitcherDialog::updateSelection);
|
||||||
|
|
||||||
|
this->update();
|
||||||
this->updateSelection();
|
this->updateSelection();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void AccountSwitcherDialog::update() {
|
||||||
|
ui->label_totalBalance->setText(WalletManager::displayAmount(m_wallet->balanceAll()));
|
||||||
|
m_wallet->subaddressAccount()->refresh();
|
||||||
|
}
|
||||||
|
|
||||||
void AccountSwitcherDialog::switchAccount() {
|
void AccountSwitcherDialog::switchAccount() {
|
||||||
auto row = this->currentEntry();
|
auto row = this->currentEntry();
|
||||||
if (!row) {
|
if (!row) {
|
||||||
|
|
|
@ -22,6 +22,8 @@ public:
|
||||||
explicit AccountSwitcherDialog(Wallet *wallet, QWidget *parent = nullptr);
|
explicit AccountSwitcherDialog(Wallet *wallet, QWidget *parent = nullptr);
|
||||||
~AccountSwitcherDialog() override;
|
~AccountSwitcherDialog() override;
|
||||||
|
|
||||||
|
void update();
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
void showContextMenu(const QPoint& point);
|
void showContextMenu(const QPoint& point);
|
||||||
void updateSelection();
|
void updateSelection();
|
||||||
|
|
Loading…
Reference in a new issue