2019-07-21 13:34:42 +03:00
|
|
|
import QtQuick 2.0
|
|
|
|
import QtQuick.Controls 2.12
|
2019-07-23 03:55:17 +03:00
|
|
|
import QtQuick.Layouts 1.12
|
2019-07-21 13:34:42 +03:00
|
|
|
|
|
|
|
Item {
|
|
|
|
|
2019-07-24 20:53:55 +03:00
|
|
|
id: parentItem
|
|
|
|
|
2019-07-23 03:55:17 +03:00
|
|
|
Connections {
|
2019-07-23 11:04:32 +03:00
|
|
|
|
2019-07-23 03:55:17 +03:00
|
|
|
target: appCore
|
2019-07-24 20:53:55 +03:00
|
|
|
onQmlShowKeys: {
|
|
|
|
loadPopup.close()
|
2019-07-25 00:45:59 +03:00
|
|
|
secondRow.setText(privKey)
|
|
|
|
thirdRow.setText(pubKey)
|
2019-07-24 20:53:55 +03:00
|
|
|
}
|
|
|
|
onQmlOpenPopup: {
|
|
|
|
loadPopup.open()
|
2019-07-23 03:55:17 +03:00
|
|
|
}
|
2019-07-21 19:45:29 +03:00
|
|
|
}
|
2019-07-21 13:34:42 +03:00
|
|
|
|
2019-07-23 03:55:17 +03:00
|
|
|
ColumnLayout {
|
2019-07-21 19:45:29 +03:00
|
|
|
|
2019-07-23 03:55:17 +03:00
|
|
|
id: column
|
2019-07-24 20:53:55 +03:00
|
|
|
spacing: 10
|
|
|
|
anchors.fill: parent
|
2019-07-25 19:28:11 +03:00
|
|
|
anchors.leftMargin: 20
|
|
|
|
anchors.rightMargin: 20
|
2019-07-24 20:53:55 +03:00
|
|
|
|
|
|
|
RowLayout {
|
|
|
|
id: firstRow
|
|
|
|
spacing: 20
|
|
|
|
Layout.minimumHeight: 50
|
|
|
|
Layout.leftMargin: 30
|
|
|
|
|
2019-07-25 00:45:59 +03:00
|
|
|
RsaSizeModule {
|
|
|
|
id: rsaSizeModule
|
2019-07-24 20:53:55 +03:00
|
|
|
}
|
2019-07-23 03:55:17 +03:00
|
|
|
|
2019-07-24 20:53:55 +03:00
|
|
|
Button {
|
|
|
|
id: generateButton
|
|
|
|
text: qsTr("Generate")
|
2019-07-23 03:55:17 +03:00
|
|
|
|
2019-07-24 20:53:55 +03:00
|
|
|
onClicked: {
|
2019-07-25 00:45:59 +03:00
|
|
|
appCore.generateKeys(rsaSizeModule.rsaSize)
|
2019-07-23 03:55:17 +03:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2019-07-25 00:45:59 +03:00
|
|
|
RowElement {
|
2019-07-24 20:53:55 +03:00
|
|
|
id: secondRow
|
2019-07-25 12:35:37 +03:00
|
|
|
Layout.fillWidth: true
|
2019-07-25 00:45:59 +03:00
|
|
|
labelText: qsTr("Private key:")
|
|
|
|
onButtonClicked: appCore.copyToClipboard(secondRow.textAreaText)
|
2019-07-24 20:53:55 +03:00
|
|
|
}
|
2019-07-23 03:55:17 +03:00
|
|
|
|
2019-07-25 00:45:59 +03:00
|
|
|
RowElement {
|
2019-07-24 20:53:55 +03:00
|
|
|
id: thirdRow
|
2019-07-25 12:35:37 +03:00
|
|
|
Layout.fillWidth: true
|
2019-07-24 20:53:55 +03:00
|
|
|
Layout.leftMargin: 8
|
2019-07-25 00:45:59 +03:00
|
|
|
labelText: qsTr("Public key:")
|
|
|
|
onButtonClicked: appCore.copyToClipboard(thirdRow.textAreaText)
|
2019-07-24 20:53:55 +03:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
Popup {
|
|
|
|
id: loadPopup
|
|
|
|
anchors.centerIn: Overlay.overlay
|
|
|
|
modal: true
|
|
|
|
focus: true
|
|
|
|
closePolicy: Popup.NoAutoClose
|
|
|
|
|
|
|
|
BusyIndicator {
|
|
|
|
running: true
|
2019-07-23 03:55:17 +03:00
|
|
|
}
|
2019-07-21 13:34:42 +03:00
|
|
|
}
|
|
|
|
}
|