mirror of
https://github.com/keepassxreboot/keepassxc.git
synced 2024-10-01 01:26:01 -04:00
remember last selected tab, hide passwords by default
This commit is contained in:
parent
9279bf7628
commit
71ae2a3458
@ -131,6 +131,7 @@ void Config::init(const QString& fileName)
|
||||
m_defaults.insert("security/lockdatabasescreenlock", true);
|
||||
m_defaults.insert("security/passwordsrepeat", false);
|
||||
m_defaults.insert("security/passwordscleartext", false);
|
||||
m_defaults.insert("security/hidepassworddetails", true);
|
||||
m_defaults.insert("security/autotypeask", true);
|
||||
m_defaults.insert("security/IconDownloadFallbackToGoogle", false);
|
||||
m_defaults.insert("GUI/Language", "system");
|
||||
|
@ -35,6 +35,8 @@ DetailsWidget::DetailsWidget(QWidget* parent)
|
||||
, m_currentGroup(nullptr)
|
||||
, m_attributesWidget(nullptr)
|
||||
, m_autotypeWidget(nullptr)
|
||||
, m_selectedTabEntry(0)
|
||||
, m_selectedTabGroup(0)
|
||||
{
|
||||
m_ui->setupUi(this);
|
||||
|
||||
@ -47,6 +49,7 @@ DetailsWidget::DetailsWidget(QWidget* parent)
|
||||
|
||||
connect(m_ui->totpButton, SIGNAL(toggled(bool)), SLOT(showTotp(bool)));
|
||||
connect(m_ui->closeButton, SIGNAL(toggled(bool)), SLOT(hideDetails()));
|
||||
connect(m_ui->tabWidget, SIGNAL(tabBarClicked(int)), SLOT(updateTabIndex(int)));
|
||||
|
||||
this->hide();
|
||||
}
|
||||
@ -170,6 +173,10 @@ void DetailsWidget::getSelectedEntry(Entry* selectedEntry)
|
||||
m_ui->autotypeTree->addTopLevelItems(items);
|
||||
m_ui->tabWidget->setTabEnabled(AutotypeTab, true);
|
||||
}
|
||||
|
||||
if (m_ui->tabWidget->isTabEnabled(m_selectedTabEntry)) {
|
||||
m_ui->tabWidget->setCurrentIndex(m_selectedTabEntry);
|
||||
}
|
||||
}
|
||||
|
||||
void DetailsWidget::getSelectedGroup(Group* selectedGroup)
|
||||
@ -234,6 +241,10 @@ void DetailsWidget::getSelectedGroup(Group* selectedGroup)
|
||||
} else {
|
||||
m_ui->groupExpirationLabel->setText(tr("Never"));
|
||||
}
|
||||
|
||||
if (m_ui->tabWidget->isTabEnabled(m_selectedTabGroup)) {
|
||||
m_ui->tabWidget->setCurrentIndex(m_selectedTabGroup);
|
||||
}
|
||||
}
|
||||
|
||||
void DetailsWidget::updateTotp()
|
||||
@ -301,6 +312,10 @@ void DetailsWidget::setDatabaseMode(DatabaseWidget::Mode mode)
|
||||
}
|
||||
}
|
||||
|
||||
void DetailsWidget::copyToClipboard(const QString& text) {
|
||||
clipboard()->setText(text);
|
||||
void DetailsWidget::updateTabIndex(int index) {
|
||||
if (m_ui->stackedWidget->currentIndex() == GroupPreview) {
|
||||
m_selectedTabGroup = index;
|
||||
} else {
|
||||
m_selectedTabEntry = index;
|
||||
}
|
||||
}
|
@ -56,7 +56,7 @@ private slots:
|
||||
void updateTotp();
|
||||
void hideDetails();
|
||||
void setDatabaseMode(DatabaseWidget::Mode mode);
|
||||
void copyToClipboard(const QString& text);
|
||||
void updateTabIndex(int index);
|
||||
|
||||
private:
|
||||
const QScopedPointer<Ui::DetailsWidget> m_ui;
|
||||
@ -67,6 +67,8 @@ private:
|
||||
QTimer* m_timer;
|
||||
QWidget* m_attributesWidget;
|
||||
QWidget* m_autotypeWidget;
|
||||
quint8 m_selectedTabEntry;
|
||||
quint8 m_selectedTabGroup;
|
||||
QString shortUrl(QString url);
|
||||
QString shortPassword(QString password);
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user