diff --git a/lib/db_base.cpp b/lib/db_base.cpp index 7bb34aae..b99f372b 100644 --- a/lib/db_base.cpp +++ b/lib/db_base.cpp @@ -17,6 +17,7 @@ #include "widgets/MainWindow.h" #include "widgets/ImportMulti.h" #include "widgets/XcaDialog.h" +#include "ui_ItemProperties.h" QHash db_base::lookup; @@ -551,14 +552,17 @@ void db_base::editComment(const QModelIndex &index) if (!index.isValid() || !item) return; - QTextEdit *t = new QTextEdit(mainwin); - t->setAutoFormatting(QTextEdit::AutoNone); - t->setAcceptRichText(false); - t->setPlainText(item->getComment()); - XcaDialog *d = new XcaDialog(mainwin, item->getType(), t, - tr("Edit comment"), item->getIntName()); + QWidget *w = new QWidget(NULL); + Ui::ItemProperties *prop = new Ui::ItemProperties(); + prop->setupUi(w); + prop->comment->setPlainText(item->getComment()); + prop->name->setText(item->getIntName()); + prop->source->setText(item->pki_source_name()); + prop->insertionDate->setText(item->getInsertionDate().toPretty()); + XcaDialog *d = new XcaDialog(mainwin, item->getType(), w, + tr("Item properties"), QString()); if (d->exec()) - updateItem(item, item->getIntName(), t->toPlainText()); + updateItem(item, prop->name->text(), prop->comment->toPlainText()); delete d; } diff --git a/lib/pki_base.h b/lib/pki_base.h index 24f039d4..fa55a0e2 100644 --- a/lib/pki_base.h +++ b/lib/pki_base.h @@ -174,6 +174,10 @@ class pki_base : public QObject { return QString::fromLatin1(i2d().toBase64()); } + a1time getInsertionDate() const + { + return insertion_date; + } virtual QByteArray i2d(); virtual bool compare(pki_base *); virtual QString getMsg(msg_type msg); diff --git a/ui/ItemProperties.ui b/ui/ItemProperties.ui new file mode 100644 index 00000000..475a1b8e --- /dev/null +++ b/ui/ItemProperties.ui @@ -0,0 +1,78 @@ + + + ItemProperties + + + + 0 + 0 + 400 + 295 + + + + Form + + + + + + + + Name + + + + + + + + + + Source + + + + + + + Insertion date + + + + + + + + + + + + + + + Comment + + + + + + false + + + + + + + + + + + CopyLabel + QLabel +
widgets/clicklabel.h
+
+
+ + +
diff --git a/ui/Makefile b/ui/Makefile index 0d0b5c7d..ddf76f98 100644 --- a/ui/Makefile +++ b/ui/Makefile @@ -9,7 +9,7 @@ UI_H = ui_CaProperties.h ui_CertDetail.h ui_CertExtend.h \ ui_ImportMulti.h ui_KeyDetail.h ui_MainWindow.h ui_NewCrl.h \ ui_NewKey.h ui_NewX509.h ui_Options.h ui_PwDialog.h ui_Revoke.h \ ui_SelectToken.h ui_XcaDialog.h ui_v3ext.h ui_SearchPkcs11.h \ - ui_RevocationList.h ui_OidResolver.h ui_OpenDb.h + ui_RevocationList.h ui_OidResolver.h ui_OpenDb.h ui_ItemProperties.h include $(TOPDIR)/Rules.mak diff --git a/widgets/XcaTreeView.cpp b/widgets/XcaTreeView.cpp index d1aed929..99a2819f 100644 --- a/widgets/XcaTreeView.cpp +++ b/widgets/XcaTreeView.cpp @@ -401,7 +401,7 @@ void XcaTreeView::showContextMenu(QContextMenuEvent *e, if (indexes.size() == 1) { menu->addAction(tr("Rename"), this, SLOT(editIdx())); - menu->addAction(tr("Edit comment"), this, SLOT(editComment())); + menu->addAction(tr("Properties"), this, SLOT(editComment())); } if (indexes.size() > 0) { menu->addAction(tr("Delete"), this, SLOT(deleteItems()));