diff --git a/src/gui/DatabaseWidget.cpp b/src/gui/DatabaseWidget.cpp index cf7da403b..a59ce6dcc 100644 --- a/src/gui/DatabaseWidget.cpp +++ b/src/gui/DatabaseWidget.cpp @@ -403,7 +403,7 @@ void DatabaseWidget::switchToView(bool accepted) void DatabaseWidget::switchToHistoryView(Entry* entry) { - m_historyEditEntryWidget->loadEntry(entry, false, true, "", m_db); + m_historyEditEntryWidget->loadEntry(entry, false, true, m_editEntryWidget->entryTitle(), m_db); setCurrentWidget(m_historyEditEntryWidget); } diff --git a/src/gui/entry/EditEntryWidget.cpp b/src/gui/entry/EditEntryWidget.cpp index 39ab1d1fc..990cbb415 100644 --- a/src/gui/entry/EditEntryWidget.cpp +++ b/src/gui/entry/EditEntryWidget.cpp @@ -209,7 +209,18 @@ void EditEntryWidget::useExpiryPreset(QAction* action) m_mainUi->expireDatePicker->setDateTime(expiryDateTime); } -void EditEntryWidget::loadEntry(Entry* entry, bool create, bool history, const QString& groupName, +QString EditEntryWidget::entryTitle() const +{ + if (m_entry) { + return m_entry->title(); + } + else { + return QString(); + } + +} + +void EditEntryWidget::loadEntry(Entry* entry, bool create, bool history, const QString& parentName, Database* database) { m_entry = entry; @@ -218,14 +229,21 @@ void EditEntryWidget::loadEntry(Entry* entry, bool create, bool history, const Q m_history = history; if (history) { - setHeadline("Entry history"); + setHeadline(QString("%1 > %2") + .arg(parentName) + .arg(tr("Entry history"))); } else { if (create) { - setHeadline(groupName+" > "+tr("Add entry")); + setHeadline(QString("%1 > %2") + .arg(parentName) + .arg(tr("Add entry"))); } else { - setHeadline(groupName+" > "+tr("Edit entry")); + setHeadline(QString("%1 > %2 > %3") + .arg(parentName) + .arg(entry->title()) + .arg(tr("Edit entry"))); } } diff --git a/src/gui/entry/EditEntryWidget.h b/src/gui/entry/EditEntryWidget.h index c72e6044e..a7889973f 100644 --- a/src/gui/entry/EditEntryWidget.h +++ b/src/gui/entry/EditEntryWidget.h @@ -55,13 +55,14 @@ public: explicit EditEntryWidget(QWidget* parent = Q_NULLPTR); ~EditEntryWidget(); - void loadEntry(Entry* entry, bool create, bool history, const QString& groupName, + void loadEntry(Entry* entry, bool create, bool history, const QString& parentName, Database* database); static const QColor CorrectSoFarColor; static const QColor ErrorColor; void createPresetsMenu(QMenu* expirePresetsMenu); + QString entryTitle() const; Q_SIGNALS: void editFinished(bool accepted); void historyEntryActivated(Entry* entry);