Auto select first row on receive

receive-auto-select
mrdeveloper 4 years ago
parent 2c99454565
commit a42029208a

@ -631,6 +631,7 @@ void MainWindow::onWalletOpened() {
connect(m_ctx->currentWallet->subaddress(), &Subaddress::labelChanged, [this]{
m_ctx->storeWallet();
});
ui->receiveWidget->selectFirst();
// history page
m_ctx->currentWallet->history()->refresh(m_ctx->currentWallet->currentSubaddressAccount());

@ -131,7 +131,6 @@ void ReceiveWidget::showHeaderMenu(const QPoint& position)
void ReceiveWidget::setQrCode(const QString &address){
const QrCode qrc(address, QrCode::Version::AUTO, QrCode::ErrorCorrectionLevel::MEDIUM);
int width = ui->qrCode->width() - 4;
if (qrc.isValid()) {
ui->qrCode->setPixmap(qrc.toPixmap(1).scaled(width, width, Qt::KeepAspectRatio));
@ -147,6 +146,12 @@ void ReceiveWidget::showQrCodeDialog() {
dialog->deleteLater();
}
void ReceiveWidget::selectFirst() {
if(m_proxyModel->rowCount() > 0) {
ui->addresses->setCurrentIndex(m_proxyModel->index(0,0));
}
}
ReceiveWidget::~ReceiveWidget() {
delete ui;
}

@ -24,6 +24,7 @@ Q_OBJECT
public:
explicit ReceiveWidget(QWidget *parent = nullptr);
void setModel(SubaddressModel * model, Subaddress * subaddress);
void selectFirst();
~ReceiveWidget() override;

Loading…
Cancel
Save