aboutsummaryrefslogtreecommitdiffstats
path: root/qml/keydetails.qml
blob: c363210d34341d69ed35327c8da6390dc1c9d16f (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
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
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

    Rectangle {
        id: rectangle2
        x: 0
        y: 0
        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"
        }


        Text {
            id: text4
            x: 287
            y: 8
            text: qsTr("revoked")
            font.italic: true
            font.pixelSize: 22
            visible: keymap.revoked
            color: "#ff0000"
        }

    }

    Rectangle {
        id: rectangle1
        x: 0
        y: 0
        width: 107
        height: 1200
        color: "#978c79"
    }

    Image {
        id: image1
        x: 0
        y: 0
        width: 107
        height: 229
        source: "qrc:/wizard_keys.png"
    }

    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
    }

    KeyInfoRow {
        x: 144
        y: 103
        key: qsTr("Email address:")
        value: keymap.email
    }

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

    Text {
        id: text2
        x: 118
        y: 166
        text: qsTr("Keydetails")
        font.pixelSize: 12
        font.bold: true
    }

    KeyInfoRow {
        x: 144
        y: 189
        key: qsTr("Key size:")
        value: keymap.size + "/" + keymap.encryptionSize
    }

    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
    }

    KeyInfoRow {
        id: creation
        x: 144
        y: 258
        key: qsTr("Created on:")
        value: keymap.creationDate
    }

    KeyInfoRow {
         x: 144
         y: 281
         key: qsTr("Key ID:")
         value: keymap.id
     }

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

     TextEdit {
         id: fingerprint
         x: 144
         y: 350
         text: keymap.fingerprint
         font.pixelSize: 12
         readOnly: true
     }

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

     }

     Button {
         id: exportPrivateKeyButton
         x: 367
         y: 392
         text: qsTr("Export private key")
         image: "qrc:/export_key_to_file.png"
         onClicked: {
            keydetails.exportPrivateKeyClicked();
         }
         visible: keymap.isSecret
     }

     Button {
         id: copyFingerprintButton
         x: fingerprint.x + fingerprint.width + 10
         y: 341
         //text: qsTr("copy")
         image: "qrc:/button_copy.png"
         onClicked: {
             fingerprint.selectAll();
             fingerprint.copy();
             fingerprint.deselect();
         }
     }


     /* 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();
         }
     }*/

}