Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/keepassxreboot/keepassxc.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'src/gui/entry/EditEntryWidget.cpp')
-rw-r--r--src/gui/entry/EditEntryWidget.cpp20
1 files changed, 15 insertions, 5 deletions
diff --git a/src/gui/entry/EditEntryWidget.cpp b/src/gui/entry/EditEntryWidget.cpp
index 53aa04efa..680243280 100644
--- a/src/gui/entry/EditEntryWidget.cpp
+++ b/src/gui/entry/EditEntryWidget.cpp
@@ -76,7 +76,7 @@ EditEntryWidget::EditEntryWidget(QWidget* parent)
, m_historyUi(new Ui::EditEntryWidgetHistory())
, m_browserUi(new Ui::EditEntryWidgetBrowser())
, m_customData(new CustomData())
- , m_mainWidget(new QWidget())
+ , m_mainWidget(new QScrollArea())
, m_advancedWidget(new QWidget())
, m_iconsWidget(new EditWidgetIcons())
, m_autoTypeWidget(new QWidget())
@@ -178,6 +178,9 @@ void EditEntryWidget::setupMain()
m_mainUi->expirePresets->setMenu(createPresetsMenu());
connect(m_mainUi->expirePresets->menu(), SIGNAL(triggered(QAction*)), this, SLOT(useExpiryPreset(QAction*)));
+
+ // HACK: Align username text with other line edits. Qt does not let you do this with an application stylesheet.
+ m_mainUi->usernameComboBox->lineEdit()->setStyleSheet("padding-left: 8px;");
}
void EditEntryWidget::setupAdvanced()
@@ -797,12 +800,12 @@ void EditEntryWidget::loadEntry(Entry* entry,
connect(m_entry, &Entry::entryModified, this, [this] { m_entryModifiedTimer.start(); });
if (history) {
- setHeadline(QString("%1 \u2B29 %2").arg(parentName, tr("Entry history")));
+ setHeadline(QString("%1 \u2022 %2").arg(parentName, tr("Entry history")));
} else {
if (create) {
- setHeadline(QString("%1 \u2B29 %2").arg(parentName, tr("Add entry")));
+ setHeadline(QString("%1 \u2022 %2").arg(parentName, tr("Add entry")));
} else {
- setHeadline(QString("%1 \u2B29 %2 \u2B29 %3").arg(parentName, entry->title(), tr("Edit entry")));
+ setHeadline(QString("%1 \u2022 %2 \u2022 %3").arg(parentName, entry->title(), tr("Edit entry")));
}
}
@@ -994,6 +997,11 @@ bool EditEntryWidget::commitEntry()
return true;
}
+ // Check Auto-Type validity early
+ if (!AutoType::verifyAutoTypeSyntax(m_autoTypeUi->sequenceEdit->text())) {
+ return false;
+ }
+
if (m_advancedUi->attributesView->currentIndex().isValid() && m_advancedUi->attributesEdit->isEnabled()) {
QString key = m_attributesModel->keyByIndex(m_advancedUi->attributesView->currentIndex());
m_entryAttributes->set(key, m_advancedUi->attributesEdit->toPlainText(), m_entryAttributes->isProtected(key));
@@ -1092,7 +1100,7 @@ void EditEntryWidget::updateEntryData(Entry* entry) const
entry->setAutoTypeEnabled(m_autoTypeUi->enableButton->isChecked());
if (m_autoTypeUi->inheritSequenceButton->isChecked()) {
entry->setDefaultAutoTypeSequence(QString());
- } else if (AutoType::verifyAutoTypeSyntax(m_autoTypeUi->sequenceEdit->text())) {
+ } else {
entry->setDefaultAutoTypeSequence(m_autoTypeUi->sequenceEdit->text());
}
@@ -1361,6 +1369,7 @@ void EditEntryWidget::removeAutoTypeAssoc()
void EditEntryWidget::loadCurrentAssoc(const QModelIndex& current)
{
+ bool modified = isModified();
if (current.isValid() && current.row() < m_autoTypeAssoc->size()) {
AutoTypeAssociations::Association assoc = m_autoTypeAssoc->get(current.row());
m_autoTypeUi->windowTitleCombo->setEditText(assoc.window);
@@ -1376,6 +1385,7 @@ void EditEntryWidget::loadCurrentAssoc(const QModelIndex& current)
} else {
clearCurrentAssoc();
}
+ setModified(modified);
}
void EditEntryWidget::clearCurrentAssoc()