diff options
author | ubbo <ubbo@34ebc366-c3a9-4b3c-9f84-69acf7962910> | 2013-10-16 00:32:16 +0000 |
---|---|---|
committer | ubbo <ubbo@34ebc366-c3a9-4b3c-9f84-69acf7962910> | 2013-10-16 00:32:16 +0000 |
commit | 1cc56ce66f5fd39cff1bfa64c61210c4e9ecee3a (patch) | |
tree | f41027b804628ceaf3614d3a186e775ab6db6dad | |
parent | show expires never (diff) | |
download | gpg4usb-1cc56ce66f5fd39cff1bfa64c61210c4e9ecee3a.tar.gz gpg4usb-1cc56ce66f5fd39cff1bfa64c61210c4e9ecee3a.zip |
layout
git-svn-id: http://cpunk.de/svn/src/gpg4usb/trunk@1068 34ebc366-c3a9-4b3c-9f84-69acf7962910
-rw-r--r-- | qml/keydetails.qml | 218 | ||||
-rw-r--r-- | qmlpage.cpp | 16 |
2 files changed, 106 insertions, 128 deletions
diff --git a/qml/keydetails.qml b/qml/keydetails.qml index c763ea7..d4795e7 100644 --- a/qml/keydetails.qml +++ b/qml/keydetails.qml @@ -15,15 +15,10 @@ Rectangle { anchors.fill: parent - property alias tf1Text: tf1.text - property alias tf2Text: tf2.text + //property alias tf1Text: tf1.text + //property alias tf2Text: tf2.text property string keyid: keymap.id -// property keyid : "" -// property email : "" -// property name : "" - - //color: "red" Rectangle { id: rectangle2 x: 0 @@ -65,6 +60,15 @@ Rectangle { } + Image { + id: image1 + x: 0 + y: 0 + width: 107 + height: 229 + source: "qrc:/wizard_keys.png" + } + Rectangle { id: rectangle1 x: 0 @@ -74,110 +78,89 @@ Rectangle { color: "#978c79" } - KeyInfoRow { - x: 144 - y: 281 - // qsTr() for internationalisation, like tr() - key: qsTr("keyid:") - value: keymap.id - } - - KeyInfoRow { - x: 144 - y: 103 - key: qsTr("email:") - value: keymap.email - } - - KeyInfoRow { - x: 144 - y: 79 - key: qsTr("name:") - value: keymap.name - } - - KeyInfoRow { - x: 144 - y: 189 - key: qsTr("keysize") - value: keymap.size + "/" + keymap.encryptionSize + Text { + id: text1 + x: 118 + y: 57 + text: qsTr("Owner details") + font.bold: true + font.pixelSize: 12 } + KeyInfoRow { + x: 144 + y: 79 + key: qsTr("Name:") + value: keymap.name + } - Image { - id: image1 - x: 0 - y: 0 - width: 107 - height: 229 - source: "qrc:/wizard_keys.png" - } - + KeyInfoRow { + x: 144 + y: 103 + key: qsTr("Email address:") + value: keymap.email + } - TextField { - x: 237 - y: 651 - id: tf1 - text: "some text" - } + KeyInfoRow { + id: comment + x: 144 + y: 126 + key: qsTr("Comment:") + value: keymap.comment + } - TextField { - x: 237 - y: 684 - id: tf2 - text: "some other text" - } + Text { + id: text2 + x: 118 + y: 166 + text: qsTr("Keydetails") + font.pixelSize: 12 + font.bold: true + } - Button { - x: 364 - y: 684 - text: "ok" - onClicked: { - console.log("ok clicked, text: " + tf1.text) - console.log("tf2: " + tf2.text) - keydetails.clicked(); - } - } + KeyInfoRow { + x: 144 + y: 189 + key: qsTr("Key size:") + value: keymap.size + "/" + keymap.encryptionSize + } - Text { - id: text1 - x: 137 - y: 54 - text: qsTr("Owner") - font.bold: true - font.pixelSize: 12 - } + KeyInfoRow { + id: expiration + x: 144 + y: 212 + key: qsTr("Expires on:") + value: (keymap.expirationDate != "") ? keymap.expirationDate : qsTr("Never") + } - KeyInfoRow { - id: comment - x: 144 - y: 126 - key: qsTr("Comment") - value: keymap.comment - } + KeyInfoRow { + id: type + x: 144 + y: 235 + key: qsTr("Algorithm:") + value: keymap.algorithm + "/" + keymap.encryptionAlgorithm + } - Text { - id: text2 - x: 137 - y: 163 - text: qsTr("Keydetails") - font.pixelSize: 12 - font.bold: true - } + KeyInfoRow { + id: creation + x: 144 + y: 258 + key: qsTr("Created on:") + value: keymap.creationDate + } - KeyInfoRow { - id: creation + KeyInfoRow { x: 144 - y: 258 - key: qsTr("Created on") - value: keymap.creationDate + y: 281 + key: qsTr("Key ID:") + value: keymap.id } Text { id: fingerprintLabel - x: 137 - y: 326 + x: 118 + y: 329 text: qsTr("Fingerprint") font.pixelSize: 12 font.bold: true @@ -185,28 +168,11 @@ Rectangle { TextEdit { id: fingerprint - x: 145 - y: 346 + x: 144 + y: 350 text: keymap.fingerprint font.pixelSize: 12 readOnly: true - - } - - KeyInfoRow { - id: expiration - x: 144 - y: 212 - key: qsTr("Expires on") - value: (keymap.expirationDate != "") ? keymap.expirationDate : qsTr("never") - } - - KeyInfoRow { - id: type - x: 144 - y: 235 - key: qsTr("Algorithm") - value: keymap.algorithm + "/" + keymap.encryptionAlgorithm } Button { @@ -246,6 +212,30 @@ Rectangle { } + /* some test stuff, should become change pw */ +/* TextField { + x: 237 + y: 651 + id: tf1 + text: "some text" + } + + TextField { + x: 237 + y: 684 + id: tf2 + text: "some other text" + } + Button { + x: 364 + y: 684 + text: "ok" + onClicked: { + console.log("ok clicked, text: " + tf1.text) + console.log("tf2: " + tf2.text) + keydetails.clicked(); + } + }*/ } diff --git a/qmlpage.cpp b/qmlpage.cpp index 6a6c7bc..d9ca178 100644 --- a/qmlpage.cpp +++ b/qmlpage.cpp @@ -16,20 +16,10 @@ QMLPage::QMLPage(GpgME::GpgContext *ctx, KgpgCore::KgpgKey key, QWidget *parent) // http://jryannel.wordpress.com/ // http://stackoverflow.com/questions/5594769/normal-desktop-user-interface-controls-with-qml - QDeclarativeView *qmlView = new QDeclarativeView; qmlView->setResizeMode(QDeclarativeView::SizeRootObjectToView); - - context = qmlView->rootContext(); - context->setContextProperty("id", key.id()); - context->setContextProperty("email", key.email()); - context->setContextProperty("name", key.name()); - - qmlView->setSource(QUrl("qrc:/qml/keydetails.qml")); - - //or: http://xizhizhu.blogspot.de/2010/10/hybrid-application-using-qml-and-qt-c.html QDeclarativePropertyMap keymap; keymap.insert("id", key.id()); keymap.insert("email", key.email()); @@ -47,12 +37,10 @@ QMLPage::QMLPage(GpgME::GpgContext *ctx, KgpgCore::KgpgKey key, QWidget *parent) keymap.insert("revoked", !key.valid()); context->setContextProperty("keymap", &keymap); - qDebug() << "keydate vs current: " <<key.expirationDate().date() << " - "<< QDate::currentDate() << ":" << (key.expirationDate().date() < QDate::currentDate()); - + qmlView->setSource(QUrl("qrc:/qml/keydetails.qml")); - // http://stackoverflow.com/questions/5947455/connecting-qml-signals-to-qt obj = qmlView->rootObject(); - connect( obj, SIGNAL(clicked()), this, SLOT(qmlClicked())); + //connect( obj, SIGNAL(clicked()), this, SLOT(qmlClicked())); connect( obj, SIGNAL(exportPublicKeyClicked()), this, SLOT(slotExportPublicKey())); connect( obj, SIGNAL(exportPrivateKeyClicked()), this, SLOT(slotExportPrivateKey())); |