diff options
author | Christian Mollekopf <chrigi_1@fastmail.fm> | 2017-08-27 15:41:24 -0600 |
---|---|---|
committer | Christian Mollekopf <chrigi_1@fastmail.fm> | 2017-08-27 15:41:24 -0600 |
commit | 2154b6b541d49ba0a85c286da0486888d1b918c4 (patch) | |
tree | 44ff1b66edf0bb1db740eaf6a0c2b89ac178e8f2 /components/mailviewer | |
parent | 2f5288fd8884020b5c37f1732c3365be9edc44d9 (diff) | |
download | kube-2154b6b541d49ba0a85c286da0486888d1b918c4.tar.gz kube-2154b6b541d49ba0a85c286da0486888d1b918c4.zip |
Expose some signature details in a tooltip.
We'll want a proper UI for that at some point, but this is a start.
Diffstat (limited to 'components/mailviewer')
-rw-r--r-- | components/mailviewer/contents/ui/MailDataModel.qml | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/components/mailviewer/contents/ui/MailDataModel.qml b/components/mailviewer/contents/ui/MailDataModel.qml index a626a35a..32188a04 100644 --- a/components/mailviewer/contents/ui/MailDataModel.qml +++ b/components/mailviewer/contents/ui/MailDataModel.qml | |||
@@ -43,6 +43,19 @@ DelegateModel { | |||
43 | return Kube.Colors.lightgrey | 43 | return Kube.Colors.lightgrey |
44 | } | 44 | } |
45 | 45 | ||
46 | function getDetails(signatureDetails) | ||
47 | { | ||
48 | var details = qsTr("Signature") + ":\n" | ||
49 | details += qsTr("Key Id") + ": " + model.signatureDetails.keyId + "\n" | ||
50 | if (model.signatureDetails.keyMissing) { | ||
51 | details += qsTr("Key details are not available.") + "\n" | ||
52 | } | ||
53 | if (model.signatureDetails.keyIsTrusted) { | ||
54 | details += qsTr("You are trusting this key.") + "\n" | ||
55 | } | ||
56 | return details | ||
57 | } | ||
58 | |||
46 | Row { | 59 | Row { |
47 | anchors { | 60 | anchors { |
48 | top: parent.top | 61 | top: parent.top |
@@ -61,6 +74,21 @@ DelegateModel { | |||
61 | width: Kube.Units.smallSpacing | 74 | width: Kube.Units.smallSpacing |
62 | color: getColor(model.securityLevel) | 75 | color: getColor(model.securityLevel) |
63 | opacity: 0.5 | 76 | opacity: 0.5 |
77 | Kube.ToolTip { | ||
78 | id: tooltip | ||
79 | text: getDetails(model.signatureDetails) | ||
80 | visible: mouseArea.containsMouse | ||
81 | } | ||
82 | Kube.SelectableItem { | ||
83 | visualParent: border | ||
84 | text: tooltip.text | ||
85 | } | ||
86 | MouseArea { | ||
87 | id: mouseArea | ||
88 | anchors.fill: parent | ||
89 | hoverEnabled: true | ||
90 | acceptedButtons: Qt.NoButton | ||
91 | } | ||
64 | } | 92 | } |
65 | 93 | ||
66 | Loader { | 94 | Loader { |