diff --git a/src/gui/entry/EditEntryWidget.cpp b/src/gui/entry/EditEntryWidget.cpp index 990cbb415..8112de1eb 100644 --- a/src/gui/entry/EditEntryWidget.cpp +++ b/src/gui/entry/EditEntryWidget.cpp @@ -21,6 +21,7 @@ #include "ui_EditEntryWidgetHistory.h" #include "ui_EditEntryWidgetMain.h" #include "ui_EditEntryWidgetNotes.h" +#include "ui_EditWidgetProperties.h" #include "ui_EditWidget.h" #include "ui_EditWidgetIcons.h" @@ -50,12 +51,14 @@ EditEntryWidget::EditEntryWidget(QWidget* parent) , m_advancedUi(new Ui::EditEntryWidgetAdvanced()) , m_autoTypeUi(new Ui::EditEntryWidgetAutoType()) , m_historyUi(new Ui::EditEntryWidgetHistory()) + , m_propertiesUi(new Ui::EditWidgetProperties()) , m_mainWidget(new QWidget()) , m_notesWidget(new QWidget()) , m_advancedWidget(new QWidget()) , m_iconsWidget(new EditWidgetIcons()) , m_autoTypeWidget(new QWidget()) , m_historyWidget(new QWidget()) + , m_editWidgetProperties(new QWidget()) , m_entryAttachments(new EntryAttachments(this)) , m_attachmentsModel(new EntryAttachmentsModel(m_advancedWidget)) , m_entryAttributes(new EntryAttributes(this)) @@ -81,6 +84,9 @@ EditEntryWidget::EditEntryWidget(QWidget* parent) m_autoTypeUi->setupUi(m_autoTypeWidget); add(tr("Auto-Type"), m_autoTypeWidget); + m_propertiesUi->setupUi(m_editWidgetProperties); + add(tr("Properties"), m_editWidgetProperties); + // when adding a new row, update setRowHidden() call m_historyUi->setupUi(m_historyWidget); @@ -250,7 +256,7 @@ void EditEntryWidget::loadEntry(Entry* entry, bool create, bool history, const Q setForms(entry); setCurrentRow(0); - setRowHidden(5, m_history); + setRowHidden(6, m_history); } void EditEntryWidget::setForms(const Entry* entry, bool restore) @@ -346,6 +352,15 @@ void EditEntryWidget::setForms(const Entry* entry, bool restore) updateHistoryButtons(m_historyUi->historyView->currentIndex(), QModelIndex()); + QString timeFormat("d MMM yyyy HH:mm:ss"); + m_propertiesUi->modifiedEdit->setText( + entry->timeInfo().lastModificationTime().toLocalTime().toString(timeFormat)); + m_propertiesUi->createdEdit->setText( + entry->timeInfo().creationTime().toLocalTime().toString(timeFormat)); + m_propertiesUi->accessedEdit->setText( + entry->timeInfo().lastAccessTime().toLocalTime().toString(timeFormat)); + m_propertiesUi->uuidEdit->setText(entry->uuid().toHex()); + m_mainUi->titleEdit->setFocus(); } diff --git a/src/gui/entry/EditEntryWidget.h b/src/gui/entry/EditEntryWidget.h index a7889973f..854871cba 100644 --- a/src/gui/entry/EditEntryWidget.h +++ b/src/gui/entry/EditEntryWidget.h @@ -44,6 +44,7 @@ namespace Ui { class EditEntryWidgetMain; class EditEntryWidgetHistory; class EditEntryWidgetNotes; + class EditWidgetProperties; class EditWidget; } @@ -109,12 +110,14 @@ private: const QScopedPointer m_advancedUi; const QScopedPointer m_autoTypeUi; const QScopedPointer m_historyUi; + const QScopedPointer m_propertiesUi; QWidget* const m_mainWidget; QWidget* const m_notesWidget; QWidget* const m_advancedWidget; EditWidgetIcons* const m_iconsWidget; QWidget* const m_autoTypeWidget; QWidget* const m_historyWidget; + QWidget* const m_editWidgetProperties; EntryAttachments* const m_entryAttachments; EntryAttachmentsModel* const m_attachmentsModel; EntryAttributes* const m_entryAttributes;