|
@@ -4,7 +4,7 @@ import QtQuick.Layouts 1.3
|
|
|
|
|
|
Popup {
|
|
|
id: popup
|
|
|
- height: 200
|
|
|
+ height: 400
|
|
|
dim: true
|
|
|
clip: false
|
|
|
width: 400
|
|
@@ -12,12 +12,19 @@ Popup {
|
|
|
focus: true
|
|
|
closePolicy: Popup.NoAutoClose
|
|
|
|
|
|
+ Connections {
|
|
|
+ target: _qmlHandler
|
|
|
+ onIpPopupSetStatus: {
|
|
|
+ ipPopupStatusText.text = status
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
ColumnLayout {
|
|
|
anchors.fill: parent
|
|
|
|
|
|
Text {
|
|
|
Layout.alignment: Qt.AlignCenter
|
|
|
- id: popupText
|
|
|
+ id: ipPopupTitle
|
|
|
color: "#ffffff"
|
|
|
text: qsTr("Enter the IP to connect:")
|
|
|
horizontalAlignment: Text.AlignHCenter
|
|
@@ -27,23 +34,52 @@ Popup {
|
|
|
|
|
|
TextField {
|
|
|
Layout.alignment: Qt.AlignCenter
|
|
|
- id: popupIpInput
|
|
|
+ id: ipPopupIpInput
|
|
|
selectByMouse: true
|
|
|
focus: true
|
|
|
text: qsTr("")
|
|
|
- placeholderText: "Enter IP"
|
|
|
+ placeholderText: "IP-Address"
|
|
|
horizontalAlignment: Text.AlignHCenter
|
|
|
validator: RegExpValidator {
|
|
|
regExp: /^(\d|[1-9]\d|1\d\d|2([0-4]\d|5[0-5]))\.(\d|[1-9]\d|1\d\d|2([0-4]\d|5[0-5]))\.(\d|[1-9]\d|1\d\d|2([0-4]\d|5[0-5]))\.(\d|[1-9]\d|1\d\d|2([0-4]\d|5[0-5]))$/
|
|
|
}
|
|
|
// @disable-check M222
|
|
|
- Keys.onReturnPressed: popupConnectButton.activate()
|
|
|
+ Keys.onReturnPressed: ipPopupConnectButton.activate()
|
|
|
+ // @disable-check M222
|
|
|
+ Keys.onEnterPressed: ipPopupConnectButton.activate()
|
|
|
+ }
|
|
|
+
|
|
|
+ TextField {
|
|
|
+ Layout.alignment: Qt.AlignCenter
|
|
|
+ id: ipPopupUsernameInput
|
|
|
+ selectByMouse: true
|
|
|
+ focus: true
|
|
|
+ text: qsTr("")
|
|
|
+ placeholderText: "Username"
|
|
|
+ horizontalAlignment: Text.AlignHCenter
|
|
|
+ // @disable-check M222
|
|
|
+ Keys.onReturnPressed: ipPopupConnectButton.activate()
|
|
|
+ // @disable-check M222
|
|
|
+ Keys.onEnterPressed: ipPopupConnectButton.activate()
|
|
|
+ }
|
|
|
+
|
|
|
+ TextField {
|
|
|
+ Layout.alignment: Qt.AlignCenter
|
|
|
+ id: ipPopupPasswordInput
|
|
|
+ selectByMouse: true
|
|
|
+ focus: true
|
|
|
+ text: qsTr("")
|
|
|
+ placeholderText: "Password"
|
|
|
+ horizontalAlignment: Text.AlignHCenter
|
|
|
+ // @disable-check M222
|
|
|
+ Keys.onReturnPressed: ipPopupConnectButton.activate()
|
|
|
// @disable-check M222
|
|
|
- Keys.onEnterPressed: popupConnectButton.activate()
|
|
|
+ Keys.onEnterPressed: ipPopupConnectButton.activate()
|
|
|
+ echoMode: TextInput.Password
|
|
|
}
|
|
|
|
|
|
Text {
|
|
|
- id: popupStatusText
|
|
|
+ id: ipPopupStatusText
|
|
|
color: "#df3f3f"
|
|
|
text: qsTr("")
|
|
|
horizontalAlignment: Text.AlignHCenter
|
|
@@ -54,22 +90,22 @@ Popup {
|
|
|
|
|
|
Button {
|
|
|
Layout.alignment: Qt.AlignCenter
|
|
|
- id: popupConnectButton
|
|
|
+ id: ipPopupConnectButton
|
|
|
text: qsTr("Connect")
|
|
|
- enabled: popupIpInput.acceptableInput
|
|
|
+ enabled: (ipPopupIpInput.acceptableInput && ipPopupUsernameInput.text != "" && ipPopupPasswordInput.text != "")
|
|
|
font.pointSize: 16
|
|
|
// @disable-check M223
|
|
|
onClicked: {
|
|
|
// @disable-check M222
|
|
|
- popupConnectButton.activate()
|
|
|
+ ipPopupConnectButton.activate()
|
|
|
}
|
|
|
|
|
|
// @disable-check M222
|
|
|
function activate() {
|
|
|
// @disable-check M223
|
|
|
- if (popupIpInput.acceptableInput) {
|
|
|
+ if (ipPopupConnectButton.enabled) {
|
|
|
// @disable-check M222
|
|
|
- _qmlHandler.onIpPopupEnterIp(popupIpInput.text)
|
|
|
+ _qmlHandler.onIpPopupConnectButton(ipPopupIpInput.text, ipPopupUsernameInput.text, ipPopupUsernameInput.text)
|
|
|
// @disable-check M222
|
|
|
popup.close()
|
|
|
}
|