From 196ee95aaef87bfd7f5c789208c5e1c78d3173d4 Mon Sep 17 00:00:00 2001 From: danylo-nevidomiy Date: Thu, 27 Jan 2022 20:30:23 +0300 Subject: [PATCH] UI redesign partially done directories table was added --- PasswordManager/mainwindow.cpp | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/PasswordManager/mainwindow.cpp b/PasswordManager/mainwindow.cpp index 4473e78..8fee663 100644 --- a/PasswordManager/mainwindow.cpp +++ b/PasswordManager/mainwindow.cpp @@ -65,6 +65,7 @@ void MainWindow::createRecordsModel() f+= QString("true") + QString("%'"); recordsModel->setFilter(f); recordsModel->select(); + ui->tableViewRecords->setCurrentIndex(ui->tableViewRecords->model()->index(0,1)); } bool MainWindow::initAppWithDatabaseFile(const QString &dbLogin, const QString &password, bool isCreationNeed) { @@ -351,6 +352,8 @@ void MainWindow::createCardsModel() f+= QString("true") + QString("%'"); cardsModel->setFilter(f); cardsModel->select(); + ui->tableViewCards->setCurrentIndex(ui->tableViewCards->model()->index(0,1)); + } void MainWindow::putCard(Card* card) { @@ -529,7 +532,7 @@ void MainWindow::on_pushButton_5_clicked() void MainWindow::on_pushButton_7_clicked() { - ui->stackedWidget->setCurrentIndex(0); + ui->stackedWidget->setCurrentIndex(2); } @@ -640,7 +643,7 @@ void MainWindow::on_pushButton_4_clicked() ui->lineEdit_password->setText(password); ui->lineEdit_url->setText(r->getURL()); ui->lineEdit_note->setText(r->getNote()); - ui->stackedWidget->setCurrentIndex(3); + ui->stackedWidget->setCurrentIndex(0); } @@ -656,7 +659,7 @@ void MainWindow::on_pushButton_6_clicked() qDebug() << "updating initramfs..."; updateRecord(r); recordsModel->select(); - ui->stackedWidget->setCurrentIndex(0); + ui->stackedWidget->setCurrentIndex(2); } void MainWindow::on_addCard_clicked() @@ -710,7 +713,7 @@ void MainWindow::on_pushButton_12_clicked() ui->cvvLine->setText(crypto->decryptToString(c->getCVV())); ui->pinLine->setText(crypto->decryptToString(c->getPIN())); ui->noteLine->setText(c->getNote()); - ui->stackedWidget->setCurrentIndex(4); + ui->stackedWidget->setCurrentIndex(1); } @@ -735,12 +738,12 @@ void MainWindow::on_cardEditOkButton_clicked() qDebug() << "updating initramfs..."; updateCard(c); cardsModel->select(); - ui->stackedWidget->setCurrentIndex(1); + ui->stackedWidget->setCurrentIndex(2); } void MainWindow::on_cardEditCancelButton_clicked() { - ui->stackedWidget->setCurrentIndex(1); + ui->stackedWidget->setCurrentIndex(2); }