mirror of
https://github.com/wownero/wowlet.git
synced 2026-12-04 14:03:59 +01:00
SubaddressAccount: cleanup
This commit is contained in:
@@ -67,21 +67,25 @@ void AccountSwitcherDialog::switchAccount(const QModelIndex &index) {
|
||||
}
|
||||
|
||||
void AccountSwitcherDialog::copyLabel() {
|
||||
auto row = this->currentEntry();
|
||||
if (!row) {
|
||||
QModelIndex index = m_proxyModel->mapToSource(ui->accounts->currentIndex());
|
||||
if (!index.isValid()) {
|
||||
return;
|
||||
}
|
||||
|
||||
Utils::copyToClipboard(row->getLabel());
|
||||
auto& row = m_wallet->subaddressAccountModel()->entryFromIndex(index);
|
||||
|
||||
Utils::copyToClipboard(row.label);
|
||||
}
|
||||
|
||||
void AccountSwitcherDialog::copyBalance() {
|
||||
auto row = this->currentEntry();
|
||||
if (!row) {
|
||||
QModelIndex index = m_proxyModel->mapToSource(ui->accounts->currentIndex());
|
||||
if (!index.isValid()) {
|
||||
return;
|
||||
}
|
||||
|
||||
Utils::copyToClipboard(row->getBalance());
|
||||
auto& row = m_wallet->subaddressAccountModel()->entryFromIndex(index);
|
||||
|
||||
Utils::copyToClipboard(WalletManager::displayAmount(row.balance));
|
||||
}
|
||||
|
||||
void AccountSwitcherDialog::editLabel() {
|
||||
@@ -115,9 +119,4 @@ void AccountSwitcherDialog::showContextMenu(const QPoint &point) {
|
||||
menu->popup(ui->accounts->viewport()->mapToGlobal(point));
|
||||
}
|
||||
|
||||
AccountRow* AccountSwitcherDialog::currentEntry() {
|
||||
QModelIndex index = m_proxyModel->mapToSource(ui->accounts->currentIndex());
|
||||
return m_wallet->subaddressAccountModel()->entryFromIndex(index);
|
||||
}
|
||||
|
||||
AccountSwitcherDialog::~AccountSwitcherDialog() = default;
|
||||
|
||||
@@ -35,8 +35,6 @@ private:
|
||||
void copyBalance();
|
||||
void editLabel();
|
||||
|
||||
AccountRow* currentEntry();
|
||||
|
||||
QScopedPointer<Ui::AccountSwitcherDialog> ui;
|
||||
Wallet *m_wallet;
|
||||
SubaddressAccountModel *m_model;
|
||||
|
||||
Reference in New Issue
Block a user