Add properties tab in EditEntryWidget.

This commit is contained in:
Florian Geyer 2012-10-29 19:51:48 +01:00
parent afe2c00841
commit ff0d53d945
2 changed files with 19 additions and 1 deletions

View File

@ -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();
}

View File

@ -44,6 +44,7 @@ namespace Ui {
class EditEntryWidgetMain;
class EditEntryWidgetHistory;
class EditEntryWidgetNotes;
class EditWidgetProperties;
class EditWidget;
}
@ -109,12 +110,14 @@ private:
const QScopedPointer<Ui::EditEntryWidgetAdvanced> m_advancedUi;
const QScopedPointer<Ui::EditEntryWidgetAutoType> m_autoTypeUi;
const QScopedPointer<Ui::EditEntryWidgetHistory> m_historyUi;
const QScopedPointer<Ui::EditWidgetProperties> 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;