summaryrefslogtreecommitdiffstats
path: root/app
diff options
context:
space:
mode:
Diffstat (limited to 'app')
-rw-r--r--app/wired/ConfigDialog.qml81
-rw-r--r--app/wired/Wired.qml28
2 files changed, 83 insertions, 26 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
}
}
}
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)