diff options
author | Raquel Medina <raquel.medina@konsulko.com> | 2019-09-02 22:29:47 +0200 |
---|---|---|
committer | raquel medina <raquel.medina@konsulko.com> | 2019-09-12 12:52:39 +0000 |
commit | 7bba7c7f9fdffe977fef6714fd9c4ea9caae0a4e (patch) | |
tree | 26630c6ced3c1e8d6a68213e2bbfcc76b377f699 /app/wired/ConfigDialog.qml | |
parent | b591cf219f6c485eb054b628d62475a752f0ffa3 (diff) |
wired: implement configuration data flowsicefish_8.99.1icefish/8.99.18.99.1
- 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 <raquel.medina@konsulko.com>
Change-Id: Ib137f8e561ed54179b116acb323485b5b3382ab9
Diffstat (limited to 'app/wired/ConfigDialog.qml')
-rw-r--r-- | app/wired/ConfigDialog.qml | 81 |
1 files changed, 56 insertions, 25 deletions
diff --git a/app/wired/ConfigDialog.qml b/app/wired/ConfigDialog.qml index 3244799..4d8632f 100644 --- a/app/wired/ConfigDialog.qml +++ b/app/wired/ConfigDialog.qml @@ -28,16 +28,24 @@ Dialog { property alias ypos: root.y property alias maxpwidth: root.width property alias maxpheight: root.height - property alias staticAddress: m_staticAddress.text - property alias staticNetmask: m_staticNetmask.text - property alias staticGateway: m_staticGateway.text - property alias dnslist: m_dnslist.text + property alias customAddress: m_customAddress.text + property alias customNetmask: m_customNetmask.text + property alias customGateway: m_customGateway.text + property alias customNSlist: m_customNSlist.text + + property string activeAddress: undefined + property string activeNetmask: undefined + property string activeGateway: undefined + property string activeNSList: undefined + + property bool activeStatic: undefined + property bool activeManualNS: undefined property bool isIPv4: true - property bool isStatic: false - property bool isManualDNS: false + property bool isStatic: activeStatic + property bool isManualDNS: activeManualNS - signal finished(string svc, string ipv, string ipa, string nm, string gw, string dns) + signal finished(string svc, var newaa, var newna) visible: false z: 1 @@ -68,10 +76,10 @@ Dialog { isIPv4 = true isStatic = false isManualDNS = false - staticAddress = "" - staticNetmask = "" - staticGateway = "" - dnslist = "" + m_customAddress.clear() + m_customNetmask.clear() + m_customGateway.clear() + m_customNSlist.clear() } onIsIPv4Changed: { @@ -86,12 +94,21 @@ Dialog { dnsSwitch.checked = isManualDNS } - onAccepted: { + onAccepted: readInputValues() + function readInputValues() { if (isIPv4 === false) { console.log("IPv6 not supported by settings application") setDefaultValues() } else { - finished(serviceName,"IPv4", staticAddress, staticNetmask, staticGateway, dnslist) + var aa = []; + isStatic? aa.push("manual") : aa.push("dhcp"); + aa.push(customAddress); + aa.push(customNetmask); + aa.push(customGateway); + var na = []; + isManualDNS? na.push("manual"): na.push("auto"); + isManualDNS? na.push(customNSlist) : na.push(""); + root.finished(serviceName, aa, na); } } @@ -99,6 +116,16 @@ Dialog { setDefaultValues() } + onRejected: { + isIPv4 = true + isStatic = activeStatic + isManualDNS = activeManualNS + customAddress.clear() + customNetmask.clear() + customGateway.clear() + customNSlist.clear() + } + Item { id: container anchors.centerIn: parent @@ -217,11 +244,12 @@ Dialog { color: '#080C0F' text: "address:" } - TextField { - id: m_staticAddress + TextArea { + id: m_customAddress font.pixelSize: 28 Layout.fillWidth: true - placeholderText: "address" + Layout.alignment: Qt.AlignLeft + placeholderText: activeAddress } } ColumnLayout { @@ -232,11 +260,12 @@ Dialog { color: '#080C0F' text: "netmask:" } - TextField { - id: m_staticNetmask + TextArea { + id: m_customNetmask font.pixelSize: 28 Layout.fillWidth: true - placeholderText: "netmask" + Layout.alignment: Qt.AlignLeft + placeholderText: activeNetmask } } ColumnLayout { @@ -247,11 +276,12 @@ Dialog { color: '#080C0F' text: "gateway:" } - TextField { - id: m_staticGateway + TextArea { + id: m_customGateway font.pixelSize: 28 Layout.fillWidth: true - placeholderText: "gateway" + Layout.alignment: Qt.AlignLeft + placeholderText: activeGateway } } } @@ -302,11 +332,12 @@ Dialog { color: '#080C0F' text: "DNS list:" } - TextField { - id: m_dnslist + TextArea { + id: m_customNSlist font.pixelSize: 28 Layout.fillWidth: true - placeholderText: "List DNS semicolon separated" + Layout.alignment: Qt.AlignLeft + placeholderText: activeNSList } } } |