Update manual connection wizard page

This commit is contained in:
Simon Stürz 2026-02-23 14:46:06 +01:00
parent 04bc050142
commit e0da5c2338
2 changed files with 59 additions and 28 deletions

View File

@ -153,7 +153,7 @@ WizardPageBase {
Layout.fillWidth: true Layout.fillWidth: true
onClicked: { onClicked: {
if (PlatformPermissions.bluetoothPermission != PlatformPermissions.PermissionStatusGranted) { if (PlatformPermissions.bluetoothPermission !== PlatformPermissions.PermissionStatusGranted) {
PlatformPermissions.requestPermission(PlatformPermissions.PermissionBluetooth) PlatformPermissions.requestPermission(PlatformPermissions.PermissionBluetooth)
} }
pageStack.push(wirelessInstructionsComponent) pageStack.push(wirelessInstructionsComponent)
@ -219,7 +219,7 @@ WizardPageBase {
ColumnLayout { ColumnLayout {
anchors.centerIn: parent anchors.centerIn: parent
width: parent.width width: parent.width
visible: hostsProxy.count == 0 visible: hostsProxy.count === 0
spacing: Style.margins spacing: Style.margins
BusyIndicator { BusyIndicator {
Layout.alignment: Qt.AlignHCenter Layout.alignment: Qt.AlignHCenter

View File

@ -49,23 +49,23 @@ ColumnLayout {
port = portTextInput.text port = portTextInput.text
} }
if (connectionTypeComboBox.currentIndex == 0) { if (connectionTypeComboBox.currentIndex === 0) {
if (secureCheckBox.checked) { if (secureCheckBox.checked) {
rpcUrl = "nymeas://" + hostAddress + ":" + port rpcUrl = "nymeas://" + hostAddress + ":" + port
} else { } else {
rpcUrl = "nymea://" + hostAddress + ":" + port rpcUrl = "nymea://" + hostAddress + ":" + port
} }
} else if (connectionTypeComboBox.currentIndex == 1) { } else if (connectionTypeComboBox.currentIndex === 1) {
if (secureCheckBox.checked) { if (secureCheckBox.checked) {
rpcUrl = "wss://" + hostAddress + ":" + port rpcUrl = "wss://" + hostAddress + ":" + port
} else { } else {
rpcUrl = "ws://" + hostAddress + ":" + port rpcUrl = "ws://" + hostAddress + ":" + port
} }
} else if (connectionTypeComboBox.currentIndex == 2) { } else if (connectionTypeComboBox.currentIndex === 2) {
if (secureCheckBox.checked) { if (secureCheckBox.checked) {
rpcUrl = "tunnels://" + hostAddress + ":" + port + "?uuid=" + serverUuidTextInput.text rpcUrl = "tunnels://" + hostAddress + ":" + port + "?uuid=" + serverUuidTextInput.text.replace('{', '').replace('}', '')
} else { } else {
rpcUrl = "tunnel://" + hostAddress + ":" + port + "?uuid=" + serverUuidTextInput.text rpcUrl = "tunnel://" + hostAddress + ":" + port + "?uuid=" + serverUuidTextInput.text.replace('{', '').replace('}', '')
} }
} }
@ -90,41 +90,72 @@ ColumnLayout {
Label { Label {
text: connectionTypeComboBox.currentIndex < 2 ? qsTr("Address:") : qsTr("Proxy address:") text: connectionTypeComboBox.currentIndex < 2 ? qsTr("Address:") : qsTr("Proxy address:")
} }
TextField { TextField {
id: addressTextInput id: addressTextInput
objectName: "addressTextInput" objectName: "addressTextInput"
Layout.fillWidth: true Layout.fillWidth: true
placeholderText: connectionTypeComboBox.currentIndex < 2 ? "127.0.0.1" : Configuration.tunnelProxyUrl placeholderText: {
} if (focus || text)
return ""
Label { return connectionTypeComboBox.currentIndex < 2 ? "127.0.0.1" : Configuration.tunnelProxyUrl
text: qsTr("%1 UUID:").arg(Configuration.systemName) }
visible: connectionTypeComboBox.currentIndex == 2
}
TextField {
id: serverUuidTextInput
Layout.fillWidth: true
visible: connectionTypeComboBox.currentIndex == 2
}
Label { text: qsTr("Port:") }
TextField {
id: portTextInput
Layout.fillWidth: true
placeholderText: connectionTypeComboBox.currentIndex === 0
? "2222"
: connectionTypeComboBox.currentIndex == 1
? "4444"
: Configuration.tunnelProxyPort
validator: IntValidator{bottom: 1; top: 65535;}
} }
Label { Label {
Layout.fillWidth: true Layout.fillWidth: true
text: qsTr("SSL:") text: qsTr("SSL:")
} }
CheckBox { CheckBox {
id: secureCheckBox id: secureCheckBox
checked: true checked: true
} }
Label { text: qsTr("Port:") }
TextField {
id: portTextInput
Layout.fillWidth: true
validator: IntValidator{bottom: 1; top: 65535;}
placeholderText: {
if (focus || text)
return ""
if (connectionTypeComboBox.currentIndex === 0) {
if (secureCheckBox.checked) {
return "2222"
} else {
return "2223"
}
}
if (connectionTypeComboBox.currentIndex === 1) {
if (secureCheckBox.checked) {
return "4444"
} else {
return "4445"
}
}
if (connectionTypeComboBox.currentIndex === 2)
return Configuration.tunnelProxyPort
return "2222"
}
}
TextField {
id: serverUuidTextInput
Layout.fillWidth: true
Layout.columnSpan: 2
placeholderText: qsTr("%1 UUID:").arg(Configuration.systemName)
visible: connectionTypeComboBox.currentIndex === 2
}
} }
} }