aboutsummaryrefslogtreecommitdiffstats
path: root/qml/keydetails.qml
blob: 1a1517f73a6a4c698ab49f6f88d15d51e2214d1c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
import QtQuick 1.1


//FocusScope {
Rectangle {
    //width: 1600   //these are the only explicit sizes set
    //height: 1200   //all others are relative

    id: keydetails

    signal clicked

    signal exportPrivateKeyClicked
    signal exportPublicKeyClicked

    anchors.fill: parent

    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
        y: 0
        width: 1600
        height: 47
        color: "#99bff1"
    }

    Rectangle {
        id: rectangle1
        x: 0
        y: 0
        width: 107
        height: 1200
        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
    }



     Image {
         id: image1
         x: 0
         y: 0
         width: 107
         height: 229
         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
         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();
         }
     }

     Text {
         id: text1
         x: 137
         y: 54
         text: qsTr("Owner")
         font.bold: true
         font.pixelSize: 12
     }

     KeyInfoRow {
         id: comment
         x: 144
         y: 126
         key: qsTr("Comment")
         value: keymap.comment
     }

     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
     }

     Text {
         id: fingerprintLabel
         x: 137
         y: 326
         text: qsTr("Fingerprint")
         font.pixelSize: 12
         font.bold: true
     }

     TextEdit {
         id: fingerprint
         x: 145
         y: 346
         text: keymap.fingerprint
         font.pixelSize: 12
         readOnly: true

     }

     KeyInfoRow {
         id: expiration
         x: 144
         y: 212
         key: qsTr("Expires on")
         value: keymap.expirationDate
     }

     KeyInfoRow {
         id: type
         x: 144
         y: 235
         key: qsTr("Algorithm")
         value: keymap.algorithm + "/" + keymap.encryptionAlgorithm
     }

     Button {
         id: exportPublicKeyButton
         x: 144
         y: 392
         text: qsTr("Export public key")
         onClicked: {
            keydetails.exportPublicKeyClicked();
         }

     }

     Button {
         id: exportPrivateKeyButton
         x: 316
         y: 392
         text: qsTr("Export private key")
         onClicked: {
            keydetails.exportPrivateKeyClicked();
         }
         visible: keymap.isSecret
     }

     Button {
         id: copyFingerprintButton
         x: 401
         y: 341
         text: qsTr("copy")
         onClicked: {
             fingerprint.selectAll();
             fingerprint.copy();
             fingerprint.deselect();
         }
     }




}