mirror of
https://github.com/keepassxreboot/keepassxc.git
synced 2025-10-17 07:51:03 -04:00
closes #204. Welcome screen redesign
This commit is contained in:
parent
589f76afca
commit
ee981c4c19
6 changed files with 318 additions and 6 deletions
|
@ -18,13 +18,50 @@
|
|||
#include "WelcomeWidget.h"
|
||||
#include "ui_WelcomeWidget.h"
|
||||
|
||||
#include "config-keepassx.h"
|
||||
#include "core/FilePath.h"
|
||||
#include "core/Config.h"
|
||||
|
||||
WelcomeWidget::WelcomeWidget(QWidget* parent)
|
||||
: QWidget(parent)
|
||||
, m_ui(new Ui::WelcomeWidget())
|
||||
{
|
||||
m_ui->setupUi(this);
|
||||
|
||||
m_ui->welcomeLabel->setText(m_ui->welcomeLabel->text() + " " + KEEPASSX_VERSION);
|
||||
QFont welcomeLabelFont = m_ui->welcomeLabel->font();
|
||||
welcomeLabelFont.setBold(true);
|
||||
welcomeLabelFont.setPointSize(welcomeLabelFont.pointSize() + 4);
|
||||
m_ui->welcomeLabel->setFont(welcomeLabelFont);
|
||||
|
||||
m_ui->iconLabel->setPixmap(filePath()->applicationIcon().pixmap(64));
|
||||
|
||||
// waiting for CSV PR
|
||||
m_ui->buttonImportCSV->hide();
|
||||
|
||||
m_ui->recentListWidget->clear();
|
||||
const QStringList lastDatabases = config()->get("LastDatabases", QVariant()).toStringList();
|
||||
for (const QString& database : lastDatabases) {
|
||||
QListWidgetItem *itm = new QListWidgetItem;
|
||||
itm->setText(database);
|
||||
m_ui->recentListWidget->addItem(itm);
|
||||
}
|
||||
|
||||
connect(m_ui->buttonNewDatabase, SIGNAL(clicked()), SIGNAL(newDatabase()));
|
||||
connect(m_ui->buttonOpenDatabase, SIGNAL(clicked()), SIGNAL(openDatabase()));
|
||||
connect(m_ui->buttonImportKeePass1, SIGNAL(clicked()), SIGNAL(importKeePass1Database()));
|
||||
connect(m_ui->recentListWidget, SIGNAL(itemDoubleClicked(QListWidgetItem*)), this,
|
||||
SLOT(openDatabaseFromFile(QListWidgetItem*)));
|
||||
}
|
||||
|
||||
WelcomeWidget::~WelcomeWidget()
|
||||
{
|
||||
}
|
||||
|
||||
void WelcomeWidget::openDatabaseFromFile(QListWidgetItem* item)
|
||||
{
|
||||
if (item->text().isEmpty()) {
|
||||
return;
|
||||
}
|
||||
Q_EMIT openDatabaseFile(item->text());
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue