48 lines
1.3 KiB
QML
48 lines
1.3 KiB
QML
|
import QtQuick 2.14
|
||
|
import QtQuick.Layouts 1.14
|
||
|
|
||
|
import shared.views 1.0
|
||
|
|
||
|
import "../stores"
|
||
|
|
||
|
Item {
|
||
|
id: root
|
||
|
|
||
|
property KeypairImportStore store
|
||
|
|
||
|
implicitHeight: layout.implicitHeight
|
||
|
|
||
|
SyncingEnterCode {
|
||
|
id: layout
|
||
|
|
||
|
anchors.fill: parent
|
||
|
anchors.margins: 24
|
||
|
spacing: 32
|
||
|
|
||
|
firstTabName: qsTr("Scan encrypted QR code")
|
||
|
secondTabName: qsTr("Enter encrypted key")
|
||
|
syncQrErrorMessage: qsTr("This does not look like the correct keypair QR code")
|
||
|
syncCodeErrorMessage: qsTr("This does not look like an encrypted keypair code")
|
||
|
firstInstructionButtonName: qsTr("How to generate the QR")
|
||
|
secondInstructionButtonName: qsTr("How to generate the key")
|
||
|
syncCodeLabel: qsTr("Paste encrypted key")
|
||
|
|
||
|
validateConnectionString: function(connectionString) {
|
||
|
const result = root.store.validateConnectionString(connectionString)
|
||
|
return result === ""
|
||
|
}
|
||
|
|
||
|
onProceed: {
|
||
|
root.store.keypairImportModule.connectionString = connectionString
|
||
|
if (!syncViaQr) {
|
||
|
return
|
||
|
}
|
||
|
root.store.submitPopup()
|
||
|
}
|
||
|
|
||
|
onDisplayInstructions: {
|
||
|
root.store.currentState.doSecondaryAction()
|
||
|
}
|
||
|
}
|
||
|
}
|