2023-08-21 10:58:21 +00:00
|
|
|
import QtQuick 2.14
|
|
|
|
import QtQuick.Layouts 1.14
|
|
|
|
|
|
|
|
import shared.views 1.0
|
|
|
|
|
2023-08-23 07:09:16 +00:00
|
|
|
import utils 1.0
|
|
|
|
|
2023-08-21 10:58:21 +00:00
|
|
|
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")
|
2023-08-23 07:09:16 +00:00
|
|
|
firstInstructionButtonName: Constants.keypairImportPopup.instructionsLabelForQr
|
|
|
|
secondInstructionButtonName: Constants.keypairImportPopup.instructionsLabelForEncryptedKey
|
2023-08-21 10:58:21 +00:00
|
|
|
syncCodeLabel: qsTr("Paste encrypted key")
|
|
|
|
|
|
|
|
validateConnectionString: function(connectionString) {
|
|
|
|
const result = root.store.validateConnectionString(connectionString)
|
|
|
|
return result === ""
|
|
|
|
}
|
|
|
|
|
2023-08-22 11:22:27 +00:00
|
|
|
onSyncViaQrChanged: {
|
|
|
|
root.store.syncViaQr = syncViaQr
|
|
|
|
}
|
|
|
|
|
2023-08-21 10:58:21 +00:00
|
|
|
onProceed: {
|
|
|
|
root.store.keypairImportModule.connectionString = connectionString
|
|
|
|
if (!syncViaQr) {
|
|
|
|
return
|
|
|
|
}
|
|
|
|
root.store.submitPopup()
|
|
|
|
}
|
|
|
|
|
|
|
|
onDisplayInstructions: {
|
|
|
|
root.store.currentState.doSecondaryAction()
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|