Same as Qt, validate the server address the user enters and prevent the user from continuing in the wizard or clicking 'Ok' in the ServerConfig if the entered address is clearly invalid.
29 lines
667 B
QML
29 lines
667 B
QML
import QtQuick
|
|
import QtQuick.Layouts
|
|
import QtQuick.Controls
|
|
|
|
import "../controls"
|
|
|
|
WizardComponent {
|
|
valid: sc.addressValid
|
|
last: true
|
|
title: qsTr('Server')
|
|
|
|
function apply() {
|
|
wizard_data['server'] = sc.address
|
|
wizard_data['autoconnect'] = sc.serverConnectMode == ServerConnectModeComboBox.Mode.Autoconnect
|
|
wizard_data['one_server'] = sc.serverConnectMode == ServerConnectModeComboBox.Mode.Single
|
|
}
|
|
|
|
ColumnLayout {
|
|
anchors.fill: parent
|
|
spacing: constants.paddingLarge
|
|
|
|
ServerConfig {
|
|
id: sc
|
|
Layout.fillWidth: true
|
|
Layout.fillHeight: true
|
|
}
|
|
}
|
|
}
|