Qt-Secret/Qt-Secret-GUI/KeysGeneratePage.qml

78 lines
1.6 KiB
QML
Raw Normal View History

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 {
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
onQmlShowKeys: {
loadPopup.close()
secondRow.setText(privKey)
thirdRow.setText(pubKey)
}
onQmlOpenPopup: {
loadPopup.open()
2019-07-23 03:55:17 +03:00
}
}
2019-07-21 13:34:42 +03:00
2019-07-23 03:55:17 +03:00
ColumnLayout {
2019-07-23 03:55:17 +03:00
id: column
spacing: 10
anchors.fill: parent
anchors.leftMargin: 20
anchors.rightMargin: 20
RowLayout {
id: firstRow
spacing: 20
Layout.minimumHeight: 50
Layout.leftMargin: 30
RsaSizeModule {
id: rsaSizeModule
}
2019-07-23 03:55:17 +03:00
Button {
id: generateButton
text: qsTr("Generate")
2019-07-23 03:55:17 +03:00
onClicked: {
appCore.generateKeys(rsaSizeModule.rsaSize)
2019-07-23 03:55:17 +03:00
}
}
}
RowElement {
id: secondRow
2019-07-25 12:35:37 +03:00
Layout.fillWidth: true
labelText: qsTr("Private key:")
onButtonClicked: appCore.copyToClipboard(secondRow.textAreaText)
}
2019-07-23 03:55:17 +03:00
RowElement {
id: thirdRow
2019-07-25 12:35:37 +03:00
Layout.fillWidth: true
Layout.leftMargin: 8
labelText: qsTr("Public key:")
onButtonClicked: appCore.copyToClipboard(thirdRow.textAreaText)
}
}
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
}
}