Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Add network parameter jump function #285

Merged
merged 1 commit into from
Dec 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions dcc-network/qml/network.qml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
// SPDX-FileCopyrightText: 2024 - 2027 UnionTech Software Technology Co., Ltd.
// SPDX-License-Identifier: GPL-3.0-or-later
import org.deepin.dcc 1.0

DccObject {
property string cmd
function showPage() {
if (cmd.length !== 0 && children.length !== 0) {
children[0].showPage(cmd)
}
}
name: "network"
parentName: "root"
displayName: qsTr("Network")
icon: "dcc_network"
weight: 50
onChildrenChanged: showPage()
onActive: cmdParam => {
cmd = cmdParam
showPage()
}
}
124 changes: 64 additions & 60 deletions dcc-network/qml/networkMain.qml
Original file line number Diff line number Diff line change
Expand Up @@ -14,61 +14,8 @@ DccObject {
property var wiredDevs: []
property var wirelessDevs: []

name: "network"
parentName: "root"
displayName: qsTr("Network")
icon: "dcc_network"
weight: 50
Component {
id: wiredComponent
PageWiredDevice {}
}
Component {
id: wirelessComponent
PageWirelessDevice {}
}

PageVPN {
id: vpnPage
name: "networkVpn"
parentName: "network"
weight: 3010
}
PageSystemProxy {
id: systemProxyPage
name: "systemProxy"
parentName: "network"
weight: 3020
}
PageAppProxy {
id: appProxyPage
name: "applicationProxy"
parentName: "network"
weight: 3030
}
PageHotspot {
id: hotspotPage
name: "personalHotspot"
parentName: "network"
weight: 3040
}
PageAirplane {
name: "airplaneMode"
parentName: "network"
weight: 3050
item: dccData.root
}
PageDSL {
id: dslPage
name: "dsl"
parentName: "network"
weight: 3060
}
PageDetails {
id: detailsPage
name: "networkDetails"
parentName: "network"
weight: 3070
function showPage(cmd) {
dccData.exec(NetManager.ShowPage, cmd, {})
}
function updateDevice() {
const delWiredDevs = wiredDevs.concat()
Expand Down Expand Up @@ -152,17 +99,74 @@ DccObject {
delDev.destroy()
}
}
Component {
id: wiredComponent
PageWiredDevice {
property var showPage: root.showPage
}
}
Component {
id: wirelessComponent
PageWirelessDevice {
property var showPage: root.showPage
}
}

PageVPN {
id: vpnPage
property var showPage: root.showPage
name: "networkVpn"
parentName: "network"
weight: 3010
}
PageSystemProxy {
id: systemProxyPage
property var showPage: root.showPage
name: "systemProxy"
parentName: "network"
weight: 3020
}
PageAppProxy {
id: appProxyPage
property var showPage: root.showPage
name: "applicationProxy"
parentName: "network"
weight: 3030
}
PageHotspot {
id: hotspotPage
property var showPage: root.showPage
name: "personalHotspot"
parentName: "network"
weight: 3040
}
PageAirplane {
name: "airplaneMode"
property var showPage: root.showPage
parentName: "network"
weight: 3050
item: dccData.root
}
PageDSL {
id: dslPage
property var showPage: root.showPage
name: "dsl"
parentName: "network"
weight: 3060
}
PageDetails {
id: detailsPage
property var showPage: root.showPage
name: "networkDetails"
parentName: "network"
weight: 3070
}
Connections {
target: dccData.root
function onChildrenChanged() {
updateDevice()
}
}
onActive: cmd => {
if (cmd.length !== 0) {
dccData.exec(NetManager.FindConnectInfo, cmd, {})
}
}
Component.onCompleted: {
updateDevice()
}
Expand Down
2 changes: 1 addition & 1 deletion dcc-network/translations/network.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1688,7 +1688,7 @@
</message>
</context>
<context>
<name>networkMain</name>
<name>network</name>
<message>
<source>Network</source>
<translation type="unfinished"></translation>
Expand Down
2 changes: 1 addition & 1 deletion dcc-network/translations/network_az.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1688,7 +1688,7 @@
</message>
</context>
<context>
<name>networkMain</name>
<name>network</name>
<message>
<source>Network</source>
<translation type="unfinished"></translation>
Expand Down
2 changes: 1 addition & 1 deletion dcc-network/translations/network_bo.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1688,7 +1688,7 @@
</message>
</context>
<context>
<name>networkMain</name>
<name>network</name>
<message>
<source>Network</source>
<translation type="unfinished"></translation>
Expand Down
2 changes: 1 addition & 1 deletion dcc-network/translations/network_ca.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1688,7 +1688,7 @@
</message>
</context>
<context>
<name>networkMain</name>
<name>network</name>
<message>
<source>Network</source>
<translation type="unfinished"></translation>
Expand Down
2 changes: 1 addition & 1 deletion dcc-network/translations/network_es.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1688,7 +1688,7 @@
</message>
</context>
<context>
<name>networkMain</name>
<name>network</name>
<message>
<source>Network</source>
<translation type="unfinished"></translation>
Expand Down
2 changes: 1 addition & 1 deletion dcc-network/translations/network_fi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1688,7 +1688,7 @@
</message>
</context>
<context>
<name>networkMain</name>
<name>network</name>
<message>
<source>Network</source>
<translation type="unfinished"></translation>
Expand Down
2 changes: 1 addition & 1 deletion dcc-network/translations/network_fr.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1688,7 +1688,7 @@
</message>
</context>
<context>
<name>networkMain</name>
<name>network</name>
<message>
<source>Network</source>
<translation type="unfinished"></translation>
Expand Down
2 changes: 1 addition & 1 deletion dcc-network/translations/network_hu.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1688,7 +1688,7 @@
</message>
</context>
<context>
<name>networkMain</name>
<name>network</name>
<message>
<source>Network</source>
<translation type="unfinished"></translation>
Expand Down
2 changes: 1 addition & 1 deletion dcc-network/translations/network_it.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1688,7 +1688,7 @@
</message>
</context>
<context>
<name>networkMain</name>
<name>network</name>
<message>
<source>Network</source>
<translation type="unfinished"></translation>
Expand Down
2 changes: 1 addition & 1 deletion dcc-network/translations/network_ja.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1688,7 +1688,7 @@
</message>
</context>
<context>
<name>networkMain</name>
<name>network</name>
<message>
<source>Network</source>
<translation type="unfinished"></translation>
Expand Down
2 changes: 1 addition & 1 deletion dcc-network/translations/network_ko.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1688,7 +1688,7 @@
</message>
</context>
<context>
<name>networkMain</name>
<name>network</name>
<message>
<source>Network</source>
<translation type="unfinished"></translation>
Expand Down
2 changes: 1 addition & 1 deletion dcc-network/translations/network_nb_NO.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1688,7 +1688,7 @@
</message>
</context>
<context>
<name>networkMain</name>
<name>network</name>
<message>
<source>Network</source>
<translation type="unfinished"></translation>
Expand Down
2 changes: 1 addition & 1 deletion dcc-network/translations/network_pl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1688,7 +1688,7 @@
</message>
</context>
<context>
<name>networkMain</name>
<name>network</name>
<message>
<source>Network</source>
<translation type="unfinished"></translation>
Expand Down
2 changes: 1 addition & 1 deletion dcc-network/translations/network_pt_BR.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1688,7 +1688,7 @@
</message>
</context>
<context>
<name>networkMain</name>
<name>network</name>
<message>
<source>Network</source>
<translation type="unfinished"></translation>
Expand Down
2 changes: 1 addition & 1 deletion dcc-network/translations/network_ru.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1688,7 +1688,7 @@
</message>
</context>
<context>
<name>networkMain</name>
<name>network</name>
<message>
<source>Network</source>
<translation type="unfinished"></translation>
Expand Down
2 changes: 1 addition & 1 deletion dcc-network/translations/network_uk.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1688,7 +1688,7 @@
</message>
</context>
<context>
<name>networkMain</name>
<name>network</name>
<message>
<source>Network</source>
<translation type="unfinished"></translation>
Expand Down
2 changes: 1 addition & 1 deletion dcc-network/translations/network_zh_CN.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1688,7 +1688,7 @@
</message>
</context>
<context>
<name>networkMain</name>
<name>network</name>
<message>
<source>Network</source>
<translation>网络</translation>
Expand Down
2 changes: 1 addition & 1 deletion dcc-network/translations/network_zh_HK.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1688,7 +1688,7 @@
</message>
</context>
<context>
<name>networkMain</name>
<name>network</name>
<message>
<source>Network</source>
<translation type="unfinished"></translation>
Expand Down
2 changes: 1 addition & 1 deletion dcc-network/translations/network_zh_TW.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1688,7 +1688,7 @@
</message>
</context>
<context>
<name>networkMain</name>
<name>network</name>
<message>
<source>Network</source>
<translation type="unfinished"></translation>
Expand Down
4 changes: 2 additions & 2 deletions net-view/operation/netmanager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -436,9 +436,9 @@ void NetManagerPrivate::exec(NetManager::CmdType cmd, const QString &id, const Q
QString file = param.value("file").toString();
m_managerThread->exportConnect(id, file);
} break;
case NetManager::FindConnectInfo: {
case NetManager::ShowPage: {
if (!id.isEmpty()) {
m_managerThread->findConnectInfo(id);
m_managerThread->showPage(id);
}
} break;
default:
Expand Down
2 changes: 1 addition & 1 deletion net-view/operation/netmanager.h
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ class NetManager : public QObject
ImportConnect, // 导入配置
ImportError, // 导入出错
ExportConnect, // 导出配置
FindConnectInfo, // 查找配置 任务栏打开网络配置界面
ShowPage, // 查找配置 任务栏打开网络配置界面
};
Q_ENUM(CmdType)

Expand Down
Loading
Loading