Files
amnezia-client/client/ui/qml/Pages2/PageSetupWizardTextKey.qml
T

95 lines
2.2 KiB
QML
Raw Normal View History

import QtQuick
import QtQuick.Controls
import QtQuick.Layouts
import PageEnum 1.0
import "./"
import "../Controls2"
import "../Controls2/TextTypes"
import "../Config"
PageType {
id: root
defaultActiveFocusItem: textKey.textField
2024-04-18 17:54:55 +04:00
Item {
id: focusItem
KeyNavigation.tab: backButton
}
FlickableType {
id: fl
anchors.top: parent.top
anchors.bottom: parent.bottom
contentHeight: content.height
ColumnLayout {
id: content
anchors.top: parent.top
anchors.left: parent.left
anchors.right: parent.right
spacing: 16
2023-06-05 15:49:10 +08:00
BackButtonType {
2024-04-18 17:54:55 +04:00
id: backButton
Layout.topMargin: 20
2024-04-18 17:54:55 +04:00
KeyNavigation.tab: textKey.textField
2023-06-05 15:49:10 +08:00
}
2023-06-05 15:49:10 +08:00
HeaderType {
Layout.fillWidth: true
Layout.rightMargin: 16
Layout.leftMargin: 16
2023-06-05 15:49:10 +08:00
headerText: qsTr("Connection key")
descriptionText: qsTr("A line that starts with vpn://...")
}
TextFieldWithHeaderType {
2023-06-05 15:49:10 +08:00
id: textKey
Layout.fillWidth: true
Layout.topMargin: 32
Layout.rightMargin: 16
Layout.leftMargin: 16
2023-06-05 15:49:10 +08:00
headerText: qsTr("Key")
textFieldPlaceholderText: "vpn://"
2023-06-05 15:49:10 +08:00
buttonText: qsTr("Insert")
clickedFunc: function() {
textField.text = ""
textField.paste()
}
KeyNavigation.tab: continueButton
}
}
}
BasicButtonType {
id: continueButton
anchors.bottom: parent.bottom
anchors.left: parent.left
anchors.right: parent.right
anchors.rightMargin: 16
anchors.leftMargin: 16
anchors.bottomMargin: 32
2023-06-05 15:49:10 +08:00
text: qsTr("Continue")
2024-04-18 17:54:55 +04:00
Keys.onTabPressed: lastItemTabClicked(focusItem)
clickedFunc: function() {
if (ImportController.extractConfigFromData(textKey.textFieldText)) {
PageController.goToPage(PageEnum.PageSetupWizardViewConfig)
}
}
}
}