Skip to content

Commit

Permalink
feat: Implement control center network plugin
Browse files Browse the repository at this point in the history
Implement control center network plugin

Log:
Task: https://pms.uniontech.com/task-view-361719.html
  • Loading branch information
caixr23 committed Oct 24, 2024
1 parent f7cc3a7 commit 8c73485
Show file tree
Hide file tree
Showing 569 changed files with 64,878 additions and 737 deletions.
10 changes: 5 additions & 5 deletions .reuse/dep5
Original file line number Diff line number Diff line change
Expand Up @@ -34,22 +34,22 @@ Copyright: None
License: CC0-1.0

# png svg
Files: *.png *.svg
Files: *.png *.svg *.dci *.gif
Copyright: UnionTech Software Technology Co., Ltd.
License: LGPL-3.0-or-later

# project config files(json)
Files: dock-network-plugin/network.json dcc-network-plugin/network.json config/org.deepin.dde.network.json dde-network-dialog/network.json dss-network-plugin/network.json dock-hotspot-plugin/hotspot.json
Files: *.json
Copyright: UnionTech Software Technology Co., Ltd.
License: LGPL-3.0-or-later

# project config files(pkla in cc)
Files: dss-network-plugin/50-dss-network-plugin.rules src/dde-network-core.pc.in try-compile/networkmanagerqt.cc
Files: dss-network-plugin/50-dss-network-plugin.rules src/dde-network-core.pc.in try-compile/networkmanagerqt.cc *.pc.in
Copyright: UnionTech Software Technology Co., Ltd.
License: LGPL-3.0-or-later

# sh
Files: dcc-network-plugin/lupdate.sh dde-network-dialog/lupdate.sh dss-network-plugin/lupdate.sh dock-network-plugin/lupdate.sh tests/test-recoverage.sh dock-hotspot-plugin/lupdate.sh
Files: *.sh
Copyright: UnionTech Software Technology Co., Ltd.
License: LGPL-3.0-or-later

Expand All @@ -64,7 +64,7 @@ Copyright: None
License: CC0-1.0

# xml toml json conf yaml
Files: src/*.xml .clog.toml configs/*.json src/*conf src/*.yaml .tx/config .tx/deepin.conf
Files: src/*.xml .clog.toml configs/*.json src/*conf src/*.yaml .tx/config .tx/deepin.conf *.conf
Copyright: None
License: CC0-1.0

Expand Down
21 changes: 6 additions & 15 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,10 @@ set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -z relro -z now -z noexec

option(ENABLE_DEEPIN_NMQT "enable nmqt patch on deepin" OFF)

set(DDE-Network-Core_INCLUDE_DIRS "${CMAKE_SOURCE_DIR}/src")
set(DDE-Network-Core_INCLUDE_DIRS "${CMAKE_SOURCE_DIR}/src-old")
set(DDE-Network-Core_LIBRARIES dde-network-core)

find_package(PkgConfig REQUIRED)
find_package(KF5NetworkManagerQt REQUIRED)
pkg_check_modules(LibNM REQUIRED IMPORTED_TARGET libnm)
include_directories(${LibNM_INCLUDE_DIRS})

Expand All @@ -30,19 +29,6 @@ pkg_search_module(GLIB REQUIRED glib-2.0)
include_directories(${GLIB_INCLUDE_DIRS})
link_directories(${GLIB_LIBRARY_DIRS})

set(TRY_KF5_LIBRARIES
IMPORTED_LOCATION_DEBIAN
IMPORTED_LOCATION_NOCONFIG
)

if (NOT KF5_QT_LIBRARIES)
find_library(KF5_QT_LIBRARIES libKF5NetworkManagerQt.so)
endif()

find_package(Qt5 COMPONENTS Core Widgets DBus Network LinguistTools REQUIRED)
find_package(KF5NetworkManagerQt REQUIRED)
get_target_property(KF5_QT_INCLUDE_DIRS KF5::NetworkManagerQt INTERFACE_INCLUDE_DIRECTORIES)

if (QT_DEBUG)
message(" KF5_QT_INCLUDE_DIRS : " ${KF5_QT_INCLUDE_DIRS})
message(" GLIB_INCLUDE_DIRS :" ${GLIB_INCLUDE_DIRS})
Expand All @@ -56,13 +42,18 @@ endif()

message(STATUS DEEPIN_NMQT_TEST ": ${DEEPIN_NMQT_TEST}")

set(INTERFACE_VERSION "2.0")
add_definitions(-DINTERFACE_VERSION="${INTERFACE_VERSION}")
message("Interface Version: " ${INTERFACE_VERSION})
if (CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
set(CMAKE_INSTALL_PREFIX "/usr")
endif()
include(GNUInstallDirs)

add_subdirectory("src")
add_subdirectory("src-old")
add_subdirectory("dcc-network-plugin")
add_subdirectory("dcc-network")
add_subdirectory("tests")
add_subdirectory("example")
#add_subdirectory("dock-network-plugin")
Expand Down
232 changes: 232 additions & 0 deletions LICENSES/GPL-3.0-or-later.txt

Large diffs are not rendered by default.

218 changes: 218 additions & 0 deletions config/org.deepin.dde.network.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,17 @@
"flags": [],
"name": "wireless_scan_interval",
"name[zh_CN]": "无线网络扫描间隔",
"description": "deprecated",
"description[zh_CN]": "已废弃",
"permissions": "readwrite",
"visibility": "public"
},
"wirelessScanInterval": {
"value": 10,
"serial": 0,
"flags": [],
"name": "wirelessScanInterval",
"name[zh_CN]": "无线网络扫描间隔",
"description": "",
"description[zh_CN]": "",
"permissions": "readwrite",
Expand All @@ -30,6 +41,213 @@
"description": "控制中心-网络模块是否显示飞行模式页面,默认不显示。",
"permissions": "readwrite",
"visibility": "private"
},
"lastProxyMethod": {
"value": "manual",
"serial": 0,
"flags": [],
"name": "LastProxyMethod",
"name[zh_CN]": "最后一次设置的代理类型",
"description": "控制中心-网络模块最后一次设置的代理类型,默认手动。",
"permissions": "readwrite",
"visibility": "private"
},
"WPA3-Enterprise-Visible": {
"value": false,
"serial": 0,
"flags": [],
"name": "WPA3_Enterprise",
"name[zh_CN]": "是否显示WPA3 Enterprise选项",
"description": "控制中心-无线网络模块安全选项-WPA3 企业版,默认不显示",
"permissions": "readwrite",
"visibility": "private"
},
"supportCertifiedEscape":{
"value": false,
"serial": 0,
"flags":[],
"name":"supportCertifiedEscape",
"name[zh_CN]":"是否回退到未经授权的网络",
"description[zh_CN]":"当设置为true时,默认勾选是否回退到未经授权的网络,反之亦然",
"description":"true: Fallback to Unauthorized Network Access",
"permissions":"readwrite",
"visibility":"private"
},
"showUnauthorizedSwitch":{
"value": false,
"serial": 0,
"flags":[],
"name":"showUnauthorizedSwitch",
"name[zh_CN]":"是否显示回退到未经授权的网络的开关",
"description[zh_CN]":"当设置为true时,显示回退到未经授权的网络的开关,反之亦然",
"description":"true: show the switch of Unauthorized Switcher",
"permissions":"readwrite",
"visibility":"private"
},
"reconnectIfIpConflicted":{
"value": false,
"serial": 0,
"flags":["global"],
"name":"reconnectIfIpConflicted",
"name[zh_CN]":"IP冲突是否重连",
"description[zh_CN]":"当为true,如果发生了IP冲突,则会自动重连,如果为false,则不会自动重连",
"description":"ture: if ip conflicted,it will re connect",
"permissions":"readwrite",
"visibility":"private"
},
"enableConnectivity":{
"value": true,
"serial": 0,
"flags":["global"],
"name":"enableConnectivity",
"name[zh_CN]":"检查网络连接标记",
"description[zh_CN]":"当设置为true时,使用前端检测网络连接,false,则使用NetworkManager自身的检测连接流程",
"description":"ture: use dde-network-core to check connectivity",
"permissions":"readwrite",
"visibility":"private"
},
"checkPortal":{
"value": true,
"serial": 0,
"flags":["global"],
"name":"checkPortal",
"name[zh_CN]":"检测到需要认证的网页,是否需要打开认证页面",
"description[zh_CN]":"当设置为true时,需要打开认证页面,false,不需要打开认证页面",
"description":"ture: open the auth page",
"permissions":"readwrite",
"visibility":"private"
},
"NetworkCheckerUrls":{
"value":["http://detect.uniontech.com", "http://detectportal.deepin.com"],
"serial":0,
"flags":[],
"name":"NetworkCheckerUrls",
"name[zh_CN]":"网络联通性检测地址",
"description[zh_CN]":"用于检测网络的联通性",
"description":"the url to check network connecitity",
"permissions":"readwrite",
"visibility":"private"
},
"ConnectivityCheckInterval":{
"value":30,
"serial":0,
"flags":[],
"name":"ConnectivityCheckInterval",
"name[zh_CN]":"检测网络联通性的时间间隔(单位:秒))",
"description[zh_CN]":"检测网络联通性的时间间隔(单位:秒)",
"description":"the span to check connectivity(unit:second)",
"permissions":"readwrite",
"visibility":"private"
},
"LoadServiceFromNM":{
"value": true,
"serial": 0,
"flags":["global"],
"name":"LoadServiceFromNM",
"name[zh_CN]":"数据是否来源于NetworkManager",
"description[zh_CN]":"当设置为true时,直接从NetworkManager中获取网络数据,false,则使用后端接口获取网络数据",
"description":"ture: use NetworkManager to get data",
"permissions":"readwrite",
"visibility":"private"
},
"disabledNetwork":{
"value": false,
"serial": 0,
"flags":["global"],
"name":"disabledNetwork",
"name[zh_CN]":"是否禁用网络模块",
"description[zh_CN]":"为军用项目设置的开关",
"description":"ture: disable wireless and bluetooth",
"permissions":"readwrite",
"visibility":"private"
},
"enableAccountNetwork":{
"value": false,
"serial": 0,
"flags":["global"],
"name":"enableAccountNetwork",
"name[zh_CN]":"是否使用用户网络进行网络连接(工银瑞信定制项目)",
"description[zh_CN]":"是否使用用户网络进行网络连接(工银瑞信定制项目)",
"description":"ture: 开启用户私有网络连接,false: 不开启该功能",
"permissions":"readwrite",
"visibility":"private"
},
"enableEapInput":{
"value": false,
"serial": 0,
"flags":["global"],
"name":"enableEapInput",
"name[zh_CN]":"是否启用企业网输入用户名和密码进行认证(工商银行定制项目)",
"description[zh_CN]":"是否启用企业网输入用户名和密码进行认证(工商银行定制项目)",
"description":"ture: 第一次点击企业网的时候,打开用户名和密码的输入框,false: 直接跳转到控制中心或者给出提示",
"permissions":"readwrite",
"visibility":"private"
},
"wpaEapAuthen":{
"value": "peap",
"serial": 0,
"flags":["global"],
"name":"wpaEapAuthen",
"name[zh_CN]":"默认的安全认证方式(工商银行定制项目)",
"description[zh_CN]":"默认的安全认证方式(工商银行定制项目)",
"description":"tls leap fast tls peap",
"permissions":"readwrite",
"visibility":"private"
},
"wpaEapAuthmethod":{
"value": "MSCHAPV2",
"serial": 0,
"flags":["global"],
"name":"wpaEapAuthmethod",
"name[zh_CN]":"默认内部认证方式(工商银行定制项目)",
"description[zh_CN]":"默认内部认证方式(工商银行定制项目)",
"description":"Pap chap mschap mschapv2 gtc otp md5 tls",
"permissions":"readwrite",
"visibility":"private"
},
"dontSetIpIfConflict":{
"value": false,
"serial": 0,
"flags":["global"],
"name":"dontSetIpIfConflict",
"name[zh_CN]":"IP冲突的情况下禁止设置IP",
"description[zh_CN]":"true: 开启,false:关闭该功能",
"description":"true: enable, false: disabled",
"permissions":"readwrite",
"visibility":"private"
},
"showBrowserLink":{
"value":false,
"serial":0,
"flags":[],
"name":"showBrowserLink",
"name[zh_CN]":"显示打开浏览器的文字链接",
"description[zh_CN]":"显示打开浏览器的文字链接",
"description":"show the link word of open browser",
"permissions":"readwrite",
"visibility":"private"
},
"browserUrl":{
"value":"https://www.uniontech.com",
"serial":0,
"flags":[],
"name":"browserUrl",
"name[zh_CN]":"文字链接打开浏览器时默认网址",
"description[zh_CN]":"文字链接打开浏览器时默认网址",
"description":"the default URL by the browser opens",
"permissions":"readwrite",
"visibility":"private"
},
"NobindEthernetMacDefault":{
"value": false,
"serial": 0,
"flags":["global"],
"name":"NobindEthernetMacDefault",
"name[zh_CN]":"添加有线连接默认选择不绑定Mac",
"description[zh_CN]":"添加有线连接默认选择不绑定Mac",
"description":"ture: 选择不绑定Mac地址",
"permissions":"readwrite",
"visibility":"private"
}
}
}
4 changes: 2 additions & 2 deletions dcc-network-plugin/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ ADD_DEFINITIONS("-fstack-protector-strong -D_FORTITY_SOURCE=1 -z noexecstack -pi
# 指定所有源码文件
file(GLOB_RECURSE SRCS "*.h"
"*.cpp"
"../src/*.h"
"../src/*.cpp"
"../src-old/*.h"
"../src-old/*.cpp"
"*.qrc"
"*.svg"
)
Expand Down
Loading

0 comments on commit 8c73485

Please sign in to comment.