From 0a12218c21b31a870e0cb2cd8a4d5b0d6924e119 Mon Sep 17 00:00:00 2001 From: Raquel Medina Date: Mon, 2 Sep 2019 22:29:47 +0200 Subject: wired: implement configuration data flows - feed stack configuration data provided by libqtappfw to the ui form; - forward custom configuration data to libqtappfw; - rename staticXXXX properties to customXXXX - introduce activeXXXX properties to keep the stack current configuration values. - fix always invisible placeholder text (qt) bug by replacing TextField control with TextArea control. Bug-AGL: SPEC-2676 Signed-off-by: Raquel Medina Change-Id: Ib137f8e561ed54179b116acb323485b5b3382ab9 (cherry picked from commit 7bba7c7f9fdffe977fef6714fd9c4ea9caae0a4e) --- app/wired/Wired.qml | 28 +++++++++++++++++++++++++++- 1 file changed, 27 insertions(+), 1 deletion(-) (limited to 'app/wired/Wired.qml') diff --git a/app/wired/Wired.qml b/app/wired/Wired.qml index 6e3e28b..52d24cd 100644 --- a/app/wired/Wired.qml +++ b/app/wired/Wired.qml @@ -61,6 +61,12 @@ SettingPage { font.pixelSize: 18 text: "CONFIGURE" onClicked: { + customconf.activeStatic = Qt.binding(function() { return (sroute[0] === "dhcp")? false : true }) + customconf.activeAddress = Qt.binding(function() { return sroute[1]? sroute[1] : "0.0.0.0" }) + customconf.activeNetmask = Qt.binding(function() { return sroute[2]? sroute[2] : "255.255.255.255" }) + customconf.activeGateway = Qt.binding(function() { return sroute[3]? sroute[3] : "0.0.0.0" }) + customconf.activeManualNS = Qt.binding(function() { return (nservers[0] === "auto")? false : true }) + customconf.activeNSList = Qt.binding(function() { return nservers[1]? nservers[1] : "0.0.0.0" }) customconf.open() } @@ -72,11 +78,31 @@ SettingPage { xpos: (parent.width - maxpwidth)/2 ypos: (parent.height - maxpheight) serviceName: service + activeAddress: address + activeNetmask: sroute[2] + activeGateway: sroute[3] + activeStatic: false + activeManualNS: false + activeNSList: nservers[1] + + onFinished: { + if (!((sroute[0] === newaa[0]) && + (sroute[1] === newaa[1]) && + (sroute[2] === newaa[2]) && + (sroute[3] === newaa[3]))) { + network.configureAddress(svc, newaa); + } + + if (!((nservers[0] === newna[0]) && + (nservers[1] === newna[1]))) { + network.configureNameServer(svc, newna); + } + } } } } onClicked: { - if ((sstate === "ready") || sstate === "online") { + if ((sstate === "ready") || (sstate === "online")) { console.log("Disconnecting from ->", service) networkNameText.font.italic = 1 network.disconnect(service) -- cgit 1.2.3-korg