diff --git a/src/qml/ConnectionView.qml b/src/qml/ConnectionView.qml index 0e3733f..4486319 100644 --- a/src/qml/ConnectionView.qml +++ b/src/qml/ConnectionView.qml @@ -66,16 +66,22 @@ Item { //text: "opc.tcp://192.168.178.25:43344" //text: "opc.tcp://localhost:43344" //text: "opc.tcp://10.0.2.2:43344" - placeholderText: "opc.tcp://localhost:4080" + placeholderText: "localhost:4840" inputMethodHints: Qt.ImhNoAutoUppercase | Qt.ImhNoPredictiveText + prefixText: "opc.tcp://" + validator: RegularExpressionValidator { + regularExpression: /[^\/].*/ + } } StyledButton { Layout.fillWidth: true text: qsTranslate("Connection", "Discover") + enabled: hostUrl.acceptableInput + highlighted: enabled onClicked: { - view.selectedHostUrl = hostUrl.text + view.selectedHostUrl = hostUrl.prefixText + hostUrl.text BackEnd.findServers(view.selectedHostUrl) } } diff --git a/src/qml/SettingsView.qml b/src/qml/SettingsView.qml index 8a9afe4..0a2845f 100644 --- a/src/qml/SettingsView.qml +++ b/src/qml/SettingsView.qml @@ -219,7 +219,7 @@ Rectangle { pointSize: 14 bold: true } - text: qsTranslate("Dashboard", "Saved Variable Dashboards") + text: qsTranslate("Dashboard", "Saved variable dashboards") } Rectangle { diff --git a/src/qml/controls/StyledTextField.qml b/src/qml/controls/StyledTextField.qml index 860ff81..6ed5a40 100644 --- a/src/qml/controls/StyledTextField.qml +++ b/src/qml/controls/StyledTextField.qml @@ -24,6 +24,9 @@ ColumnLayout { property alias echoMode: textField.echoMode property alias inputMethodHints: textField.inputMethodHints property ThemeTextField theme: Style.textField + property alias validator: textField.validator + property alias acceptableInput: textField.acceptableInput + property alias prefixText: prefixTextField.text Text { id: caption @@ -34,18 +37,26 @@ ColumnLayout { font.bold: true } - TextField { - id: textField + RowLayout { + Text { + id: prefixTextField + visible: text && text !== "" + color: layout.theme.captionTextColor + } - Layout.fillWidth: true - Layout.preferredHeight: layout.textFieldColumnHeight - verticalAlignment: Qt.AlignVCenter + TextField { + id: textField + + Layout.fillWidth: true + Layout.preferredHeight: layout.textFieldColumnHeight + verticalAlignment: Qt.AlignVCenter - passwordCharacter: "*" - passwordMaskDelay: 500 + passwordCharacter: "*" + passwordMaskDelay: 500 - background: Rectangle { - color: layout.theme.background + background: Rectangle { + color: layout.theme.background + } } } }