Skip to content

Commit eece112

Browse files
committed
fix: Add network parameter jump function
网络加带参数的跳转 ShowPage参数 network?ssid=xxx // 跳转到无线网络xxx的配置页面 network?page=wired // 跳转到第一个有线网络页面 network?page=wireless // 跳转到第一个无线网络页面 pms: TASK-361719
1 parent d2c1810 commit eece112

25 files changed

+187
-131
lines changed

dcc-network/qml/network.qml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
// SPDX-FileCopyrightText: 2024 - 2027 UnionTech Software Technology Co., Ltd.
2+
// SPDX-License-Identifier: GPL-3.0-or-later
3+
import org.deepin.dcc 1.0
4+
5+
DccObject {
6+
property string cmd
7+
function showPage() {
8+
if (cmd.length !== 0 && children.length !== 0) {
9+
children[0].showPage(cmd)
10+
}
11+
}
12+
name: "network"
13+
parentName: "root"
14+
displayName: qsTr("Network")
15+
icon: "dcc_network"
16+
weight: 50
17+
onChildrenChanged: showPage()
18+
onActive: cmdParam => {
19+
cmd = cmdParam
20+
showPage()
21+
}
22+
}

dcc-network/qml/networkMain.qml

Lines changed: 64 additions & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -14,61 +14,8 @@ DccObject {
1414
property var wiredDevs: []
1515
property var wirelessDevs: []
1616

17-
name: "network"
18-
parentName: "root"
19-
displayName: qsTr("Network")
20-
icon: "dcc_network"
21-
weight: 50
22-
Component {
23-
id: wiredComponent
24-
PageWiredDevice {}
25-
}
26-
Component {
27-
id: wirelessComponent
28-
PageWirelessDevice {}
29-
}
30-
31-
PageVPN {
32-
id: vpnPage
33-
name: "networkVpn"
34-
parentName: "network"
35-
weight: 3010
36-
}
37-
PageSystemProxy {
38-
id: systemProxyPage
39-
name: "systemProxy"
40-
parentName: "network"
41-
weight: 3020
42-
}
43-
PageAppProxy {
44-
id: appProxyPage
45-
name: "applicationProxy"
46-
parentName: "network"
47-
weight: 3030
48-
}
49-
PageHotspot {
50-
id: hotspotPage
51-
name: "personalHotspot"
52-
parentName: "network"
53-
weight: 3040
54-
}
55-
PageAirplane {
56-
name: "airplaneMode"
57-
parentName: "network"
58-
weight: 3050
59-
item: dccData.root
60-
}
61-
PageDSL {
62-
id: dslPage
63-
name: "dsl"
64-
parentName: "network"
65-
weight: 3060
66-
}
67-
PageDetails {
68-
id: detailsPage
69-
name: "networkDetails"
70-
parentName: "network"
71-
weight: 3070
17+
function showPage(cmd) {
18+
dccData.exec(NetManager.ShowPage, cmd, {})
7219
}
7320
function updateDevice() {
7421
const delWiredDevs = wiredDevs.concat()
@@ -152,17 +99,74 @@ DccObject {
15299
delDev.destroy()
153100
}
154101
}
102+
Component {
103+
id: wiredComponent
104+
PageWiredDevice {
105+
property var showPage: root.showPage
106+
}
107+
}
108+
Component {
109+
id: wirelessComponent
110+
PageWirelessDevice {
111+
property var showPage: root.showPage
112+
}
113+
}
114+
115+
PageVPN {
116+
id: vpnPage
117+
property var showPage: root.showPage
118+
name: "networkVpn"
119+
parentName: "network"
120+
weight: 3010
121+
}
122+
PageSystemProxy {
123+
id: systemProxyPage
124+
property var showPage: root.showPage
125+
name: "systemProxy"
126+
parentName: "network"
127+
weight: 3020
128+
}
129+
PageAppProxy {
130+
id: appProxyPage
131+
property var showPage: root.showPage
132+
name: "applicationProxy"
133+
parentName: "network"
134+
weight: 3030
135+
}
136+
PageHotspot {
137+
id: hotspotPage
138+
property var showPage: root.showPage
139+
name: "personalHotspot"
140+
parentName: "network"
141+
weight: 3040
142+
}
143+
PageAirplane {
144+
name: "airplaneMode"
145+
property var showPage: root.showPage
146+
parentName: "network"
147+
weight: 3050
148+
item: dccData.root
149+
}
150+
PageDSL {
151+
id: dslPage
152+
property var showPage: root.showPage
153+
name: "dsl"
154+
parentName: "network"
155+
weight: 3060
156+
}
157+
PageDetails {
158+
id: detailsPage
159+
property var showPage: root.showPage
160+
name: "networkDetails"
161+
parentName: "network"
162+
weight: 3070
163+
}
155164
Connections {
156165
target: dccData.root
157166
function onChildrenChanged() {
158167
updateDevice()
159168
}
160169
}
161-
onActive: cmd => {
162-
if (cmd.length !== 0) {
163-
dccData.exec(NetManager.FindConnectInfo, cmd, {})
164-
}
165-
}
166170
Component.onCompleted: {
167171
updateDevice()
168172
}

dcc-network/translations/network.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1688,7 +1688,7 @@
16881688
</message>
16891689
</context>
16901690
<context>
1691-
<name>networkMain</name>
1691+
<name>network</name>
16921692
<message>
16931693
<source>Network</source>
16941694
<translation type="unfinished"></translation>

dcc-network/translations/network_az.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1688,7 +1688,7 @@
16881688
</message>
16891689
</context>
16901690
<context>
1691-
<name>networkMain</name>
1691+
<name>network</name>
16921692
<message>
16931693
<source>Network</source>
16941694
<translation type="unfinished"></translation>

dcc-network/translations/network_bo.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1688,7 +1688,7 @@
16881688
</message>
16891689
</context>
16901690
<context>
1691-
<name>networkMain</name>
1691+
<name>network</name>
16921692
<message>
16931693
<source>Network</source>
16941694
<translation type="unfinished"></translation>

dcc-network/translations/network_ca.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1688,7 +1688,7 @@
16881688
</message>
16891689
</context>
16901690
<context>
1691-
<name>networkMain</name>
1691+
<name>network</name>
16921692
<message>
16931693
<source>Network</source>
16941694
<translation type="unfinished"></translation>

dcc-network/translations/network_es.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1688,7 +1688,7 @@
16881688
</message>
16891689
</context>
16901690
<context>
1691-
<name>networkMain</name>
1691+
<name>network</name>
16921692
<message>
16931693
<source>Network</source>
16941694
<translation type="unfinished"></translation>

dcc-network/translations/network_fi.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1688,7 +1688,7 @@
16881688
</message>
16891689
</context>
16901690
<context>
1691-
<name>networkMain</name>
1691+
<name>network</name>
16921692
<message>
16931693
<source>Network</source>
16941694
<translation type="unfinished"></translation>

dcc-network/translations/network_fr.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1688,7 +1688,7 @@
16881688
</message>
16891689
</context>
16901690
<context>
1691-
<name>networkMain</name>
1691+
<name>network</name>
16921692
<message>
16931693
<source>Network</source>
16941694
<translation type="unfinished"></translation>

dcc-network/translations/network_hu.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1688,7 +1688,7 @@
16881688
</message>
16891689
</context>
16901690
<context>
1691-
<name>networkMain</name>
1691+
<name>network</name>
16921692
<message>
16931693
<source>Network</source>
16941694
<translation type="unfinished"></translation>

0 commit comments

Comments
 (0)