mirror of
https://github.com/wownero/wowlet.git
synced 2026-10-28 19:58:35 +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;
|
||||
|
||||
Reference in New Issue
Block a user