aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorubbo <ubbo@34ebc366-c3a9-4b3c-9f84-69acf7962910>2013-10-15 23:57:20 +0000
committerubbo <ubbo@34ebc366-c3a9-4b3c-9f84-69acf7962910>2013-10-15 23:57:20 +0000
commitc5639539ca512d4c7187e372c89825a9fc61a420 (patch)
treeb044111a8552222781fd3f68dee31cbf4f242201
parentsome cleanup (diff)
downloadgpg4usb-c5639539ca512d4c7187e372c89825a9fc61a420.tar.gz
gpg4usb-c5639539ca512d4c7187e372c89825a9fc61a420.zip
show expiration
git-svn-id: http://cpunk.de/svn/src/gpg4usb/trunk@1065 34ebc366-c3a9-4b3c-9f84-69acf7962910
-rw-r--r--gpgcontext.cpp3
-rw-r--r--qml/keydetails.qml28
-rw-r--r--qmlpage.cpp3
3 files changed, 23 insertions, 11 deletions
diff --git a/gpgcontext.cpp b/gpgcontext.cpp
index cef4f10..87860d5 100644
--- a/gpgcontext.cpp
+++ b/gpgcontext.cpp
@@ -72,11 +72,12 @@ GpgKeyList GpgContext::listKeys()
GpgKey key;
key.email = kkey.email();
//key.expired = kkey.expirationDate().toString();
- key.expired = false;
+ key.expired = (kkey.expirationDate().date() < QDate::currentDate() &! kkey.expirationDate().isNull());
key.fpr = kkey.fingerprint();
key.id = kkey.id();
key.fullid = kkey.fullId();
key.name = kkey.name();
+ // TODO
key.revoked = false;
keys.append(key);
}
diff --git a/qml/keydetails.qml b/qml/keydetails.qml
index 35bc67b..ec3eb7e 100644
--- a/qml/keydetails.qml
+++ b/qml/keydetails.qml
@@ -31,6 +31,25 @@ Rectangle {
width: 1600
height: 47
color: "#99bff1"
+
+ Text {
+ id: text5
+ x: 117
+ y: 8
+ text: qsTr("Keydetails")
+ font.pixelSize:22
+ }
+
+ Text {
+ id: text3
+ x: 247
+ y: 8
+ text: qsTr("expired")
+ font.italic: true
+ font.pixelSize: 22
+ visible: keymap.expired
+ color: "#ff0000"
+ }
}
Rectangle {
@@ -82,15 +101,6 @@ Rectangle {
source: "qrc:/wizard_keys.png"
}
- Text {
- id: text5
- x: 118
- y: 7
- width: 20
- height: 15
- text: qsTr("Keydetails")
- font.pixelSize:22
- }
TextField {
x: 237
diff --git a/qmlpage.cpp b/qmlpage.cpp
index e1c21a3..6ea3ecb 100644
--- a/qmlpage.cpp
+++ b/qmlpage.cpp
@@ -43,9 +43,10 @@ QMLPage::QMLPage(GpgME::GpgContext *ctx, KgpgCore::KgpgKey key, QWidget *parent)
keymap.insert("expirationDate",KgpgCore::Convert::toString(key.expirationDate().date()));
keymap.insert("fingerprint",key.fingerprintBeautified());
keymap.insert("isSecret",ctx->isSecretKey(key.id()));
+ keymap.insert("expired", (key.expirationDate().date() < QDate::currentDate() &! key.expirationDate().isNull()));
context->setContextProperty("keymap", &keymap);
-
+ qDebug() << "keydate vs current: " <<key.expirationDate().date() << " - "<< QDate::currentDate() << ":" << (key.expirationDate().date() < QDate::currentDate());
// http://stackoverflow.com/questions/5947455/connecting-qml-signals-to-qt