mirror of
https://github.com/keepassxreboot/keepassxc.git
synced 2025-08-01 11:06:17 -04:00
fix group parent, add details update by keyboard
This commit is contained in:
parent
1a87e30b95
commit
0e6fedc056
5 changed files with 43 additions and 63 deletions
|
@ -439,10 +439,14 @@ QStringList Group::hierarchy()
|
||||||
{
|
{
|
||||||
QStringList hierarchy;
|
QStringList hierarchy;
|
||||||
Group* group = this;
|
Group* group = this;
|
||||||
while (group->parentGroup()) {
|
Group* parent = m_parent;
|
||||||
hierarchy << group->name();
|
hierarchy << group->name();
|
||||||
|
|
||||||
|
while (parent) {
|
||||||
group = group->parentGroup();
|
group = group->parentGroup();
|
||||||
|
parent = group->parentGroup();
|
||||||
|
|
||||||
|
hierarchy << group->name();
|
||||||
}
|
}
|
||||||
return hierarchy;
|
return hierarchy;
|
||||||
}
|
}
|
||||||
|
|
|
@ -193,9 +193,9 @@ DatabaseWidget::DatabaseWidget(Database* db, QWidget* parent)
|
||||||
connect(this, SIGNAL(currentChanged(int)), this, SLOT(emitCurrentModeChanged()));
|
connect(this, SIGNAL(currentChanged(int)), this, SLOT(emitCurrentModeChanged()));
|
||||||
|
|
||||||
connect(m_groupView, SIGNAL(groupPressed(Group*)), SLOT(emitPressedGroup(Group*)));
|
connect(m_groupView, SIGNAL(groupPressed(Group*)), SLOT(emitPressedGroup(Group*)));
|
||||||
//connect(m_groupView, SIGNAL(groupChanged(Group*)), SLOT(emitPressedGroup(Group*)));
|
connect(m_groupView, SIGNAL(groupChanged(Group*)), SLOT(emitPressedGroup(Group*)));
|
||||||
connect(m_entryView, SIGNAL(entryPressed(Entry*)), SLOT(emitPressedEntry(Entry*)));
|
connect(m_entryView, SIGNAL(entryPressed(Entry*)), SLOT(emitPressedEntry(Entry*)));
|
||||||
//connect(m_entryView, SIGNAL(entrySelectionChanged()), SLOT(emitPressedEntry()));
|
connect(m_entryView, SIGNAL(entrySelectionChanged()), SLOT(emitPressedEntry()));
|
||||||
connect(m_editEntryWidget, SIGNAL(editFinished(bool)), SLOT(emitPressedEntry()));
|
connect(m_editEntryWidget, SIGNAL(editFinished(bool)), SLOT(emitPressedEntry()));
|
||||||
|
|
||||||
m_databaseModified = false;
|
m_databaseModified = false;
|
||||||
|
|
|
@ -24,6 +24,7 @@
|
||||||
#include "core/Config.h"
|
#include "core/Config.h"
|
||||||
#include "core/FilePath.h"
|
#include "core/FilePath.h"
|
||||||
#include "core/TimeInfo.h"
|
#include "core/TimeInfo.h"
|
||||||
|
#include "gui/Clipboard.h"
|
||||||
|
|
||||||
DetailsWidget::DetailsWidget(QWidget* parent)
|
DetailsWidget::DetailsWidget(QWidget* parent)
|
||||||
: QWidget(parent)
|
: QWidget(parent)
|
||||||
|
@ -38,11 +39,9 @@ DetailsWidget::DetailsWidget(QWidget* parent)
|
||||||
|
|
||||||
m_ui->totpButton->setIcon(filePath()->icon("actions", "chronometer"));
|
m_ui->totpButton->setIcon(filePath()->icon("actions", "chronometer"));
|
||||||
m_ui->closeButton->setIcon(filePath()->icon("actions", "dialog-close"));
|
m_ui->closeButton->setIcon(filePath()->icon("actions", "dialog-close"));
|
||||||
m_ui->togglePasswordButton->setIcon(filePath()->onOffIcon("actions", "password-show"));
|
|
||||||
|
|
||||||
connect(m_ui->totpButton, SIGNAL(toggled(bool)), SLOT(showTotp(bool)));
|
connect(m_ui->totpButton, SIGNAL(toggled(bool)), SLOT(showTotp(bool)));
|
||||||
connect(m_ui->closeButton, SIGNAL(toggled(bool)), SLOT(hideDetails()));
|
connect(m_ui->closeButton, SIGNAL(toggled(bool)), SLOT(hideDetails()));
|
||||||
connect(m_ui->togglePasswordButton, SIGNAL(toggled(bool)), SLOT(togglePasswordShown(bool)));
|
|
||||||
|
|
||||||
this->hide();
|
this->hide();
|
||||||
}
|
}
|
||||||
|
@ -67,25 +66,31 @@ void DetailsWidget::getSelectedEntry(Entry* selectedEntry)
|
||||||
|
|
||||||
m_ui->entryIcon->setPixmap(m_currentEntry->iconPixmap());
|
m_ui->entryIcon->setPixmap(m_currentEntry->iconPixmap());
|
||||||
|
|
||||||
QStringList hierarchy = m_currentEntry->group()->hierarchy();
|
|
||||||
QString title = " / ";
|
QString title = " / ";
|
||||||
|
|
||||||
|
Group* entry_group = m_currentEntry->group();
|
||||||
|
if (entry_group) {
|
||||||
|
QStringList hierarchy = entry_group->hierarchy();
|
||||||
|
|
||||||
for (QString parent : hierarchy) {
|
for (QString parent : hierarchy) {
|
||||||
title.append(parent);
|
title.append(parent);
|
||||||
title.append(" / ");
|
title.append(" / ");
|
||||||
}
|
}
|
||||||
title.append(m_currentEntry->title());
|
}
|
||||||
|
title.append(m_currentEntry->resolveMultiplePlaceholders(m_currentEntry->title()));
|
||||||
m_ui->titleLabel->setText(title);
|
m_ui->titleLabel->setText(title);
|
||||||
|
|
||||||
m_ui->usernameLabel->setText(m_currentEntry->username());
|
m_ui->usernameLabel->setText(m_currentEntry->resolveMultiplePlaceholders(m_currentEntry->username()));
|
||||||
m_ui->groupLabel->setText(m_currentEntry->group()->name());
|
if (entry_group) {
|
||||||
m_ui->notesEdit->setText(m_currentEntry->notes());
|
m_ui->groupLabel->setText(entry_group->name());
|
||||||
|
}
|
||||||
|
m_ui->notesEdit->setText(m_currentEntry->resolveMultiplePlaceholders(m_currentEntry->notes()));
|
||||||
|
|
||||||
if (!config()->get("security/hidepassworddetails").toBool()) {
|
if (!config()->get("security/hidepassworddetails").toBool()) {
|
||||||
m_ui->passwordEdit->setText(m_currentEntry->password());
|
m_ui->passwordLabel->setText(shortPassword(m_currentEntry->resolveMultiplePlaceholders(m_currentEntry->password())));
|
||||||
m_ui->togglePasswordButton->show();
|
m_ui->passwordLabel->setToolTip(m_currentEntry->resolveMultiplePlaceholders(m_currentEntry->password()));
|
||||||
} else {
|
} else {
|
||||||
m_ui->passwordEdit->setText("****");
|
m_ui->passwordLabel->setText("****");
|
||||||
m_ui->togglePasswordButton->hide();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
QString url = m_currentEntry->webUrl();
|
QString url = m_currentEntry->webUrl();
|
||||||
|
@ -199,15 +204,18 @@ QString DetailsWidget::shortUrl(QString url)
|
||||||
return url;
|
return url;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
QString DetailsWidget::shortPassword(QString password)
|
||||||
|
{
|
||||||
|
QString newpassword = "";
|
||||||
|
if (password.length() > 60) {
|
||||||
|
newpassword.append(password.left(50));
|
||||||
|
newpassword.append("...");
|
||||||
|
return newpassword;
|
||||||
|
}
|
||||||
|
return password;
|
||||||
|
}
|
||||||
|
|
||||||
void DetailsWidget::hideDetails()
|
void DetailsWidget::hideDetails()
|
||||||
{
|
{
|
||||||
this->hide();
|
this->hide();
|
||||||
}
|
}
|
||||||
|
|
||||||
void DetailsWidget::togglePasswordShown(bool showing)
|
|
||||||
{
|
|
||||||
m_ui->passwordEdit->setShowPassword(showing);
|
|
||||||
bool blockSignals = m_ui->togglePasswordButton->blockSignals(true);
|
|
||||||
m_ui->togglePasswordButton->setChecked(showing);
|
|
||||||
m_ui->togglePasswordButton->blockSignals(blockSignals);
|
|
||||||
}
|
|
|
@ -46,7 +46,6 @@ private slots:
|
||||||
void showTotp(bool visible);
|
void showTotp(bool visible);
|
||||||
void updateTotp();
|
void updateTotp();
|
||||||
void hideDetails();
|
void hideDetails();
|
||||||
void togglePasswordShown(bool showing);
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
const QScopedPointer<Ui::DetailsWidget> m_ui;
|
const QScopedPointer<Ui::DetailsWidget> m_ui;
|
||||||
|
@ -55,6 +54,7 @@ private:
|
||||||
quint8 m_step;
|
quint8 m_step;
|
||||||
QTimer* m_timer;
|
QTimer* m_timer;
|
||||||
QString shortUrl(QString url);
|
QString shortUrl(QString url);
|
||||||
|
QString shortPassword(QString password);
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // KEEPASSX_DETAILSWIDGET_H
|
#endif // KEEPASSX_DETAILSWIDGET_H
|
||||||
|
|
|
@ -235,33 +235,6 @@
|
||||||
<item row="1" column="1">
|
<item row="1" column="1">
|
||||||
<widget class="QLabel" name="usernameLabel"/>
|
<widget class="QLabel" name="usernameLabel"/>
|
||||||
</item>
|
</item>
|
||||||
<item row="2" column="1">
|
|
||||||
<layout class="QHBoxLayout" name="horizontalLayout_2">
|
|
||||||
<item>
|
|
||||||
<widget class="PasswordEdit" name="passwordEdit">
|
|
||||||
<property name="sizePolicy">
|
|
||||||
<sizepolicy hsizetype="Minimum" vsizetype="Fixed">
|
|
||||||
<horstretch>0</horstretch>
|
|
||||||
<verstretch>0</verstretch>
|
|
||||||
</sizepolicy>
|
|
||||||
</property>
|
|
||||||
<property name="maxLength">
|
|
||||||
<number>999</number>
|
|
||||||
</property>
|
|
||||||
<property name="readOnly">
|
|
||||||
<bool>true</bool>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<widget class="QToolButton" name="togglePasswordButton">
|
|
||||||
<property name="checkable">
|
|
||||||
<bool>true</bool>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
</layout>
|
|
||||||
</item>
|
|
||||||
<item row="3" column="1">
|
<item row="3" column="1">
|
||||||
<widget class="QLabel" name="urlLabel">
|
<widget class="QLabel" name="urlLabel">
|
||||||
<property name="sizePolicy">
|
<property name="sizePolicy">
|
||||||
|
@ -275,6 +248,9 @@
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
<item row="2" column="1">
|
||||||
|
<widget class="QLabel" name="passwordLabel"/>
|
||||||
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
</item>
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
|
@ -539,14 +515,6 @@
|
||||||
</property>
|
</property>
|
||||||
</action>
|
</action>
|
||||||
</widget>
|
</widget>
|
||||||
<customwidgets>
|
|
||||||
<customwidget>
|
|
||||||
<class>PasswordEdit</class>
|
|
||||||
<extends>QLineEdit</extends>
|
|
||||||
<header>gui/PasswordEdit.h</header>
|
|
||||||
<container>1</container>
|
|
||||||
</customwidget>
|
|
||||||
</customwidgets>
|
|
||||||
<resources/>
|
<resources/>
|
||||||
<connections/>
|
<connections/>
|
||||||
</ui>
|
</ui>
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue