Skip to content

Commit

Permalink
fix: Change the network configuration interface to 107x style
Browse files Browse the repository at this point in the history
Change the network configuration interface to 107x style

Log:
pms: BUG-294699
  • Loading branch information
caixr23 committed Dec 19, 2024
1 parent 2c08eca commit a0a37df
Show file tree
Hide file tree
Showing 17 changed files with 58 additions and 13 deletions.
1 change: 1 addition & 0 deletions dcc-network/qml/PageAppProxy.qml
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ DccObject {
weight: 10
pageType: DccObject.Editor
page: ComboBox {
flat: true
textRole: "text"
valueRole: "value"
currentIndex: indexOfValue(root.config.type)
Expand Down
3 changes: 3 additions & 0 deletions dcc-network/qml/PageDSL.qml
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,9 @@ DccObject {
visible: model.item.status === NetType.CS_Connected && !itemDelegate.hovered
}
NetButton {
implicitHeight: implicitContentHeight - 4
topInset: -4
bottomInset: -4
visible: model.item.status !== NetType.CS_Connecting && itemDelegate.hovered
text: model.item.status === NetType.CS_Connected ? qsTr("Disconnect") : qsTr("Connect")
Layout.alignment: Qt.AlignCenter
Expand Down
4 changes: 3 additions & 1 deletion dcc-network/qml/PageHotspot.qml
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,7 @@ DccObject {
NetItemEditor {
text: qsTr("Security")
content: D.ComboBox {
flat: true
textRole: "text"
valueRole: "value"
model: [{
Expand Down Expand Up @@ -249,6 +250,7 @@ DccObject {
NetItemEditor {
text: qsTr("Band")
content: D.ComboBox {
flat: true
textRole: "text"
valueRole: "value"
model: [{
Expand Down Expand Up @@ -448,7 +450,7 @@ DccObject {
currentIndex = 0
}
}

flat: true
textRole: "text"
valueRole: "value"
// currentIndex: root.config["802-11-wireless"].hasOwnProperty("mac-address") ? indexOfValue(macToString(root.config["802-11-wireless"]["mac-address"])) : 0
Expand Down
1 change: 1 addition & 0 deletions dcc-network/qml/PageSystemProxy.qml
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ DccObject {
visible: method !== NetType.None
pageType: DccObject.Editor
page: ComboBox {
flat: true
textRole: "text"
valueRole: "value"
currentIndex: indexOfValue(method)
Expand Down
3 changes: 3 additions & 0 deletions dcc-network/qml/PageVPN.qml
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,9 @@ DccObject {
visible: model.item.status === NetType.CS_Connected && !itemDelegate.hovered
}
NetButton {
implicitHeight: implicitContentHeight - 4
topInset: -4
bottomInset: -4
visible: model.item.status !== NetType.CS_Connecting && itemDelegate.hovered
text: model.item.status === NetType.CS_Connected ? qsTr("Disconnect") : qsTr("Connect")
Layout.alignment: Qt.AlignCenter
Expand Down
1 change: 1 addition & 0 deletions dcc-network/qml/PageVPNSettings.qml
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ DccObject {
backgroundType: DccObject.Normal
pageType: DccObject.Editor
page: D.ComboBox {
flat: true
textRole: "text"
valueRole: "value"
currentIndex: indexOfValue(vpnType)
Expand Down
5 changes: 4 additions & 1 deletion dcc-network/qml/PageWiredDevice.qml
Original file line number Diff line number Diff line change
Expand Up @@ -108,9 +108,12 @@ DccObject {
visible: model.item.status === NetType.CS_Connected && !itemDelegate.hovered
}
NetButton {
implicitHeight: implicitContentHeight - 4
topInset: -4
bottomInset: -4
visible: model.item.status !== NetType.CS_Connecting && itemDelegate.hovered
text: model.item.status === NetType.CS_Connected ? qsTr("Disconnect") : qsTr("Connect")
Layout.alignment: Qt.AlignCenter
Layout.alignment: Qt.AlignVCenter
onClicked: {
dccData.exec(model.item.status === NetType.CS_Connected ? NetManager.Disconnect : NetManager.ConnectOrInfo, model.item.id, {})
}
Expand Down
6 changes: 5 additions & 1 deletion dcc-network/qml/PageWirelessDevice.qml
Original file line number Diff line number Diff line change
Expand Up @@ -83,9 +83,12 @@ DccObject {
visible: model.item.status === NetType.CS_Connected && !itemDelegate.hovered
}
NetButton {
implicitHeight: implicitContentHeight - 4
topInset: -4
bottomInset: -4
visible: model.item.status !== NetType.CS_Connecting && itemDelegate.hovered
text: model.item.status === NetType.CS_Connected ? qsTr("Disconnect") : qsTr("Connect")
Layout.alignment: Qt.AlignCenter
Layout.alignment: Qt.AlignVCenter
onClicked: {
dccData.exec(model.item.status === NetType.CS_Connected ? NetManager.Disconnect : NetManager.ConnectOrInfo, model.item.id, {})
}
Expand Down Expand Up @@ -263,6 +266,7 @@ DccObject {
let tmpItem = items[0]
if (tmpItem.id === id) {
wirelessSettings.displayName = tmpItem.name
wirelessSettings.type = tmpItem.itemType
wirelessSettings.item = tmpItem
wirelessSettings.config = param

Expand Down
5 changes: 3 additions & 2 deletions dcc-network/qml/SectionDevice.qml
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,6 @@ DccTitleObject {

return true
}
onErrorKeyChanged: console.log("dev errorKey", errorKey)
ListModel {
id: devModel
ListElement {
Expand All @@ -90,7 +89,7 @@ DccTitleObject {
}
}
name: "devTitle"
displayName: type === NetType.WirelessItem ? qsTr("WLAN") : qsTr("Ethernet")
displayName: (type === NetType.WirelessItem || type === NetType.WirelessHiddenItem) ? qsTr("WLAN") : qsTr("Ethernet")
DccObject {
name: "devGroup"
parentName: root.parentName
Expand All @@ -104,6 +103,7 @@ DccTitleObject {
displayName: qsTr("Device MAC Addr")
pageType: DccObject.Editor
page: D.ComboBox {
flat: true
textRole: "text"
valueRole: "value"
currentIndex: root.config.hasOwnProperty("mac-address") ? indexOfValue(root.config["mac-address"]) : 0
Expand Down Expand Up @@ -198,6 +198,7 @@ DccTitleObject {
visible: type === NetType.WirelessItem
pageType: DccObject.Editor
page: ComboBox {
flat: true
textRole: "text"
valueRole: "value"
model: [{
Expand Down
1 change: 0 additions & 1 deletion dcc-network/qml/SectionGeneric.qml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ DccTitleObject {

return errorKey.length === 0
}
onErrorKeyChanged: console.log("generic errorKey", errorKey)
name: "genericTitle"
displayName: qsTr("General")
DccObject {
Expand Down
1 change: 1 addition & 0 deletions dcc-network/qml/SectionIPv4.qml
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,7 @@ DccObject {
displayName: qsTr("Method")
pageType: DccObject.Editor
page: ComboBox {
flat: true
textRole: "text"
valueRole: "value"
currentIndex: indexOfValue(root.method)
Expand Down
1 change: 1 addition & 0 deletions dcc-network/qml/SectionIPv6.qml
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,7 @@ DccObject {
displayName: qsTr("Method")
pageType: DccObject.Editor
page: ComboBox {
flat: true
textRole: "text"
valueRole: "value"
currentIndex: indexOfValue(root.method)
Expand Down
10 changes: 8 additions & 2 deletions dcc-network/qml/SectionSecret.qml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ DccTitleObject {
id: root
property var configWSecurity
property var config802_1x
property string parentName: ""
property int type: NetType.WiredItem
property string eapType: "peap"
property int pwdFlays: 0
Expand Down Expand Up @@ -332,9 +331,10 @@ DccTitleObject {
parentName: root.parentName + "/secretGroup"
displayName: qsTr("Security")
weight: 10
visible: root.type === NetType.WirelessItem
visible: root.type === NetType.WirelessItem || root.type === NetType.WirelessHiddenItem
pageType: DccObject.Editor
page: D.ComboBox {
flat: true
textRole: "text"
valueRole: "value"
model: [{
Expand Down Expand Up @@ -388,6 +388,7 @@ DccTitleObject {
visible: root.keyMgmt === "wpa-eap"
pageType: DccObject.Editor
page: D.ComboBox {
flat: true
textRole: "text"
valueRole: "value"
currentIndex: indexOfValue(root.eapType)
Expand Down Expand Up @@ -438,6 +439,7 @@ DccTitleObject {
visible: root.keyMgmt !== ""
pageType: DccObject.Editor
page: D.ComboBox {
flat: true
textRole: "text"
valueRole: "value"
model: [{
Expand Down Expand Up @@ -481,6 +483,7 @@ DccTitleObject {
visible: root.keyMgmt === "none"
pageType: DccObject.Editor
page: D.ComboBox {
flat: true
textRole: "text"
valueRole: "value"
model: [{
Expand Down Expand Up @@ -539,6 +542,7 @@ DccTitleObject {
visible: root.keyMgmt === "wpa-eap" && root.eapType === "fast"
pageType: DccObject.Editor
page: D.ComboBox {
flat: true
textRole: "text"
valueRole: "value"
currentIndex: (root.config802_1x && root.config802_1x.hasOwnProperty("phase1-fast-provisioning")) ? indexOfValue(root.config802_1x["phase1-fast-provisioning"]) : 0
Expand Down Expand Up @@ -615,6 +619,7 @@ DccTitleObject {
visible: root.keyMgmt === "wpa-eap" && root.eapType === "peap"
pageType: DccObject.Editor
page: D.ComboBox {
flat: true
textRole: "text"
valueRole: "value"
currentIndex: (root.config802_1x && root.config802_1x.hasOwnProperty("phase1-peapver")) ? indexOfValue(root.config802_1x["phase1-peapver"]) : 0
Expand Down Expand Up @@ -648,6 +653,7 @@ DccTitleObject {
visible: root.keyMgmt === "wpa-eap" && (root.eapType === "fast" || root.eapType === "ttls" || root.eapType === "peap")
pageType: DccObject.Editor
page: D.ComboBox {
flat: true
textRole: "text"
valueRole: "value"
currentIndex: (root.config802_1x && root.config802_1x.hasOwnProperty("phase2-auth")) ? indexOfValue(root.config802_1x["phase2-auth"]) : 0
Expand Down
18 changes: 18 additions & 0 deletions dcc-network/qml/SectionVPN.qml
Original file line number Diff line number Diff line change
Expand Up @@ -584,6 +584,7 @@ DccTitleObject {
visible: root.vpnType & (NetUtils.VpnTypeEnum["strongswan"])
pageType: DccObject.Editor
page: D.ComboBox {
flat: true
textRole: "text"
valueRole: "value"
model: [{
Expand Down Expand Up @@ -726,6 +727,7 @@ DccTitleObject {
visible: root.vpnType & (NetUtils.VpnTypeEnum["openvpn"])
pageType: DccObject.Editor
page: D.ComboBox {
flat: true
textRole: "text"
valueRole: "value"
model: [{
Expand Down Expand Up @@ -775,6 +777,7 @@ DccTitleObject {
visible: (root.vpnType & (NetUtils.VpnTypeEnum["l2tp"] | NetUtils.VpnTypeEnum["pptp"])) || (root.vpnType & (NetUtils.VpnTypeEnum["openvpn"])) && (root.dataMap["connection-type"] === "password" || root.dataMap["connection-type"] === "password-tls")
pageType: DccObject.Editor
page: D.ComboBox {
flat: true
textRole: "text"
valueRole: "value"
model: [{
Expand Down Expand Up @@ -835,6 +838,7 @@ DccTitleObject {
visible: (root.vpnType & (NetUtils.VpnTypeEnum["openvpn"])) && (root.dataMap["connection-type"] === "password-tls" || root.dataMap["connection-type"] === "tls")
pageType: DccObject.Editor
page: D.ComboBox {
flat: true
textRole: "text"
valueRole: "value"
model: [{
Expand Down Expand Up @@ -904,6 +908,7 @@ DccTitleObject {
visible: root.dataMap.hasOwnProperty(this.name) && (root.vpnType & (NetUtils.VpnTypeEnum["openvpn"])) && (root.dataMap["connection-type"] === "static-key")
pageType: DccObject.Editor
page: D.ComboBox {
flat: true
textRole: "text"
valueRole: "value"
model: [{
Expand Down Expand Up @@ -1039,6 +1044,7 @@ DccTitleObject {
visible: root.vpnType & (NetUtils.VpnTypeEnum["vpnc"])
pageType: DccObject.Editor
page: D.ComboBox {
flat: true
textRole: "text"
valueRole: "value"
model: [{
Expand Down Expand Up @@ -1090,6 +1096,7 @@ DccTitleObject {
visible: root.vpnType & (NetUtils.VpnTypeEnum["vpnc"])
pageType: DccObject.Editor
page: D.ComboBox {
flat: true
textRole: "text"
valueRole: "value"
model: [{
Expand Down Expand Up @@ -1192,6 +1199,7 @@ DccTitleObject {
visible: mppe
pageType: DccObject.Editor
page: D.ComboBox {
flat: true
textRole: "text"
valueRole: "value"
currentIndex: indexOfValue(currentMppeMethod)
Expand Down Expand Up @@ -1650,6 +1658,7 @@ DccTitleObject {
weight: 20
pageType: DccObject.Editor
page: D.ComboBox {
flat: true
textRole: "text"
valueRole: "value"
model: [{
Expand Down Expand Up @@ -1682,6 +1691,7 @@ DccTitleObject {
weight: 40
pageType: DccObject.Editor
page: D.ComboBox {
flat: true
textRole: "text"
valueRole: "value"
model: [{
Expand Down Expand Up @@ -1709,6 +1719,7 @@ DccTitleObject {
weight: 50
pageType: DccObject.Editor
page: D.ComboBox {
flat: true
textRole: "text"
valueRole: "value"
model: [{
Expand Down Expand Up @@ -1739,6 +1750,7 @@ DccTitleObject {
weight: 60
pageType: DccObject.Editor
page: D.ComboBox {
flat: true
textRole: "text"
valueRole: "value"
model: [{
Expand Down Expand Up @@ -1766,6 +1778,7 @@ DccTitleObject {
weight: 70
pageType: DccObject.Editor
page: D.ComboBox {
flat: true
textRole: "text"
valueRole: "value"
model: [{
Expand Down Expand Up @@ -1851,6 +1864,7 @@ DccTitleObject {
weight: 10
pageType: DccObject.Editor
page: D.ComboBox {
flat: true
textRole: "text"
valueRole: "value"
currentIndex: root.dataMap.hasOwnProperty("cipher") ? indexOfValue(root.dataMap["cipher"]) : 0
Expand Down Expand Up @@ -1923,6 +1937,7 @@ DccTitleObject {
weight: 20
pageType: DccObject.Editor
page: D.ComboBox {
flat: true
textRole: "text"
valueRole: "value"
currentIndex: root.dataMap.hasOwnProperty("auth") ? indexOfValue(root.dataMap["auth"]) : 0
Expand Down Expand Up @@ -1987,6 +2002,7 @@ DccTitleObject {
weight: 10
pageType: DccObject.Editor
page: D.ComboBox {
flat: true
textRole: "text"
valueRole: "value"
currentIndex: root.dataMap.hasOwnProperty("proxy-type") ? indexOfValue(root.dataMap["proxy-type"]) : 0
Expand Down Expand Up @@ -2101,6 +2117,7 @@ DccTitleObject {
weight: 20
pageType: DccObject.Editor
page: D.ComboBox {
flat: true
textRole: "text"
valueRole: "value"
currentIndex: root.dataMap.hasOwnProperty(dccObj.name) ? indexOfValue(root.dataMap[dccObj.name]) : 0
Expand Down Expand Up @@ -2160,6 +2177,7 @@ DccTitleObject {
visible: root.dataMap.hasOwnProperty(this.name)
pageType: DccObject.Editor
page: D.ComboBox {
flat: true
textRole: "text"
valueRole: "value"
currentIndex: root.dataMap.hasOwnProperty(dccObj.name) ? indexOfValue(root.dataMap[dccObj.name]) : 0
Expand Down
Binary file modified dcc-network/qml/dcc_network.dci
Binary file not shown.
9 changes: 5 additions & 4 deletions dcc-network/qml/network.qml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ DccObject {
function showPage() {
if (cmd.length !== 0 && children.length !== 0) {
children[0].showPage(cmd)
cmd = ""
}
}
name: "network"
Expand All @@ -15,8 +16,8 @@ DccObject {
icon: "dcc_network"
weight: 20
onChildrenChanged: showPage()
onActive: cmdParam => {
cmd = cmdParam
showPage()
}
onActive: function (cmdParam) {
cmd = cmdParam
showPage()
}
}
Loading

0 comments on commit a0a37df

Please sign in to comment.