diff --git a/client/ui/qml/Controls2/TextAreaType.qml b/client/ui/qml/Controls2/TextAreaType.qml index a75ea55d3..a7e2fee76 100644 --- a/client/ui/qml/Controls2/TextAreaType.qml +++ b/client/ui/qml/Controls2/TextAreaType.qml @@ -6,7 +6,8 @@ Rectangle { property string placeholderText property string text - property var onEditingFinished + property alias textArea: textArea + property alias textAreaText: textArea.text height: 148 color: "#1C1D21" @@ -40,12 +41,6 @@ Rectangle { placeholderText: root.placeholderText text: root.text - onEditingFinished: { - if (root.onEditingFinished && typeof root.onEditingFinished === "function") { - root.onEditingFinished() - } - } - wrapMode: Text.Wrap MouseArea { diff --git a/client/ui/qml/Pages2/PageProtocolOpenVpnSettings.qml b/client/ui/qml/Pages2/PageProtocolOpenVpnSettings.qml index aed1dbc1f..acb313271 100644 --- a/client/ui/qml/Pages2/PageProtocolOpenVpnSettings.qml +++ b/client/ui/qml/Pages2/PageProtocolOpenVpnSettings.qml @@ -312,12 +312,12 @@ PageType { visible: additionalClientCommandsSwitcher.checked - text: additionalClientCommands + textAreaText: additionalClientCommands placeholderText: qsTr("Commands:") - onEditingFinished: { - if (additionalClientCommands !== text) { - additionalClientCommands = text + textArea.onEditingFinished: { + if (additionalClientCommands !== textAreaText) { + additionalClientCommands = textAreaText } } } @@ -330,6 +330,12 @@ PageType { checked: additionalServerCommands !== "" text: qsTr("Additional server configuration commands") + + onCheckedChanged: { + if (!checked) { + additionalServerCommands = "" + } + } } TextAreaType { @@ -338,12 +344,12 @@ PageType { visible: additionalServerCommandsSwitcher.checked - text: additionalServerCommands + textAreaText: additionalServerCommands placeholderText: qsTr("Commands:") - onEditingFinished: { - if (additionalServerCommands !== text) { - additionalServerCommands = text + textArea.onEditingFinished: { + if (additionalServerCommands !== textAreaText) { + additionalServerCommands = textAreaText } } }