diff --git a/debian/changelog b/debian/changelog new file mode 100644 index 00000000..dd50a78a --- /dev/null +++ b/debian/changelog @@ -0,0 +1,140 @@ +kylin-nm (4.0.0.0-ok8.1) yangtze; urgency=medium + + * rebuild with no changes. + + -- handsome_feng Fri, 09 Jun 2023 16:55:52 +0800 + +kylin-nm (4.0.0.0-ok8) yangtze; urgency=medium + + * issue #I71UQZ #I71VZ1 #I7200J #I72OMH #I73HNK + + -- zhaoshixu Tue, 30 May 2023 13:52:06 +0800 + +kylin-nm (4.0.0.0-ok7) yangtze; urgency=medium + + * issue #I73I44 #I71WH5 + + -- zhaoshixu Wed, 24 May 2023 15:36:21 +0800 + +kylin-nm (4.0.0.0-ok6) yangtze; urgency=medium + + * issue #I7357J + + -- zhaoshixu Wed, 17 May 2023 09:56:46 +0800 + +kylin-nm (4.0.0.0-ok5) yangtze; urgency=medium + + * Modify plugin name from Vpn to VPN. + + -- handsome_feng Sat, 13 May 2023 16:52:05 +0800 + +kylin-nm (4.0.0.0-ok4) yangtz; urgency=medium + + * remove kysec + + -- zhaoshixu Wed, 12 Apr 2023 19:28:57 +0800 + +kylin-nm (4.0.0.0-ok3) yangtze; urgency=medium + + * #include + + -- zhaoshixu Wed, 12 Apr 2023 19:05:00 +0800 + +kylin-nm (4.0.0.0-ok2) yangtze; urgency=medium + + * remove wired switch + + -- zhaoshixu Wed, 12 Apr 2023 18:44:10 +0800 + +kylin-nm (4.0.0.0-ok1) yangtze; urgency=medium + + * merge upstream + + -- zhaoshixu Wed, 12 Apr 2023 17:09:37 +0800 + +kylin-nm (3.14.0.0+0512-3k15) yangtze; urgency=medium + + * QSystemTrayIcon register + + -- zhaoshixu Fri, 06 Jan 2023 16:22:59 +0800 + +kylin-nm (3.14.0.0+0512-3k14) yangtze; urgency=medium + + * add include QPainterPath + + -- zhaoshixu Thu, 05 Jan 2023 16:27:10 +0800 + +kylin-nm (3.14.0.0+0512-3k13) yangtze; urgency=medium + + * 增加三种企业网加密方式LEAP PWD FAST + + -- zhaoshixu Mon, 26 Dec 2022 16:11:31 +0800 + +kylin-nm (3.14.0.0+0512-3k12) yangtze; urgency=medium + + * vpn页面增加 + * dns优化 + * tabBar圆角 + + -- zhaoshixu Fri, 16 Dec 2022 12:04:41 +0800 + +kylin-nm (3.14.0.0+0512-3k11) yangtz; urgency=medium + + * 合并3.22需求 + + -- zhaoshixu Mon, 21 Nov 2022 15:31:28 +0800 + +kylin-nm (3.14.0.0+0512-2k11) yangtz; urgency=medium + + * 修改因有线连接未指定网卡造成VPN托盘崩溃的问题 + + -- zhaoshixu Fri, 21 Oct 2022 16:35:19 +0800 + +kylin-nm (3.14.0.0+0512-2k10) yangtz; urgency=medium + + * 托盘vpn需求 + + -- zhaoshixu Thu, 20 Oct 2022 20:21:39 +0800 + +kylin-nm (3.14.0.0+0512-1k10) yangtz; urgency=medium + + * 同步3.22需求 + + -- zhaoshixu Wed, 19 Oct 2022 10:01:07 +0800 + +kylin-nm (3.14.0.0+0512-0k10) yangtz; urgency=medium + + * close-cd #131075 【网络】普通用户在详情界面修改网络IP信息时会弹出授权框,如果不进行授权详情界面也会显示修改成功,但是实际未修改 + + -- zhaoshixu Thu, 18 Aug 2022 17:09:12 +0800 + +kylin-nm (3.14.0.0+0512-0k9) yangtz; urgency=medium + + * close-cd #131247 登录界面连接wifi后,登录桌面任务栏网络工具显示未连接,wifi依旧关闭状态 + + -- zhaoshixu Wed, 03 Aug 2022 16:12:40 +0800 + +kylin-nm (3.14.0.0+0512-0k8) yangtz; urgency=medium + + * close-cd #127890 开启无线局域网后关闭,重新打开控制面板,无线局域网处显示网卡名称 + * close-cd #128339 连接WIFI过程中点击忘记此WIFI,之后密码仍保留在输入框内 + -- zhaoshixu Mon, 18 Jul 2022 10:54:25 +0800 + +kylin-nm (3.14.0.0+0512-0k7~0707) yangtz; urgency=medium + + * Fix mobilehotspot segmentation fault and init wlanSwitchEnable status. + * close-cd #91326 【控制面板】-首页图标、左侧导航线性图标可以跟随主题切换 + + -- zhaoshixu Wed, 22 Jun 2022 09:44:33 +0800 + +kylin-nm (3.14.0.0+0512-0k5) yangtz; urgency=medium + + * set window frameless. + + -- zhaoshixu Mon, 20 Jun 2022 16:01:48 +0800 + +kylin-nm (3.14.0.0+0512-0k4) yangtze; urgency=medium + + * Initial for openKylin. + + -- zhaoshixu Fri, 17 Jun 2022 11:46:09 +0800 diff --git a/debian/compat b/debian/compat new file mode 100644 index 00000000..ec635144 --- /dev/null +++ b/debian/compat @@ -0,0 +1 @@ +9 diff --git a/debian/control b/debian/control new file mode 100644 index 00000000..4f8b3798 --- /dev/null +++ b/debian/control @@ -0,0 +1,49 @@ +Source: kylin-nm +Section: utils +Priority: optional +Maintainer: Kylin Team +Uploaders: handsome_feng +Build-Depends: debhelper (>=9), + libcap-dev, + libgsettings-qt-dev, + libgtk-3-dev, + libkf5networkmanagerqt-dev (>= 5.36.0), + libkf5windowsystem-dev, + libkysdk-qtwidgets-dev(>= 1.2.0), + libkysdk-sysinfo-dev, + libkysdk-waylandhelper-dev(>= 1.2.0kylin2), + libnm-dev, + libnma-dev, + libqt5svg5-dev, + libqt5x11extras5-dev, + libsecret-1-dev, + libukcc-dev (>= 3.1.1+1217), + libukui-common-dev, + libukui-log4qt-dev, + libx11-dev, + qt5-qmake, + qtbase5-dev, + qtbase5-dev-tools, + qtchooser, + qtscript5-dev, + qttools5-dev-tools +Standards-Version: 4.5.0 +Rules-Requires-Root: no +Homepage: https://github.com/ukui/kylin-nm +Vcs-Git: https://github.com/ukui/kylin-nm.git +Vcs-Browser: https://github.com/ukui/kylin-nm + +Package: kylin-nm +Architecture: any +Depends: libkysdk-qtwidgets(>= 1.2.0), + libkysdk-waylandhelper(>= 1.2.0kylin2), + network-manager (>=1.2.6), + ukui-control-center (>= 3.1.1+1217), + dpkg-dev, + libkysdk-sysinfo, + ${shlibs:Depends}, + ${misc:Depends} +Description: Gui Applet tool for display and edit network simply + Kylin NM is a Applet tool for managing network settings simply. + It has beautiful UI and very comfortable to use. + It's better work together with UKUI. diff --git a/debian/copyright b/debian/copyright new file mode 100644 index 00000000..ab540d0e --- /dev/null +++ b/debian/copyright @@ -0,0 +1,25 @@ +Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ +Upstream-Name: kylin-nm +Upstream-Contact: Kylin Team +Source: https://github.com/ukui/kylin-nm + +Files: * +Copyright: 2019, Tianjin KYLIN Information Technology Co., Ltd. +License: GPL-3+ + +License: GPL-3+ + This package is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + . + This package is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU Genaral Public License for more details. + . + You should have received a copy og the GNU General Public License + along with this program. If not, see + . + On Debian systems, the complete text of the GNU General + Public License version 3 can be found in "/usr/share/common-licenses/GPL-3". diff --git a/debian/kylin-nm.manpages b/debian/kylin-nm.manpages new file mode 100644 index 00000000..9691523b --- /dev/null +++ b/debian/kylin-nm.manpages @@ -0,0 +1 @@ +man/kylin-nm.1 \ No newline at end of file diff --git a/debian/kylin-nm.postinst b/debian/kylin-nm.postinst new file mode 100755 index 00000000..e99563ba --- /dev/null +++ b/debian/kylin-nm.postinst @@ -0,0 +1,14 @@ +#!/bin/sh + +set -e + +PROGRAM=$(dpkg-divert --truename /usr/bin/kylin-nm) + +if setcap cap_net_raw+ep $PROGRAM; then + chmod u-s $PROGRAM +fi + +echo "kylin nm set cap success" + +exit 0 + diff --git a/debian/kylin-nm.preinst b/debian/kylin-nm.preinst new file mode 100644 index 00000000..1390f944 --- /dev/null +++ b/debian/kylin-nm.preinst @@ -0,0 +1,12 @@ +#!/bin/bash + +set -e + +path="/usr/lib/`/usr/bin/dpkg-architecture -qDEB_TARGET_MULTIARCH`/ukui-control-center/libnetconnect.so" +dpkg-divert --package kylin-nm --rename --divert "$path"".old" --add $path + +path2="/usr/lib/`/usr/bin/dpkg-architecture -qDEB_TARGET_MULTIARCH`/ukui-control-center/libproxy.so" +dpkg-divert --package kylin-nm --rename --divert "$path2"".old" --add $path2 + +path3="/usr/lib/`/usr/bin/dpkg-architecture -qDEB_TARGET_MULTIARCH`/ukui-control-center/libvpn.so" +dpkg-divert --package kylin-nm --rename --divert "$path3"".old" --add $path3 diff --git a/debian/rules b/debian/rules new file mode 100755 index 00000000..2da18dca --- /dev/null +++ b/debian/rules @@ -0,0 +1,34 @@ +#!/usr/bin/make -f + +export QT_SELECT=5 +export DEB_BUILD_MAINT_OPTIONS = hardening=+all + +QMAKE_OPTS = DEFINES+=NO_DEBUG_ON_CONSOLE +MAKE_OPTS = PREFIX=/usr QMAKE=qmake LRELEASE=lrelease QMAKE_OPTS="$(QMAKE_OPTS)" + +override_dh_auto_configure: + QT_SELECT=qt5 dh_auto_configure \ + -- "QMAKE_CXXFLAGS=$(CFLAGS)" \ + kylin-nm.pro + +%: + dh $@ + +override_dh_install: + dh_install + +override_dh_missing: + dh_missing --fail-missing + +override_dh_auto_clean: + [ ! -d .moc ] || $(RM) -r .moc + [ ! -d .obj ] || $(RM) -r .obj + [ ! -d .ui ] || $(RM) -r .ui + [ ! -f Makefile ] || dh_auto_clean + +override_dh_auto_build: + dh_auto_build -- $(MAKE_OPTS) + +override_dh_shlibdeps: + dh_shlibdeps --dpkg-shlibdeps-params=--ignore-missing-info + diff --git a/debian/source/format b/debian/source/format new file mode 100644 index 00000000..89ae9db8 --- /dev/null +++ b/debian/source/format @@ -0,0 +1 @@ +3.0 (native) diff --git a/debian/watch b/debian/watch new file mode 100644 index 00000000..8253cbbc --- /dev/null +++ b/debian/watch @@ -0,0 +1,2 @@ +version=4 +https://github.com/ukui/kylin-nm/releases .*/kylin-nm_(\d\S+)\.orig\.tar\.gz diff --git a/kylin-nm.pro b/kylin-nm.pro index 6efb1b3c..21f0d085 100644 --- a/kylin-nm.pro +++ b/kylin-nm.pro @@ -1,5 +1,6 @@ TEMPLATE = subdirs + CONFIG += \ ordered \ qt \ diff --git a/plugins/component/AddBtn/addnetbtn.cpp b/plugins/component/AddBtn/addnetbtn.cpp index 7c2627de..ca39e460 100644 --- a/plugins/component/AddBtn/addnetbtn.cpp +++ b/plugins/component/AddBtn/addnetbtn.cpp @@ -4,7 +4,7 @@ * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or + * the Free Software Foundation; either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, @@ -82,6 +82,7 @@ void AddNetBtn::paintEvent(QPaintEvent *event) QPainter painter(this); painter.setRenderHint(QPainter:: Antialiasing, true); //设置渲染,启动反锯齿 painter.setPen(Qt::NoPen); + painter.setBrush(this->palette().base().color()); QPalette pal = qApp->palette(); diff --git a/plugins/component/AddBtn/addnetbtn.h b/plugins/component/AddBtn/addnetbtn.h index 85876755..e43acfc2 100644 --- a/plugins/component/AddBtn/addnetbtn.h +++ b/plugins/component/AddBtn/addnetbtn.h @@ -4,7 +4,7 @@ * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or + * the Free Software Foundation; either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, diff --git a/plugins/component/AddBtn/grayinfobutton.cpp b/plugins/component/AddBtn/grayinfobutton.cpp index daa4fa1d..ffc16760 100644 --- a/plugins/component/AddBtn/grayinfobutton.cpp +++ b/plugins/component/AddBtn/grayinfobutton.cpp @@ -4,7 +4,7 @@ * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or + * the Free Software Foundation; either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, diff --git a/plugins/component/AddBtn/grayinfobutton.h b/plugins/component/AddBtn/grayinfobutton.h index 0024f8b7..7a318a9c 100644 --- a/plugins/component/AddBtn/grayinfobutton.h +++ b/plugins/component/AddBtn/grayinfobutton.h @@ -4,7 +4,7 @@ * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or + * the Free Software Foundation; either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, diff --git a/plugins/component/DrownLabel/drownlabel.cpp b/plugins/component/DrownLabel/drownlabel.cpp index 356c7d23..9d05152a 100644 --- a/plugins/component/DrownLabel/drownlabel.cpp +++ b/plugins/component/DrownLabel/drownlabel.cpp @@ -4,7 +4,7 @@ * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or + * the Free Software Foundation; either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, diff --git a/plugins/component/DrownLabel/drownlabel.h b/plugins/component/DrownLabel/drownlabel.h index 281af51f..7938cc28 100644 --- a/plugins/component/DrownLabel/drownlabel.h +++ b/plugins/component/DrownLabel/drownlabel.h @@ -1,10 +1,11 @@ + /* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- * * Copyright (C) 2022 Tianjin KYLIN Information Technology Co., Ltd. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or + * the Free Software Foundation; either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, diff --git a/plugins/component/InfoButton/infobutton.cpp b/plugins/component/InfoButton/infobutton.cpp index 27a33f98..bce835fb 100644 --- a/plugins/component/InfoButton/infobutton.cpp +++ b/plugins/component/InfoButton/infobutton.cpp @@ -4,7 +4,7 @@ * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or + * the Free Software Foundation; either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, diff --git a/plugins/component/InfoButton/infobutton.h b/plugins/component/InfoButton/infobutton.h index f4607ade..49eaa013 100644 --- a/plugins/component/InfoButton/infobutton.h +++ b/plugins/component/InfoButton/infobutton.h @@ -4,7 +4,7 @@ * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or + * the Free Software Foundation; either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, diff --git a/plugins/component/SwitchButton/switchbutton.cpp b/plugins/component/SwitchButton/switchbutton.cpp index a7e62f65..43d2be96 100644 --- a/plugins/component/SwitchButton/switchbutton.cpp +++ b/plugins/component/SwitchButton/switchbutton.cpp @@ -4,7 +4,7 @@ * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or + * the Free Software Foundation; either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, diff --git a/plugins/component/SwitchButton/switchbutton.h b/plugins/component/SwitchButton/switchbutton.h index a54e501b..a7750de5 100644 --- a/plugins/component/SwitchButton/switchbutton.h +++ b/plugins/component/SwitchButton/switchbutton.h @@ -4,7 +4,7 @@ * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or + * the Free Software Foundation; either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, diff --git a/plugins/mobilehotspot/blacklistitem.cpp b/plugins/mobilehotspot/blacklistitem.cpp index bc59735d..ceaa625a 100644 --- a/plugins/mobilehotspot/blacklistitem.cpp +++ b/plugins/mobilehotspot/blacklistitem.cpp @@ -4,7 +4,7 @@ * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or + * the Free Software Foundation; either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, diff --git a/plugins/mobilehotspot/blacklistitem.h b/plugins/mobilehotspot/blacklistitem.h index dab02aae..bba26d51 100644 --- a/plugins/mobilehotspot/blacklistitem.h +++ b/plugins/mobilehotspot/blacklistitem.h @@ -4,7 +4,7 @@ * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or + * the Free Software Foundation; either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, diff --git a/plugins/mobilehotspot/blacklistpage.cpp b/plugins/mobilehotspot/blacklistpage.cpp index d923749c..aa22f45f 100644 --- a/plugins/mobilehotspot/blacklistpage.cpp +++ b/plugins/mobilehotspot/blacklistpage.cpp @@ -4,7 +4,7 @@ * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or + * the Free Software Foundation; either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, diff --git a/plugins/mobilehotspot/blacklistpage.h b/plugins/mobilehotspot/blacklistpage.h index 8a511c1d..c7e075da 100644 --- a/plugins/mobilehotspot/blacklistpage.h +++ b/plugins/mobilehotspot/blacklistpage.h @@ -4,7 +4,7 @@ * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or + * the Free Software Foundation; either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, diff --git a/plugins/mobilehotspot/connectdevlistitem.cpp b/plugins/mobilehotspot/connectdevlistitem.cpp index a8107905..b8d1ae07 100644 --- a/plugins/mobilehotspot/connectdevlistitem.cpp +++ b/plugins/mobilehotspot/connectdevlistitem.cpp @@ -4,7 +4,7 @@ * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or + * the Free Software Foundation; either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, diff --git a/plugins/mobilehotspot/connectdevlistitem.h b/plugins/mobilehotspot/connectdevlistitem.h index 182d581e..52773fa8 100644 --- a/plugins/mobilehotspot/connectdevlistitem.h +++ b/plugins/mobilehotspot/connectdevlistitem.h @@ -4,7 +4,7 @@ * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or + * the Free Software Foundation; either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, diff --git a/plugins/mobilehotspot/connectdevpage.cpp b/plugins/mobilehotspot/connectdevpage.cpp index 473a4c69..d64342b9 100644 --- a/plugins/mobilehotspot/connectdevpage.cpp +++ b/plugins/mobilehotspot/connectdevpage.cpp @@ -4,7 +4,7 @@ * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or + * the Free Software Foundation; either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, diff --git a/plugins/mobilehotspot/connectdevpage.h b/plugins/mobilehotspot/connectdevpage.h index ce9abb09..9468e920 100644 --- a/plugins/mobilehotspot/connectdevpage.h +++ b/plugins/mobilehotspot/connectdevpage.h @@ -4,7 +4,7 @@ * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or + * the Free Software Foundation; either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, diff --git a/plugins/mobilehotspot/mobilehotspot.cpp b/plugins/mobilehotspot/mobilehotspot.cpp index 46bd4409..0a3d594c 100644 --- a/plugins/mobilehotspot/mobilehotspot.cpp +++ b/plugins/mobilehotspot/mobilehotspot.cpp @@ -4,7 +4,7 @@ * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or + * the Free Software Foundation; either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, diff --git a/plugins/mobilehotspot/mobilehotspot.h b/plugins/mobilehotspot/mobilehotspot.h index 7bb3cb63..c669dc64 100644 --- a/plugins/mobilehotspot/mobilehotspot.h +++ b/plugins/mobilehotspot/mobilehotspot.h @@ -4,7 +4,7 @@ * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or + * the Free Software Foundation; either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, diff --git a/plugins/mobilehotspot/mobilehotspotwidget.cpp b/plugins/mobilehotspot/mobilehotspotwidget.cpp index 848d498c..dd77bb24 100644 --- a/plugins/mobilehotspot/mobilehotspotwidget.cpp +++ b/plugins/mobilehotspot/mobilehotspotwidget.cpp @@ -4,7 +4,7 @@ * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or + * the Free Software Foundation; either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, @@ -27,13 +27,16 @@ #define FRAME_MIN_SIZE 550, 60 #define FRAME_MAX_SIZE 16777215, 16777215 #define CONTECT_FRAME_MAX_SIZE 16777215, 60 + #define HINT_TEXT_MARGINS 8, 0, 0, 0 #define FRAME_MIN_SIZE 550, 60 + #define LABLE_MIN_WIDTH 188 #define COMBOBOX_MIN_WIDTH 200 #define LINE_MAX_SIZE 16777215, 1 #define LINE_MIN_SIZE 0, 1 #define ICON_SIZE 24,24 + #define PASSWORD_FRAME_MIN_HIGHT 60 #define PASSWORD_FRAME_FIX_HIGHT 90 #define PASSWORD_FRAME_MIN_SIZE 550, 60 @@ -191,7 +194,6 @@ bool MobileHotspotWidget::eventFilter(QObject *watched, QEvent *event) qDebug() << LOG_HEAD << "call activeWirelessAp failed "; return true; } - } return true; } @@ -260,7 +262,6 @@ void MobileHotspotWidget::initUI() } - void MobileHotspotWidget::initDbusConnect() { if(m_interface->isValid()) { @@ -269,6 +270,7 @@ void MobileHotspotWidget::initDbusConnect() connect(m_interface,SIGNAL(wirelessDeviceStatusChanged()), this, SLOT(onDeviceStatusChanged()), Qt::QueuedConnection); connect(m_interface,SIGNAL(deviceNameChanged(QString, QString, int)), this, SLOT(onDeviceNameChanged(QString, QString, int)), Qt::QueuedConnection); connect(m_interface,SIGNAL(hotspotDeactivated(QString, QString)), this, SLOT(onHotspotDeactivated(QString, QString)), Qt::QueuedConnection); + connect(m_interface,SIGNAL(hotspotActivated(QString, QString, QString, QString, QString)), this, SLOT(onHotspotActivated(QString, QString, QString, QString, QString)), Qt::QueuedConnection); connect(m_interface, SIGNAL(wlanactiveConnectionStateChanged(QString, QString, QString, int)), this, SLOT(onActiveConnectionChanged(QString, QString, QString, int)), Qt::QueuedConnection); @@ -440,11 +442,11 @@ void MobileHotspotWidget::getApInfo() } if (m_interfaceComboBox->count() <= 0) { - m_switchBtn->setChecked(false); - setWidgetHidden(true); - qWarning() << LOG_HEAD << "getApInfo but interface is empty"; - return; - } + m_switchBtn->setChecked(false); + setWidgetHidden(true); + qWarning() << LOG_HEAD << "getApInfo but interface is empty"; + return; + } QDBusReply reply = m_interface->call("getStoredApInfo"); @@ -819,7 +821,6 @@ void MobileHotspotWidget::setWidgetHidden(bool isHidden) onWirelessBtnChanged(state); } resetFrameSize(); - } void MobileHotspotWidget::updateBandCombox() @@ -846,6 +847,7 @@ void MobileHotspotWidget::updateBandCombox() if (index >= 0) { m_freqBandComboBox->setCurrentIndex(index); } + m_isUserSelect = true; } @@ -994,4 +996,3 @@ void MobileHotspotWidget::initBlackListPage() m_Vlayout->addSpacing(32); m_Vlayout->addWidget(m_blacklistPage); } - diff --git a/plugins/mobilehotspot/mobilehotspotwidget.h b/plugins/mobilehotspot/mobilehotspotwidget.h index c1f48942..87975bfc 100644 --- a/plugins/mobilehotspot/mobilehotspotwidget.h +++ b/plugins/mobilehotspot/mobilehotspotwidget.h @@ -4,7 +4,7 @@ * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or + * the Free Software Foundation; either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, diff --git a/plugins/mobilehotspot/translations/bo.ts b/plugins/mobilehotspot/translations/bo.ts index 364b3fa4..474663d6 100644 --- a/plugins/mobilehotspot/translations/bo.ts +++ b/plugins/mobilehotspot/translations/bo.ts @@ -56,79 +56,79 @@ MobileHotspotWidget - + wirless switch is close or no wireless device - + hotpots name or device is invalid - + Contains at least 8 characters - + Hotspot - + Settings - + Settings desktop message - + use - + share network, will interrupt local wireless connection - - + + hotspot already close - + Open - + Wi-Fi Name - + Password - + Frequency band - + Net card - - + + hotspot already open diff --git a/plugins/mobilehotspot/translations/bo_CN.ts b/plugins/mobilehotspot/translations/bo_CN.ts index d8f31126..fc74385e 100644 --- a/plugins/mobilehotspot/translations/bo_CN.ts +++ b/plugins/mobilehotspot/translations/bo_CN.ts @@ -64,7 +64,7 @@ ukui ཚོད་འཛིན་ལྟེ་གནས་ཀྱི་ཅོག་ངོས་ཆ་འཕྲིན། - + wirless switch is close or no wireless device སྐུད་མེད་གློག་སྒོ་རྒྱག་པའམ་ཡང་ན་སྐུད་མེད་སྒྲིག་ཆས་མེད་པ། @@ -73,7 +73,7 @@ སྒོ་རྒྱག་འགོ་བརྩམས། - + hotpots name or device is invalid ཚ་བ་ཆེ་བའི་མིང་ངམ་སྒྲིག་ཆས་ལ་ནུས་པ་མེད། @@ -86,69 +86,69 @@ ཀུན་གྱིས་དོ་སྣང་བྱེད་ཡུལ་གསར་སྐྲུན་བྱེད་འགོ་ - + Contains at least 8 characters མ་མཐར་ཡང་ཡིག་རྟགས་བརྒྱད་འདུས་ཡོད། - + Hotspot ཚ་བ་ཆེ་བ། - + Settings བཀོད་སྒྲིག་བཅས་བྱ་དགོས། - + Settings desktop message བཀོད་སྒྲིག་བཅས་བྱ་དགོས། ཅོག་ངོས་ལ་བརྡ་ཐོ་གཏོང་དགོས། - + use བེད་སྤྱོད། - + share network, will interrupt local wireless connection གླེང་མང་མཉམ་སྤྱོད་བྱས་ནས་འཕྲུལ་ཆས་ཀྱི་སྐུད་མེད་དྲ་བ་སྦྲེལ་མཐུད་བྱེད་ངེས་རེད། - - + + hotspot already close ཚ་བ་ཆེ་བའི་གནད་དོན་ཐག་ཉེ་རུ་སོང་ཡོད། - + Open སྒོ་ཕྱེ་བ། - + Wi-Fi Name Wi-Fiཡི་མིང་། - + Password གསང་གྲངས། - + Frequency band ཐེངས་གྲངས་ཀྱི་རོལ་ཆའི་རུ་ཁག - + Net card དྲ་རྒྱའི་བྱང་བུ། - - + + hotspot already open ཚ་བ་ཆེ་བའི་གནད་དོན་དེ་སྒོ་ཕྱེ་ཟིན། diff --git a/plugins/mobilehotspot/translations/en_US.ts b/plugins/mobilehotspot/translations/en_US.ts index 77b2dce8..c911b573 100644 --- a/plugins/mobilehotspot/translations/en_US.ts +++ b/plugins/mobilehotspot/translations/en_US.ts @@ -64,79 +64,79 @@ ukui control center desktop message - + Settings - + Settings desktop message - + wirless switch is close or no wireless device wirless switch is close or no wireless device - + hotpots name or device is invalid hotpots name or device is invalid - + Hotspot Hotspot - + use - + share network, will interrupt local wireless connection - - + + hotspot already close hotspot already close - + Open Open - + Wi-Fi Name Wi-Fi Name - + Password Password - + Contains at least 8 characters Contains at least 8 characters - + Frequency band Frequency band - + Net card Net card - - + + hotspot already open hotspot already open diff --git a/plugins/mobilehotspot/translations/mn.ts b/plugins/mobilehotspot/translations/mn.ts index 13bee58d..b6da58c0 100644 --- a/plugins/mobilehotspot/translations/mn.ts +++ b/plugins/mobilehotspot/translations/mn.ts @@ -64,7 +64,7 @@ ᠡᠵᠡᠮᠰᠢᠯ ᠤ᠋ᠨ ᠬᠠᠪᠳᠠᠰᠤᠨ ᠤ᠋ ᠰᠢᠷᠡᠭᠡᠨ ᠨᠢᠭᠤᠷ ᠤ᠋ᠨ ᠮᠡᠳᠡᠭᠳᠡᠯ - + wirless switch is close or no wireless device ᠤᠲᠠᠰᠤ ᠦᠭᠡᠢ ᠨᠡᠭᠡᠭᠡᠯᠭᠡ ᠨᠢᠭᠡᠨᠲᠡ ᠬᠠᠭᠠᠭᠰᠠᠨ ᠪᠤᠶᠤ ᠬᠠᠯᠠᠭᠤᠨ ᠴᠡᠭ ᠤ᠋ᠨ ᠴᠢᠳᠠᠮᠵᠢ ᠲᠠᠢ ᠤᠲᠠᠰᠤ ᠦᠭᠡᠢ ᠰᠦᠯᠵᠢᠶᠡᠨ ᠤ᠋ ᠺᠠᠷᠲ ᠪᠠᠢᠬᠤ ᠦᠭᠡᠢ @@ -73,7 +73,7 @@ ᠬᠠᠯᠠᠭᠤᠨ ᠴᠡᠭ ᠢ᠋ ᠡᠬᠢᠯᠡᠵᠤ ᠬᠠᠭᠠᠬᠤ - + hotpots name or device is invalid ᠬᠠᠯᠠᠭᠤᠨ ᠴᠡᠭ ᠤ᠋ᠨ ᠨᠡᠷᠡᠢᠳᠦᠯ ᠪᠤᠶᠤ ᠳᠦᠬᠦᠬᠡᠷᠦᠮᠵᠢ ᠪᠤᠷᠤᠭᠤ @@ -86,69 +86,69 @@ ᠬᠠᠯᠠᠭᠤᠨ ᠴᠡᠭ ᠢ᠋ ᠡᠬᠢᠯᠡᠵᠤ ᠪᠠᠢᠭᠤᠯᠬᠤ - + Contains at least 8 characters ᠠᠳᠠᠭ ᠲᠤ᠌ ᠪᠡᠨ 8 ᠦᠰᠦᠭ ᠳᠡᠮᠳᠡᠭ ᠠᠭᠤᠯᠠᠭᠳᠠᠵᠤ ᠪᠠᠢᠨ᠎ᠠ - + Hotspot ᠰᠢᠯᠵᠢᠮᠡᠯ ᠬᠠᠯᠠᠭᠤᠨ ᠴᠡᠭ - + Settings ᠳᠤᠬᠢᠷᠠᠭᠤᠯᠭ᠎ᠠ - + Settings desktop message ᠰᠢᠷᠡᠭᠡᠨ ᠨᠢᠭᠤᠷ᠎ᠤ᠋ᠨ ᠵᠠᠩᠭᠢ᠎ᠶ᠋ᠢ ᠵᠣᠬᠢᠷᠠᠭᠤᠯᠬᠤ - + use ᠬᠡᠷᠡᠭᠯᠡᠬᠦ - + share network, will interrupt local wireless connection ᠬᠠᠮᠲᠤ ᠡᠳ᠋ᠯᠡᠬᠦ ᠲᠣᠣᠷ ᠰᠦᠯᠵᠢᠶ᠎ᠡ ᠂ ᠲᠤᠰ ᠭᠠᠵᠠᠷ᠎ᠤ᠋ᠨ ᠤᠲᠠᠰᠤᠭᠤᠢ ᠵᠠᠯᠭᠠᠯᠲᠠ᠎ᠶ᠋ᠢ ᠲᠠᠰᠤᠯᠠᠬᠤ - - + + hotspot already close ᠬᠠᠯᠠᠭᠤᠨ ᠴᠡᠭ ᠢ᠋ ᠬᠠᠭᠠᠪᠠ - + Open ᠨᠡᠭᠡᠭᠡᠭᠦ - + Wi-Fi Name Wi-Fi ᠨᠡᠷᠡᠢᠳᠦᠯ - + Password ᠰᠦᠯᠵᠢᠶᠡᠨ ᠤ᠋ ᠨᠢᠭᠤᠴᠠ ᠺᠤᠳ᠋ - + Frequency band ᠲᠤᠤᠷ ᠰᠦᠯᠵᠢᠶᠡᠨ ᠤ᠋ ᠳᠠᠪᠳᠠᠮᠵᠢ ᠵᠢᠨ ᠪᠦᠰᠡ - + Net card ᠬᠠᠮᠳᠤᠪᠠᠷ ᠡᠳ᠋ᠯᠡᠬᠦ ᠨᠧᠲ ᠤ᠋ᠨ ᠦᠵᠦᠬᠦᠷ - - + + hotspot already open ᠬᠠᠯᠠᠭᠤᠨ ᠴᠡᠭ ᠢ᠋ ᠨᠡᠬᠡᠬᠡᠪᠡ diff --git a/plugins/mobilehotspot/translations/tr.ts b/plugins/mobilehotspot/translations/tr.ts index 364b3fa4..474663d6 100644 --- a/plugins/mobilehotspot/translations/tr.ts +++ b/plugins/mobilehotspot/translations/tr.ts @@ -56,79 +56,79 @@ MobileHotspotWidget - + wirless switch is close or no wireless device - + hotpots name or device is invalid - + Contains at least 8 characters - + Hotspot - + Settings - + Settings desktop message - + use - + share network, will interrupt local wireless connection - - + + hotspot already close - + Open - + Wi-Fi Name - + Password - + Frequency band - + Net card - - + + hotspot already open diff --git a/plugins/mobilehotspot/translations/zh_CN.ts b/plugins/mobilehotspot/translations/zh_CN.ts index 205ecda0..013183b7 100644 --- a/plugins/mobilehotspot/translations/zh_CN.ts +++ b/plugins/mobilehotspot/translations/zh_CN.ts @@ -64,7 +64,7 @@ 控制面板桌面通知 - + wirless switch is close or no wireless device 无线开关已关闭或不存在有热点功能的无线网卡 @@ -73,7 +73,7 @@ 开始关闭热点 - + hotpots name or device is invalid 热点名称或设备错误 @@ -86,69 +86,69 @@ 开始创建热点 - + Contains at least 8 characters 至少包含8个字符 - + Hotspot 移动热点 - + Settings 设置 - + Settings desktop message 设置 桌面通知 - + use 使用 - + share network, will interrupt local wireless connection 进行热点共享,会中断本机无线网络连接 - - + + hotspot already close 热点已关闭 - + Open 开启 - + Wi-Fi Name Wi-Fi 名称 - + Password 网络密码 - + Frequency band 网络频带 - + Net card 共享网卡端口 - - + + hotspot already open 热点已开启 diff --git a/plugins/netconnect/deviceframe.cpp b/plugins/netconnect/deviceframe.cpp index a90e9f67..75353825 100644 --- a/plugins/netconnect/deviceframe.cpp +++ b/plugins/netconnect/deviceframe.cpp @@ -4,7 +4,7 @@ * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or + * the Free Software Foundation; either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, @@ -34,23 +34,23 @@ DeviceFrame::DeviceFrame(QString devName, QWidget *parent) : QFrame(parent) deviceLabel = new QLabel(this); dropDownLabel = new DrownLabel(devName, this); - deviceSwitch = new KSwitchButton(this); - deviceSwitch->installEventFilter(this); +// deviceSwitch = new KSwitchButton(this); +// deviceSwitch->installEventFilter(this); deviceLayout->addWidget(deviceLabel); deviceLayout->addStretch(); - deviceLayout->addWidget(dropDownLabel); - deviceLayout->addWidget(deviceSwitch); + deviceLayout->addWidget(dropDownLabel);/* + deviceLayout->addWidget(deviceSwitch);*/ } bool DeviceFrame::eventFilter(QObject *w,QEvent *e) { - if (w == deviceSwitch) { - if (e->type() == QEvent::MouseButtonPress) { - emit deviceSwitchClicked(!deviceSwitch->isChecked()); - return true; - } - } +// if (w == deviceSwitch) { +// if (e->type() == QEvent::MouseButtonPress) { +// emit deviceSwitchClicked(!deviceSwitch->isChecked()); +// return true; +// } +// } return QFrame::eventFilter(w, e); } diff --git a/plugins/netconnect/deviceframe.h b/plugins/netconnect/deviceframe.h index 41752d03..1bde1e7d 100644 --- a/plugins/netconnect/deviceframe.h +++ b/plugins/netconnect/deviceframe.h @@ -4,7 +4,7 @@ * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or + * the Free Software Foundation; either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, @@ -34,6 +34,7 @@ using namespace kdk; class DeviceFrame : public QFrame { + Q_OBJECT public: DeviceFrame(QString devName, QWidget *parent = nullptr); @@ -52,7 +53,6 @@ private: signals: void deviceSwitchClicked(bool); - }; #endif // DEVICEFRAME_H diff --git a/plugins/netconnect/itemframe.cpp b/plugins/netconnect/itemframe.cpp index 17b83de7..c7f8684a 100644 --- a/plugins/netconnect/itemframe.cpp +++ b/plugins/netconnect/itemframe.cpp @@ -4,7 +4,7 @@ * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or + * the Free Software Foundation; either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, diff --git a/plugins/netconnect/itemframe.h b/plugins/netconnect/itemframe.h index ee3bbe9e..dfe4ae03 100644 --- a/plugins/netconnect/itemframe.h +++ b/plugins/netconnect/itemframe.h @@ -4,7 +4,7 @@ * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or + * the Free Software Foundation; either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, @@ -31,6 +31,7 @@ class ItemFrame : public QFrame Q_OBJECT public: ItemFrame(QString devName, QWidget *parent = nullptr); + //单设备整体layout QVBoxLayout * deviceLanLayout = nullptr; //单设备名称+下拉按钮Frame+d单设备开关 diff --git a/plugins/netconnect/lanitem.cpp b/plugins/netconnect/lanitem.cpp index 45b7d6ed..753e4fe5 100644 --- a/plugins/netconnect/lanitem.cpp +++ b/plugins/netconnect/lanitem.cpp @@ -4,7 +4,7 @@ * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or + * the Free Software Foundation; either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, @@ -164,7 +164,7 @@ bool LanItem::eventFilter(QObject *watched, QEvent *event) { //菜单右边界与按钮右边界对齐 if (event->type() == QEvent::Show && watched == m_moreMenu) { - int menuXPos = m_moreMenu->pos().x(); + int menuXPos = mapToGlobal(m_moreButton->pos()).x(); int menuWidth = m_moreMenu->size().width(); int btnWidth = m_moreButton->size().width(); @@ -174,4 +174,3 @@ bool LanItem::eventFilter(QObject *watched, QEvent *event) } return false; } - diff --git a/plugins/netconnect/lanitem.h b/plugins/netconnect/lanitem.h index b27a9df2..4aabbe6a 100644 --- a/plugins/netconnect/lanitem.h +++ b/plugins/netconnect/lanitem.h @@ -4,7 +4,7 @@ * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or + * the Free Software Foundation; either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, diff --git a/plugins/netconnect/netconnect.cpp b/plugins/netconnect/netconnect.cpp index 5afd434d..fd70ad59 100644 --- a/plugins/netconnect/netconnect.cpp +++ b/plugins/netconnect/netconnect.cpp @@ -4,7 +4,7 @@ * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or + * the Free Software Foundation; either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, @@ -35,7 +35,6 @@ #define KYLIN_APP_MANAGER_NAME "com.kylin.AppManager" #define KYLIN_APP_MANAGER_PATH "/com/kylin/AppManager" #define KYLIN_APP_MANAGER_INTERFACE "com.kylin.AppManager" - const QString KLanSymbolic = "network-wired-connected-symbolic"; const QString NoNetSymbolic = "network-wired-disconnected-symbolic"; @@ -83,6 +82,8 @@ NetConnect::NetConnect() : mFirstLoad(true) { pluginName = tr("LAN"); pluginType = NETWORK; + + needLoad = isExitWiredDevice(); } NetConnect::~NetConnect() { @@ -131,7 +132,7 @@ const QString NetConnect::name() const { bool NetConnect::isEnable() const { - return true; + return needLoad; } @@ -166,61 +167,63 @@ bool NetConnect::eventFilter(QObject *w, QEvent *e) { if (w->findChild()) w->findChild()->setStyleSheet("QWidget{background: palette(base);border-radius:4px;}"); } - if (w == wiredSwitch) { - if (e->type() == QMouseEvent::MouseButtonRelease) { - if (!wiredSwitch->isCheckable()) { - showDesktopNotify(tr("No ethernet device avaliable")); - } else { - UkccCommon::buriedSettings(QString("netconnect"), QString("Open"), QString("settings"),wiredSwitch->isChecked()?"false":"true"); - if (m_interface != nullptr && m_interface->isValid()) { - m_interface->call(QStringLiteral("setWiredSwitchEnable"), !wiredSwitch->isChecked()); - } - return true; - } - } - } + +// if (w == wiredSwitch) { +// if (e->type() == QMouseEvent::MouseButtonRelease) { +// if (!wiredSwitch->isCheckable()) { +// showDesktopNotify(tr("No ethernet device avaliable")); +// } else { +// UkccCommon::buriedSettings(QString("netconnect"), QString("Open"), QString("settings"),wiredSwitch->isChecked()?"false":"true"); +// if (m_interface != nullptr && m_interface->isValid()) { +// m_interface->call(QStringLiteral("setWiredSwitchEnable"), !wiredSwitch->isChecked()); +// } +// return true; +// } +// } +// } return QObject::eventFilter(w,e); } void NetConnect::initComponent() { - wiredSwitch = new KSwitchButton(pluginWidget); - ui->openWIifLayout->addWidget(wiredSwitch); +// wiredSwitch = new KSwitchButton(pluginWidget); +// ui->openWIifLayout->addWidget(wiredSwitch); ui->openWIifLayout->setContentsMargins(0,0,8,0); + ui->openWifiFrame->hide(); ui->detailLayOut->setContentsMargins(MAIN_LAYOUT_MARGINS); ui->verticalLayout_3->setContentsMargins(NO_MARGINS); ui->verticalLayout_3->setSpacing(8); ui->availableLayout->setSpacing(SPACING); ui->horizontalLayout->setContentsMargins(TOP_MARGINS); - wiredSwitch->installEventFilter(this); +// wiredSwitch->installEventFilter(this); - if (QGSettings::isSchemaInstalled(GSETTINGS_SCHEMA)) { - m_switchGsettings = new QGSettings(GSETTINGS_SCHEMA); +// if (QGSettings::isSchemaInstalled(GSETTINGS_SCHEMA)) { +// m_switchGsettings = new QGSettings(GSETTINGS_SCHEMA); - setSwitchStatus(); +// setSwitchStatus(); - connect(m_switchGsettings, &QGSettings::changed, this, [=] (const QString &key) { - if (key == WIRED_SWITCH) { - setSwitchStatus(); - } - }); - } else { - wiredSwitch->blockSignals(true); - wiredSwitch->setChecked(true); - wiredSwitch->blockSignals(false); - qDebug()<<"[Netconnect] org.ukui.kylin-nm.switch is not installed!"; - } +// connect(m_switchGsettings, &QGSettings::changed, this, [=] (const QString &key) { +// if (key == WIRED_SWITCH) { +// setSwitchStatus(); +// } +// }); +// } else { +// wiredSwitch->blockSignals(true); +// wiredSwitch->setChecked(true); +// wiredSwitch->blockSignals(false); +// qDebug()<<"[Netconnect] org.ukui.kylin-nm.switch is not installed!"; +// } getDeviceStatusMap(deviceStatusMap); - if (deviceStatusMap.isEmpty()) { - qDebug() << "[Netconnect] no device exist when init, set switch disable"; - wiredSwitch->setChecked(false); - wiredSwitch->setCheckable(false); - } +// if (deviceStatusMap.isEmpty()) { +// qDebug() << "[Netconnect] no device exist when init, set switch disable"; +// wiredSwitch->setChecked(false); +// wiredSwitch->setCheckable(false); +// } initNet(); - if (!wiredSwitch->isChecked() || deviceStatusMap.isEmpty() || !m_interface->isValid()) { + if (/*!wiredSwitch->isChecked() || */deviceStatusMap.isEmpty() || !m_interface->isValid()) { hideLayout(ui->availableLayout); } @@ -306,19 +309,19 @@ void NetConnect::updateLanInfo(QString deviceName, QStringList lanInfo) //总开关 void NetConnect::setSwitchStatus() { - if (QGSettings::isSchemaInstalled(GSETTINGS_SCHEMA)) { - bool status = m_switchGsettings->get(WIRED_SWITCH).toBool(); - wiredSwitch->blockSignals(true); - wiredSwitch->setChecked(status); - wiredSwitch->blockSignals(false); - if (!status) { - hideLayout(ui->availableLayout); - } else { - showLayout(ui->availableLayout); - } - } else { - qDebug()<<"[netconnect] org.ukui.kylin-nm.switch is not installed!"; - } +// if (QGSettings::isSchemaInstalled(GSETTINGS_SCHEMA)) { +// bool status = m_switchGsettings->get(WIRED_SWITCH).toBool(); +// wiredSwitch->blockSignals(true); +// wiredSwitch->setChecked(status); +// wiredSwitch->blockSignals(false); +// if (!status) { +// hideLayout(ui->availableLayout); +// } else { +// showLayout(ui->availableLayout); +// } +// } else { +// qDebug()<<"[netconnect] org.ukui.kylin-nm.switch is not installed!"; +// } } @@ -529,7 +532,7 @@ void NetConnect::addDeviceFrame(QString devName) ItemFrame *itemFrame = new ItemFrame(devName, pluginWidget); ui->availableLayout->addWidget(itemFrame); itemFrame->deviceFrame->deviceLabel->setText(tr("card")+/*QString("%1").arg(count)+*/":"+devName); - itemFrame->deviceFrame->deviceSwitch->setChecked(enable); +// itemFrame->deviceFrame->deviceSwitch->setChecked(enable); if (enable) { itemFrame->lanItemFrame->show(); itemFrame->deviceFrame->dropDownLabel->show(); @@ -541,30 +544,30 @@ void NetConnect::addDeviceFrame(QString devName) deviceFrameMap.insert(devName, itemFrame); qDebug() << "[NetConnect]deviceFrameMap insert" << devName; - connect(itemFrame->deviceFrame, &DeviceFrame::deviceSwitchClicked ,this, [=] (bool checked) { - UkccCommon::buriedSettings(QString("netconnect"), "device open", QString("settings"), checked?"true":"fasle"); - qDebug() << "[NetConnect]call setDeviceEnable" << devName << checked << __LINE__; - m_interface->call(QStringLiteral("setDeviceEnable"), devName, checked); - qDebug() << "[NetConnect]call setDeviceEnable Respond" << __LINE__; - }); +// connect(itemFrame->deviceFrame, &DeviceFrame::deviceSwitchClicked ,this, [=] (bool checked) { +// UkccCommon::buriedSettings(QString("netconnect"), "device open", QString("settings"), checked?"true":"fasle"); +// qDebug() << "[NetConnect]call setDeviceEnable" << devName << checked << __LINE__; +// m_interface->call(QStringLiteral("setDeviceEnable"), devName, checked); +// qDebug() << "[NetConnect]call setDeviceEnable Respond" << __LINE__; +// }); - connect(itemFrame->deviceFrame->deviceSwitch, &KSwitchButton::stateChanged, this, [=] (bool checked) { +// connect(itemFrame->deviceFrame->deviceSwitch, &KSwitchButton::stateChanged, this, [=] (bool checked) { - if (checked) { - qDebug() << "[NetConnect]set " << devName << "status" << true; - itemFrame->lanItemFrame->show(); - itemFrame->deviceFrame->dropDownLabel->show(); - itemFrame->addLanWidget->show(); - itemFrame->deviceFrame->dropDownLabel->setDropDownStatus(true); - deviceStatusMap[devName] = true; - } else { - qDebug() << "[NetConnect]set " << devName << "status" << false; - itemFrame->lanItemFrame->hide(); - itemFrame->deviceFrame->dropDownLabel->hide(); - itemFrame->addLanWidget->hide(); - deviceStatusMap[devName] = false; - } - }); +// if (checked) { +// qDebug() << "[NetConnect]set " << devName << "status" << true; +// itemFrame->lanItemFrame->show(); +// itemFrame->deviceFrame->dropDownLabel->show(); +// itemFrame->addLanWidget->show(); +// itemFrame->deviceFrame->dropDownLabel->setDropDownStatus(true); +// deviceStatusMap[devName] = true; +// } else { +// qDebug() << "[NetConnect]set " << devName << "status" << false; +// itemFrame->lanItemFrame->hide(); +// itemFrame->deviceFrame->dropDownLabel->hide(); +// itemFrame->addLanWidget->hide(); +// deviceStatusMap[devName] = false; +// } +// }); connect(itemFrame->addLanWidget, &AddNetBtn::clicked, this, [=](){ UkccCommon::buriedSettings(pluginName, "Add net", QString("clicked")); @@ -640,22 +643,22 @@ void NetConnect::onDeviceStatusChanged() initNetListFromDevice(addList.at(i)); } deviceStatusMap = map; - if (deviceStatusMap.isEmpty()) { - wiredSwitch->setChecked(false); - wiredSwitch->setCheckable(false); - } else { - wiredSwitch->setCheckable(true); - setSwitchStatus(); - } +// if (deviceStatusMap.isEmpty()) { +// wiredSwitch->setChecked(false); +// wiredSwitch->setCheckable(false); +// } else { +// wiredSwitch->setCheckable(true); +// setSwitchStatus(); +// } - QMap::iterator iter; - for (iter = deviceFrameMap.begin(); iter != deviceFrameMap.end(); iter++) { - if (deviceStatusMap.contains(iter.key())) { - if (iter.value()->deviceFrame->deviceSwitch->isChecked() != deviceStatusMap[iter.key()]) { - iter.value()->deviceFrame->deviceSwitch->setChecked(deviceStatusMap[iter.key()]); - } - } - } +// QMap::iterator iter; +// for (iter = deviceFrameMap.begin(); iter != deviceFrameMap.end(); iter++) { +// if (deviceStatusMap.contains(iter.key())) { +// if (iter.value()->deviceFrame->deviceSwitch->isChecked() != deviceStatusMap[iter.key()]) { +// iter.value()->deviceFrame->deviceSwitch->setChecked(deviceStatusMap[iter.key()]); +// } +// } +// } } void NetConnect::onDeviceNameChanged(QString oldName, QString newName, int type) @@ -967,3 +970,31 @@ bool NetConnect::LaunchApp(QString desktopFile) return reply; } } + +bool NetConnect::isExitWiredDevice() +{ + QDBusInterface *interface = new QDBusInterface("com.kylin.network", "/com/kylin/network", + "com.kylin.network", + QDBusConnection::sessionBus()); + if (!interface->isValid()) { + qDebug() << "/com/kylin/network is invalid"; + return false; + } + + QDBusMessage result = interface->call(QStringLiteral("getDeviceListAndEnabled"),0); + if(result.type() == QDBusMessage::ErrorMessage) { + qWarning() << "getWiredDeviceList error:" << result.errorMessage(); + return false; + } + + auto dbusArg = result.arguments().at(0).value(); + QMap deviceListMap; + dbusArg >> deviceListMap; + + + if (deviceListMap.isEmpty()) { + qDebug() << "no wired device"; + return false; + } + return true; +} diff --git a/plugins/netconnect/netconnect.h b/plugins/netconnect/netconnect.h index e115f875..0f4a0a7e 100644 --- a/plugins/netconnect/netconnect.h +++ b/plugins/netconnect/netconnect.h @@ -4,7 +4,7 @@ * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or + * the Free Software Foundation; either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, @@ -125,6 +125,9 @@ private: void itemActiveConnectionStatusChanged(LanItem *item, int status); bool LaunchApp(QString desktopFile); + + bool isExitWiredDevice(); + protected: bool eventFilter(QObject *w,QEvent *e); @@ -144,6 +147,8 @@ private: QMap deviceStatusMap; QMap deviceFrameMap; + bool needLoad; + private slots: void updateLanInfo(QString deviceName, QStringList lanInfo); diff --git a/plugins/netconnect/translations/bo.qm b/plugins/netconnect/translations/bo.qm deleted file mode 100644 index be651eed..00000000 --- a/plugins/netconnect/translations/bo.qm +++ /dev/null @@ -1 +0,0 @@ - + + LanItem + + + Delete + + + + + + Disconnect + + + + + + Connect + + + NetConnect @@ -23,47 +43,49 @@ - + open /netconnect/open - + Advanced settings /netconnect/Advanced settings" - + Settings - + Settings desktop message - - + + LAN - - No ethernet device avaliable - - - - - + + connected - + + + + not connected + + + + card diff --git a/plugins/netconnect/translations/bo_CN.ts b/plugins/netconnect/translations/bo_CN.ts index de8032de..b77e09a0 100644 --- a/plugins/netconnect/translations/bo_CN.ts +++ b/plugins/netconnect/translations/bo_CN.ts @@ -6,7 +6,7 @@ Add Others - + སྐུད་ཡོད་བརྙན་འཕྲིན་ཁ་སྣོན་བྱས་ཡོད། @@ -14,6 +14,26 @@ སྐུད་ཡོད་བརྙན་འཕྲིན་ཁ་སྣོན་བྱས་ཡོད། + + LanItem + + + Delete + བསུབ་པ། + + + + + Disconnect + འབྲེལ་ཐག་ཆད་པ། + + + + + Connect + སྦྲེལ་མཐུད་བྱེད་པ། + + NetConnect @@ -23,14 +43,14 @@ - + open སྒོ་ཕྱེ་བ། /netconnect/open - + Advanced settings སྔོན་ཐོན་གྱི་སྒྲིག་བཀོད། /netconnect/Advanced settings" @@ -48,34 +68,40 @@ སྐུད་ཡོད་སྦྲེལ་མཐུད། - + Settings བཀོད་སྒྲིག་བཅས་བྱ་དགོས། - + Settings desktop message བཀོད་སྒྲིག་བཅས་བྱ་དགོས། ཅོག་ངོས་ལ་བརྡ་ཐོ་གཏོང་དགོས། - - + + LAN སྐུད་ཡོད་དྲ་བ། - No ethernet device avaliable - ཨེ་ཙི་དྲ་རྒྱའི་སྒྲིག་ཆས་ལ་བཙན་འཛུལ་བྱས་མི་ཆོག། + ཨེ་ཙི་དྲ་རྒྱའི་སྒྲིག་ཆས་ལ་བཙན་འཛུལ་བྱས་མི་ཆོག། - - + + connected འབྲེལ་མཐུད་བྱེད་པ། - + + + + not connected + འབྲེལ་མཐུད་མི་བྱེད་པ། + + + card བྱང་བུ། diff --git a/plugins/netconnect/translations/en_US.ts b/plugins/netconnect/translations/en_US.ts index 2a4f6b07..138a8002 100644 --- a/plugins/netconnect/translations/en_US.ts +++ b/plugins/netconnect/translations/en_US.ts @@ -14,6 +14,26 @@ Add WiredNetork + + LanItem + + + Delete + + + + + + Disconnect + + + + + + Connect + + + NetConnect @@ -23,14 +43,14 @@ - + open open /netconnect/open - + Advanced settings Advanced settings /netconnect/Advanced settings" @@ -44,34 +64,40 @@ ukui control center desktop message - + Settings - + Settings desktop message - - + + LAN LAN - No ethernet device avaliable - No ethernet device avaliable + No ethernet device avaliable - - + + connected connected - + + + + not connected + + + + card card diff --git a/plugins/netconnect/translations/mn.ts b/plugins/netconnect/translations/mn.ts index 236f834a..1218b8c6 100644 --- a/plugins/netconnect/translations/mn.ts +++ b/plugins/netconnect/translations/mn.ts @@ -14,6 +14,26 @@ ᠤᠲᠠᠰᠤᠲᠤ ᠨᠧᠲ ᠨᠡᠮᠡᠬᠦ + + LanItem + + + Delete + + + + + + Disconnect + + + + + + Connect + + + NetConnect @@ -23,14 +43,14 @@ - + open ᠨᠡᠭᠡᠭᠡᠬᠦ /netconnect/open - + Advanced settings ᠦᠨᠳᠦᠷ ᠵᠡᠷᠬᠡ ᠵᠢᠨ ᠳᠤᠬᠢᠷᠠᠭᠤᠯᠤᠯᠳᠠ /netconnect/Advanced settings" @@ -48,34 +68,40 @@ ᠤᠳᠠᠰᠤᠳᠤ ᠰᠦᠯᠵᠢᠶ᠎ᠡ - + Settings ᠳᠤᠬᠢᠷᠠᠭᠤᠯᠭ᠎ᠠ - + Settings desktop message ᠰᠢᠷᠡᠭᠡᠨ ᠨᠢᠭᠤᠷ᠎ᠤ᠋ᠨ ᠵᠠᠩᠭᠢ᠎ᠶ᠋ᠢ ᠵᠣᠬᠢᠷᠠᠭᠤᠯᠬᠤ - - + + LAN ᠤᠲᠠᠰᠤᠲᠤ ᠲᠣᠣᠷ ᠰᠦᠯᠵᠢᠶ᠎ᠡ ᠃ - No ethernet device avaliable - ᠤᠳᠠᠰᠤᠳᠤ ᠳᠦᠬᠦᠬᠡᠷᠦᠮᠵᠢ ᠵᠢ ᠪᠠᠢᠴᠠᠭᠠᠵᠤ ᠤᠯᠤᠭᠰᠠᠨ ᠦᠬᠡᠢ + ᠤᠳᠠᠰᠤᠳᠤ ᠳᠦᠬᠦᠬᠡᠷᠦᠮᠵᠢ ᠵᠢ ᠪᠠᠢᠴᠠᠭᠠᠵᠤ ᠤᠯᠤᠭᠰᠠᠨ ᠦᠬᠡᠢ - - + + connected ᠨᠢᠬᠡᠨᠳᠡ ᠴᠦᠷᠬᠡᠯᠡᠪᠡ - + + + + not connected + + + + card ᠨᠧᠲ ᠤ᠋ᠨ ᠺᠠᠷᠲ diff --git a/plugins/netconnect/translations/tr.qm b/plugins/netconnect/translations/tr.qm deleted file mode 100644 index be651eed..00000000 --- a/plugins/netconnect/translations/tr.qm +++ /dev/null @@ -1 +0,0 @@ - + + LanItem + + + Delete + + + + + + Disconnect + + + + + + Connect + + + NetConnect @@ -23,47 +43,49 @@ - + open /netconnect/open - + Advanced settings /netconnect/Advanced settings" - + Settings - + Settings desktop message - - + + LAN - - No ethernet device avaliable - - - - - + + connected - + + + + not connected + + + + card diff --git a/plugins/netconnect/translations/zh_CN.ts b/plugins/netconnect/translations/zh_CN.ts index 0834c4af..221b8951 100644 --- a/plugins/netconnect/translations/zh_CN.ts +++ b/plugins/netconnect/translations/zh_CN.ts @@ -6,7 +6,7 @@ Add Others - + @@ -14,6 +14,26 @@ 添加有线网络 + + LanItem + + + Delete + 删除 + + + + + Disconnect + 断开 + + + + + Connect + 连接 + + NetConnect @@ -23,14 +43,14 @@ - + open 开启 /netconnect/open - + Advanced settings 高级设置 /netconnect/Advanced settings" @@ -48,34 +68,40 @@ 有线网络 - + Settings 设置 - + Settings desktop message 设置 桌面通知 - - + + LAN 有线网络 - No ethernet device avaliable - 未检测到有线设备 + 未检测到有线设备 - - + + connected 已连接 - + + + + not connected + 未连接 + + + card 网卡 diff --git a/plugins/proxy/applistwidget.cpp b/plugins/proxy/applistwidget.cpp index ab9d2fb2..597532a6 100644 --- a/plugins/proxy/applistwidget.cpp +++ b/plugins/proxy/applistwidget.cpp @@ -4,7 +4,7 @@ * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or + * the Free Software Foundation; either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, diff --git a/plugins/proxy/applistwidget.h b/plugins/proxy/applistwidget.h index 4c93bd91..31b7e184 100644 --- a/plugins/proxy/applistwidget.h +++ b/plugins/proxy/applistwidget.h @@ -4,7 +4,7 @@ * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or + * the Free Software Foundation; either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, diff --git a/plugins/proxy/aptinfo.h b/plugins/proxy/aptinfo.h index 6752eb8e..95e9ff3e 100644 --- a/plugins/proxy/aptinfo.h +++ b/plugins/proxy/aptinfo.h @@ -1,3 +1,22 @@ +/* + * + * Copyright (C) 2023, KylinSoft Co., Ltd. + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + * + */ #ifndef APTINFO_H #define APTINFO_H #include diff --git a/plugins/proxy/aptproxydialog.cpp b/plugins/proxy/aptproxydialog.cpp index 69bf29b5..e42b738f 100644 --- a/plugins/proxy/aptproxydialog.cpp +++ b/plugins/proxy/aptproxydialog.cpp @@ -1,3 +1,22 @@ +/* + * + * Copyright (C) 2023, KylinSoft Co., Ltd. + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + * + */ #include "aptproxydialog.h" #include #include diff --git a/plugins/proxy/aptproxydialog.h b/plugins/proxy/aptproxydialog.h index ab677ebb..95d49f05 100644 --- a/plugins/proxy/aptproxydialog.h +++ b/plugins/proxy/aptproxydialog.h @@ -1,3 +1,22 @@ +/* + * + * Copyright (C) 2023, KylinSoft Co., Ltd. + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + * + */ #ifndef APTPROXYDIALOG_H #define APTPROXYDIALOG_H diff --git a/plugins/proxy/certificationdialog.h b/plugins/proxy/certificationdialog.h index 3cffb5ef..01624a61 100644 --- a/plugins/proxy/certificationdialog.h +++ b/plugins/proxy/certificationdialog.h @@ -4,7 +4,7 @@ * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or + * the Free Software Foundation; either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, diff --git a/plugins/proxy/proxy.cpp b/plugins/proxy/proxy.cpp index cdef6f4c..e217764f 100644 --- a/plugins/proxy/proxy.cpp +++ b/plugins/proxy/proxy.cpp @@ -4,7 +4,7 @@ * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or + * the Free Software Foundation; either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, @@ -123,7 +123,7 @@ QWidget *Proxy::pluginUi() { initManualProxyStatus(); initIgnoreHostStatus(); initDbus(); - initAppProxyStatus(); +// initAppProxyStatus(); } else { qCritical() << "Xml needed by Proxy is not installed"; } @@ -372,10 +372,10 @@ void Proxy::initUi(QWidget *widget) Lyt->addWidget(mIgnoreFrame); //应用代理模块 - m_appProxyLabel = new TitleLabel(widget); - m_appProxyLabel->setText(tr("Application Proxy")); //应用代理 - setAppProxyFrameUi(widget); - setAppListFrameUi(widget); +// m_appProxyLabel = new TitleLabel(widget); +// m_appProxyLabel->setText(tr("Application Proxy")); //应用代理 +// setAppProxyFrameUi(widget); +// setAppListFrameUi(widget); //APT代理模块 mAptProxyLabel = new TitleLabel(widget); @@ -438,12 +438,13 @@ void Proxy::initUi(QWidget *widget) mverticalLayout->addWidget(mTitleLabel); mverticalLayout->addWidget(mProxyFrame); + mverticalLayout->addWidget(m_sysSpacerFrame); - mverticalLayout->addWidget(m_appProxyLabel); - mverticalLayout->addWidget(m_appProxyFrame); +// mverticalLayout->addWidget(m_appProxyLabel); +// mverticalLayout->addWidget(m_appProxyFrame); mverticalLayout->addWidget(m_appListSpacerFrame); - mverticalLayout->addWidget(m_appListFrame); - mverticalLayout->addWidget(m_appSpacerFrame); +// mverticalLayout->addWidget(m_appListFrame); +// mverticalLayout->addWidget(m_appSpacerFrame); mverticalLayout->addWidget(mAptProxyLabel); mverticalLayout->addWidget(mAPTFrame); mverticalLayout->addStretch(); @@ -982,7 +983,7 @@ QMap Proxy::getAppListProxy() void Proxy::setUkccProxySettings() { setSystemProxyFrameHidden(false); - setAppProxyFrameHidden(false); +// setAppProxyFrameHidden(false); setAPTProxyFrameHidden(false); QDBusInterface ukccDbusInterface("org.ukui.ukcc.session", @@ -1016,7 +1017,7 @@ void Proxy::setUkccProxySettings() if (setting.contains("SystemProxyFrame") && setting.contains("false")) { setSystemProxyFrameHidden(true); } else if (setting.contains("AppProxyFrame") && setting.contains("false")) { - setAppProxyFrameHidden(true); +// setAppProxyFrameHidden(true); } else if (setting.contains("APTProxyFrame") && setting.contains("false")) { setAPTProxyFrameHidden(true); } @@ -1251,6 +1252,7 @@ void Proxy::setAppListFrameUi(QWidget *widget) appListLayout->addWidget(m_allowAppProxyLabel); appListLayout->addWidget(m_appListWidget); + onPaletteChanged(); const QByteArray style_id(THEME_SCHAME); if (QGSettings::isSchemaInstalled(style_id)) { diff --git a/plugins/proxy/proxy.h b/plugins/proxy/proxy.h index d6e24d0a..30d7437e 100644 --- a/plugins/proxy/proxy.h +++ b/plugins/proxy/proxy.h @@ -4,7 +4,7 @@ * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or + * the Free Software Foundation; either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, diff --git a/plugins/proxy/translations/bo_CN.ts b/plugins/proxy/translations/bo_CN.ts index 844a9638..300c6189 100644 --- a/plugins/proxy/translations/bo_CN.ts +++ b/plugins/proxy/translations/bo_CN.ts @@ -4,27 +4,27 @@ AptProxyDialog - + Set APT Proxy APT ངོ་ཚབ་ བཙུགས་པ། - + Server Address ཞབས་ཞུའི་ས་གནས། - + Port གྲུ་ཁ། - + Cancel ཕྱིར་འཐེན། - + Confirm གཏན་འཁེལ་བྱ་དགོས། @@ -37,136 +37,135 @@ ཚབ་བྱེད་མི་སྣ། - + Start using བཀོལ་སྤྱོད་བྱེད་འགོ་ཚུགས། - + Proxy mode ཚབ་བྱེད་དཔེ་དབྱིབས། - + Auto རང་འགུལ་གྱིས་རླངས་ - + Manual ལག་དེབ། - Application Proxy - ཉེར་སྤྱོད་ངོ་ཚབ། + ཉེར་སྤྱོད་ངོ་ཚབ། - + System Proxy མ་ལག་གི་ཚབ་བྱེད་ - + Auto url རླངས་འཁོར་གྱི་དྲ་ཚིགས། /Proxy/Auto url - + Http Proxy HTTP ཚབ་བྱེད་མི་སྣ། /Proxy/Http Proxy - + Https Proxy HTTPS ཚབ་བྱེད་མི་སྣ། /Proxy/Https Proxy - + Ftp Proxy FTP ཚབ་བྱེད་མི་སྣ། /Proxy/Ftp Proxy - + Socks Proxy SOCKS ཚབ་བྱེད་མི་སྣ། /Proxy/Socks Proxy - - - - - + + + + + Port གྲུ་ཁ། - + List of ignored hosts. more than one entry, please separate with english semicolon(;) སྣང་མེད་དུ་བཞག་པའི་བདག་པོའི་མིང་ཐོ། འཇུག་སྒོ་གཅིག་ལས་བརྒལ་ན་དབྱིན་ཡིག་གི་ཕྱེད་ཀ་དང་ཁ་གྱེས་རོགས། (;) - + App Proxy ཉེར་སྤྱོད་ངོ་ཚབ། /Proxy/App Proxy - + APT Proxy APT ཚབ་བྱེད་མི་སྣ། /Proxy/APT Proxy - - + + Open སྒོ་ཕྱེ་བ། - + Server Address : ཞབས་ཞུའི་ཡོ་བྱད་ཀྱི་གནས་ཡུལ - + Port : གྲུ་ཁ། - + Edit རྩོམ་སྒྲིག - + The APT proxy has been turned off and needs to be restarted to take effect ངོ་ཚབ་ཀྱི་སྒོ་བརྒྱབ་ཟིན་པས་ཡང་བསྐྱར་ནུས་པ་ཐོན་པར་བྱ་དགོས། - - + + Reboot Later རྗེས་སུ་ཡང་བསྐྱར་ཐེངས་གཅིག་ལ་བསྐྱར་ - - + + Reboot Now ད་ལྟ་བསྐྱར་དུ་ལས་ཀ་བྱེད་དགོས། - + The system needs to be restarted to set the APT proxy, whether to reboot མ་ལག་འདི་བསྐྱར་དུ་འགོ་ཚུགས་ནས་APT ཡི་ཚབ་བྱེད་འཕྲུལ་ཆས་གཏན་འཁེལ་བྱེད་དགོས་པ་དང་། བསྐྱར་དུ་འགོ་འཛུགས་དགོས་མིན་ - + Proxy type ངོ་ཚབ་ཀྱི་རིགས་དབྱིབས། @@ -183,49 +182,49 @@ རྐང་འབོབ་5 - + IP address IPས་གནས། - - + + Required བླང་བྱ་བཏོན་པ། - + Invalid IP Address གོ་མི་ཆོད་པའི་IPས་གནས། - + Username སྤྱོད་མཁན་གྱི་མིང་། - - + + Optional བསལ་འདེམས་ཀྱི་རང་བཞིན། - + Password གསང་གྲངས། - + Cancel ཕྱིར་འཐེན། - + Save གྲོན་ཆུང་བྱེད་དགོས། - + The following applications are allowed to use this configuration: གཤམ་གྱི་ཉེར་སྤྱོད་གོ་རིམ་ཁྲོད་དུ་བཀོད་སྒྲིག་འདི་བཀོལ་ཆོག་པ་སྟེ། diff --git a/plugins/proxy/translations/en_US.ts b/plugins/proxy/translations/en_US.ts index 298d0630..5b631c06 100644 --- a/plugins/proxy/translations/en_US.ts +++ b/plugins/proxy/translations/en_US.ts @@ -4,27 +4,27 @@ AptProxyDialog - + Set APT Proxy - + Server Address - + Port - + Cancel - + Confirm @@ -37,183 +37,178 @@ - + Start using - + Proxy mode - + Auto - + Manual - - Application Proxy - - - - + System Proxy - + Auto url /Proxy/Auto url - + Http Proxy /Proxy/Http Proxy - + Https Proxy /Proxy/Https Proxy - + Ftp Proxy /Proxy/Ftp Proxy - + Socks Proxy /Proxy/Socks Proxy - - - - - + + + + + Port - + List of ignored hosts. more than one entry, please separate with english semicolon(;) - + App Proxy /Proxy/App Proxy - + APT Proxy /Proxy/APT Proxy - - + + Open - + Server Address : - + Port : - + Edit - + The APT proxy has been turned off and needs to be restarted to take effect - - + + Reboot Later - - + + Reboot Now - + The system needs to be restarted to set the APT proxy, whether to reboot - + Proxy type - + IP address - - + + Required - + Invalid IP Address - + Username - - + + Optional - + Password - + Cancel - + Save - + The following applications are allowed to use this configuration: diff --git a/plugins/proxy/translations/mn.ts b/plugins/proxy/translations/mn.ts index f9785d04..a339baf6 100644 --- a/plugins/proxy/translations/mn.ts +++ b/plugins/proxy/translations/mn.ts @@ -4,27 +4,27 @@ AptProxyDialog - + Set APT Proxy APT ᠤᠷᠤᠯᠠᠭᠴᠢ ᠳᠤᠬᠢᠷᠠᠭᠤᠯᠬᠤ - + Server Address ᠦᠢᠯᠡᠴᠢᠯᠡᠬᠦᠷ ᠤ᠋ᠨ ᠬᠠᠶᠢᠭ - + Port ᠦᠵᠦᠬᠦᠷ - + Cancel ᠦᠬᠡᠢᠰᠬᠡᠬᠦ - + Confirm ᠪᠠᠳᠤᠯᠠᠬᠤ @@ -37,183 +37,182 @@ ᠤᠷᠤᠯᠠᠭᠴᠢ - + Start using ᠡᠬᠢᠯᠡᠬᠦᠯᠬᠦ - + Proxy mode ᠤᠷᠤᠯᠠᠭᠴᠢ ᠵᠢᠨ ᠳᠦᠷᠦᠯ ᠵᠦᠢᠯ - + Auto ᠠᠦ᠋ᠲ᠋ᠣ᠋ - + Manual ᠠᠦ᠋ᠲ᠋ᠣ᠋ ᠪᠤᠰᠤ - Application Proxy - ᠬᠡᠷᠡᠭᠯᠡᠭᠡᠨ ᠤ᠋ ᠤᠷᠤᠯᠠᠭᠴᠢ + ᠬᠡᠷᠡᠭᠯᠡᠭᠡᠨ ᠤ᠋ ᠤᠷᠤᠯᠠᠭᠴᠢ - + System Proxy ᠰᠢᠰᠲ᠋ᠧᠮ ᠤ᠋ᠨ ᠤᠷᠤᠯᠠᠭᠴᠢ - + Auto url URL ᠳᠤᠬᠢᠷᠠᠭᠤᠯᠭ᠎ᠠ /Proxy/Auto url - + Http Proxy HTTP ᠤᠷᠤᠯᠠᠭᠴᠢ /Proxy/Http Proxy - + Https Proxy HTTPS ᠤᠷᠤᠯᠠᠭᠴᠢ /Proxy/Https Proxy - + Ftp Proxy FTP ᠤᠷᠤᠯᠠᠭᠴᠢ /Proxy/Ftp Proxy - + Socks Proxy SOCKS ᠤᠷᠤᠯᠠᠭᠴᠢ /Proxy/Socks Proxy - - - - - + + + + + Port ᠦᠵᠦᠬᠦᠷ - + List of ignored hosts. more than one entry, please separate with english semicolon(;) ᠤᠮᠳᠤᠭᠠᠢᠯᠠᠭᠰᠠᠨ ᠭᠤᠤᠯ ᠮᠠᠰᠢᠨ ᠤ᠋ ᠵᠢᠭᠰᠠᠭᠠᠯᠳᠠ᠂ ᠠᠩᠭ᠌ᠯᠢ ᠬᠡᠯᠡᠨ ᠤ᠋ ᠵᠠᠭᠠᠭᠯᠠᠬᠤ ᠳᠡᠮᠳᠡᠭ ᠢ᠋ ᠬᠡᠷᠡᠭᠯᠡᠬᠡᠷᠡᠢ (;) - + App Proxy ᠬᠡᠷᠡᠭᠯᠡᠭᠡᠨ ᠤ᠋ ᠤᠷᠤᠯᠠᠭᠴᠢ /Proxy/App Proxy - + APT Proxy APT ᠤᠷᠤᠯᠠᠭᠴᠢ /Proxy/APT Proxy - - + + Open ᠨᠡᠬᠡᠬᠡᠬᠦ - + Server Address : ᠦᠢᠯᠡᠴᠢᠯᠡᠬᠦᠷ ᠤ᠋ᠨ ᠬᠠᠶᠢᠭ: - + Port : ᠫᠤᠷᠲ : - + Edit ᠨᠠᠢᠷᠠᠭᠤᠯᠬᠤ - + The APT proxy has been turned off and needs to be restarted to take effect APT ᠤᠷᠤᠯᠠᠭᠴᠢ ᠬᠠᠭᠠᠭᠳᠠᠪᠠ᠂ ᠳᠠᠬᠢᠵᠤ ᠨᠡᠬᠡᠬᠡᠭᠰᠡᠨ ᠤ᠋ ᠳᠠᠷᠠᠭ᠎ᠠ ᠰᠠᠶᠢ ᠬᠦᠴᠦᠨ ᠲᠠᠢ ᠪᠤᠯᠤᠨ᠎ᠠ - - + + Reboot Later ᠤᠳᠠᠰᠬᠢᠭᠠᠳ ᠳᠠᠬᠢᠨ ᠡᠬᠢᠯᠡᠬᠦᠯᠬᠦ - - + + Reboot Now ᠳᠠᠷᠤᠢ ᠳᠠᠬᠢᠨ ᠡᠬᠢᠯᠡᠬᠦᠯᠬᠦ - + The system needs to be restarted to set the APT proxy, whether to reboot ᠳᠤᠬᠢᠷᠠᠭᠤᠯᠤᠭᠰᠠᠨ APT ᠤᠷᠤᠯᠠᠭᠴᠢ ᠰᠢᠰᠲ᠋ᠧᠮ ᠢ᠋ ᠳᠠᠬᠢᠨ ᠡᠬᠢᠯᠡᠬᠦᠯᠦᠭᠰᠡᠨ ᠤ᠋ ᠳᠠᠷᠠᠭ᠎ᠠ ᠰᠠᠶᠢ ᠬᠦᠴᠦᠨ ᠲᠠᠢ ᠪᠤᠯᠤᠨ᠎ᠠ᠂ ᠰᠢᠰᠲ᠋ᠧᠮ ᠢ᠋ ᠳᠠᠬᠢᠨ ᠡᠬᠢᠯᠡᠬᠦᠯᠬᠦ ᠤᠤ - + Proxy type ᠤᠷᠤᠯᠠᠭᠴᠢ ᠵᠢᠨ ᠳᠦᠷᠦᠯ ᠵᠦᠢᠯ - + IP address IP ᠬᠠᠶᠢᠭ - - + + Required ᠡᠷᠬᠡᠪᠰᠢ ᠳᠠᠭᠯᠠᠬᠤ - + Invalid IP Address ᠬᠦᠴᠦᠨ ᠦᠭᠡᠢ IP ᠬᠠᠶᠢᠭ - + Username ᠬᠡᠷᠡᠭᠯᠡᠭᠴᠢ ᠵᠢᠨ ᠨᠡᠷ᠎ᠡ - - + + Optional ᠰᠤᠩᠭᠤᠵᠤ ᠳᠠᠭᠯᠠᠬᠤ - + Password ᠨᠢᠭᠤᠴᠠ ᠺᠤᠳ᠋ - + Cancel ᠦᠬᠡᠢᠰᠬᠡᠬᠦ - + Save ᠬᠠᠳᠠᠭᠠᠯᠠᠬᠤ - + The following applications are allowed to use this configuration: ᠳᠤᠤᠷᠠᠬᠢ ᠬᠡᠷᠡᠭᠯᠡᠭᠡ ᠲᠤᠰ ᠳᠤᠬᠢᠷᠠᠭᠤᠯᠭ᠎ᠠ ᠵᠢ ᠬᠡᠷᠡᠭᠯᠡᠬᠦ ᠵᠢ ᠵᠦᠪᠰᠢᠶᠡᠷᠡᠨ᠎ᠡ: diff --git a/plugins/proxy/translations/tr.ts b/plugins/proxy/translations/tr.ts index 298d0630..5b631c06 100644 --- a/plugins/proxy/translations/tr.ts +++ b/plugins/proxy/translations/tr.ts @@ -4,27 +4,27 @@ AptProxyDialog - + Set APT Proxy - + Server Address - + Port - + Cancel - + Confirm @@ -37,183 +37,178 @@ - + Start using - + Proxy mode - + Auto - + Manual - - Application Proxy - - - - + System Proxy - + Auto url /Proxy/Auto url - + Http Proxy /Proxy/Http Proxy - + Https Proxy /Proxy/Https Proxy - + Ftp Proxy /Proxy/Ftp Proxy - + Socks Proxy /Proxy/Socks Proxy - - - - - + + + + + Port - + List of ignored hosts. more than one entry, please separate with english semicolon(;) - + App Proxy /Proxy/App Proxy - + APT Proxy /Proxy/APT Proxy - - + + Open - + Server Address : - + Port : - + Edit - + The APT proxy has been turned off and needs to be restarted to take effect - - + + Reboot Later - - + + Reboot Now - + The system needs to be restarted to set the APT proxy, whether to reboot - + Proxy type - + IP address - - + + Required - + Invalid IP Address - + Username - - + + Optional - + Password - + Cancel - + Save - + The following applications are allowed to use this configuration: diff --git a/plugins/proxy/translations/zh_CN.ts b/plugins/proxy/translations/zh_CN.ts index 64c2d76c..69d215ae 100644 --- a/plugins/proxy/translations/zh_CN.ts +++ b/plugins/proxy/translations/zh_CN.ts @@ -4,27 +4,27 @@ AptProxyDialog - + Set APT Proxy 设置 APT 代理 - + Server Address 服务器地址 - + Port 端口 - + Cancel 取消 - + Confirm 确定 @@ -37,183 +37,182 @@ 代理 - + Start using 启用 - + Proxy mode 代理类型 - + Auto 自动 - + Manual 手动 - Application Proxy - 应用代理 + 应用代理 - + System Proxy 系统代理 - + Auto url 配置 URL /Proxy/Auto url - + Http Proxy HTTP 代理 /Proxy/Http Proxy - + Https Proxy HTTPS 代理 /Proxy/Https Proxy - + Ftp Proxy FTP 代理 /Proxy/Ftp Proxy - + Socks Proxy SOCKS 代理 /Proxy/Socks Proxy - - - - - + + + + + Port 端口 - + List of ignored hosts. more than one entry, please separate with english semicolon(;) 忽略的主机列表,请使用英文分号(;) - + App Proxy 应用代理 /Proxy/App Proxy - + APT Proxy APT 代理 /Proxy/APT Proxy - - + + Open 开启 - + Server Address : 服务器地址: - + Port : 端口: - + Edit 编辑 - + The APT proxy has been turned off and needs to be restarted to take effect APT 代理已关闭,需要重启才能生效 - - + + Reboot Later 稍后重启 - - + + Reboot Now 立即重启 - + The system needs to be restarted to set the APT proxy, whether to reboot 设置 APT 代理需要重启系统后生效,是否重启系统 - + Proxy type 代理类型 - + IP address IP 地址 - - + + Required 必填 - + Invalid IP Address 无效的 IP 地址 - + Username 用户名 - - + + Optional 选填 - + Password 密码 - + Cancel 取消 - + Save 保存 - + The following applications are allowed to use this configuration: 允许以下应用使用该配置: diff --git a/plugins/vpn/translations/bo_CN.ts b/plugins/vpn/translations/bo_CN.ts index 8ccdc940..fb6446e7 100644 --- a/plugins/vpn/translations/bo_CN.ts +++ b/plugins/vpn/translations/bo_CN.ts @@ -64,19 +64,19 @@ VpnItem - + Delete སུབ་དགོས། - - + + Disconnect བར་མཚམས་ཆད་པ་རེད། - - + + Connect འབྲེལ་མཐུད་བཅས་བྱ་དགོས། diff --git a/plugins/vpn/translations/en_US.ts b/plugins/vpn/translations/en_US.ts index 3a66cf9f..f58fab41 100644 --- a/plugins/vpn/translations/en_US.ts +++ b/plugins/vpn/translations/en_US.ts @@ -64,19 +64,19 @@ VpnItem - + Delete - - + + Disconnect - - + + Connect diff --git a/plugins/vpn/translations/mn.ts b/plugins/vpn/translations/mn.ts index b19de118..6a8cc0be 100644 --- a/plugins/vpn/translations/mn.ts +++ b/plugins/vpn/translations/mn.ts @@ -4,12 +4,12 @@ AddNetBtn - + Add Others ᠪᠤᠰᠤᠳ ᠲᠤᠤᠷ ᠰᠦᠯᠵᠢᠶᠡᠨ ᠳ᠋ᠤ᠌ ᠵᠠᠯᠭᠠᠬᠤ - + Add WiredNetork ᠤᠲᠠᠰᠤᠲᠤ ᠨᠧᠲ ᠨᠡᠮᠡᠬᠦ @@ -26,6 +26,7 @@ Vpn + VPN @@ -35,19 +36,27 @@ - + + Show on Taskbar ᠡᠬᠦᠷᠬᠡ ᠵᠢᠨ ᠪᠠᠭᠠᠷ ᠲᠤ᠌ ᠢᠺᠦᠨ ᠵᠢᠷᠤᠭ ᠢ᠋ ᠢᠯᠡᠷᠡᠬᠦᠯᠬᠦ + /Vpn/Show on Taskbar - - + + Add VPN + VPN ᠨᠡᠮᠡᠬᠦ + /Vpn/Add VPN + + + + connected ᠴᠦᠷᠬᠡᠯᠡᠪᠡ - - + + not connected ᠴᠦᠷᠬᠡᠯᠡᠭᠡ ᠦᠬᠡᠢ @@ -55,19 +64,19 @@ VpnItem - + Delete ᠬᠠᠰᠤᠬᠤ - - + + Disconnect ᠳᠠᠰᠤᠯᠬᠤ - - + + Connect ᠴᠦᠷᠬᠡᠯᠡᠬᠦ diff --git a/plugins/vpn/translations/zh_CN.ts b/plugins/vpn/translations/zh_CN.ts index 37d0f8ef..ef0e9b29 100644 --- a/plugins/vpn/translations/zh_CN.ts +++ b/plugins/vpn/translations/zh_CN.ts @@ -19,7 +19,7 @@ Add VPN - 添加 VPN + 添加VPN diff --git a/plugins/vpn/vpn.cpp b/plugins/vpn/vpn.cpp index 3e40296d..5efd3e43 100644 --- a/plugins/vpn/vpn.cpp +++ b/plugins/vpn/vpn.cpp @@ -114,7 +114,7 @@ QWidget *Vpn::pluginUi(){ const QString Vpn::name() const { - return QStringLiteral("Vpn"); + return QStringLiteral("VPN"); } bool Vpn::isShowOnHomePage() const @@ -187,6 +187,7 @@ void Vpn::initComponent(){ hotspotLyt->setSpacing(0); //列表 + m_listFrame = new ItemFrame(m_pluginWidget); ui->verticalLayout_4->addWidget(m_topFrame); diff --git a/plugins/vpn/vpnitem.cpp b/plugins/vpn/vpnitem.cpp index 7d120179..7b03a5cd 100644 --- a/plugins/vpn/vpnitem.cpp +++ b/plugins/vpn/vpnitem.cpp @@ -58,7 +58,6 @@ VpnItem::VpnItem(bool bAcitve, QWidget *parent) m_moreMenu->addAction(m_connectAction); m_moreMenu->addAction(m_deleteAction); m_moreButton->setMenu(m_moreMenu); - mLanLyt->addWidget(m_iconLabel); mLanLyt->addWidget(m_titileLabel,Qt::AlignLeft); mLanLyt->addStretch(); diff --git a/plugins/wlanconnect/deviceframe.cpp b/plugins/wlanconnect/deviceframe.cpp index a7822712..b69ec7c4 100644 --- a/plugins/wlanconnect/deviceframe.cpp +++ b/plugins/wlanconnect/deviceframe.cpp @@ -4,7 +4,7 @@ * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or + * the Free Software Foundation; either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, diff --git a/plugins/wlanconnect/deviceframe.h b/plugins/wlanconnect/deviceframe.h index d6300e36..73d7c382 100644 --- a/plugins/wlanconnect/deviceframe.h +++ b/plugins/wlanconnect/deviceframe.h @@ -4,7 +4,7 @@ * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or + * the Free Software Foundation; either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, diff --git a/plugins/wlanconnect/itemframe.cpp b/plugins/wlanconnect/itemframe.cpp index 503e3b2b..c721ea33 100644 --- a/plugins/wlanconnect/itemframe.cpp +++ b/plugins/wlanconnect/itemframe.cpp @@ -4,7 +4,7 @@ * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or + * the Free Software Foundation; either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, diff --git a/plugins/wlanconnect/itemframe.h b/plugins/wlanconnect/itemframe.h index ee947279..a09187a7 100644 --- a/plugins/wlanconnect/itemframe.h +++ b/plugins/wlanconnect/itemframe.h @@ -4,7 +4,7 @@ * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or + * the Free Software Foundation; either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, diff --git a/plugins/wlanconnect/translations/bo.ts b/plugins/wlanconnect/translations/bo.ts index decf3d2a..51bf40aa 100644 --- a/plugins/wlanconnect/translations/bo.ts +++ b/plugins/wlanconnect/translations/bo.ts @@ -23,49 +23,49 @@ - - + + WLAN - + open /wlanconnect/open - + Advanced settings /wlanconnect/Advanced settings" - + Settings - + Settings desktop message - + No wireless network card detected - - - + + + connected - + card diff --git a/plugins/wlanconnect/translations/bo_CN.ts b/plugins/wlanconnect/translations/bo_CN.ts index 23e9c1ed..876b3054 100644 --- a/plugins/wlanconnect/translations/bo_CN.ts +++ b/plugins/wlanconnect/translations/bo_CN.ts @@ -23,21 +23,21 @@ - - + + WLAN སྐུད་མེད་ཅུས་ཁོངས་ཀྱི་དྲ་བ། - + open སྒོ་ཕྱེ་བ། /wlanconnect/open - + Advanced settings སྔོན་ཐོན་གྱི་སྒྲིག་བཀོད། /wlanconnect/Advanced settings" @@ -51,29 +51,29 @@ ངོས་ལེབ་ངོས་ཀྱི་བརྡ་ཐོ་ཚོད་འཛིན་བྱ་དགོས། - + Settings བཀོད་སྒྲིག་བཅས་བྱ་དགོས། - + Settings desktop message བཀོད་སྒྲིག་བཅས་བྱ་དགོས། ཅོག་ངོས་ལ་བརྡ་ཐོ་གཏོང་དགོས། - + No wireless network card detected སྐུད་མེད་དྲ་རྒྱའི་བྱང་བུ་མ་རྙེད་པ། - - - + + + connected འབྲེལ་མཐུད་བྱེད་པ། - + card བྱང་བུ། diff --git a/plugins/wlanconnect/translations/en_US.ts b/plugins/wlanconnect/translations/en_US.ts index fd454c8f..0433849d 100644 --- a/plugins/wlanconnect/translations/en_US.ts +++ b/plugins/wlanconnect/translations/en_US.ts @@ -23,21 +23,21 @@ - - + + WLAN WLAN - + open open /wlanconnect/open - + Advanced settings Advanced settings /wlanconnect/Advanced settings" @@ -51,29 +51,29 @@ ukui control center desktop message - + Settings - + Settings desktop message - + No wireless network card detected No wireless network card detected - - - + + + connected connected - + card card diff --git a/plugins/wlanconnect/translations/mn.ts b/plugins/wlanconnect/translations/mn.ts index 41727cef..986ac6c9 100644 --- a/plugins/wlanconnect/translations/mn.ts +++ b/plugins/wlanconnect/translations/mn.ts @@ -23,21 +23,21 @@ - - + + WLAN ᠤᠳᠠᠰᠤ ᠦᠬᠡᠢ ᠬᠡᠰᠡᠭ ᠰᠦᠯᠵᠢᠶ᠎ᠡ - + open ᠨᠡᠭᠡᠭᠡᠬᠦ /wlanconnect/open - + Advanced settings ᠦᠨᠳᠦᠷ ᠵᠡᠷᠬᠡ ᠵᠢᠨ ᠳᠤᠬᠢᠷᠠᠭᠤᠯᠤᠯᠳᠠ /wlanconnect/Advanced settings" @@ -51,29 +51,29 @@ ᠡᠵᠡᠮᠰᠢᠯ ᠤ᠋ᠨ ᠬᠠᠪᠳᠠᠰᠤᠨ ᠤ᠋ ᠰᠢᠷᠡᠭᠡᠨ ᠨᠢᠭᠤᠷ ᠤ᠋ᠨ ᠮᠡᠳᠡᠭᠳᠡᠯ - + Settings ᠳᠤᠬᠢᠷᠠᠭᠤᠯᠭ᠎ᠠ - + Settings desktop message ᠰᠢᠷᠡᠭᠡᠨ ᠨᠢᠭᠤᠷ᠎ᠤ᠋ᠨ ᠵᠠᠩᠭᠢ᠎ᠶ᠋ᠢ ᠵᠣᠬᠢᠷᠠᠭᠤᠯᠬᠤ - + No wireless network card detected ᠤᠳᠠᠰᠤ ᠦᠬᠡᠢ ᠨᠧᠲ ᠺᠠᠷᠲ᠎ᠢ ᠬᠢᠨᠠᠨ ᠬᠡᠮᠵᠢᠵᠤ ᠤᠯᠤᠭᠰᠠᠨ ᠦᠬᠡᠢ - - - + + + connected ᠨᠢᠬᠡᠨᠳᠡ ᠴᠦᠷᠬᠡᠯᠡᠪᠡ - + card ᠨᠧᠲ ᠺᠠᠷᠲ diff --git a/plugins/wlanconnect/translations/tr.ts b/plugins/wlanconnect/translations/tr.ts index decf3d2a..51bf40aa 100644 --- a/plugins/wlanconnect/translations/tr.ts +++ b/plugins/wlanconnect/translations/tr.ts @@ -23,49 +23,49 @@ - - + + WLAN - + open /wlanconnect/open - + Advanced settings /wlanconnect/Advanced settings" - + Settings - + Settings desktop message - + No wireless network card detected - - - + + + connected - + card diff --git a/plugins/wlanconnect/translations/zh_CN.ts b/plugins/wlanconnect/translations/zh_CN.ts index 1f4335f6..c1f0a350 100644 --- a/plugins/wlanconnect/translations/zh_CN.ts +++ b/plugins/wlanconnect/translations/zh_CN.ts @@ -23,21 +23,21 @@ - - + + WLAN 无线局域网 - + open 开启 /wlanconnect/open - + Advanced settings 高级设置 /wlanconnect/Advanced settings" @@ -51,29 +51,29 @@ 控制面板桌面通知 - + Settings 设置 - + Settings desktop message 设置 桌面通知 - + No wireless network card detected 未检测到无线网卡 - - - + + + connected 已连接 - + card 网卡 diff --git a/plugins/wlanconnect/wlanconnect.cpp b/plugins/wlanconnect/wlanconnect.cpp index 62ae8439..5d51bdca 100644 --- a/plugins/wlanconnect/wlanconnect.cpp +++ b/plugins/wlanconnect/wlanconnect.cpp @@ -4,7 +4,7 @@ * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or + * the Free Software Foundation; either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, @@ -283,7 +283,6 @@ void WlanConnect::initComponent() { //网卡name处理 connect(m_interface, SIGNAL(deviceNameChanged(QString, QString, int)), this, SLOT(onDeviceNameChanged(QString, QString, int)), Qt::QueuedConnection); connect(m_interface, SIGNAL(wirelessSwitchBtnChanged(bool)), this, SLOT(onSwitchBtnChanged(bool)), Qt::QueuedConnection); - connect(m_interface, SIGNAL(timeToUpdate()), this, SLOT(updateList()), Qt::QueuedConnection); //高级设置 connect(ui->detailBtn, &QPushButton::clicked, this, [=](bool checked) { diff --git a/plugins/wlanconnect/wlanconnect.h b/plugins/wlanconnect/wlanconnect.h index d39c87fe..10088b38 100644 --- a/plugins/wlanconnect/wlanconnect.h +++ b/plugins/wlanconnect/wlanconnect.h @@ -4,7 +4,7 @@ * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or + * the Free Software Foundation; either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, diff --git a/plugins/wlanconnect/wlanitem.cpp b/plugins/wlanconnect/wlanitem.cpp index 8cb31ae1..9697f59e 100644 --- a/plugins/wlanconnect/wlanitem.cpp +++ b/plugins/wlanconnect/wlanitem.cpp @@ -4,7 +4,7 @@ * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or + * the Free Software Foundation; either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, diff --git a/plugins/wlanconnect/wlanitem.h b/plugins/wlanconnect/wlanitem.h index 035daccf..2f9e4712 100644 --- a/plugins/wlanconnect/wlanitem.h +++ b/plugins/wlanconnect/wlanitem.h @@ -4,7 +4,7 @@ * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or + * the Free Software Foundation; either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, diff --git a/src-vpn/frontend/single-pages/vpnpage.cpp b/src-vpn/frontend/single-pages/vpnpage.cpp index d207c6ba..9d2053f7 100644 --- a/src-vpn/frontend/single-pages/vpnpage.cpp +++ b/src-vpn/frontend/single-pages/vpnpage.cpp @@ -45,11 +45,11 @@ VpnPage::VpnPage(QWidget *parent) : SinglePage(parent) connect(m_vpnConnectOperation, &KyVpnConnectOperation::activateConnectionError, this, &VpnPage::activateFailed); connect(m_vpnConnectOperation, &KyVpnConnectOperation::deactivateConnectionError, this, &VpnPage::deactivateFailed); - connect(KWindowSystem::self(), &KWindowSystem::activeWindowChanged, this, [&](WId activeWindowId){ - if (activeWindowId != this->winId() && activeWindowId != 0) { - hide(); - } - }); +// connect(KWindowSystem::self(), &KWindowSystem::activeWindowChanged, this, [&](WId activeWindowId){ +// if (activeWindowId != this->winId() && activeWindowId != 0) { +// hide(); +// } +// }); } VpnPage::~VpnPage() @@ -575,6 +575,16 @@ bool VpnPage::eventFilter(QObject *watched, QEvent *event) } } + if (watched == this) { + //失焦退出 + if (event->type() == QEvent::ActivationChange) { + if (QApplication::activeWindow() != this) { + hide(); + return true; + } + } + } + return QWidget::eventFilter(watched, event); } diff --git a/src-vpn/frontend/vpndetails/vpnaddpage.cpp b/src-vpn/frontend/vpndetails/vpnaddpage.cpp index 06e5032d..843a9422 100644 --- a/src-vpn/frontend/vpndetails/vpnaddpage.cpp +++ b/src-vpn/frontend/vpndetails/vpnaddpage.cpp @@ -21,6 +21,17 @@ #include #include "vpnconfigpage.h" +#define VPNADDPAGE_SIZE 520,272 +#define MAINLAYOUT_MARGINS 24, 16, 24, 24 +#define MAINLAYOUT_SPACE 24 +#define NULL_MARGINS 0,0,0,0 +#define NULL_SPACE 0 +#define VPNADDPAGE_NAME_MAX_LENGTH 32 +#define VPNADDPAGE_LABLE_FIXEDWIDTH 112 +#define VPNADDPAGE_COMBOBOX_FIXEDWIDTH 360 +#define VPNADDPAGE_INPUTBOX_FIXEDWIDTH 360 + + vpnAddPage::vpnAddPage(QWidget *parent) : QWidget(parent) { m_vpnConnOperation = new KyVpnConnectOperation(this); @@ -52,8 +63,8 @@ void vpnAddPage::initWindow() void vpnAddPage::initUI() { QVBoxLayout *mainLayout = new QVBoxLayout(this); - mainLayout->setContentsMargins(VPNADDPAGE_MAINLAYOUT_MARGINS); - mainLayout->setSpacing(VPNADDPAGE_NULLSPACE); + mainLayout->setContentsMargins(MAINLAYOUT_MARGINS); + mainLayout->setSpacing(MAINLAYOUT_SPACE); initVpnTypeFrame(); initVpnNameFrame(); @@ -73,11 +84,10 @@ void vpnAddPage::initVpnTypeFrame() { m_vpnTypeFrame = new QFrame(this); m_vpnTypeFrame->setFrameShape(QFrame::Shape::NoFrame); - m_vpnTypeFrame->setFixedSize(VPNADDPAGE_FRAME_FIXEDSIZE); QHBoxLayout *typeLayout = new QHBoxLayout(m_vpnTypeFrame); - typeLayout->setContentsMargins(VPNADDPAGE_ITEM_MARGINS); - typeLayout->setSpacing(VPNADDPAGE_NULLSPACE); + typeLayout->setContentsMargins(NULL_MARGINS); + typeLayout->setSpacing(NULL_SPACE); QLabel *vpnTypeLabel = new QLabel(tr("VPN Type"), this); vpnTypeLabel->setFixedWidth(VPNADDPAGE_LABLE_FIXEDWIDTH); @@ -102,11 +112,10 @@ void vpnAddPage::initVpnNameFrame() { m_vpnNameFrame = new QFrame(this); m_vpnNameFrame->setFrameShape(QFrame::Shape::NoFrame); - m_vpnNameFrame->setFixedSize(VPNADDPAGE_FRAME_FIXEDSIZE); QHBoxLayout *nameLayout = new QHBoxLayout(m_vpnNameFrame); - nameLayout->setContentsMargins(VPNADDPAGE_ITEM_MARGINS); - nameLayout->setSpacing(VPNADDPAGE_NULLSPACE); + nameLayout->setContentsMargins(NULL_MARGINS); + nameLayout->setSpacing(NULL_SPACE); QLabel *vpnNameLabel = new QLabel(tr("VPN Name"), this); vpnNameLabel->setFixedWidth(VPNADDPAGE_LABLE_FIXEDWIDTH); @@ -125,11 +134,10 @@ void vpnAddPage::initVpnServerFrame() { m_vpnServerFrame = new QFrame(this); m_vpnServerFrame->setFrameShape(QFrame::Shape::NoFrame); - m_vpnServerFrame->setFixedSize(VPNADDPAGE_FRAME_FIXEDSIZE); QHBoxLayout *serverLayout = new QHBoxLayout(m_vpnServerFrame); - serverLayout->setContentsMargins(VPNADDPAGE_ITEM_MARGINS); - serverLayout->setSpacing(VPNADDPAGE_NULLSPACE); + serverLayout->setContentsMargins(NULL_MARGINS); + serverLayout->setSpacing(NULL_SPACE); QLabel *vpnServerLabel = new QLabel(tr("VPN Server"), this); vpnServerLabel->setFixedWidth(VPNADDPAGE_LABLE_FIXEDWIDTH); @@ -151,35 +159,22 @@ void vpnAddPage::initVpnServerFrame() void vpnAddPage::initButtonFrame() { m_buttonFrame = new QFrame(this); - m_buttonFrame->setFixedSize(VPNDETAILPAGE_FRAME_FIXEDSIZE); QHBoxLayout *buttonLayout = new QHBoxLayout(m_buttonFrame); - buttonLayout->setContentsMargins(VPNDETAILPAGE_ITEM_MARGINS); - buttonLayout->setSpacing(VPNDETAILPAGE_NULLSPACE); + buttonLayout->setContentsMargins(NULL_MARGINS); + buttonLayout->setSpacing(NULL_SPACE); - QLabel *autoConnectLabel = new QLabel(this); m_autoConnectBox = new QCheckBox(this); - autoConnectLabel->setText(tr("Auto Connection")); - QWidget *autoConWidget = new QWidget(this); - QHBoxLayout *autoLayout = new QHBoxLayout(autoConWidget); - - autoLayout->setContentsMargins(VPNDETAILPAGE_NULLMAGINS); - autoLayout->setSpacing(VPNDETAILPAGE_NULLSPACE); - autoLayout->addWidget(m_autoConnectBox); - autoLayout->addWidget(autoConnectLabel); - autoConWidget->setLayout(autoLayout); - + m_autoConnectBox->setText(tr("Auto Connection")); m_confimBtn = new QPushButton(this); - m_confimBtn->setFixedSize(VPNDETAILPAGE_BUTTON_FIXEDSIZE); m_confimBtn->setText(tr("Confirm")); m_cancelBtn = new QPushButton(this); - m_cancelBtn->setFixedSize(VPNDETAILPAGE_BUTTON_FIXEDSIZE); m_cancelBtn->setText(tr("Cancel")); - buttonLayout->addWidget(autoConWidget); + buttonLayout->addWidget(m_autoConnectBox); buttonLayout->addStretch(); buttonLayout->addWidget(m_cancelBtn); - buttonLayout->addSpacing(VPNDETAILPAGE_BUTTON_SPACE); + buttonLayout->addSpacing(16); buttonLayout->addWidget(m_confimBtn); m_buttonFrame->setLayout(buttonLayout); } @@ -251,3 +246,14 @@ vpnAddPage::~vpnAddPage() { Q_EMIT this->closed(); } + +void vpnAddPage::paintEvent(QPaintEvent *event) +{ + QPalette pal = qApp->palette(); + QPainter painter(this); + painter.setBrush(pal.color(QPalette::Base)); + painter.drawRect(this->rect()); + painter.fillRect(rect(), QBrush(pal.color(QPalette::Base))); + + return QWidget::paintEvent(event); +} diff --git a/src-vpn/frontend/vpndetails/vpnaddpage.h b/src-vpn/frontend/vpndetails/vpnaddpage.h index 1008c078..1ae1785f 100644 --- a/src-vpn/frontend/vpndetails/vpnaddpage.h +++ b/src-vpn/frontend/vpndetails/vpnaddpage.h @@ -32,6 +32,7 @@ #include #include #include +#include #include "kyvpnconnectoperation.h" @@ -67,6 +68,9 @@ public: void centerToScreen(); ~vpnAddPage(); +protected: + void paintEvent(QPaintEvent *event); + private: void initWindow(); void initUI(); @@ -80,7 +84,6 @@ private: bool checkConfimBtnIsEnabled(); bool createVpnConnect(); -private: QFrame *m_vpnTypeFrame = nullptr; QFrame *m_vpnNameFrame = nullptr; QFrame *m_vpnServerFrame = nullptr; diff --git a/src-vpn/frontend/vpndetails/vpnipv6page.h b/src-vpn/frontend/vpndetails/vpnipv6page.h index cf41a0c7..0b1b0dde 100644 --- a/src-vpn/frontend/vpndetails/vpnipv6page.h +++ b/src-vpn/frontend/vpndetails/vpnipv6page.h @@ -17,6 +17,7 @@ * * */ + #ifndef VPNIPV6PAGE_H #define VPNIPV6PAGE_H diff --git a/src-vpn/frontend/vpnobject.cpp b/src-vpn/frontend/vpnobject.cpp index 4df263da..edcc12d3 100644 --- a/src-vpn/frontend/vpnobject.cpp +++ b/src-vpn/frontend/vpnobject.cpp @@ -177,6 +177,7 @@ void vpnObject::showVpnAddWidget() m_vpnAddPage = new vpnAddPage(); connect(m_vpnAddPage, &vpnAddPage::closed, [&] () {m_vpnAddPage = nullptr;}); m_vpnAddPage->show(); + m_vpnAddPage->centerToScreen(); } m_vpnAddPage->raise(); #else diff --git a/src-vpn/main.cpp b/src-vpn/main.cpp index 84360b47..7d7b6df2 100644 --- a/src-vpn/main.cpp +++ b/src-vpn/main.cpp @@ -80,8 +80,13 @@ int main(int argc, char *argv[]) { initUkuiLog4qt("kylin-vpn"); +#if (QT_VERSION >= QT_VERSION_CHECK(5, 12, 0)) QApplication::setAttribute(Qt::AA_EnableHighDpiScaling); QApplication::setAttribute(Qt::AA_UseHighDpiPixmaps); +#endif +#if (QT_VERSION >= QT_VERSION_CHECK(5, 14, 0)) + QApplication::setHighDpiScaleFactorRoundingPolicy(Qt::HighDpiScaleFactorRoundingPolicy::PassThrough); +#endif QString id = QString("kylin-vpn"+ QLatin1String(getenv("DISPLAY"))); QtSingleApplication a(id, argc, argv); diff --git a/src-vpn/translations/kylin-vpn_bo_CN.ts b/src-vpn/translations/kylin-vpn_bo_CN.ts index 819d365f..9d778219 100644 --- a/src-vpn/translations/kylin-vpn_bo_CN.ts +++ b/src-vpn/translations/kylin-vpn_bo_CN.ts @@ -4,17 +4,17 @@ SinglePage - + Settings བཀོད་སྒྲིག་བཅས་བྱ་དགོས། - + Kylin VPN VPNཡོ་བྱད། - + kylin vpn applet desktop message vpnཅོག་ངོས་ཀྱི་གསལ་འདེབས་བཀོད་སྒྲིག་བྱེད་པ། @@ -22,632 +22,682 @@ VpnAdvancedPage - + MPPE encryption algorithm: MPPEགསང་སྣོན་རྩིས་ཐབས།: - + Use Stateful encryption རྣམ་པ་ལྡན་པའི་སྒོ་ནས་ཚགས་དམ་དུ་གཏོང་བ། - + Send PPP echo packets སྐྱེལ་སྤྲོད་བྱེད་དགོས།PPPཁུག་མ་ཕྱིར་མངོན་པ། - + Authentication Mode: བདེན་དཔང་ར་སྤྲོད་བྱེད་སྟངས།: - + PAP authentication PAPདཔང་དངོས་བདེན་པ་ཡིན་པའི - + CHAP authentication CHAPདཔང་དངོས་བདེན་པ་ཡིན་པའི - + MSCHAP authentication MSCHAPདཔང་དངོས་བདེན་པ་ཡིན་པའི - + MSCHAP2 authentication MSCHAP2དཔང་དངོས་བདེན་པ་ཡིན་པའི - + EAP authentication EAPདཔང་དངོས་བདེན་པ་ཡིན་པའི - + Compression Mode: ཉུང་འཕྲི་བྱེད་སྟངས།: - + Allow BSD data compression ཆོག་པ་བྱ་དགོས།BSDཉུང་འཕྲི་བཅས་བྱ་ - + Allow Default data compression ཆོག་པ་བྱ་དགོས།Defaultཉུང་འཕྲི་བཅས་བྱ་ - + Allow TCP header compression ཆོག་པ་བྱ་དགོས།TCPམགོ་བོ།ཉུང་འཕྲི་བཅས་བྱ་ - + Use protocol field compression negotiation གྲོས་མཐུན་གྱི་ཁྱབ་ཁོངས་སྤྱད་དེ་གྲོས་མོལ་ཉུང་འཕྲ - + Use Address/Control compression ས་གནས་སྤྱོད་པ།/ཉུང་འཕྲི་ཚོད་འཛིན་ - + All Available རང་སྣང་གང་དྲན་བྱེད་པ - + 128-bit 128གནས་ས། - + 40-bit 40གནས་ས། - + Use custom gateway port རང་ཉིད་ཀྱི་མཚན་ཉིད་འཇོག་པའི་དྲ་བའི་འགག་སྒོ་བེད་སྤྱོད་བྱ་དགོས - + Use compression བཀོལ་སྤྱོད་ཉུང་འཕྲི་ - + Use a TCP connection བེད་སྤྱོད།TCPའབྲེལ་མཐུད་བཅས་བྱ་དགོས། - + Set virtual device type རྟོག་བཟོའི་སྒྲིག་ཆས་ཀྱི་རིགས་བཟོ་བ། - + Set virtual device name རྟོག་བཟོའི་སྒྲིག་ཆས་ཀྱི་མིང་བཟོ་བ། - + Limit TCP Maximum Segment Size(MSS) ཚོད་འཛིན།TCPཆེས་ཆེ་བའི་རིང་ཐུང་།(MSS) - + Randomize remote hosts སྐབས་བསྟུན་ཅན་གྱི་རྒྱང་ཁྲིད་འཕྲུལ་ཆས་གཙོ་བོ། - + IPv6 tun link IPv6 tunའབྲེལ་མཐུད་བཅས་བྱ་དགོས། - + Specify ping interval དམིགས་འཛུགས་བྱས་པ།Pingདུས་འཁོར། - + Specify exit or restart ping ཕྱིར་འཐེན་ནམ་ཡང་ན་བསྐྱར་དུ་སྒོ་འབྱེད་རྒྱུའི་དམིགས་འཛུགས་བྱས་རིགས།Ping - + Specify max routes དམིགས་འཛུགས་བྱེད་པའི་ལམ་དེ་གོང་ནས་ཚད་བཀག་དགོས། - + Infinite retry on error ནོར་འཁྲུལ་བྱུང་དུས་ཚོད་ལྟ་ཚད་མེད་བྱེད་དགོས། - + Use custom key size རང་གི་མཚན་ཉིད་ཀྱི་གསང་བའི་ལྡེ་མིག་ཆེ་ཆུང་སྤྱོད་པ། - + Choose གདམ་ག་རྒྱག་པ། - + Use custom renegotiation interval རང་ཉིད་ཀྱི་མཚན་ཉིད་བཞག་ནས་གྲོས་མོལ་བྱེད་པའི་བར་མཚམས་འཇོག་དགོས - + Use custom tunnel Maximum Transmission Umit(MTU) རང་ཉིད་ཀྱི་མཚན་ཉིད་བཞག་པའི་ཕུག་ལམ་གྱི་ཆེས་ཆེ་བའི་ཚན་པ་བརྒྱུད་གཏོང་བྱེད་པ།(MTU) - + Use custom UDP fragment size རང་ཉིད་ཀྱི་མཚན་ཉིད་སྤྱད་པ།UDPཆ་བགོས་ཆེ་ཆུང་། - + Accept authenticated packets from any address (Float) ས་གནས་གང་ནས་ཡོང་བ་དང་ལེན་བྱེད་དགོས།(Float)ཐོབ་ཐང་ཚོད་ལྟསར་སྤྲོད་བྱས་ཟིན་པའི་གྲངས་གཞིའི་ཁུག་མ། - + Subject Match བརྗོད་བྱ་གཙོ་བོ་ཆ་འགྲིག་པ། - + Key File གསང་ལྡེའི་ཡིག་ཆ། - + Key Direction གསང་ལྡེའི་ཁ་ཕྱོགས། - + Server Address ཞབས་ཞུ་ཡོ་བྱད་ཀྱི་ས་གནས། - + Port ཁ་བཤད་པ། - + Proxy USername བེད་སྤྱོད་བྱེད་མཁན་གྱི་ཚབ་ཏུ་མིང་། - + Proxy Password གསང་གྲངས་ཚབ་སྒྲུབ་བྱེད་པ། - + General རྒྱུན་སྲོལ། - + TLS settings TLSབཀོད་སྒྲིག་བཅས་བྱ་དགོས། - + Server Certificate Check ཞབས་ཞུ་ཡོ་བྱད་དཔང་ཡིག་ལ་ཞིབ་བཤེར་བྱ་དགོས། - + Use the previous authentication end (server) certificate གོང་དུ་ཚོད་ལྟས་ར་སྤྲོད་བྱ་དགོས།(ཞབས་ཞུའི་ཡོ་བྱད།)དཔང་ཡིག - + Verify peer (server) certificate nsCertType specification ཚོད་ལྟས་ར་སྤྲོད་བྱེད་པ་སོགས་ཡིན།(ཞབས་ཞུའི་ཡོ་བྱད།)དཔང་ཡིགnsCertTypeདམིགས་འཛུགས་བྱས་པ། - + Mode མ་དཔེ། - + Proxies ངོ་ཚབ་ - + Proxy Type ངོ་ཚབ་ཀྱི་རིགས་དབྱིབས། - + Security བདེ་འཇགས། - + HMAC Authentication HMACདཔང་དངོས་བདེན་པ་ཡིན་པའི - + Input content ནང་དོན་ནང་འཇུག་བྱེད་པ། - + No དེ་ལྟར་མ་བྱས་ - + Self-adaption རང་གིས་རང་ལ་འཕྲོད་པར - + Automatic རང་འགུལ་ཡིན་དགོས། - + Exit ཕྱིར་འཐེན་བྱ་དགོས། - + Restart བསྐྱར་དུ་སྒོ་འབྱེད་དགོས། - + Don't verify certificate identification དཔང་ཡིག་གི་མཚོན་རྟགས་ལ་ཚོད་ལྟས་ར་སྤྲོད་མི་བྱེད། - + Verify the entire subject exactly བརྗོད་བྱ་གཙོ་བོ་ཡོངས་རྫོགས་ལ་ཚོད་ལྟས་ར་སྤྲོད་གསལ་པོ་བྱས་ - + Verify name exactly ཞིབ་ཅིང་དག་པའི་སྒོ་ནས་ར་སྤྲོད་བྱས་པའི་མིང་། - + Verify name by prefix སྔོན་གྱི་缀ཚོད་ལྟས་ར་སྤྲོད་ཀྱི་མིང་ལྟར། - - + + Server ཞབས་ཞུའི་ཡོ་བྱད། - - + + Client ཚོང་འགྲུལ་པ་སྣེ་ལེན་བྱེད་པ། - - - + + + None མེད། - + TLS-Certification TLS-དཔང་དངོས་བདེན་པ་ཡིན་པའི - + TLS-Encryption TLS-ཚགས་དམ་དུ་གཏོང་བ། - + Not Required དགོས་མཁོ་མེད། - + Default ཁ་རོག་གེར་ཁས་ལེན - + Options: རྣམ་གྲངས་འདེམས་པ།: - + Request an inner IP address ནང་ཁུལ་ལ་རེ་ཞུ་བྱེད་པ།IPས་གནས། - + Enforce UDP encapsulation བཙན་ཤེད་ཀྱིས་བཙན་ཤེད་བྱེདUDPཐུམ་རྒྱག་པ། - + Use IP compression བེད་སྤྱོད།IPཉུང་འཕྲི་བཅས་བྱ་ - + Enable custom password suggestions རང་ཉིད་ཀྱི་མཚན་ཉིད་གསང་བའི་གྲོས་འགོ་འདོན་དགོས། + + + Choose a private key + སྒེར་གྱི་ལྡེ་མིག་འདེམས་པ། + + + + Key Files (*.key *.pem *.der *.p12 *.pfx) + སྒེར་གྱི་ལྡེ་མིག་ཡིག་ཆ།(*.key *.pem *.der *.p12 *.pfx) + VpnConfigPage - + Type རིགས་དབྱིབས། - + Name མིང་། - + Static Key ཁ་རོག་གེར་ལྡེ་མིག་ལྟ་བ - + Local IP ས་གནས་དེ་ག་རེད།IPས་གནས། - + Remote IP རྒྱང་རིང་།IPས་གནས། - + PIN Code PINཨང་གྲངས། - - - + + + Password གསང་བའི་ཨང་གྲངས། - + NT Domain NTས་ཁོངས། - + Server Address ཞབས་ཞུ་ཡོ་བྱད་ཀྱི་ས་གནས། - + Authentication Mode བདེན་དཔང་ར་སྤྲོད་བྱེད་སྟངས། - + CA Certificate CAདཔང་ཡིག - + User Certificate སྤྱོད་མཁན།དཔང་ཡིག - + Key Direction གསང་ལྡེའི་ཁ་ཕྱོགས། - + Private Key སྒེར་གྱི་ལྡེ་མིག - + Private Key Password སྒེར་ལ་གསང་བའི་གསང་བ་ཡོད། - - + + Password Options གསང་བའི་ཐོག་ནས་རྣམ་གྲངས་བདམས་པ། - + Username སྤྱོད་མཁན་གྱི་མིང་། - + Notice: If key direction is used, it must be opposite to the VPN side used. If '1' is used, the connection must use '0'. If you are not sure which value to use, please contact your system administrator. ཡིད་འཇོག་བྱ་དགོས་ གལ་ཏེ་གསང་བའི་ཁ་ཕྱོགས་སྤྱད་ན་ངེས་པར་དུ་VPNཡི་སྣེ་དང་ལྡོག་དགོས། གལ་ཏེ་"1"བེད་སྤྱོད་བྱས་ན་ངེས་པར་དུ་"0"བེད་སྤྱོད་གཏོང་དགོས། གལ་ཏེ་རིན་ཐང་གང་ཡིན་པ་མི་ཤེས་ན། ཁྱེད་ཀྱི་མ་ལག་དོ་དམ་པ་ལ་འབྲེལ་གཏུག་བྱེད་རོགས། - - - - + + + + Choose གདམ་ག་རྒྱག་པ། - + None མེད། - - + + Save password only for this user མིག་སྔར་སྤྱོད་མཁན་ཁོ་ནར་གསང་གྲངས་ཉར་ཚགས་བྱས་ཡོད། - - + + Save password for all users སྤྱོད་མཁན་ཚང་མར་གསང་གྲངས་ཉར་ཚགས་བྱས་ཡོད། - - + + Ask password every time ཚང་མར་འདྲི་རྩད་བྱེད་ཐེངས་རེ་ཡིན། - - + + Don't require a password གསང་བ་མི་དགོས། - - + + Required ངེས་པར་དུ་སྐོང་དགོས། - + Certificate(TLS) དཔང་ཡིག(TLS) - + Static key ཁ་རོག་གེར་ལྡེ་མིག་ལྟ་བ - + Password and certificate(TLS) གསང་བ་དང་དཔང་ཡིག(TLS) - + Certificate/Private key དཔང་ཡིག/སྒེར་གྱི་ལྡེ་མིག - + Certificate/ssh-agent དཔང་ཡིག/ssh-agent - + Smart card རིག་ནུས་བྱང་བུ། - + Choose a private key སྒེར་གྱི་ལྡེ་མིག་འདེམས་པ། - - + + Key Files (*.key *.pem *.der *.p12 *.pfx) སྒེར་གྱི་ལྡེ་མིག་ཡིག་ཆ།(*.key *.pem *.der *.p12 *.pfx) - + Choose a CA certificate གདམ་ག་རྒྱག་པ།CAདཔང་ཡིག - - + + CA Files (*.pem *.der *.p12 *.crt *.cer *.pfx) CAཡིག་ཆ། (*.pem *.der *.p12 *.crt *.cer *.pfx) - + Choose a User certificate སྤྱོད་མཁན་གྱི་ལག་ཁྱེར་འདེམས་དགོས། - + Choose a Static key འཇམ་ཐིང་ཐིང་གི་ལྡེ་མིག་འདེམས་ + + VpnDetail + + + + VPN + + + + + IPv4 + + + + + + IPv6 + + + + + Advanced + མཐོ་རིམ།མཐོ་རིམ་ + + + + Auto Connection + རང་འགུལ་གྱིས་སྦྲེལ་མཐུད་བྱ་དགོས། + + + + Cancel + མེད་པར་བཟོ་དགོས། + + + + Confirm + གཏན་འཁེལ་བྱ། + + VpnIpv4Page - + IPv4 Config IPv4བཀོད་སྒྲིག་བཅས་བྱ་དགོས། - + Address ས་གནས། - + Netmask དྲ་བ་འགེབས་པ། - + Default Gateway དྲ་རྒྱའི་འགག་སྒོ་ཁས་ལེན་བྱེད་དགོས། - + DNS Server DNSཞབས་ཞུའི་ཡོ་བྱད། - + Search Domain ས་ཁོངས་འཚོལ་ཞིབ་བྱ། - + DHCP Client ID DHCPཚོང་འགྲུལ་པ་སྣེ་ལེན་བྱེད་པ།ID - + Auto(DHCP) རང་འགུལ་ཡིན་དགོས།(DHCP) - + Manual ལག་པ་འགུལ་དགོས། @@ -655,42 +705,42 @@ If key direction is used, it must be opposite to the VPN side used. If '1&a VpnIpv6Page - + IPv6 Config IPv6བཀོད་སྒྲིག་བཅས་བྱ་དགོས། - + Address ས་གནས། - + Netmask དྲ་བ་འགེབས་པ། - + Default Gateway དྲ་རྒྱའི་འགག་སྒོ་ཁས་ལེན་བྱེད་དགོས། - + DNS Server DNSཞབས་ཞུའི་ཡོ་བྱད། - + Search Domain ས་ཁོངས་འཚོལ་ཞིབ་བྱ། - + Auto(DHCP) རང་འགུལ་ཡིན་དགོས།(DHCP) - + Manual ལག་པ་འགུལ་དགོས། @@ -703,14 +753,14 @@ If key direction is used, it must be opposite to the VPN side used. If '1&a འབྲེལ་མཐུད་མ་བྱས་པ། - - + + Disconnect བར་མཚམས་ཆད་པ་རེད། - - + + Connect འབྲེལ་མཐུད་བཅས་བྱ་དགོས། @@ -718,12 +768,12 @@ If key direction is used, it must be opposite to the VPN side used. If '1&a VpnPage - + VPN - + VPN Settings VPNབཀོད་སྒྲིག་བཅས་བྱ་དགོས། @@ -731,48 +781,43 @@ If key direction is used, it must be opposite to the VPN side used. If '1&a vpnAddPage - + create VPN གསར་འཛུགས་བྱ་དགོས།VPN - + VPN Type VPNརིགས་དབྱིབས། - + VPN Name VPNམིང་། - - + + Required ངེས་པར་དུ་སྐོང་དགོས། - + VPN Server ཞབས་ཞུ་ཡོ་བྱད་ཀྱི་ས་གནས། - - VPN - - - - + Auto Connection རང་འགུལ་གྱིས་སྦྲེལ་མཐུད་བྱ་དགོས། - + Confirm གཏན་འཁེལ་བྱ། - + Cancel མེད་པར་བཟོ་དགོས། @@ -784,50 +829,10 @@ If key direction is used, it must be opposite to the VPN side used. If '1&a VPN类型 - - VpnDetail - - - - VPN - - - - - IPv4 - - - - - - IPv6 - - - - - Advanced - མཐོ་རིམ།མཐོ་རིམ་ - - - - Auto Connection - རང་འགུལ་གྱིས་སྦྲེལ་མཐུད་བྱ་དགོས། - - - - Cancel - མེད་པར་བཟོ་དགོས། - - - - Confirm - གཏན་འཁེལ་བྱ། - - vpnObject - + vpn tool VPNཡོ་བྱད། diff --git a/src-vpn/translations/kylin-vpn_mn.ts b/src-vpn/translations/kylin-vpn_mn.ts index 6364d82e..d50b8000 100644 --- a/src-vpn/translations/kylin-vpn_mn.ts +++ b/src-vpn/translations/kylin-vpn_mn.ts @@ -4,17 +4,17 @@ SinglePage - + Settings ᠳᠤᠬᠢᠷᠠᠭᠤᠯᠬᠤ - + Kylin VPN VPN ᠪᠠᠭᠠᠵᠢ - + kylin vpn applet desktop message VPN ᠳᠤᠬᠢᠷᠠᠭᠤᠯᠭ᠎ᠠ ᠰᠢᠷᠡᠭᠡᠨ ᠨᠢᠭᠤᠷ ᠤ᠋ᠨ ᠠᠩᠬᠠᠷᠤᠭᠤᠯᠭ᠎ᠠ @@ -22,632 +22,682 @@ VpnAdvancedPage - + MPPE encryption algorithm: MPPE ᠨᠢᠭᠤᠴᠠᠯᠠᠨ ᠪᠤᠳᠤᠬᠤ ᠠᠷᠭ᠎ᠠ: - + Use Stateful encryption ᠨᠢᠭᠤᠴᠠᠯᠠᠭᠰᠠᠨ ᠪᠠᠢᠳᠠᠯ ᠳᠦᠯᠦᠪ ᠢ᠋ ᠬᠡᠷᠡᠭᠯᠡᠬᠦ - + Send PPP echo packets PPP ᠪᠤᠴᠠᠭᠠᠨ ᠢᠯᠡᠷᠡᠬᠦᠯᠬᠦ ᠪᠠᠭᠯᠠᠭ᠎ᠠ ᠵᠢ ᠢᠯᠡᠭᠡᠬᠦ - + Authentication Mode: ᠬᠡᠷᠡᠴᠢᠯᠡᠬᠦ ᠠᠷᠭ᠎ᠠ: - + PAP authentication PAP ᠬᠡᠷᠡᠴᠢᠯᠡᠯ - + CHAP authentication CHAP ᠭᠡᠷᠡᠴᠢᠯᠡᠯ - + MSCHAP authentication MSCHAP ᠭᠡᠷᠡᠴᠢᠯᠡᠯ - + MSCHAP2 authentication MSCHAP2 ᠭᠡᠷᠡᠴᠢᠯᠡᠯ - + EAP authentication EAP ᠭᠡᠷᠡᠴᠢᠯᠡᠯ - + Compression Mode: ᠠᠪᠴᠢᠭᠤᠯᠬᠤ ᠠᠷᠭ᠎ᠠ: - + Allow BSD data compression BSD ᠠᠪᠴᠢᠭᠤᠯᠤᠯ ᠢ᠋ ᠵᠦᠪᠰᠢᠶᠡᠷᠡᠬᠦ - + Allow Default data compression Default ᠠᠪᠴᠢᠭᠤᠯᠤᠯ ᠢ᠋ ᠵᠦᠪᠰᠢᠶᠡᠷᠡᠬᠦ - + Allow TCP header compression TCP ᠲᠤᠯᠤᠭᠠᠢ ᠠᠪᠴᠢᠭᠤᠯᠤᠯ ᠢ᠋ ᠵᠦᠪᠰᠢᠶᠡᠷᠡᠬᠦ - + Use protocol field compression negotiation ᠭᠡᠷ᠎ᠡ ᠵᠢᠨ ᠬᠡᠰᠡᠭ ᠤ᠋ᠨ ᠠᠪᠴᠢᠭᠤᠯᠬᠤ ᠵᠦᠪᠰᠢᠯᠴᠡᠯ ᠢ᠋ ᠬᠡᠷᠡᠭᠯᠡᠬᠦ - + Use Address/Control compression ᠬᠡᠷᠡᠭᠯᠡᠬᠦ ᠬᠠᠶᠢᠭ / ᠠᠪᠴᠢᠭᠤᠯᠤᠯ ᠢ᠋ ᠡᠵᠡᠮᠳᠡᠬᠦ - + All Available ᠶᠠᠮᠠᠷᠪᠠ - + 128-bit 128- ᠤᠷᠤᠨ - + 40-bit 40- ᠤᠷᠤᠨ - + Use custom gateway port ᠦᠪᠡᠷᠳᠡᠭᠡᠨ ᠳᠤᠭᠳᠠᠭᠠᠭᠰᠠᠨ ᠨᠸᠲ ᠪᠤᠭᠤᠮᠳᠠ ᠵᠢᠨ ᠦᠵᠦᠬᠦᠷ ᠢ᠋ ᠬᠡᠷᠡᠭᠯᠡᠬᠦ - + Use compression ᠠᠪᠴᠢᠭᠤᠯᠤᠯ ᠢ᠋ ᠬᠡᠷᠡᠭᠯᠡᠬᠦ - + Use a TCP connection TCP ᠴᠦᠷᠬᠡᠯᠡᠬᠡ ᠵᠢ ᠬᠡᠷᠡᠭᠯᠡᠬᠦ - + Set virtual device type ᠳᠠᠭᠤᠷᠢᠶᠠᠮᠠᠯ ᠳᠦᠬᠦᠬᠡᠷᠦᠮᠵᠢ ᠵᠢᠨ ᠳᠦᠷᠦᠯ ᠵᠦᠢᠯ ᠢ᠋ ᠳᠤᠬᠢᠷᠠᠭᠤᠯᠬᠤ - + Set virtual device name ᠳᠠᠭᠤᠷᠢᠶᠠᠮᠠᠯ ᠳᠦᠬᠦᠬᠡᠷᠦᠮᠵᠢ ᠵᠢᠨ ᠨᠡᠷᠡᠢᠳᠦᠯ ᠢ᠋ ᠳᠤᠬᠢᠷᠠᠭᠤᠯᠬᠤ - + Limit TCP Maximum Segment Size(MSS) TCP ᠤ᠋ᠨ/ ᠵᠢᠨ ᠬᠠᠮᠤᠭ ᠤ᠋ᠨ ᠶᠡᠬᠡ ᠬᠡᠰᠡᠭ ᠤ᠋ᠨ ᠬᠡᠮᠵᠢᠶ᠎ᠡ ᠵᠢ ᠬᠢᠵᠠᠭᠠᠷᠯᠠᠬᠤ (MSS) - + Randomize remote hosts ᠳᠠᠰᠢᠷᠠᠮᠴᠢᠯᠠᠭᠰᠠᠨ ᠠᠯᠤᠰ ᠡᠵᠡᠮᠰᠢᠯ ᠤ᠋ᠨ ᠭᠤᠤᠯ ᠮᠠᠰᠢᠨ - + IPv6 tun link IPv6 tun ᠴᠦᠷᠬᠡᠯᠡᠬᠡ - + Specify ping interval ping ᠤ᠋ᠨ/ ᠵᠢᠨ ᠦᠶᠡᠯᠡᠯ ᠢ᠋ ᠳᠤᠭᠳᠠᠬᠤ - + Specify exit or restart ping ᠪᠤᠴᠠᠵᠤ ᠭᠠᠷᠤᠭᠰᠠᠨ ᠪᠤᠶᠤ ᠳᠠᠬᠢᠨ ᠡᠬᠢᠯᠡᠭᠰᠡᠨ ping ᠢ᠋/ ᠵᠢ ᠳᠤᠭᠳᠠᠬᠤ - + Specify max routes ᠵᠠᠮᠴᠢᠯᠠᠭᠤᠷ ᠤ᠋ᠨ ᠳᠡᠭᠡᠳᠦ ᠬᠢᠵᠠᠭᠠᠷ ᠢ᠋ ᠳᠤᠭᠳᠠᠬᠤ - + Infinite retry on error ᠠᠯᠳᠠᠭ᠎ᠠ ᠭᠠᠷᠬᠤ ᠦᠶ᠎ᠡ ᠳ᠋ᠤ᠌ ᠬᠢᠵᠠᠭᠠᠷ ᠦᠬᠡᠢ ᠳᠠᠬᠢᠵᠤ ᠳᠤᠷᠰᠢᠬᠤ - + Use custom key size ᠦᠪᠡᠷᠳᠡᠭᠡᠨ ᠳᠤᠬᠢᠷᠠᠭᠤᠯᠤᠭᠰᠠᠨ ᠨᠢᠭᠤᠴᠠ ᠳᠦᠯᠬᠢᠬᠦᠷ ᠤ᠋ᠨ ᠬᠡᠮᠵᠢᠶ᠎ᠡ ᠵᠢ ᠬᠡᠷᠡᠭᠯᠡᠬᠦ - + Choose ᠰᠤᠩᠭᠤᠬᠤ - + Use custom renegotiation interval ᠦᠪᠡᠷᠳᠡᠭᠡᠨ ᠳᠤᠭᠳᠠᠭᠠᠭᠰᠠᠨ ᠳᠠᠬᠢᠨ ᠵᠦᠪᠰᠢᠯᠴᠡᠬᠦ ᠵᠠᠭᠠᠭ ᠢ᠋ ᠬᠡᠷᠡᠭᠯᠡᠬᠦ - + Use custom tunnel Maximum Transmission Umit(MTU) ᠦᠪᠡᠷᠳᠡᠭᠡᠨ ᠳᠤᠭᠳᠠᠭᠠᠭᠰᠠᠨ ᠰᠤᠪᠠᠭ ᠤ᠋ᠨ ᠬᠠᠮᠤᠭ ᠤ᠋ᠨ ᠶᠡᠬᠡ ᠨᠢᠭᠡᠴᠢ ᠵᠢᠨ ᠳᠠᠮᠵᠢᠭᠤᠯᠭ᠎ᠠ ᠵᠢ ᠬᠡᠷᠡᠭᠯᠡᠬᠦ (MTU) - + Use custom UDP fragment size ᠦᠪᠡᠷᠳᠡᠭᠡᠨ ᠳᠤᠭᠳᠠᠭᠠᠭᠰᠠᠨ UDP ᠬᠤᠪᠢᠶᠠᠷᠢ ᠬᠡᠰᠡᠭ ᠤ᠋ᠨ ᠬᠡᠮᠵᠢᠶ᠎ᠡ ᠵᠢ ᠬᠡᠷᠡᠭᠯᠡᠬᠦ - + Accept authenticated packets from any address (Float) ᠶᠠᠮᠠᠷᠪᠠ ᠬᠠᠶᠢᠭ (Float) ᠵᠢᠡᠷ ᠢᠷᠡᠭᠰᠡᠨ ᠨᠢᠭᠡᠨᠳᠡ ᠪᠡᠶ᠎ᠡ ᠵᠢᠨ ᠭᠠᠷᠤᠯ ᠢ᠋ ᠪᠠᠳᠤᠯᠠᠭᠠᠵᠢᠭᠤᠯᠤᠭᠰᠠᠨ ᠳ᠋ᠠᠢᠲ᠋ᠠ ᠪᠠᠭᠯᠠᠭ᠎ᠠ ᠵᠢ ᠬᠦᠯᠢᠶᠡᠵᠤ ᠠᠪᠤᠨ᠎ᠠ - + Subject Match ᠭᠤᠤᠯ ᠰᠡᠳᠦᠪ ᠠᠪᠴᠠᠯᠳᠤᠬᠤ - + Key File ᠨᠢᠭᠤᠴᠠ ᠳᠦᠯᠬᠢᠬᠦᠷ ᠤ᠋ᠨ ᠹᠠᠢᠯ - + Key Direction ᠨᠢᠭᠤᠴᠠ ᠳᠦᠯᠬᠢᠬᠦᠷ ᠤ᠋ᠨ ᠴᠢᠭᠯᠡᠯ - + Server Address ᠦᠢᠯᠡᠴᠢᠯᠡᠬᠦᠷ ᠤ᠋ᠨ ᠬᠠᠶᠢᠭ - + Port ᠦᠵᠦᠬᠦᠷ - + Proxy USername ᠤᠷᠤᠯᠠᠭᠴᠢ ᠬᠡᠷᠡᠭᠡᠯᠡᠭᠴᠢ ᠵᠢᠨ ᠨᠡᠷ᠎ᠡ - + Proxy Password ᠤᠷᠤᠯᠠᠭᠴᠢ ᠨᠢᠭᠤᠴᠠ ᠺᠤᠳ᠋ - + General ᠳᠦᠷᠢᠮᠵᠢᠯ - + TLS settings TLS ᠳᠤᠬᠢᠷᠠᠭᠤᠯᠭ᠎ᠠ - + Server Certificate Check ᠦᠢᠯᠡᠴᠢᠯᠡᠬᠦᠷ ᠤ᠋ᠨ ᠦᠨᠡᠮᠯᠡᠯ ᠢ᠋ ᠰᠢᠯᠭᠠᠨ ᠪᠠᠢᠴᠠᠭᠠᠬᠤ - + Use the previous authentication end (server) certificate ᠡᠮᠦᠨᠡᠬᠢ ᠪᠠᠳᠤᠯᠠᠭᠠᠵᠢᠭᠤᠯᠬᠤ ᠦᠵᠦᠬᠦᠷ ᠤ᠋ᠨ ᠦᠨᠡᠮᠯᠡᠯ ( ᠦᠢᠯᠡᠴᠢᠯᠡᠬᠦᠷ) ᠢ᠋ ᠬᠡᠷᠡᠭᠯᠡᠬᠦ - + Verify peer (server) certificate nsCertType specification ᠳᠡᠩᠴᠡᠬᠦᠦ ᠴᠡᠭ ( ᠦᠢᠯᠡᠴᠢᠯᠡᠬᠦᠷ) ᠤ᠋ᠨ ᠦᠨᠡᠮᠯᠡᠯ nsCertType ᠢ᠋/ ᠵᠢ ᠪᠠᠳᠤᠯᠠᠭᠠᠵᠢᠭᠤᠯᠵᠤ ᠳᠤᠭᠳᠠᠬᠤ - + Mode ᠮᠤᠳ᠋ - + Proxies ᠤᠷᠤᠯᠠᠭᠴᠢ - + Proxy Type ᠤᠷᠤᠯᠠᠭᠴᠢ ᠵᠢᠨ ᠳᠦᠷᠦᠯ ᠵᠦᠢᠯ - + Security ᠠᠮᠤᠷ ᠳᠦᠪᠰᠢᠨ - + HMAC Authentication HMAC ᠭᠡᠷᠡᠴᠢᠯᠡᠯ - + Input content ᠤᠷᠤᠭᠤᠯᠬᠤ ᠠᠭᠤᠯᠭ᠎ᠠ - + No ᠪᠢᠰᠢ/ ᠦᠬᠡᠢ - + Self-adaption ᠦᠪᠡᠷᠳᠡᠭᠡᠨ ᠵᠤᠬᠢᠴᠠᠬᠤ - + Automatic ᠠᠦ᠋ᠲ᠋ᠣ᠋ - + Exit ᠪᠤᠴᠠᠵᠤ ᠭᠠᠷᠬᠤ - + Restart ᠳᠠᠬᠢᠨ ᠡᠬᠢᠯᠡᠬᠦ - + Don't verify certificate identification ᠦᠨᠡᠮᠯᠡᠯ ᠤ᠋ᠨ ᠳᠡᠮᠳᠡᠭ ᠢ᠋ ᠪᠠᠳᠤᠯᠠᠭᠠᠵᠢᠭᠤᠯᠬᠤ ᠦᠬᠡᠢ - + Verify the entire subject exactly ᠪᠦᠬᠦᠢᠯᠡ ᠭᠤᠤᠯ ᠰᠡᠳᠦᠪ ᠢ᠋ ᠪᠠᠳᠤᠳᠠᠢ ᠪᠠᠳᠤᠯᠠᠭᠠᠵᠢᠭᠤᠯᠬᠤ - + Verify name exactly ᠨᠡᠷᠡᠢᠳᠦᠯ ᠢ᠋ ᠤᠨᠤᠪᠴᠢᠳᠠᠢ ᠪᠠᠳᠤᠯᠠᠭᠠᠵᠢᠭᠤᠯᠬᠤ - + Verify name by prefix ᠤᠭᠳᠤᠪᠤᠷᠢ ᠪᠡᠷ ᠨᠡᠷᠡᠢᠳᠦᠯ ᠢ᠋ ᠪᠠᠳᠤᠯᠠᠭᠠᠵᠢᠭᠤᠯᠬᠤ - - + + Server ᠦᠢᠯᠡᠴᠢᠯᠡᠬᠦᠷ - - + + Client ᠬᠡᠷᠡᠭᠡᠯᠡᠭᠴᠢ ᠵᠢᠨ ᠦᠵᠦᠬᠦᠷ - - - + + + None ᠪᠠᠢᠬᠤ ᠦᠬᠡᠢ - + TLS-Certification TLS- ᠭᠡᠷᠡᠴᠢᠯᠡᠯ - + TLS-Encryption TLS- ᠨᠢᠭᠤᠴᠠᠯᠠᠬᠤ - + Not Required ᠱᠠᠭᠠᠷᠳᠠᠬᠤ ᠦᠬᠡᠢ - + Default ᠠᠶᠠᠳᠠᠯ - + Options: ᠰᠤᠩᠭᠤᠭᠳᠠᠬᠤᠨ: - + Request an inner IP address ᠳᠤᠳᠤᠭᠠᠳᠤ IP ᠬᠠᠶᠢᠭ ᠢ᠋ ᠭᠤᠶᠤᠴᠢᠯᠠᠬᠤ - + Enforce UDP encapsulation ᠠᠯᠪᠠ ᠪᠡᠷ UDP ᠪᠢᠳᠡᠬᠦᠮᠵᠢᠯᠡᠬᠦ - + Use IP compression IP ᠠᠪᠴᠢᠭᠤᠯᠤᠯ ᠢ᠋ ᠬᠡᠷᠡᠭᠯᠡᠬᠦ - + Enable custom password suggestions ᠦᠪᠡᠷᠳᠡᠭᠡᠨ ᠳᠤᠭᠳᠠᠭᠠᠬᠰᠠᠨ ᠨᠢᠭᠤᠴᠠ ᠺᠤᠳ᠋ ᠤ᠋ᠨ ᠰᠠᠨᠠᠭᠤᠯᠤᠮᠵᠢ ᠵᠢ ᠡᠬᠢᠯᠡᠬᠦᠯᠬᠦ + + + Choose a private key + ᠬᠤᠪᠢ ᠵᠢᠨ ᠨᠢᠭᠤᠴᠠ ᠳᠦᠯᠬᠢᠬᠦᠷ ᠢ᠋ ᠰᠤᠩᠭᠤᠬᠤ + + + + Key Files (*.key *.pem *.der *.p12 *.pfx) + ᠬᠤᠪᠢ ᠵᠢᠨ ᠨᠢᠭᠤᠴᠠ ᠳᠦᠯᠬᠢᠬᠦᠷ ᠤ᠋ᠨ ᠹᠠᠢᠯ (*.key *.pem *.der *.p12 *.pfx) + VpnConfigPage - + Type ᠳᠦᠷᠦᠯ ᠵᠦᠢᠯ - + Name ᠨᠡᠷᠡᠢᠳᠦᠯ - + Static Key ᠳᠠᠢᠪᠤᠩ ᠨᠢᠭᠤᠴᠠ ᠳᠦᠯᠬᠢᠬᠦᠷ - + Local IP ᠲᠤᠰ ᠭᠠᠵᠠᠷ ᠤ᠋ᠨ IP ᠬᠠᠶᠢᠭ - + Remote IP ᠠᠯᠤᠰ ᠡᠵᠡᠮᠰᠢᠯ ᠤ᠋ᠨ IP ᠬᠠᠶᠢᠭ - + PIN Code PIN ᠺᠤᠳ᠋ - - - + + + Password ᠨᠢᠭᠤᠴᠠ ᠺᠤᠳ᠋ - + NT Domain NT ᠬᠡᠰᠡᠭ - + Server Address ᠦᠢᠯᠡᠴᠢᠯᠡᠬᠦᠷ ᠤ᠋ᠨ ᠬᠠᠶᠢᠭ - + Authentication Mode ᠬᠡᠷᠡᠴᠢᠯᠡᠬᠦ ᠠᠷᠭ᠎ᠠ - + CA Certificate CA ᠦᠨᠡᠮᠯᠡᠯ - + User Certificate ᠬᠡᠷᠡᠭᠡᠯᠡᠭᠴᠢ ᠵᠢᠨ ᠦᠨᠡᠮᠯᠡᠯ - + Key Direction ᠨᠢᠭᠤᠴᠠ ᠳᠦᠯᠬᠢᠬᠦᠷ ᠤ᠋ᠨ ᠴᠢᠭᠯᠡᠯ - + Private Key ᠬᠤᠪᠢ ᠵᠢᠨ ᠨᠢᠭᠤᠴᠠ ᠳᠦᠯᠬᠢᠬᠦᠷ - + Private Key Password ᠬᠤᠪᠢ ᠵᠢᠨ ᠨᠢᠭᠤᠴᠠ ᠳᠦᠯᠬᠢᠬᠦᠷ ᠤ᠋ᠨ ᠨᠢᠭᠤᠴᠠ ᠺᠤᠳ᠋ - - + + Password Options ᠨᠢᠭᠤᠴᠠ ᠺᠤᠳ᠋ ᠤ᠋ᠨ ᠰᠤᠩᠭᠤᠭᠳᠠᠬᠤᠨ - + Username ᠬᠡᠷᠡᠭᠯᠡᠭᠴᠢ ᠵᠢᠨ ᠨᠡᠷ᠎ᠡ - + Notice: If key direction is used, it must be opposite to the VPN side used. If '1' is used, the connection must use '0'. If you are not sure which value to use, please contact your system administrator. ᠠᠩᠬᠠᠷᠤᠭᠠᠷᠠᠢ: ᠬᠡᠷᠪᠡ ᠨᠢᠭᠤᠴᠠ ᠳᠦᠯᠬᠢᠬᠦᠷ ᠤ᠋ᠨ ᠴᠢᠭᠯᠡᠯ ᠢ᠋ ᠬᠡᠷᠡᠭᠯᠡᠭᠰᠡᠨ ᠪᠤᠯ᠂ ᠲᠡᠷᠡ ᠨᠢ ᠡᠷᠬᠡᠪᠰᠢ ᠬᠡᠷᠡᠭᠯᠡᠭᠰᠡᠨ VPN ᠦᠵᠦᠬᠦᠷ ᠲᠠᠢ ᠡᠰᠡᠷᠬᠦ ᠪᠠᠢᠬᠤ ᠬᠡᠷᠡᠭᠳᠡᠢ᠃ ᠬᠡᠷᠪᠡ '1' ᠢ᠋/ ᠵᠢ ᠬᠡᠷᠡᠭᠯᠡᠭᠰᠡᠨ ᠪᠤᠯ᠂ ᠴᠦᠷᠬᠡᠯᠡᠭᠡ ᠨᠢ ᠡᠷᠬᠡᠪᠰᠢ '0' ᠢ᠋/ ᠵᠢ ᠬᠡᠷᠡᠭᠯᠡᠬᠦ ᠬᠡᠷᠡᠭᠳᠡᠢ᠃ ᠬᠡᠷᠪᠡ ᠠᠯᠢ ᠵᠢ ᠨᠢ ᠬᠡᠷᠡᠭᠯᠡᠬᠦ ᠪᠡᠨ ᠳᠤᠭᠳᠠᠵᠤ ᠴᠢᠳᠠᠭ᠎ᠠ ᠦᠬᠡᠢ ᠪᠤᠯ᠂ ᠲᠠ ᠰᠢᠰᠲ᠋ᠧᠮ ᠤ᠋ᠨ ᠬᠠᠮᠢᠶᠠᠷᠤᠭᠴᠢ ᠲᠠᠢ ᠪᠡᠨ ᠬᠠᠷᠢᠯᠴᠠᠭᠠᠷᠠᠢ. - - - - + + + + Choose ᠰᠤᠩᠭᠤᠬᠤ - + None ᠪᠠᠢᠬᠤ ᠦᠬᠡᠢ - - + + Save password only for this user ᠵᠦᠪᠬᠡᠨ ᠤᠳᠤᠬᠠᠨ ᠤ᠋ ᠬᠡᠷᠡᠭᠡᠯᠡᠭᠴᠢ ᠵᠢᠨ ᠨᠢᠭᠤᠴᠠ ᠺᠤᠳ᠋ ᠢ᠋ ᠬᠠᠳᠠᠭᠠᠯᠠᠨ᠎ᠠ - - + + Save password for all users ᠪᠦᠬᠦᠢᠯᠡ ᠬᠡᠷᠡᠭᠡᠯᠡᠭᠴᠢ ᠵᠢᠨ ᠨᠢᠭᠤᠴᠠ ᠺᠤᠳ᠋ ᠢ᠋ ᠬᠠᠳᠠᠭᠠᠯᠠᠨ᠎ᠠ - - + + Ask password every time ᠤᠳᠠᠭ᠎ᠠ ᠪᠦᠷᠢ ᠠᠰᠠᠭᠤᠨ ᠯᠠᠪᠯᠠᠬᠤ - - + + Don't require a password ᠨᠢᠭᠤᠴᠠ ᠺᠤᠳ᠋ ᠬᠡᠷᠡᠭ ᠦᠬᠡᠢ - - + + Required ᠡᠷᠬᠡᠪᠰᠢ ᠳᠠᠭᠯᠠᠬᠤ - + Certificate(TLS) ᠦᠨᠡᠮᠯᠡᠯ (TLS) - + Static key ᠳᠠᠢᠪᠤᠩ ᠨᠢᠭᠤᠴᠠ ᠳᠦᠯᠬᠢᠬᠦᠷ - + Password and certificate(TLS) ᠨᠢᠭᠤᠴᠠ ᠺᠤᠳ᠋ ᠬᠢᠬᠡᠳ ᠦᠨᠡᠮᠯᠡᠯ (TLS) - + Certificate/Private key ᠦᠨᠡᠮᠯᠡᠯ / ᠬᠤᠪᠢ ᠵᠢᠨ ᠨᠢᠭᠤᠴᠠ ᠳᠦᠯᠬᠢᠬᠦᠷ - + Certificate/ssh-agent ᠦᠨᠡᠮᠯᠡᠯ /ssh-agent - + Smart card ᠤᠶᠤᠯᠢᠭ ᠺᠠᠷᠲ - + Choose a private key ᠬᠤᠪᠢ ᠵᠢᠨ ᠨᠢᠭᠤᠴᠠ ᠳᠦᠯᠬᠢᠬᠦᠷ ᠢ᠋ ᠰᠤᠩᠭᠤᠬᠤ - - + + Key Files (*.key *.pem *.der *.p12 *.pfx) ᠬᠤᠪᠢ ᠵᠢᠨ ᠨᠢᠭᠤᠴᠠ ᠳᠦᠯᠬᠢᠬᠦᠷ ᠤ᠋ᠨ ᠹᠠᠢᠯ (*.key *.pem *.der *.p12 *.pfx) - + Choose a CA certificate CA ᠦᠨᠡᠮᠯᠡᠯ ᠢ᠋ ᠰᠤᠩᠭᠤᠬᠤ - - + + CA Files (*.pem *.der *.p12 *.crt *.cer *.pfx) CA ᠹᠠᠢᠯ (*.pem *.der *.p12 *.crt *.cer *.pfx) - + Choose a User certificate ᠬᠡᠷᠡᠭᠡᠯᠡᠭᠴᠢ ᠵᠢᠨ ᠦᠨᠡᠮᠯᠡᠯ ᠢ᠋ ᠰᠤᠩᠭᠤᠬᠤ - + Choose a Static key ᠳᠠᠢᠪᠤᠩ ᠨᠢᠭᠤᠴᠠ ᠳᠦᠯᠬᠢᠬᠦᠷ ᠢ᠋ ᠰᠤᠩᠭᠤᠬᠤ + + VpnDetail + + + + VPN + vpn + + + + IPv4 + ipv4 + + + + + IPv6 + ipv6 + + + + Advanced + ᠦᠨᠳᠦᠷ ᠳᠡᠰ + + + + Auto Connection + ᠠᠦ᠋ᠲ᠋ᠣ᠋ ᠴᠦᠷᠬᠡᠯᠡᠬᠦ + + + + Cancel + ᠦᠭᠡᠢᠰᠬᠡᠬᠦ + + + + Confirm + ᠪᠠᠳᠤᠯᠠᠬᠤ + + VpnIpv4Page - + IPv4 Config IPv4 ᠳᠤᠬᠢᠷᠠᠭᠤᠯᠭ᠎ᠠ - + Address ᠬᠠᠶᠢᠭ - + Netmask ᠬᠤᠪᠢᠶᠠᠷᠢ ᠰᠦᠯᠵᠢᠶᠡᠨ ᠤ᠋ ᠳᠠᠯᠳᠠᠯᠠᠯ ᠺᠤᠳ᠋ - + Default Gateway ᠠᠶᠠᠳᠠᠯ ᠨᠸᠲ ᠪᠤᠭᠤᠮᠳᠠ - + DNS Server DNS ᠦᠢᠯᠡᠴᠢᠯᠡᠬᠦᠷ - + Search Domain ᠬᠠᠢᠬᠤ ᠬᠡᠰᠡᠭ - + DHCP Client ID DHCP ᠬᠡᠷᠡᠭᠡᠯᠡᠭᠴᠢ ᠵᠢᠨ ᠦᠵᠦᠬᠦᠷ ID - + Auto(DHCP) ᠠᠦ᠋ᠲ᠋ᠣ᠋ (DHCP) - + Manual ᠠᠦ᠋ᠲ᠋ᠣ᠋ ᠪᠤᠰᠤ @@ -655,42 +705,42 @@ If key direction is used, it must be opposite to the VPN side used. If '1&a VpnIpv6Page - + IPv6 Config IPv6 ᠳᠤᠬᠢᠷᠠᠭᠤᠯᠭ᠎ᠠ - + Address ᠬᠠᠶᠢᠭ - + Netmask ᠬᠤᠪᠢᠶᠠᠷᠢ ᠰᠦᠯᠵᠢᠶᠡᠨ ᠤ᠋ ᠳᠠᠯᠳᠠᠯᠠᠯ ᠺᠤᠳ᠋ - + Default Gateway ᠠᠶᠠᠳᠠᠯ ᠨᠸᠲ ᠪᠤᠭᠤᠮᠳᠠ - + DNS Server DNS ᠦᠢᠯᠡᠴᠢᠯᠡᠬᠦᠷ - + Search Domain ᠬᠠᠢᠬᠤ ᠬᠡᠰᠡᠭ - + Auto(DHCP) ᠠᠦ᠋ᠲ᠋ᠣ᠋ (DHCP) - + Manual ᠠᠦ᠋ᠲ᠋ᠣ᠋ ᠪᠤᠰᠤ @@ -703,14 +753,14 @@ If key direction is used, it must be opposite to the VPN side used. If '1&a ᠴᠦᠷᠬᠡᠯᠡᠭᠡ ᠦᠬᠡᠢ - - + + Disconnect ᠳᠠᠰᠤᠯᠬᠤ - - + + Connect ᠴᠦᠷᠬᠡᠯᠡᠬᠦ @@ -718,12 +768,12 @@ If key direction is used, it must be opposite to the VPN side used. If '1&a VpnPage - + VPN vpn - + VPN Settings VPN ᠳᠤᠬᠢᠷᠠᠭᠤᠯᠭ᠎ᠠ @@ -731,48 +781,47 @@ If key direction is used, it must be opposite to the VPN side used. If '1&a vpnAddPage - + create VPN VPN ᠪᠠᠢᠭᠤᠯᠬᠤ - + VPN Type VPN ᠳᠦᠷᠦᠯ ᠵᠦᠢᠯ - + VPN Name VPN ᠨᠡᠷᠡᠢᠳᠦᠯ - - + + Required ᠡᠷᠬᠡᠪᠰᠢ ᠳᠠᠭᠯᠠᠬᠤ - + VPN Server ᠦᠢᠯᠡᠴᠢᠯᠡᠬᠦᠷ ᠤ᠋ᠨ ᠬᠠᠶᠢᠭ - VPN - vpn + vpn - + Auto Connection ᠠᠦ᠋ᠲ᠋ᠣ᠋ ᠴᠦᠷᠬᠡᠯᠡᠬᠦ - + Confirm ᠪᠠᠳᠤᠯᠠᠬᠤ - + Cancel ᠦᠬᠡᠢᠰᠬᠡᠬᠦ @@ -784,50 +833,10 @@ If key direction is used, it must be opposite to the VPN side used. If '1&a VPN类型 - - VpnDetail - - - - VPN - vpn - - - - IPv4 - ipv4 - - - - - IPv6 - ipv6 - - - - Advanced - ᠦᠨᠳᠦᠷ ᠳᠡᠰ - - - - Auto Connection - ᠠᠦ᠋ᠲ᠋ᠣ᠋ ᠴᠦᠷᠬᠡᠯᠡᠬᠦ - - - - Cancel - ᠦᠭᠡᠢᠰᠬᠡᠬᠦ - - - - Confirm - ᠪᠠᠳᠤᠯᠠᠬᠤ - - vpnObject - + vpn tool vpn ᠪᠠᠭᠠᠵᠢ diff --git a/src-vpn/translations/kylin-vpn_zh_CN.ts b/src-vpn/translations/kylin-vpn_zh_CN.ts index 38f22d6a..3875ac54 100644 --- a/src-vpn/translations/kylin-vpn_zh_CN.ts +++ b/src-vpn/translations/kylin-vpn_zh_CN.ts @@ -4,17 +4,17 @@ SinglePage - + Settings 设置 - + Kylin VPN VPN 工具 - + kylin vpn applet desktop message VPN 配置桌面提示 @@ -22,632 +22,682 @@ VpnAdvancedPage - + MPPE encryption algorithm: MPPE 加密算法: - + Use Stateful encryption 使用有状态加密 - + Send PPP echo packets 发送 PPP 回显包 - + Authentication Mode: 认证方式: - + PAP authentication PAP 认证 - + CHAP authentication CHAP 认证 - + MSCHAP authentication MSCHAP 认证 - + MSCHAP2 authentication MSCHAP2 认证 - + EAP authentication EAP 认证 - + Compression Mode: 压缩方式: - + Allow BSD data compression 允许 BSD 压缩 - + Allow Default data compression 允许 Default 压缩 - + Allow TCP header compression 允许 TCP 头压缩 - + Use protocol field compression negotiation 使用协议域压缩协商 - + Use Address/Control compression 使用地址/控制压缩 - + All Available 任意 - + 128-bit 128位 - + 40-bit 40位 - + Use custom gateway port 使用自定义网关端口 - + Use compression 使用压缩 - + Use a TCP connection 使用 TCP 连接 - + Set virtual device type 设置虚拟设备类型 - + Set virtual device name 设置虚拟设备名称 - + Limit TCP Maximum Segment Size(MSS) 限制 TCP 最大段尺寸(MSS) - + Randomize remote hosts 随机化远程主机 - + IPv6 tun link IPv6 tun 连接 - + Specify ping interval 指定 Ping 周期 - + Specify exit or restart ping 指定退出或重启的 Ping - + Specify max routes 指定路由上限 - + Infinite retry on error 出错时无限重试 - + Use custom key size 使用自定义密钥大小 - + Choose 选择 - + Use custom renegotiation interval 使用自定义重协商间隔 - + Use custom tunnel Maximum Transmission Umit(MTU) 使用自定义隧道最大单元传输(MTU) - + Use custom UDP fragment size 使用自定义 UDP 分片大小 - + Accept authenticated packets from any address (Float) 接受来自任何地址(Float)已通过身份验证的数据包 - + Subject Match 主题匹配 - + Key File 密钥文件 - + Key Direction 密钥方向 - + Server Address 服务器地址 - + Port 端口 - + Proxy USername 代理用户名 - + Proxy Password 代理密码 - + General 常规 - + TLS settings TLS 设置 - + Server Certificate Check 服务器证书检验 - + Use the previous authentication end (server) certificate 使用前面验证端(服务器)证书 - + Verify peer (server) certificate nsCertType specification 验证对等点(服务器)证书 nsCertType 指定 - + Mode 模式 - + Proxies 代理 - + Proxy Type 代理类型 - + Security 安全 - + HMAC Authentication HMAC 认证 - + Input content 输入内容 - + No - + Self-adaption 自适应 - + Automatic 自动 - + Exit 退出 - + Restart 重启 - + Don't verify certificate identification 不验证证书标识 - + Verify the entire subject exactly 确切地验证整个主题 - + Verify name exactly 精确验证名称 - + Verify name by prefix 按前缀验证名称 - - + + Server 服务器 - - + + Client 客户端 - - - + + + None - + TLS-Certification TLS-认证 - + TLS-Encryption TLS-加密 - + Not Required 不需要 - + Default 默认 - + Options: 选项: - + Request an inner IP address 请求内部 IP 地址 - + Enforce UDP encapsulation 强制 UDP 封装 - + Use IP compression 使用 IP 压缩 - + Enable custom password suggestions 启用自定义密码建议 + + + Choose a private key + 选择私钥 + + + + Key Files (*.key *.pem *.der *.p12 *.pfx) + 私钥文件 (*.key *.pem *.der *.p12 *.pfx) + VpnConfigPage - + Type 类型 - + Name 名称 - + Static Key 静态密钥 - + Local IP 本地 IP 地址 - + Remote IP 远程 IP 地址 - + PIN Code PIN 码 - - - + + + Password 密码 - + NT Domain NT 域 - + Server Address 服务器地址 - + Authentication Mode 认证方式 - + CA Certificate CA 证书 - + User Certificate 用户证书 - + Key Direction 密钥方向 - + Private Key 私钥 - + Private Key Password 私有密钥密码 - - + + Password Options 密码选项 - + Username 用户名 - + Notice: If key direction is used, it must be opposite to the VPN side used. If '1' is used, the connection must use '0'. If you are not sure which value to use, please contact your system administrator. 注意: 如果使用了密钥方向,它必须和使用的VPN端相反。如果使用了“1”,连接必须要使用“0”。如果不确定使用哪个值,请联系您的系统管理员。 - - - - + + + + Choose 选择 - + None - - + + Save password only for this user 仅对当前用户保存密码 - - + + Save password for all users 为所有用户保存密码 - - + + Ask password every time 每次都询问 - - + + Don't require a password 不需要密码 - - + + Required 必填 - + Certificate(TLS) 证书(TLS) - + Static key 静态密钥 - + Password and certificate(TLS) 密码和证书(TLS) - + Certificate/Private key 证书/私钥 - + Certificate/ssh-agent 证书/ ssh-agent - + Smart card 智能卡 - + Choose a private key 选择私钥 - - + + Key Files (*.key *.pem *.der *.p12 *.pfx) 私钥文件 (*.key *.pem *.der *.p12 *.pfx) - + Choose a CA certificate 选择 CA 证书 - - + + CA Files (*.pem *.der *.p12 *.crt *.cer *.pfx) CA文件 (*.pem *.der *.p12 *.crt *.cer *.pfx) - + Choose a User certificate 选择用户证书 - + Choose a Static key 选择静态密钥 + + VpnDetail + + + + VPN + + + + + IPv4 + + + + + + IPv6 + + + + + Advanced + 高级 + + + + Auto Connection + 自动连接 + + + + Cancel + 取消 + + + + Confirm + 确定 + + VpnIpv4Page - + IPv4 Config IPv4 配置 - + Address 地址 - + Netmask 子网掩码 - + Default Gateway 默认网关 - + DNS Server DNS 服务器 - + Search Domain 搜索域 - + DHCP Client ID DHCP 客户端 ID - + Auto(DHCP) 自动 (DHCP) - + Manual 手动 @@ -655,42 +705,42 @@ If key direction is used, it must be opposite to the VPN side used. If '1&a VpnIpv6Page - + IPv6 Config IPv6 配置 - + Address 地址 - + Netmask 子网掩码 - + Default Gateway 默认网关 - + DNS Server DNS 服务器 - + Search Domain 搜索域 - + Auto(DHCP) 自动 (DHCP) - + Manual 手动 @@ -703,14 +753,14 @@ If key direction is used, it must be opposite to the VPN side used. If '1&a 未连接 - - + + Disconnect 断开 - - + + Connect 连接 @@ -718,12 +768,12 @@ If key direction is used, it must be opposite to the VPN side used. If '1&a VpnPage - + VPN - + VPN Settings VPN 设置 @@ -731,48 +781,43 @@ If key direction is used, it must be opposite to the VPN side used. If '1&a vpnAddPage - + create VPN 创建 VPN - + VPN Type VPN 类型 - + VPN Name VPN 名称 - - + + Required 必填 - + VPN Server 服务器地址 - - VPN - - - - + Auto Connection 自动连接 - + Confirm 确定 - + Cancel 取消 @@ -784,50 +829,10 @@ If key direction is used, it must be opposite to the VPN side used. If '1&a VPN类型 - - VpnDetail - - - - VPN - - - - - IPv4 - - - - - - IPv6 - - - - - Advanced - 高级 - - - - Auto Connection - 自动连接 - - - - Cancel - 取消 - - - - Confirm - 确定 - - vpnObject - + vpn tool VPN 工具 diff --git a/src/backend/dbus-interface/gsystem-local-alloc.h b/src/backend/dbus-interface/gsystem-local-alloc.h index 54ea4818..8f04f334 100644 --- a/src/backend/dbus-interface/gsystem-local-alloc.h +++ b/src/backend/dbus-interface/gsystem-local-alloc.h @@ -4,7 +4,7 @@ * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or + * the Free Software Foundation; either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, diff --git a/src/backend/dbus-interface/kyenterpricesettinginfo.cpp b/src/backend/dbus-interface/kyenterpricesettinginfo.cpp index 9ff68dd5..c95ac75e 100644 --- a/src/backend/dbus-interface/kyenterpricesettinginfo.cpp +++ b/src/backend/dbus-interface/kyenterpricesettinginfo.cpp @@ -4,7 +4,7 @@ * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or + * the Free Software Foundation; either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, diff --git a/src/backend/dbus-interface/kyenterpricesettinginfo.h b/src/backend/dbus-interface/kyenterpricesettinginfo.h index 64462195..9a02dbb6 100644 --- a/src/backend/dbus-interface/kyenterpricesettinginfo.h +++ b/src/backend/dbus-interface/kyenterpricesettinginfo.h @@ -4,7 +4,7 @@ * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or + * the Free Software Foundation; either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, diff --git a/src/backend/dbus-interface/kylinactiveconnectresource.cpp b/src/backend/dbus-interface/kylinactiveconnectresource.cpp index 85f8dc75..efefec5b 100644 --- a/src/backend/dbus-interface/kylinactiveconnectresource.cpp +++ b/src/backend/dbus-interface/kylinactiveconnectresource.cpp @@ -4,7 +4,7 @@ * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or + * the Free Software Foundation; either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, diff --git a/src/backend/dbus-interface/kylinactiveconnectresource.h b/src/backend/dbus-interface/kylinactiveconnectresource.h index 67f580b7..68c8c0c1 100644 --- a/src/backend/dbus-interface/kylinactiveconnectresource.h +++ b/src/backend/dbus-interface/kylinactiveconnectresource.h @@ -4,7 +4,7 @@ * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or + * the Free Software Foundation; either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, diff --git a/src/backend/dbus-interface/kylinagent.h b/src/backend/dbus-interface/kylinagent.h index 8b11f044..7c491c78 100644 --- a/src/backend/dbus-interface/kylinagent.h +++ b/src/backend/dbus-interface/kylinagent.h @@ -4,7 +4,7 @@ * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or + * the Free Software Foundation; either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, diff --git a/src/backend/dbus-interface/kylinagentinterface.h b/src/backend/dbus-interface/kylinagentinterface.h index 972033e7..e086f85b 100644 --- a/src/backend/dbus-interface/kylinagentinterface.h +++ b/src/backend/dbus-interface/kylinagentinterface.h @@ -4,7 +4,7 @@ * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or + * the Free Software Foundation; either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, diff --git a/src/backend/dbus-interface/kylinapconnectitem.cpp b/src/backend/dbus-interface/kylinapconnectitem.cpp index ab3052d8..63511bf0 100644 --- a/src/backend/dbus-interface/kylinapconnectitem.cpp +++ b/src/backend/dbus-interface/kylinapconnectitem.cpp @@ -4,7 +4,7 @@ * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or + * the Free Software Foundation; either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, diff --git a/src/backend/dbus-interface/kylinapconnectitem.h b/src/backend/dbus-interface/kylinapconnectitem.h index 63f69b87..101d832b 100644 --- a/src/backend/dbus-interface/kylinapconnectitem.h +++ b/src/backend/dbus-interface/kylinapconnectitem.h @@ -4,7 +4,7 @@ * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or + * the Free Software Foundation; either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, diff --git a/src/backend/dbus-interface/kylinbluetoothconnectitem.cpp b/src/backend/dbus-interface/kylinbluetoothconnectitem.cpp index dd9dd643..a844e3c2 100644 --- a/src/backend/dbus-interface/kylinbluetoothconnectitem.cpp +++ b/src/backend/dbus-interface/kylinbluetoothconnectitem.cpp @@ -4,7 +4,7 @@ * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or + * the Free Software Foundation; either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, diff --git a/src/backend/dbus-interface/kylinbluetoothconnectitem.h b/src/backend/dbus-interface/kylinbluetoothconnectitem.h index 0b485d0f..ae2a59c1 100644 --- a/src/backend/dbus-interface/kylinbluetoothconnectitem.h +++ b/src/backend/dbus-interface/kylinbluetoothconnectitem.h @@ -4,7 +4,7 @@ * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or + * the Free Software Foundation; either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, diff --git a/src/backend/dbus-interface/kylinconnectitem.cpp b/src/backend/dbus-interface/kylinconnectitem.cpp index 27b573e5..536011ed 100644 --- a/src/backend/dbus-interface/kylinconnectitem.cpp +++ b/src/backend/dbus-interface/kylinconnectitem.cpp @@ -4,7 +4,7 @@ * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or + * the Free Software Foundation; either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, diff --git a/src/backend/dbus-interface/kylinconnectitem.h b/src/backend/dbus-interface/kylinconnectitem.h index d8fb0722..99442e67 100644 --- a/src/backend/dbus-interface/kylinconnectitem.h +++ b/src/backend/dbus-interface/kylinconnectitem.h @@ -4,7 +4,7 @@ * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or + * the Free Software Foundation; either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, diff --git a/src/backend/dbus-interface/kylinconnectoperation.h b/src/backend/dbus-interface/kylinconnectoperation.h index 8fae0bc2..2c6aa3d7 100644 --- a/src/backend/dbus-interface/kylinconnectoperation.h +++ b/src/backend/dbus-interface/kylinconnectoperation.h @@ -4,7 +4,7 @@ * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or + * the Free Software Foundation; either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, diff --git a/src/backend/dbus-interface/kylinconnectresource.cpp b/src/backend/dbus-interface/kylinconnectresource.cpp index 98818a78..739738a1 100644 --- a/src/backend/dbus-interface/kylinconnectresource.cpp +++ b/src/backend/dbus-interface/kylinconnectresource.cpp @@ -4,7 +4,7 @@ * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or + * the Free Software Foundation; either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, @@ -728,6 +728,7 @@ KyApConnectItem *KyConnectResourse::getApConnectItem(NetworkManager::Connection: apConnectItem->m_connectName = connectPtr->name(); apConnectItem->m_connectSsid = getSsidFromByteArray(rawSsid); apConnectItem->m_connectUuid = connectPtr->uuid(); + if (wirelessSetting->band() == NetworkManager::WirelessSetting::FrequencyBand::A) { apConnectItem->m_band = str5GBand; } else if (wirelessSetting->band() == NetworkManager::WirelessSetting::FrequencyBand::Bg) { diff --git a/src/backend/dbus-interface/kylinconnectresource.h b/src/backend/dbus-interface/kylinconnectresource.h index 3ab29bd2..91bffcec 100644 --- a/src/backend/dbus-interface/kylinconnectresource.h +++ b/src/backend/dbus-interface/kylinconnectresource.h @@ -4,7 +4,7 @@ * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or + * the Free Software Foundation; either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, diff --git a/src/backend/dbus-interface/kylinnetworkdeviceresource.cpp b/src/backend/dbus-interface/kylinnetworkdeviceresource.cpp index 4364cdb9..684eaed1 100644 --- a/src/backend/dbus-interface/kylinnetworkdeviceresource.cpp +++ b/src/backend/dbus-interface/kylinnetworkdeviceresource.cpp @@ -4,7 +4,7 @@ * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or + * the Free Software Foundation; either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, @@ -56,7 +56,6 @@ KyNetworkDeviceResourse::KyNetworkDeviceResourse(QObject *parent) : QObject(pare this, &KyNetworkDeviceResourse::deviceActiveChanage); connect(m_networkResourceInstance, &KyNetworkResourceManager::deviceManagedChange, this, &KyNetworkDeviceResourse::deviceManagedChange); - } KyNetworkDeviceResourse::~KyNetworkDeviceResourse() @@ -480,7 +479,6 @@ void KyNetworkDeviceResourse::onDeviceAdd(QString deviceName, QString uni, Netwo { m_deviceMap.insert(uni, deviceName); Q_EMIT deviceAdd(deviceName, deviceType); - return; } @@ -488,7 +486,6 @@ void KyNetworkDeviceResourse::onDeviceRemove(QString deviceName, QString uni) { m_deviceMap.remove(uni); Q_EMIT deviceRemove(deviceName); - return; } diff --git a/src/backend/dbus-interface/kylinnetworkdeviceresource.h b/src/backend/dbus-interface/kylinnetworkdeviceresource.h index 4756e9dc..ded05234 100644 --- a/src/backend/dbus-interface/kylinnetworkdeviceresource.h +++ b/src/backend/dbus-interface/kylinnetworkdeviceresource.h @@ -4,7 +4,7 @@ * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or + * the Free Software Foundation; either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, diff --git a/src/backend/dbus-interface/kylinnetworkresourcemanager.cpp b/src/backend/dbus-interface/kylinnetworkresourcemanager.cpp index 31b6ccfd..e0a0323e 100644 --- a/src/backend/dbus-interface/kylinnetworkresourcemanager.cpp +++ b/src/backend/dbus-interface/kylinnetworkresourcemanager.cpp @@ -26,7 +26,6 @@ #define LOG_FLAG "[KyNetworkResourceManager]" - QString enumToQstring(NetworkManager::AccessPoint::Capabilities cap, NetworkManager::AccessPoint::WpaFlags wpa_flags,NetworkManager::AccessPoint::WpaFlags rsn_flags) { QString out; diff --git a/src/backend/dbus-interface/kylinutil.cpp b/src/backend/dbus-interface/kylinutil.cpp index 7f307eb3..095c75fc 100644 --- a/src/backend/dbus-interface/kylinutil.cpp +++ b/src/backend/dbus-interface/kylinutil.cpp @@ -4,7 +4,7 @@ * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or + * the Free Software Foundation; either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, @@ -89,6 +89,7 @@ QString getSsidFromByteArray(QByteArray &rawSsid) { wifiSsid = rawSsid; } + return wifiSsid; } diff --git a/src/backend/dbus-interface/kylinutil.h b/src/backend/dbus-interface/kylinutil.h index 3925b419..df700699 100644 --- a/src/backend/dbus-interface/kylinutil.h +++ b/src/backend/dbus-interface/kylinutil.h @@ -4,7 +4,7 @@ * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or + * the Free Software Foundation; either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, diff --git a/src/backend/dbus-interface/kylinvpnconnectitem.cpp b/src/backend/dbus-interface/kylinvpnconnectitem.cpp index 7eb0c5be..5816330a 100644 --- a/src/backend/dbus-interface/kylinvpnconnectitem.cpp +++ b/src/backend/dbus-interface/kylinvpnconnectitem.cpp @@ -4,7 +4,7 @@ * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or + * the Free Software Foundation; either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, diff --git a/src/backend/dbus-interface/kylinvpnconnectitem.h b/src/backend/dbus-interface/kylinvpnconnectitem.h index 704cc3ae..84b249e1 100644 --- a/src/backend/dbus-interface/kylinvpnconnectitem.h +++ b/src/backend/dbus-interface/kylinvpnconnectitem.h @@ -4,7 +4,7 @@ * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or + * the Free Software Foundation; either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, diff --git a/src/backend/dbus-interface/kylinvpnrequest.h b/src/backend/dbus-interface/kylinvpnrequest.h index 266f085e..5bbf9beb 100644 --- a/src/backend/dbus-interface/kylinvpnrequest.h +++ b/src/backend/dbus-interface/kylinvpnrequest.h @@ -4,7 +4,7 @@ * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or + * the Free Software Foundation; either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, diff --git a/src/backend/dbus-interface/kylinwiredconnectoperation.h b/src/backend/dbus-interface/kylinwiredconnectoperation.h index a2bbd6e6..11f3afa5 100644 --- a/src/backend/dbus-interface/kylinwiredconnectoperation.h +++ b/src/backend/dbus-interface/kylinwiredconnectoperation.h @@ -4,7 +4,7 @@ * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or + * the Free Software Foundation; either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, @@ -52,7 +52,6 @@ public: Q_SIGNALS: void wiredEnabledChanged(bool); - private: void getActiveConnection(QString &deviceName, QString &connectUuid); void saveActiveConnection(QString &deviceName, QString &connectUuid); diff --git a/src/backend/dbus-interface/kywirelessconnectoperation.cpp b/src/backend/dbus-interface/kywirelessconnectoperation.cpp index 4a1cc199..c2993394 100644 --- a/src/backend/dbus-interface/kywirelessconnectoperation.cpp +++ b/src/backend/dbus-interface/kywirelessconnectoperation.cpp @@ -4,7 +4,7 @@ * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or + * the Free Software Foundation; either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, @@ -1224,6 +1224,7 @@ void KyWirelessConnectOperation::updateWirelessApSetting( wirelessSecuritySetting->setKeyMgmt(NetworkManager::WirelessSecuritySetting::WpaPsk); wirelessSecuritySetting->setPsk(apPassword); } + apConnectPtr->update(apConnectSettingPtr->toMap()); QStringList blackList = getBlackListHostName(apConnectPtr->path()); NMVariantMapMap newMap = apConnectSettingPtr->toMap(); @@ -1234,6 +1235,7 @@ void KyWirelessConnectOperation::updateWirelessApSetting( } } apConnectPtr->update(newMap); + usleep(100*1000); } void KyWirelessConnectOperation::activeWirelessAp(const QString apUuid, const QString apName, diff --git a/src/backend/dbus-interface/kywirelessconnectoperation.h b/src/backend/dbus-interface/kywirelessconnectoperation.h index 2ac4e021..f23ea505 100644 --- a/src/backend/dbus-interface/kywirelessconnectoperation.h +++ b/src/backend/dbus-interface/kywirelessconnectoperation.h @@ -4,7 +4,7 @@ * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or + * the Free Software Foundation; either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, diff --git a/src/backend/dbus-interface/kywirelessnetitem.cpp b/src/backend/dbus-interface/kywirelessnetitem.cpp index d0ef888d..1826cbf6 100644 --- a/src/backend/dbus-interface/kywirelessnetitem.cpp +++ b/src/backend/dbus-interface/kywirelessnetitem.cpp @@ -4,7 +4,7 @@ * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or + * the Free Software Foundation; either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, @@ -177,7 +177,7 @@ void KyWirelessNetItem::setKySecuType(QString strSecuType) if (strSecuType.indexOf(ENTERPRICE_TYPE) >= 0) { m_kySecuType = WPA_AND_WPA2_ENTERPRISE; } else if (strSecuType.indexOf(WPA3) >= 0) { - if ( strSecuType.indexOf(WPA1) >= 0 || strSecuType.indexOf(WPA2) >= 0) { + if (strSecuType.indexOf(WPA1) >= 0 || strSecuType.indexOf(WPA2) >= 0) { m_kySecuType = WPA_AND_WPA3; } else { m_kySecuType = WPA3_PERSONAL; diff --git a/src/backend/dbus-interface/kywirelessnetitem.h b/src/backend/dbus-interface/kywirelessnetitem.h index 9533e6b4..2a5a4682 100644 --- a/src/backend/dbus-interface/kywirelessnetitem.h +++ b/src/backend/dbus-interface/kywirelessnetitem.h @@ -4,7 +4,7 @@ * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or + * the Free Software Foundation; either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, diff --git a/src/backend/dbus-interface/kywirelessnetresource.cpp b/src/backend/dbus-interface/kywirelessnetresource.cpp index 6dd560fb..db880c5e 100644 --- a/src/backend/dbus-interface/kywirelessnetresource.cpp +++ b/src/backend/dbus-interface/kywirelessnetresource.cpp @@ -4,7 +4,7 @@ * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or + * the Free Software Foundation; either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, diff --git a/src/backend/dbus-interface/kywirelessnetresource.h b/src/backend/dbus-interface/kywirelessnetresource.h index 07ea5cce..96d7cb4b 100644 --- a/src/backend/dbus-interface/kywirelessnetresource.h +++ b/src/backend/dbus-interface/kywirelessnetresource.h @@ -4,7 +4,7 @@ * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or + * the Free Software Foundation; either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, diff --git a/src/backend/dbus-interface/nm-macros-internal.h b/src/backend/dbus-interface/nm-macros-internal.h index 025108a4..fb76cafa 100644 --- a/src/backend/dbus-interface/nm-macros-internal.h +++ b/src/backend/dbus-interface/nm-macros-internal.h @@ -1,10 +1,11 @@ + /* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- * * Copyright (C) 2022 Tianjin KYLIN Information Technology Co., Ltd. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or + * the Free Software Foundation; either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, diff --git a/src/backend/dbusadaptor.h b/src/backend/dbusadaptor.h index a6fa6a8d..85caa385 100644 --- a/src/backend/dbusadaptor.h +++ b/src/backend/dbusadaptor.h @@ -117,7 +117,6 @@ Q_SIGNALS: // SIGNALS void hotspotDeactivated(QString devName, QString ssid); //热点连接 void hotspotActivated(QString devName, QString ssid, QString uuid, QString activePath, QString settingPath); - //信号强度变化 void signalStrengthChange(QString devName, QString ssid, int strength); //安全性变化 diff --git a/src/backend/kylinarping.h b/src/backend/kylinarping.h index b1aa98be..963b3321 100644 --- a/src/backend/kylinarping.h +++ b/src/backend/kylinarping.h @@ -4,7 +4,7 @@ * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or + * the Free Software Foundation; either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, diff --git a/src/backend/kylinipv4arping.cpp b/src/backend/kylinipv4arping.cpp index 2cbdefbe..c1939085 100644 --- a/src/backend/kylinipv4arping.cpp +++ b/src/backend/kylinipv4arping.cpp @@ -4,7 +4,7 @@ * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or + * the Free Software Foundation; either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, diff --git a/src/backend/kylinipv4arping.h b/src/backend/kylinipv4arping.h index 9aa9cb91..14414df1 100644 --- a/src/backend/kylinipv4arping.h +++ b/src/backend/kylinipv4arping.h @@ -4,7 +4,7 @@ * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or + * the Free Software Foundation; either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, diff --git a/src/backend/kylinipv6arping.cpp b/src/backend/kylinipv6arping.cpp index a6969a6b..4b0917cf 100644 --- a/src/backend/kylinipv6arping.cpp +++ b/src/backend/kylinipv6arping.cpp @@ -4,7 +4,7 @@ * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or + * the Free Software Foundation; either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, diff --git a/src/backend/kylinipv6arping.h b/src/backend/kylinipv6arping.h index faa08c25..3577dcc4 100644 --- a/src/backend/kylinipv6arping.h +++ b/src/backend/kylinipv6arping.h @@ -4,7 +4,7 @@ * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or + * the Free Software Foundation; either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, diff --git a/src/backend/vpndbusadaptor.cpp b/src/backend/vpndbusadaptor.cpp new file mode 100644 index 00000000..4d3aa93d --- /dev/null +++ b/src/backend/vpndbusadaptor.cpp @@ -0,0 +1,72 @@ +/* + * This file was generated by qdbusxml2cpp version 0.8 + * Command line was: qdbusxml2cpp com.kylin.weather.xml -a VpnDbusAdaptor -c VpnDbusAdaptor -l MainWindow + * + * qdbusxml2cpp is Copyright (C) 2015 The Qt Company Ltd. + * + * This is an auto-generated file. + * Do not edit! All changes made to it will be lost. + */ + +#include "vpndbusadaptor.h" +#include +#include +#include +#include +#include +#include +#include + +/* + * Implementation of adaptor class VpnDbusAdaptor + */ + +VpnDbusAdaptor::VpnDbusAdaptor(vpnObject *parent) + : QDBusAbstractAdaptor(parent) +{ + // constructor + qDBusRegisterMetaType >(); + qDBusRegisterMetaType >(); + qDBusRegisterMetaType >(); + //setAutoRelaySignals(true)后会自动转发mainwindow发出的同名信号,因此不必再额外写一个转发 + setAutoRelaySignals(true); +} + +VpnDbusAdaptor::~VpnDbusAdaptor() +{ + // destructor +} + +//虚拟连接列表 +QVector VpnDbusAdaptor::getVirtualList() +{ + QVector vector; + parent()->getVirtualList(vector); + return vector; +} + +//删除 +void VpnDbusAdaptor::deleteVpn(QString uuid) +{ + qDebug() << "delete vpn" << uuid; + parent()->deleteVpn(uuid); +} + +//连接 根据网卡类型 参数1 0:lan 1:wlan 参数3 为ssid/uuid +void VpnDbusAdaptor::activateVpn(const QString& connUuid) +{ + qDebug() << "activate vpn" << connUuid; + parent()->activateVpn(connUuid); +} + +//断开连接 根据网卡类型 参数1 0:lan 1:wlan 参数3 为ssid/uuid +void VpnDbusAdaptor::deactivateVpn(const QString& connUuid) +{ + qDebug() << "deactivate vpn" << connUuid; + parent()->deactivateVpn(connUuid); +} + +void VpnDbusAdaptor::showKylinVpn() +{ + parent()->onShowMainWindow(); +} diff --git a/src/backend/vpndbusadaptor.h b/src/backend/vpndbusadaptor.h new file mode 100644 index 00000000..06c09f30 --- /dev/null +++ b/src/backend/vpndbusadaptor.h @@ -0,0 +1,71 @@ +/* + * This file was generated by qdbusxml2cpp version 0.8 + * Command line was: qdbusxml2cpp com.kylin.weather.xml -a dbusadaptor -c DbusAdaptor -l MainWindow + * + * qdbusxml2cpp is Copyright (C) 2015 The Qt Company Ltd. + * + * This is an auto-generated file. + * This file may have been hand-edited. Look for HAND-EDIT comments + * before re-generating it. + */ + +#ifndef VPNDBUSADAPTOR_H +#define VPNDBUSADAPTOR_H + +#include +#include +#include + +#include "singlepage.h" +#include "../dbus-interface/kylinnetworkdeviceresource.h" +QT_BEGIN_NAMESPACE +class QByteArray; +//template class QList; +template class QMap; +class QString; +class QStringList; +class QVariant; +template class QVector; +QT_END_NAMESPACE + +/* + * Adaptor class for interface com.kylin.weather + */ + +#include "vpnobject.h" + +class VpnDbusAdaptor: public QDBusAbstractAdaptor +{ + Q_OBJECT + Q_CLASSINFO("D-Bus Interface", "com.kylin.vpnTool") +public: + VpnDbusAdaptor(vpnObject *parent); + virtual ~VpnDbusAdaptor(); + + inline vpnObject *parent() const + { return static_cast(QObject::parent()); } + +public: // PROPERTIES +public Q_SLOTS: // METHODS + //虚拟连接列表 + QVector getVirtualList(); + //刪除 根据网络名称 参数1 0:lan 1:wlan 参数2 为ssid/uuid + Q_NOREPLY void deleteVpn(QString uuid); + //连接 根据网卡类型 参数1 0:lan 1:wlan 参数3 为ssid/uuid + Q_NOREPLY void activateVpn(const QString& connUuid); + //断开连接 根据网卡类型 参数1 0:lan 1:wlan 参数3 为ssid/uuid + Q_NOREPLY void deactivateVpn(const QString& connUuid); + //just show + void showKylinVpn(); + +Q_SIGNALS: // SIGNALS + void vpnAdd(QStringList info); + void vpnRemove(QString dbusPath); + void vpnUpdate(QStringList info); + void vpnActiveConnectionStateChanged(QString uuid, int status); + + void activateFailed(QString errorMessage); + void deactivateFailed(QString errorMessage); +}; + +#endif diff --git a/src/backend/wifi-auth-thread.cpp b/src/backend/wifi-auth-thread.cpp index a53b8e83..216f2197 100644 --- a/src/backend/wifi-auth-thread.cpp +++ b/src/backend/wifi-auth-thread.cpp @@ -4,7 +4,7 @@ * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or + * the Free Software Foundation; either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, diff --git a/src/backend/wifi-auth-thread.h b/src/backend/wifi-auth-thread.h index ab461685..be2a710f 100644 --- a/src/backend/wifi-auth-thread.h +++ b/src/backend/wifi-auth-thread.h @@ -4,7 +4,7 @@ * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or + * the Free Software Foundation; either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, diff --git a/src/frontend/customstyle.cpp b/src/frontend/customstyle.cpp index 829550f9..3c7ae28b 100644 --- a/src/frontend/customstyle.cpp +++ b/src/frontend/customstyle.cpp @@ -4,7 +4,7 @@ * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or + * the Free Software Foundation; either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, diff --git a/src/frontend/customstyle.h b/src/frontend/customstyle.h index db7f0c1b..8770d208 100644 --- a/src/frontend/customstyle.h +++ b/src/frontend/customstyle.h @@ -4,7 +4,7 @@ * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or + * the Free Software Foundation; either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, diff --git a/src/frontend/enterprise-wlan/enterprisewlandialog.cpp b/src/frontend/enterprise-wlan/enterprisewlandialog.cpp index c6a31096..68cf2fcc 100644 --- a/src/frontend/enterprise-wlan/enterprisewlandialog.cpp +++ b/src/frontend/enterprise-wlan/enterprisewlandialog.cpp @@ -4,7 +4,7 @@ * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or + * the Free Software Foundation; either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, diff --git a/src/frontend/enterprise-wlan/enterprisewlandialog.h b/src/frontend/enterprise-wlan/enterprisewlandialog.h index 90925044..50b0ba5c 100644 --- a/src/frontend/enterprise-wlan/enterprisewlandialog.h +++ b/src/frontend/enterprise-wlan/enterprisewlandialog.h @@ -4,7 +4,7 @@ * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or + * the Free Software Foundation; either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, diff --git a/src/frontend/list-items/lanlistitem.cpp b/src/frontend/list-items/lanlistitem.cpp index 7af39fab..4ff1896d 100644 --- a/src/frontend/list-items/lanlistitem.cpp +++ b/src/frontend/list-items/lanlistitem.cpp @@ -4,7 +4,7 @@ * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or + * the Free Software Foundation; either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, @@ -35,7 +35,6 @@ LanListItem::LanListItem(const KyConnectItem *lanConnectItem, connectItemCopy(lanConnectItem); m_deviceName = deviceName; - m_nameLabel->setLabelText(m_lanConnectItem.m_connectName); m_netButton->setButtonIcon(QIcon::fromTheme("network-wired-connected-symbolic")); @@ -189,7 +188,7 @@ void LanListItem::onInfoButtonClicked() << m_lanConnectItem.m_connectUuid << "; name = " << m_lanConnectItem.m_connectName << "." <addWidget(m_itemFrame); m_hoverButton->hide(); - // this->setAutoFillBackground(true); // this->setBackgroundRole(QPalette::Base); // QPalette pal = qApp->palette(); @@ -344,7 +343,6 @@ void ListItem::onPaletteChanged() } } - NameLabel::NameLabel(QWidget *parent) :QLabel(parent) { diff --git a/src/frontend/list-items/listitem.h b/src/frontend/list-items/listitem.h index 7789e3b3..de697aa4 100644 --- a/src/frontend/list-items/listitem.h +++ b/src/frontend/list-items/listitem.h @@ -4,7 +4,7 @@ * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or + * the Free Software Foundation; either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, @@ -114,8 +114,6 @@ protected: ConnectState m_connectState; QMenu *m_menu = nullptr; - - public: QVBoxLayout * m_mainLayout = nullptr; QHBoxLayout * m_hItemLayout = nullptr; diff --git a/src/frontend/list-items/vpnlistitem.cpp b/src/frontend/list-items/vpnlistitem.cpp new file mode 100644 index 00000000..6e68776e --- /dev/null +++ b/src/frontend/list-items/vpnlistitem.cpp @@ -0,0 +1,213 @@ +/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * + * Copyright (C) 2022 Tianjin KYLIN Information Technology Co., Ltd. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. + * + */ +#include "vpnlistitem.h" +#include "backend/dbus-interface/kylinconnectitem.h" + +#include + +#define LOG_FLAG "[VpnListItem]" + +VpnListItem::VpnListItem(const KyConnectItem *lanConnectItem, QWidget *parent):ListItem(parent) +{ + m_connectOperation = new KyWiredConnectOperation(this); + m_deviceResource = new KyNetworkDeviceResourse(this); + + connectItemCopy(lanConnectItem); + + m_nameLabel->setText(m_vpnConnectItem.m_connectName); + m_netButton->setButtonIcon(QIcon::fromTheme("ukui-vpn-symbolic")); + + qDebug() << "VpnListItem init:" << m_vpnConnectItem.m_connectName << m_vpnConnectItem.m_connectState << m_vpnConnectItem.m_ifaceName; + + if (Deactivated == m_vpnConnectItem.m_connectState || Activated == m_vpnConnectItem.m_connectState) { + m_netButton->stopLoading(); + if (m_vpnConnectItem.m_connectState == Activated) { + setIcon(true); + } else { + setIcon(false); + } + } else { + m_netButton->startLoading(); + } + + m_itemFrame->installEventFilter(this); + connect(this->m_infoButton, &InfoButton::clicked, this, &VpnListItem::onInfoButtonClicked); + connect(m_menu, &QMenu::triggered, this, &VpnListItem::onMenuTriggered); +} + + +VpnListItem::VpnListItem(QWidget *parent) : ListItem(parent) +{ + m_isActive = false; + m_netButton->setButtonIcon(QIcon::fromTheme("ukui-vpn-symbolic")); + setIcon(false); + const QString str=tr("Not connected"); + m_nameLabel->setText(str); + this->m_infoButton->hide(); +} + +VpnListItem::~VpnListItem() +{ + qDebug()<<"[LanPage] lan list item is deleted." << m_vpnConnectItem.m_connectName; +} + +void VpnListItem::setIcon(bool isOn) +{ + if (isOn) { + m_netButton->setActive(true); //设置图标显示不同颜色 + } else { + m_netButton->setActive(false); + } +} + +void VpnListItem::connectItemCopy(const KyConnectItem *lanConnectItem) +{ + if (lanConnectItem) { + m_vpnConnectItem.m_connectName = lanConnectItem->m_connectName; + m_vpnConnectItem.m_connectPath = lanConnectItem->m_connectPath; + m_vpnConnectItem.m_connectState = lanConnectItem->m_connectState; + m_vpnConnectItem.m_connectUuid = lanConnectItem->m_connectUuid; + m_vpnConnectItem.m_ifaceName = lanConnectItem->m_ifaceName; + m_vpnConnectItem.m_itemType = lanConnectItem->m_itemType; + } else { + qDebug() << LOG_FLAG <<"the connect item is nullptr"; + m_vpnConnectItem.m_connectName = ""; + m_vpnConnectItem.m_connectPath = ""; + m_vpnConnectItem.m_connectState = NetworkManager::ActiveConnection::State::Unknown; + m_vpnConnectItem.m_connectUuid = ""; + m_vpnConnectItem.m_ifaceName = ""; + m_vpnConnectItem.m_itemType = NetworkManager::ConnectionSettings::ConnectionType::Unknown; + } + + return; +} + +//void VpnListItem::changeState(QString uuid, +// NetworkManager::ActiveConnection::State state, +// NetworkManager::ActiveConnection::Reason reason) +//{ + +//} + +void VpnListItem::onNetButtonClicked() +{ + if (m_vpnConnectItem.m_connectUuid.isEmpty()) { + qDebug()<<"--cxc--"<activateVpnConnection(m_vpnConnectItem.m_connectUuid); + qDebug() << LOG_FLAG << "it will activate connection" << m_vpnConnectItem.m_connectName; + m_netButton->startLoading(); + } else { + qDebug() << LOG_FLAG <<"the connection" << m_vpnConnectItem.m_connectName + << "is not deactived, so it can not be operation."; + } + + return; + +} + +void VpnListItem::onRightButtonClicked() +{ + //右键点击事件 + qDebug()<< LOG_FLAG <<"onRightButtonClicked"; + if (!m_menu) { + return; + } + + m_menu->clear(); + if (Activated == m_vpnConnectItem.m_connectState || Activating == m_vpnConnectItem.m_connectState) { + m_menu->addAction(new QAction(tr("Disconnect"), this)); + } else if (Deactivated == m_vpnConnectItem.m_connectState) { + m_menu->addAction(new QAction(tr("Connect"), this)); + } else { + return; + } + + m_menu->move(cursor().pos()); + m_menu->show(); + return; +} + +void VpnListItem::onMenuTriggered(QAction *action) +{ + if (action->text() == tr("Connect")) { + this->onNetButtonClicked(); + } else if (action->text() == tr("Disconnect")) { + m_connectOperation->deactivateWiredConnection(m_vpnConnectItem.m_connectName, m_vpnConnectItem.m_connectUuid); + qDebug() << LOG_FLAG << "it will disconnect connection" << m_vpnConnectItem.m_connectName; + m_netButton->startLoading(); + } + return; +} + + +void VpnListItem::onInfoButtonClicked() +{ + //openKylin 优先做出infoButton功能,等自研详情页面做好后合入 + QString cmd = "nm-connection-editor"; + QProcess process(this); + process.startDetached(cmd); + return; +} + +void VpnListItem::updateConnectionState(ConnectState state) +{ + m_vpnConnectItem.m_connectState = (NetworkManager::ActiveConnection::State)state; + + if (Deactivated == state || Activated == state) { + m_netButton->stopLoading(); + if (state == Activated) { + setIcon(true); + } else { + setIcon(false); + } + } else { + m_netButton->startLoading(); + } + + return; +} + +QString VpnListItem::getConnectionName() +{ + return m_vpnConnectItem.m_connectName; +} + +void VpnListItem::updateConnectionName(QString connectionName) +{ + m_vpnConnectItem.m_connectName = connectionName; + m_nameLabel->setText(m_vpnConnectItem.m_connectName); + return; +} + +QString VpnListItem::getConnectionPath() +{ + return m_vpnConnectItem.m_connectPath; +} + +void VpnListItem::updateConnectionPath(QString connectionPath) +{ + m_vpnConnectItem.m_connectPath = connectionPath; +} diff --git a/src/frontend/list-items/vpnlistitem.h b/src/frontend/list-items/vpnlistitem.h new file mode 100644 index 00000000..369fdafd --- /dev/null +++ b/src/frontend/list-items/vpnlistitem.h @@ -0,0 +1,69 @@ +/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * + * Copyright (C) 2022 Tianjin KYLIN Information Technology Co., Ltd. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. + * + */ +#ifndef VPNLISTITEM_H +#define VPNLISTITEM_H +#include "listitem.h" +#include "kylinactiveconnectresource.h" + +#include +#include +#include + +class VpnListItem : public ListItem +{ + Q_OBJECT + +public: + VpnListItem(const KyConnectItem *lanConnectItem, QWidget *parent = nullptr); + VpnListItem(QWidget *parent = nullptr); + + ~VpnListItem(); + +public: + void updateConnectionState(ConnectState state); + + QString getConnectionName(); + void updateConnectionName(QString connectionName); + + QString getConnectionPath(); + void updateConnectionPath(QString connectionPath); + +protected: + void setIcon(bool isOn); + void onRightButtonClicked(); + +private: + void connectItemCopy(const KyConnectItem *lanConnectItem); + +private Q_SLOTS: + void onInfoButtonClicked(); + void onNetButtonClicked(); + void onMenuTriggered(QAction *action); + +private: + KyConnectItem m_vpnConnectItem; + + KyWiredConnectOperation *m_connectOperation = nullptr; + KyNetworkDeviceResourse *m_deviceResource = nullptr; + + QString m_deviceName = ""; +}; + +#endif // VPNLISTITEM_H diff --git a/src/frontend/list-items/wlanlistitem.cpp b/src/frontend/list-items/wlanlistitem.cpp index 767b31b2..bcd5aca7 100644 --- a/src/frontend/list-items/wlanlistitem.cpp +++ b/src/frontend/list-items/wlanlistitem.cpp @@ -4,7 +4,7 @@ * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or + * the Free Software Foundation; either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, @@ -181,7 +181,6 @@ void WlanListItem::onRightButtonClicked() return; } - if (m_wirelessNetItem.m_isConfigured) { m_menu->addAction(new QAction(tr("Property"), this)); m_menu->addAction(new QAction(tr("Forget"), this)); @@ -695,7 +694,6 @@ void WlanListItem::forgetPwd() } } - void WlanListItem::setFrequency() { uint freq = m_wirelessNetItem.m_frequency; diff --git a/src/frontend/list-items/wlanlistitem.h b/src/frontend/list-items/wlanlistitem.h index ab28e729..21b65ce0 100644 --- a/src/frontend/list-items/wlanlistitem.h +++ b/src/frontend/list-items/wlanlistitem.h @@ -4,7 +4,7 @@ * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or + * the Free Software Foundation; either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, @@ -61,6 +61,7 @@ public: public: QString getSsid(); + QString getUuid(); QString getPath(); diff --git a/src/frontend/list-items/wlanmoreitem.cpp b/src/frontend/list-items/wlanmoreitem.cpp index 576e3363..27bfff52 100644 --- a/src/frontend/list-items/wlanmoreitem.cpp +++ b/src/frontend/list-items/wlanmoreitem.cpp @@ -4,7 +4,7 @@ * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or + * the Free Software Foundation; either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, diff --git a/src/frontend/list-items/wlanmoreitem.h b/src/frontend/list-items/wlanmoreitem.h index 81218517..808f40de 100644 --- a/src/frontend/list-items/wlanmoreitem.h +++ b/src/frontend/list-items/wlanmoreitem.h @@ -4,7 +4,7 @@ * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or + * the Free Software Foundation; either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, diff --git a/src/frontend/mainwindow.cpp b/src/frontend/mainwindow.cpp index d8754ee1..58edc789 100644 --- a/src/frontend/mainwindow.cpp +++ b/src/frontend/mainwindow.cpp @@ -4,7 +4,7 @@ * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or + * the Free Software Foundation; either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, @@ -154,11 +154,13 @@ void MainWindow::firstlyStart() { initWindowProperties(); initTransparency(); + registerTrayIcon(); initUI(); initDbusConnnect(); initWindowTheme(); initTrayIcon(); initPlatform(); + installEventFilter(this); m_secondaryStartTimer = new QTimer(this); connect(m_secondaryStartTimer, &QTimer::timeout, this, [ = ]() { m_secondaryStartTimer->stop(); @@ -229,6 +231,30 @@ void MainWindow::initWindowProperties() } } +/** + * @brief MainWindow::registerTrayIcon 注册托盘图标 + */ +void MainWindow::registerTrayIcon() +{ + m_registerCount++; + if (QSystemTrayIcon::isSystemTrayAvailable() || m_registerCount > 10) { + m_trayIcon = new QSystemTrayIcon(); + if (nullptr == m_trayIcon) { + qWarning()<< "分配空间trayIcon失败"; + return ; + } + m_trayIcon->setIcon(QIcon::fromTheme("network-wired-signal-excellent-symbolic")); + m_trayIcon->setToolTip(QString(tr("kylin-nm"))); + + } else { + if (m_registerCount <= 10) { + QTimer::singleShot(m_intervalTime,[this] { + registerTrayIcon(); + }); + } + } +} + void MainWindow::paintEvent(QPaintEvent *event) { QPainter painter(this); @@ -238,6 +264,21 @@ void MainWindow::paintEvent(QPaintEvent *event) // painter.drawRoundedRect(rect, 12, 12); //窗口圆角 } +bool MainWindow::eventFilter(QObject *watched, QEvent *event) +{ + if (watched == this) { + //失焦退出 + if (event->type() == QEvent::ActivationChange) { + if (QApplication::activeWindow() != this) { + hideMainwindow(); + return true; + } + } + } + + return QObject::eventFilter(watched, event); +} + void MainWindow::initTransparency() { if(QGSettings::isSchemaInstalled(TRANSPARENCY_GSETTINGS)) { @@ -325,7 +366,6 @@ void MainWindow::initTrayIcon() iconTimer = new QTimer(this); connect(iconTimer, &QTimer::timeout, this, &MainWindow::onSetTrayIconLoading); - m_trayIcon = new QSystemTrayIcon(); m_trayIconMenu = new QMenu(); m_showMainwindowAction = new QAction(tr("Show MainWindow"),this); m_showSettingsAction = new QAction(tr("Settings"),this); @@ -334,7 +374,6 @@ void MainWindow::initTrayIcon() // m_trayIconMenu->addAction(m_showMainwindowAction); m_trayIconMenu->addAction(m_showSettingsAction); m_trayIcon->setContextMenu(m_trayIconMenu); - m_trayIcon->setIcon(QIcon::fromTheme("network-wired-signal-excellent-symbolic")); iconStatus = IconActiveType::LAN_CONNECTED; onRefreshTrayIcon(); @@ -396,7 +435,6 @@ void MainWindow::initDbusConnnect() hideMainwindow(); } }); - } /** @@ -981,6 +1019,7 @@ void MainWindow::showCreateWiredConnectWidget(const QString devName) if (m_createPagePtrMap.contains(devName)) { if (m_createPagePtrMap[devName] != nullptr) { qDebug() << "showCreateWiredConnectWidget" << devName << "already create,just raise"; + KWindowSystem::activateWindow(m_createPagePtrMap[devName]->winId()); KWindowSystem::raiseWindow(m_createPagePtrMap[devName]->winId()); return; @@ -994,6 +1033,8 @@ void MainWindow::showCreateWiredConnectWidget(const QString devName) }); m_createPagePtrMap.insert(devName, netDetail); netDetail->show(); + KWindowSystem::raiseWindow(netDetail->winId()); + netDetail->centerToScreen(); } void MainWindow::showAddOtherWlanWidget(QString devName) diff --git a/src/frontend/mainwindow.h b/src/frontend/mainwindow.h index 4bf843e2..770580ea 100644 --- a/src/frontend/mainwindow.h +++ b/src/frontend/mainwindow.h @@ -4,7 +4,7 @@ * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or + * the Free Software Foundation; either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, @@ -138,11 +138,13 @@ Q_SIGNALS: void mainWindowVisibleChanged(const bool &visible); //列表排序 void timeToUpdate(); + public Q_SLOTS: protected: void keyPressEvent(QKeyEvent *event); void paintEvent(QPaintEvent *event); + bool eventFilter(QObject *watched, QEvent *event); private: void firstlyStart(); //一级启动 @@ -155,13 +157,14 @@ private: void paintWithTrans(); void initUI(); void initDbusConnnect(); + void registerTrayIcon(); void initTrayIcon(); - void resetTrayIconTool(); void initWindowTheme(); void resetWindowTheme(); void showControlCenter(); void showByWaylandHelper(); + void setCentralWidgetType(IconActiveType iconStatus); void assembleTrayIconTooltip(QMap &map, QString &tip); void setThemePalette(); @@ -205,6 +208,9 @@ private: NetworkMode *m_networkMode; + uint m_intervalTime = 100; + uint m_registerCount = 0; + public Q_SLOTS: void onShowMainWindow(int type); diff --git a/src/frontend/netdetails/configpage.cpp b/src/frontend/netdetails/configpage.cpp index c4e63980..7c98d0a0 100644 --- a/src/frontend/netdetails/configpage.cpp +++ b/src/frontend/netdetails/configpage.cpp @@ -4,7 +4,7 @@ * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or + * the Free Software Foundation; either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, diff --git a/src/frontend/netdetails/configpage.h b/src/frontend/netdetails/configpage.h index bc35baa2..5eecf48c 100644 --- a/src/frontend/netdetails/configpage.h +++ b/src/frontend/netdetails/configpage.h @@ -4,7 +4,7 @@ * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or + * the Free Software Foundation; either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, diff --git a/src/frontend/netdetails/coninfo.h b/src/frontend/netdetails/coninfo.h index 1527424e..a2968979 100644 --- a/src/frontend/netdetails/coninfo.h +++ b/src/frontend/netdetails/coninfo.h @@ -4,7 +4,7 @@ * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or + * the Free Software Foundation; either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, diff --git a/src/frontend/netdetails/creatnetpage.cpp b/src/frontend/netdetails/creatnetpage.cpp index cc15c003..98781006 100644 --- a/src/frontend/netdetails/creatnetpage.cpp +++ b/src/frontend/netdetails/creatnetpage.cpp @@ -4,7 +4,7 @@ * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or + * the Free Software Foundation; either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, @@ -277,6 +277,7 @@ void CreatNetPage::constructIpv4Info(KyConnectSetting &setting) setting.setIpConfigType(IPADDRESS_V4, CONFIG_IP_MANUAL); setting.ipv4AddressConstruct(ipv4address, netMask, gateWay); } + setting.ipv4DnsConstruct(ipv4dnsList); } diff --git a/src/frontend/netdetails/creatnetpage.h b/src/frontend/netdetails/creatnetpage.h index d64060d3..8edc3c88 100644 --- a/src/frontend/netdetails/creatnetpage.h +++ b/src/frontend/netdetails/creatnetpage.h @@ -4,7 +4,7 @@ * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or + * the Free Software Foundation; either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, diff --git a/src/frontend/netdetails/customtabstyle.cpp b/src/frontend/netdetails/customtabstyle.cpp index 23e0745d..8db78b10 100644 --- a/src/frontend/netdetails/customtabstyle.cpp +++ b/src/frontend/netdetails/customtabstyle.cpp @@ -4,7 +4,7 @@ * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or + * the Free Software Foundation; either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, diff --git a/src/frontend/netdetails/customtabstyle.h b/src/frontend/netdetails/customtabstyle.h index 005ddef0..6fe7b76e 100644 --- a/src/frontend/netdetails/customtabstyle.h +++ b/src/frontend/netdetails/customtabstyle.h @@ -4,7 +4,7 @@ * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or + * the Free Software Foundation; either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, diff --git a/src/frontend/netdetails/detailpage.cpp b/src/frontend/netdetails/detailpage.cpp index 2b6cbcf5..07b97a51 100644 --- a/src/frontend/netdetails/detailpage.cpp +++ b/src/frontend/netdetails/detailpage.cpp @@ -4,7 +4,7 @@ * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or + * the Free Software Foundation; either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, diff --git a/src/frontend/netdetails/detailpage.h b/src/frontend/netdetails/detailpage.h index 78f3413f..36eb7b02 100644 --- a/src/frontend/netdetails/detailpage.h +++ b/src/frontend/netdetails/detailpage.h @@ -4,7 +4,7 @@ * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or + * the Free Software Foundation; either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, diff --git a/src/frontend/netdetails/detailwidget.cpp b/src/frontend/netdetails/detailwidget.cpp index 8a02c59a..543e0791 100644 --- a/src/frontend/netdetails/detailwidget.cpp +++ b/src/frontend/netdetails/detailwidget.cpp @@ -4,7 +4,7 @@ * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or + * the Free Software Foundation; either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, diff --git a/src/frontend/netdetails/detailwidget.h b/src/frontend/netdetails/detailwidget.h index dcfa6c28..13922894 100644 --- a/src/frontend/netdetails/detailwidget.h +++ b/src/frontend/netdetails/detailwidget.h @@ -4,7 +4,7 @@ * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or + * the Free Software Foundation; either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, @@ -41,7 +41,6 @@ private: QWidget *m_copyButton; void initUI(); - }; #endif // DetailWidget_H diff --git a/src/frontend/netdetails/ipv4page.cpp b/src/frontend/netdetails/ipv4page.cpp index 2fab2abc..025e312d 100644 --- a/src/frontend/netdetails/ipv4page.cpp +++ b/src/frontend/netdetails/ipv4page.cpp @@ -4,7 +4,7 @@ * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or + * the Free Software Foundation; either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, @@ -97,7 +97,7 @@ void Ipv4Page::initUI() { QRegExp rx("\\b(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\b"); Divider* divider = new Divider(false, this); - m_dnsWidget = new MultipleDnsWidget(rx, true, this); + m_dnsWidget = new MultipleDnsWidget(rx, false, this); m_detailLayout = new QFormLayout(this); m_detailLayout->setVerticalSpacing(0); @@ -142,7 +142,6 @@ void Ipv4Page::initComponent() { connect(ipv4addressEdit, SIGNAL(textChanged(QString)), this, SLOT(onAddressTextChanged())); connect(ipv4addressEdit, SIGNAL(editingFinished()), this, SLOT(onAddressEditFinished())); connect(netMaskEdit, SIGNAL(textChanged(QString)), this, SLOT(onNetMaskTextChanged())); - connect(ipv4ConfigCombox, SIGNAL(currentIndexChanged(int)), this, SLOT(setEnableOfSaveBtn())); connect(ipv4addressEdit, SIGNAL(textChanged(QString)), this, SLOT(setEnableOfSaveBtn())); connect(netMaskEdit, SIGNAL(textChanged(QString)), this, SLOT(setEnableOfSaveBtn())); @@ -288,7 +287,6 @@ void Ipv4Page::onAddressEditFinished() } void Ipv4Page::setLineEnabled(bool check) { - if (!check) { ipv4addressEdit->clear(); netMaskEdit->clear(); @@ -361,7 +359,6 @@ QString Ipv4Page::getNetMaskText(QString text) return QString("%1.%2.%3.%4").arg(list[0],list[1],list[2],list[3]); } - void Ipv4Page::initConflictHintLable() { QIcon icon = QIcon::fromTheme("dialog-warning"); diff --git a/src/frontend/netdetails/ipv4page.h b/src/frontend/netdetails/ipv4page.h index 54521908..3e6bb3e6 100644 --- a/src/frontend/netdetails/ipv4page.h +++ b/src/frontend/netdetails/ipv4page.h @@ -4,7 +4,7 @@ * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or + * the Free Software Foundation; either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, diff --git a/src/frontend/netdetails/ipv6page.cpp b/src/frontend/netdetails/ipv6page.cpp index 535a6eaf..a9cc1bb8 100644 --- a/src/frontend/netdetails/ipv6page.cpp +++ b/src/frontend/netdetails/ipv6page.cpp @@ -4,7 +4,7 @@ * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or + * the Free Software Foundation; either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, @@ -78,7 +78,6 @@ bool Ipv6Page::checkIsChanged(const ConInfo info, KyConnectSetting &setting) qDebug() << "ipv6ConfigType change to Manual"; isChanged = true; } - if(info.strIPV6Address != ipv6AddressEdit->text() || info.iIPV6Prefix != lengthEdit->text().toInt() || info.strIPV6GateWay != gateWayEdit->text()) { @@ -197,7 +196,6 @@ void Ipv6Page::initComponent() { setControlEnabled(true); } connect(ipv6ConfigCombox, SIGNAL(currentIndexChanged(int)), this, SLOT(configChanged(int))); - connect(ipv6AddressEdit, SIGNAL(textChanged(QString)), this, SLOT(onAddressTextChanged())); connect(ipv6AddressEdit, SIGNAL(editingFinished()), this, SLOT(onAddressEidtFinished())); connect(gateWayEdit, SIGNAL(textChanged(QString)), this, SLOT(onGatewayTextChanged())); @@ -388,4 +386,3 @@ void Ipv6Page::showIpv6AddressConflict(bool isConflict) m_textLabel->hide(); } } - diff --git a/src/frontend/netdetails/ipv6page.h b/src/frontend/netdetails/ipv6page.h index 49c5e917..ee6ae0f0 100644 --- a/src/frontend/netdetails/ipv6page.h +++ b/src/frontend/netdetails/ipv6page.h @@ -4,7 +4,7 @@ * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or + * the Free Software Foundation; either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, diff --git a/src/frontend/netdetails/joinhiddenwifipage.cpp b/src/frontend/netdetails/joinhiddenwifipage.cpp index 58eb3537..05db7ef4 100644 --- a/src/frontend/netdetails/joinhiddenwifipage.cpp +++ b/src/frontend/netdetails/joinhiddenwifipage.cpp @@ -4,7 +4,7 @@ * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or + * the Free Software Foundation; either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, @@ -288,3 +288,18 @@ void JoinHiddenWiFiPage::onPaletteChanged() } } #endif + +void JoinHiddenWiFiPage::centerToScreen() +{ + QDesktopWidget* m = QApplication::desktop(); + QRect desk_rect = m->screenGeometry(m->screenNumber(QCursor::pos())); + int desk_x = desk_rect.width(); + int desk_y = desk_rect.height(); + int x = this->width(); + int y = this->height(); +// this->move(desk_x / 2 - x / 2 + desk_rect.left(), desk_y / 2 - y / 2 + desk_rect.top()); + kdk::WindowManager::setGeometry(this->windowHandle(), QRect(desk_x / 2 - x / 2 + desk_rect.left(), + desk_y / 2 - y / 2 + desk_rect.top(), + this->width(), + this->height())); +} diff --git a/src/frontend/netdetails/joinhiddenwifipage.h b/src/frontend/netdetails/joinhiddenwifipage.h index 2242c2cb..2ead94aa 100644 --- a/src/frontend/netdetails/joinhiddenwifipage.h +++ b/src/frontend/netdetails/joinhiddenwifipage.h @@ -4,7 +4,7 @@ * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or + * the Free Software Foundation; either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, @@ -24,7 +24,9 @@ #include #include #include +#include +#include "windowmanager/windowmanager.h" #include "coninfo.h" #include "kywirelessconnectoperation.h" #include "securitypage.h" @@ -43,6 +45,7 @@ public: JoinHiddenWiFiPage(QString devName, KDialog *parent = nullptr); ~JoinHiddenWiFiPage(); + void centerToScreen(); protected: void closeEvent(QCloseEvent *event); diff --git a/src/frontend/netdetails/multiplednswidget.cpp b/src/frontend/netdetails/multiplednswidget.cpp index f79d4e24..4469b27f 100644 --- a/src/frontend/netdetails/multiplednswidget.cpp +++ b/src/frontend/netdetails/multiplednswidget.cpp @@ -4,7 +4,7 @@ * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or + * the Free Software Foundation; either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, @@ -259,7 +259,6 @@ void MultipleDnsWidget::onAddBtnClicked() } row --; } - m_removeDnsBtn->setEnabled(true); } diff --git a/src/frontend/netdetails/multiplednswidget.h b/src/frontend/netdetails/multiplednswidget.h index a89f5d23..44f59717 100644 --- a/src/frontend/netdetails/multiplednswidget.h +++ b/src/frontend/netdetails/multiplednswidget.h @@ -4,7 +4,7 @@ * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or + * the Free Software Foundation; either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, diff --git a/src/frontend/netdetails/netdetail.cpp b/src/frontend/netdetails/netdetail.cpp index dc9d43a8..2bd62d1a 100644 --- a/src/frontend/netdetails/netdetail.cpp +++ b/src/frontend/netdetails/netdetail.cpp @@ -4,7 +4,7 @@ * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or + * the Free Software Foundation; either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, @@ -274,7 +274,6 @@ void NetDetail::paintEvent(QPaintEvent *event) // painter.setBrush(pal.color(QPalette::Base)); // painter.drawRect(this->rect()); // painter.fillRect(rect(), QBrush(pal.color(QPalette::Base))); - return QWidget::paintEvent(event); } @@ -293,11 +292,10 @@ void NetDetail::centerToScreen() int desk_y = desk_rect.height(); int x = this->width(); int y = this->height(); - this->move(desk_x / 2 - x / 2 + desk_rect.left(), desk_y / 2 - y / 2 + desk_rect.top()); -// kdk::WindowManager::setGeometry(this->windowHandle(), QRect(desk_x / 2 - x / 2 + desk_rect.left(), -// desk_y / 2 - y / 2 + desk_rect.top(), -// this->width(), -// this->height())); + kdk::WindowManager::setGeometry(this->windowHandle(), QRect(desk_x / 2 - x / 2 + desk_rect.left(), + desk_y / 2 - y / 2 + desk_rect.top(), + this->width(), + this->height())); } void NetDetail::initUI() @@ -316,6 +314,7 @@ void NetDetail::initUI() ipv6Page = new Ipv6Page(this); securityPage = new SecurityPage(this); createNetPage = new CreatNetPage(this); + configPage = new ConfigPage(this); detailPage->setFixedWidth(PAGE_WIDTH); @@ -587,7 +586,6 @@ void NetDetail::pagePadding(QString netName, bool isWlan) if (isActive && m_networkMode != DBUS_INVAILD && m_networkMode != NO_CONFIG) { configPage->setConfigState(m_networkMode); } - } //获取网路详情信息 @@ -1174,7 +1172,6 @@ bool NetDetail::updateConnect() // qDebug () <::of(&QComboBox::currentIndexChanged), this, &SecurityPage::onSecuTypeComboxIndexChanged); connect(secuTypeCombox, QOverload::of(&QComboBox::currentIndexChanged), this, &SecurityPage::changeColumnWidthWithSecuType); - //EAP方式变化 // connect(eapTypeCombox, &QComboBox::currentTextChanged, this, &SecurityPage::onEapTypeComboxIndexChanged); connect(eapTypeCombox, QOverload::of(&QComboBox::currentIndexChanged), this, &SecurityPage::onEapTypeComboxIndexChanged); @@ -1247,4 +1246,3 @@ void SecurityPage::onPacFilePathComboxIndexChanged(QString str) qWarning() << "Choose file is null or unvalible"; } } - diff --git a/src/frontend/netdetails/securitypage.h b/src/frontend/netdetails/securitypage.h index 97ed7d8b..46f7e8da 100644 --- a/src/frontend/netdetails/securitypage.h +++ b/src/frontend/netdetails/securitypage.h @@ -4,7 +4,7 @@ * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or + * the Free Software Foundation; either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, @@ -144,7 +144,6 @@ private: bool checkConnectBtnIsEnabled(); - private Q_SLOTS: void onSecuTypeComboxIndexChanged(); void onEapTypeComboxIndexChanged(); diff --git a/src/frontend/networkmode/firewalldialog.cpp b/src/frontend/networkmode/firewalldialog.cpp index 749d4efb..4c70c5ce 100644 --- a/src/frontend/networkmode/firewalldialog.cpp +++ b/src/frontend/networkmode/firewalldialog.cpp @@ -4,7 +4,7 @@ * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or + * the Free Software Foundation; either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, diff --git a/src/frontend/networkmode/firewalldialog.h b/src/frontend/networkmode/firewalldialog.h index 4a16d315..c5a67089 100644 --- a/src/frontend/networkmode/firewalldialog.h +++ b/src/frontend/networkmode/firewalldialog.h @@ -4,7 +4,7 @@ * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or + * the Free Software Foundation; either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, diff --git a/src/frontend/networkmode/networkmodeconfig.cpp b/src/frontend/networkmode/networkmodeconfig.cpp index f770c26a..2c4e52b6 100644 --- a/src/frontend/networkmode/networkmodeconfig.cpp +++ b/src/frontend/networkmode/networkmodeconfig.cpp @@ -4,7 +4,7 @@ * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or + * the Free Software Foundation; either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, diff --git a/src/frontend/networkmode/networkmodeconfig.h b/src/frontend/networkmode/networkmodeconfig.h index 0404bb7f..94c41f80 100644 --- a/src/frontend/networkmode/networkmodeconfig.h +++ b/src/frontend/networkmode/networkmodeconfig.h @@ -4,7 +4,7 @@ * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or + * the Free Software Foundation; either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, diff --git a/src/frontend/single-pages/single-pages.pri b/src/frontend/single-pages/single-pages.pri new file mode 100644 index 00000000..96c70dc5 --- /dev/null +++ b/src/frontend/single-pages/single-pages.pri @@ -0,0 +1,10 @@ +INCLUDEPATH += $$PWD + +HEADERS += \ + $$PWD/vpnpage.h \ + $$PWD/singlepage.h + +SOURCES += \ + $$PWD/vpnpage.cpp \ + $$PWD/singlepage.cpp + diff --git a/src/frontend/single-pages/singlepage.cpp b/src/frontend/single-pages/singlepage.cpp new file mode 100644 index 00000000..896fbe5a --- /dev/null +++ b/src/frontend/single-pages/singlepage.cpp @@ -0,0 +1,187 @@ +/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * + * Copyright (C) 2022 Tianjin KYLIN Information Technology Co., Ltd. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. + * + */ +#include "singlepage.h" +#include +#include +#include +#include +#include +#include + +#include + +SinglePage::SinglePage(QWidget *parent) : QWidget(parent) +{ + initUI(); + initWindowProperties(); + initTransparency(); +} + +SinglePage::~SinglePage() +{ +} + +void SinglePage::initUI() +{ + m_mainLayout = new QVBoxLayout(this); + m_mainLayout->setContentsMargins(MAIN_LAYOUT_MARGINS); + m_mainLayout->setSpacing(MAIN_LAYOUT_SPACING); + this->setLayout(m_mainLayout); + + m_titleFrame = new QFrame(this); + m_titleFrame->setFixedHeight(TITLE_FRAME_HEIGHT); + m_titleLayout = new QHBoxLayout(m_titleFrame); + m_titleLayout->setContentsMargins(TITLE_LAYOUT_MARGINS); + m_titleFrame->setLayout(m_titleLayout); + m_titleLabel = new QLabel(m_titleFrame); + m_titleLayout->addWidget(m_titleLabel); + m_titleLayout->addStretch(); + + m_netDivider = new Divider(this); + + m_listFrame = new QFrame(this); + m_listLayout = new QVBoxLayout(m_listFrame); + m_listLayout->setContentsMargins(NET_LAYOUT_MARGINS); + m_listFrame->setLayout(m_listLayout); + m_listWidget = new QListWidget(m_listFrame); + m_listLayout->addWidget(m_listWidget); + + m_setDivider = new Divider(this); + + m_settingsFrame = new QFrame(this); + m_settingsFrame->setFixedHeight(TITLE_FRAME_HEIGHT); + m_settingsLayout = new QHBoxLayout(m_settingsFrame); + m_settingsLayout->setContentsMargins(SETTINGS_LAYOUT_MARGINS); + m_settingsLabel = new KyLable(m_settingsFrame); + m_settingsLabel->setCursor(Qt::PointingHandCursor); + m_settingsLabel->setText(tr("Settings")); + m_settingsLabel->setScaledContents(true); + m_settingsLayout->addWidget(m_settingsLabel); + m_settingsLayout->addStretch(); + m_settingsFrame->setLayout(m_settingsLayout); + + m_mainLayout->addWidget(m_titleFrame); + m_mainLayout->addWidget(m_netDivider); + m_mainLayout->addWidget(m_listFrame); + m_mainLayout->addWidget(m_setDivider); + m_mainLayout->addWidget(m_settingsFrame); +} + +void SinglePage::initWindowProperties() +{ + QPalette pal = m_listFrame->palette(); + pal.setBrush(QPalette::Base, QColor(0,0,0,0)); //背景透明 + m_listFrame->setPalette(pal); + + this->setFixedWidth(MAX_WIDTH); + this->setAttribute(Qt::WA_TranslucentBackground); + this->setProperty("useStyleWindowManager", false); //禁用拖动 + this->setWindowFlags(Qt::CustomizeWindowHint | Qt::FramelessWindowHint); + //绘制毛玻璃特效 + QString platform = QGuiApplication::platformName(); + if(!platform.startsWith(QLatin1String("wayland"),Qt::CaseInsensitive)) + { + QPainterPath path; + auto rect = this->rect(); + path.addRoundedRect(rect, 12, 12); + path.addRect(rect); + KWindowEffects::enableBlurBehind(this->winId(), true, QRegion(path.toFillPolygon().toPolygon())); //背景模糊 + } +} + +void SinglePage::showDesktopNotify(const QString &message, QString soundName) +{ + QDBusInterface iface("org.freedesktop.Notifications", + "/org/freedesktop/Notifications", + "org.freedesktop.Notifications", + QDBusConnection::sessionBus()); + QStringList actions; //跳转动作 + actions.append("kylin-nm"); + actions.append("default"); //默认动作:点击消息体时打开麒麟录音 + QMap hints; + if (!soundName.isEmpty()) { + hints.insert("sound-name",soundName); //添加声音 + } + QList args; + args<<(tr("Kylin NM")) + <<((unsigned int) 0) + <palette().window().color(); + + QPainterPath rectPath; + + col.setAlphaF(m_transparency); + rectPath.addRoundedRect(this->rect(),12,12); + + painter.setBrush(col); + painter.drawPath(rectPath); + KWindowEffects::enableBlurBehind(this->winId(), true, QRegion(rectPath.toFillPolygon().toPolygon())); //背景模糊 +} + +void SinglePage::initTransparency() +{ + if(QGSettings::isSchemaInstalled(QByteArray(TRANSPARENCY_GSETTINGS))) { + m_transGsettings = new QGSettings(QByteArray(TRANSPARENCY_GSETTINGS)); + if(m_transGsettings->keys().contains(TRANSPARENCY)) { + m_transparency = m_transGsettings->get(TRANSPARENCY).toDouble() + 0.15; + m_transparency = (m_transparency > 1) ? 1 : m_transparency; + connect(m_transGsettings, &QGSettings::changed, this, &SinglePage::onTransChanged); + } + } +} + +void SinglePage::onTransChanged() +{ + m_transparency = m_transGsettings->get("transparency").toDouble() + 0.15; + m_transparency = (m_transparency > 1) ? 1 : m_transparency; + paintWithTrans(); +} + +void SinglePage::paintWithTrans() +{ + QPalette pal = this->palette(); + QColor color = qApp->palette().base().color(); + color.setAlphaF(m_transparency); + pal.setColor(QPalette::Window, color); + this->setPalette(pal); +} + +void SinglePage::keyPressEvent(QKeyEvent *event) +{ + if (event->key() == Qt::Key_Escape) { + this->hide(); + } + return QWidget::keyPressEvent(event); +} + + diff --git a/src/frontend/single-pages/singlepage.h b/src/frontend/single-pages/singlepage.h new file mode 100644 index 00000000..611ea3f3 --- /dev/null +++ b/src/frontend/single-pages/singlepage.h @@ -0,0 +1,112 @@ +/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * + * Copyright (C) 2022 Tianjin KYLIN Information Technology Co., Ltd. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. + * + */ +#ifndef SINGLEPAGE_H +#define SINGLEPAGE_H + +#include "divider.h" +#include "kylable.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include "kylinnetworkdeviceresource.h" +#include "kwidget.h" +#include "kswitchbutton.h" + +using namespace kdk; + +#define MAIN_LAYOUT_MARGINS 0,0,0,0 +#define MAIN_LAYOUT_SPACING 0 +#define TITLE_FRAME_HEIGHT 60 //TabWidget的tab和widget有间隙,和设计稿看起来一致就不能设为设计稿里的高度 +#define TITLE_LAYOUT_MARGINS 24,0,24,0 +#define NET_LAYOUT_MARGINS 8,8,8,8 +#define TEXT_HEIGHT 20 +#define SETTINGS_LAYOUT_MARGINS 23,0,24,0 + +#define MAX_ITEMS 4 +#define MAX_WIDTH 412 +#define MIN_WIDTH 404 + +#define SCROLL_STEP 4 + +#define TRANSPARENCY "transparency" +#define TRANSPARENCY_GSETTINGS "org.ukui.control-center.personalise" + +class SinglePage : public QWidget +{ + Q_OBJECT +public: + explicit SinglePage(QWidget *parent = nullptr); + ~SinglePage(); + + static void showDesktopNotify(const QString &message, QString soundName); + +Q_SIGNALS: + void activateFailed(QString errorMessage); + void deactivateFailed(QString errorMessage); + +private Q_SLOTS: + void onTransChanged(); + +protected: + void paintEvent(QPaintEvent *event); + void keyPressEvent(QKeyEvent *event); + +protected: + void initUI(); + void initTransparency(); + void paintWithTrans(); + + +private: + void initWindowProperties(); + +protected: + QVBoxLayout * m_mainLayout = nullptr; + + QLabel * m_titleLabel = nullptr; + QFrame * m_titleFrame = nullptr; + QHBoxLayout * m_titleLayout = nullptr; + + QFrame * m_listFrame = nullptr; + QListWidget * m_listWidget = nullptr; + QVBoxLayout * m_listLayout = nullptr; + + QFrame * m_settingsFrame = nullptr; + QHBoxLayout * m_settingsLayout = nullptr; + KyLable * m_settingsLabel = nullptr; + + Divider * m_netDivider = nullptr; + Divider * m_setDivider = nullptr; + + + QGSettings * m_transGsettings = nullptr; + double m_transparency = 1.0; //透明度 + +}; + +#endif // TABPAGE_H diff --git a/src/frontend/single-pages/vpnpage.cpp b/src/frontend/single-pages/vpnpage.cpp new file mode 100644 index 00000000..fdf15fbb --- /dev/null +++ b/src/frontend/single-pages/vpnpage.cpp @@ -0,0 +1,723 @@ +/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * + * Copyright (C) 2022 Tianjin KYLIN Information Technology Co., Ltd. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. + * + */ +#include "vpnpage.h" +#include +#include +#include "windowmanager/windowmanager.h" +#include "ukuistylehelper/ukuistylehelper.h" + + +VpnPage::VpnPage(QWidget *parent) : SinglePage(parent) +{ + m_activeResourse = new KyActiveConnectResourse(this); + m_connectResourse = new KyConnectResourse(this); + m_wiredConnectOperation = new KyWiredConnectOperation(this); + + initUI(); + initVpnArea(); + installEventFilter(this); + + connect(m_activeResourse, &KyActiveConnectResourse::stateChangeReason, this, &VpnPage::onConnectionStateChange); + connect(m_activeResourse, &KyActiveConnectResourse::activeConnectRemove, this, [=] (QString activeConnectUuid) { + sendVpnStateChangeSignal(activeConnectUuid,Deactivated); + } ); + + connect(m_connectResourse, &KyConnectResourse::connectionAdd, this, &VpnPage::onAddConnection); + connect(m_connectResourse, &KyConnectResourse::connectionRemove, this, &VpnPage::onRemoveConnection); + connect(m_connectResourse, &KyConnectResourse::connectionUpdate, this, &VpnPage::onUpdateConnection); + + connect(m_wiredConnectOperation, &KyWiredConnectOperation::activateConnectionError, this, &VpnPage::activateFailed); + connect(m_wiredConnectOperation, &KyWiredConnectOperation::deactivateConnectionError, this, &VpnPage::deactivateFailed); +} + +VpnPage::~VpnPage() +{ + +} + +void VpnPage::deleteConnectionMapItem(QMap &connectMap, + QListWidget *lanListWidget, QString uuid) +{ + QListWidgetItem *p_listWidgetItem = connectMap.value(uuid); + if (p_listWidgetItem) { + connectMap.remove(uuid); + VpnListItem *p_lanItem = (VpnListItem *)lanListWidget->itemWidget(p_listWidgetItem); + lanListWidget->removeItemWidget(p_listWidgetItem); + + delete p_lanItem; + p_lanItem = nullptr; + + delete p_listWidgetItem; + p_listWidgetItem = nullptr; + } + + return; +} + +void VpnPage::clearConnectionMap(QMap &connectMap, + QListWidget *lanListWidget) +{ + QMap::iterator iter; + + iter = connectMap.begin(); + while (iter != connectMap.end()) { + qDebug()<<"[VpnPage] clear connection map item"<< iter.key(); + + QListWidgetItem *p_widgetItem = iter.value(); + VpnListItem *p_lanItem = (VpnListItem *)lanListWidget->itemWidget(p_widgetItem); + lanListWidget->removeItemWidget(p_widgetItem); + + delete p_lanItem; + p_lanItem = nullptr; + + delete p_widgetItem; + p_widgetItem = nullptr; + + iter = connectMap.erase(iter); + } + + return; +} + +void VpnPage::constructActiveConnectionArea() +{ + QList activedList; + QList netList; + QGSettings vpnGsettings(GSETTINGS_VPNICON_VISIBLE); + + activedList.clear(); + netList.clear(); + clearConnectionMap(m_activeConnectionMap, m_listWidget); + + m_connectResourse->getVpnAndVirtualConnections(netList); + KyConnectItem *p_newItem = nullptr; + if (!netList.isEmpty()) { + for (int index = 0; index < netList.size(); index++) { + KyConnectItem *p_netConnectionItem = netList.at(index); + p_newItem = m_activeResourse->getActiveConnectionByUuid(p_netConnectionItem->m_connectUuid); + if (p_newItem == nullptr) { + if (m_netConnectionMap.contains(p_netConnectionItem->m_connectUuid)) { + qDebug()<m_connectUuid; + } + QListWidgetItem *p_listWidgetItem = addNewItem(p_netConnectionItem, m_listWidget); + m_netConnectionMap.insert(p_netConnectionItem->m_connectUuid, p_listWidgetItem); + } else { + if (m_activeConnectionMap.contains(p_netConnectionItem->m_connectUuid)) { + qDebug()<m_connectUuid; + } + QListWidgetItem *p_listWidgetItem = addNewItem(p_newItem, m_listWidget); + m_activeConnectionMap.insert(p_netConnectionItem->m_connectUuid, p_listWidgetItem); + } + + delete p_netConnectionItem; + p_netConnectionItem = nullptr; + } + if (vpnGsettings.keys().contains(QString(VISIBLE))) { + vpnGsettings.set(VISIBLE, true); + } + } else { + if (vpnGsettings.keys().contains(QString(VISIBLE))) { + vpnGsettings.set(VISIBLE, false); + } + } + + if (m_listWidget->count() <= MAX_ITEMS) { + m_listFrame->setFixedWidth(MIN_WIDTH); + } else { + m_listFrame->setFixedWidth(MAX_WIDTH); + } +} + +void VpnPage::initVpnArea() +{ + constructActiveConnectionArea(); +} + +void VpnPage::resetPageHight() +{ + int height = 0; + int count = m_listWidget->count(); + m_listFrame->setFixedHeight((count >= 4) ? (MAX_ITEMS * ITEM_HEIGHT + ITEM_SPACE) : (count * ITEM_HEIGHT + ITEM_SPACE)); + + if (count == 0) { + m_listWidget->setHidden(true); + m_listFrame->setHidden(true); + m_netDivider->setHidden(true); + } else { + m_listWidget->show(); + m_listFrame->show(); + m_netDivider->show(); + } + + for (int i = 0; i < m_mainLayout->count(); i ++) { + QWidget *w = m_mainLayout->itemAt(i)->widget(); + if (w != nullptr && w->isHidden() != true) { + height += w->height(); + } + } + this->setFixedHeight(height + PAGE_SPACE); +} + +bool VpnPage::removeConnectionItem(QMap &connectMap, + QListWidget *lanListWidget, QString path) +{ + QMap::iterator iter; + for (iter = connectMap.begin(); iter != connectMap.end(); ++iter) { + QListWidgetItem *p_listWidgetItem = iter.value(); + VpnListItem *p_lanItem = (VpnListItem*)lanListWidget->itemWidget(p_listWidgetItem); + if (p_lanItem->getConnectionPath() == path) { + qDebug()<<"[VpnPage] Remove a connection from list"; + + lanListWidget->removeItemWidget(p_listWidgetItem); + + delete p_lanItem; + p_lanItem = nullptr; + + delete p_listWidgetItem; + p_listWidgetItem = nullptr; + + iter = connectMap.erase(iter); + if (m_listWidget->count() <= MAX_ITEMS) { + m_listFrame->setFixedWidth(MIN_WIDTH); + } + return true; + } + } + + return false; +} + +void VpnPage::onRemoveConnection(QString path) //删除时后端会自动断开激活,将其从未激活列表中删除 +{ + //for dbus + qDebug() << "[VpnPage] emit lanRemove because onRemoveConnection " << path; + Q_EMIT vpnRemove(path); + + removeConnectionItem(m_netConnectionMap, m_listWidget, path); + removeConnectionItem(m_activeConnectionMap, m_listWidget, path); + resetPageHight(); + resetWindowPosition(); + this->update(); +} + +void VpnPage::onAddConnection(QString uuid) //新增一个有线连接,将其加入到激活列表 +{ + if (!m_connectResourse->isVirtualConncection(uuid)) { + return; + } + + KyConnectItem *p_newItem = nullptr; + p_newItem = m_connectResourse->getConnectionItemByUuid(uuid); + if (nullptr == p_newItem) { + return; + } + + sendVpnAddSignal(p_newItem); + + qDebug()<<"[VpnPage] Add a new connection, name:"<m_connectName; + QListWidgetItem *p_listWidgetItem = insertNewItem(p_newItem, m_listWidget); + if (m_netConnectionMap.contains(p_newItem->m_connectUuid)) { + qDebug()<m_connectUuid; + } + m_netConnectionMap.insert(p_newItem->m_connectUuid, p_listWidgetItem); + + delete p_newItem; + p_newItem = nullptr; + if (m_listWidget->count() >= MAX_ITEMS) { + m_listFrame->setFixedWidth(MAX_WIDTH); + } + resetPageHight(); + resetWindowPosition(); + this->update(); + return; +} + +void VpnPage::onShowControlCenter() +{ + QProcess process; + process.startDetached("ukui-control-center -m vpn"); +} + +void VpnPage::initUI() +{ + m_titleLabel->setText(tr("VPN")); + + m_listWidget->setFrameShape(QFrame::Shape::NoFrame); + m_listWidget->setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff); + m_listWidget->setVerticalScrollMode(QAbstractItemView::ScrollMode::ScrollPerPixel); + m_listWidget->verticalScrollBar()->setProperty("drawScrollBarGroove",false); //去除滚动条的外侧黑框 + m_listWidget->verticalScrollBar()->setSingleStep(SCROLL_STEP); + m_listWidget->verticalScrollBar()->setContextMenuPolicy(Qt::NoContextMenu); + + m_settingsLabel->setText(tr("VPN Settings")); + m_settingsLabel->installEventFilter(this); +} + +QListWidgetItem *VpnPage::insertNewItem(KyConnectItem *itemData, QListWidget *listWidget) +{ + int index = 0; + + for(index = 0; index < m_listWidget->count(); index++) { + QListWidgetItem *p_listWidgetItem = m_listWidget->item(index); + VpnListItem *p_lanItem = (VpnListItem *)m_listWidget->itemWidget(p_listWidgetItem); + QString name1 = p_lanItem->getConnectionName(); + QString name2 = itemData->m_connectName; + if (QString::compare(name1, name2, Qt::CaseInsensitive) > 0) { + break; + } + } + + QListWidgetItem *p_sortListWidgetItem = new QListWidgetItem(); + p_sortListWidgetItem->setFlags(p_sortListWidgetItem->flags() & (~Qt::ItemIsSelectable)); //设置不可被选中 + p_sortListWidgetItem->setSizeHint(QSize(listWidget->width(),ITEM_HEIGHT)); + + listWidget->insertItem(index, p_sortListWidgetItem); + + VpnListItem *p_sortLanItem = nullptr; + p_sortLanItem = new VpnListItem(itemData); + listWidget->setItemWidget(p_sortListWidgetItem, p_sortLanItem); + + return p_sortListWidgetItem; +} + +QListWidgetItem *VpnPage::addNewItem(KyConnectItem *itemData, QListWidget *listWidget) +{ + QListWidgetItem *p_listWidgetItem = new QListWidgetItem(); + p_listWidgetItem->setFlags(p_listWidgetItem->flags() & (~Qt::ItemIsSelectable)); + p_listWidgetItem->setSizeHint(QSize(listWidget->width() - 16, ITEM_HEIGHT)); + listWidget->addItem(p_listWidgetItem); + VpnListItem *p_lanItem = nullptr; + if (itemData != nullptr) { + p_lanItem = new VpnListItem(itemData); + qDebug() << "[VpnPage] addNewItem, connection: " << itemData->m_connectName; + } else { + p_lanItem = new VpnListItem(); + qDebug() << "[VpnPage] Add nullItem!"; + } + + listWidget->setItemWidget(p_listWidgetItem, p_lanItem); + return p_listWidgetItem; +} + +void VpnPage::updateActivatedConnectionArea(KyConnectItem *p_newItem) +{ + if (m_activeConnectionMap.contains(p_newItem->m_connectUuid)) { + return; + } + + deleteConnectionMapItem(m_netConnectionMap, m_listWidget, p_newItem->m_connectUuid); + qDebug()<<"[VpnPage]update active connection item"<m_connectName; + deleteConnectionMapItem(m_activeConnectionMap, m_listWidget, p_newItem->m_connectUuid); + QListWidgetItem *p_listWidgetItem = addNewItem(p_newItem, m_listWidget); + m_activeConnectionMap.insert(p_newItem->m_connectUuid, p_listWidgetItem); + if (m_listWidget->count() <= MAX_ITEMS) { + m_listFrame->setFixedWidth(MIN_WIDTH); + } + + return; +} + +void VpnPage::updateConnectionArea(KyConnectItem *p_newItem) +{ + if (m_netConnectionMap.contains(p_newItem->m_connectUuid)) { + return; + } + + deleteConnectionMapItem(m_activeConnectionMap, m_listWidget, p_newItem->m_connectUuid); + qDebug()<<"[VpnPage] update connection item"<m_connectName; + QListWidgetItem *p_listWidgetItem = insertNewItem(p_newItem, m_listWidget); + m_netConnectionMap.insert(p_newItem->m_connectUuid, p_listWidgetItem); + + if (m_listWidget->count() <= MAX_ITEMS) { + m_listFrame->setFixedWidth(MIN_WIDTH); + } else { + m_listFrame->setFixedWidth(MAX_WIDTH); + } +} + +void VpnPage::updateConnectionState(QMap &connectMap, + QListWidget *lanListWidget, QString uuid, ConnectState state) +{ + qDebug() << LOG_FLAG << "update connection state"; + + QListWidgetItem *p_listWidgetItem = connectMap.value(uuid); + if (p_listWidgetItem) { + VpnListItem *p_lanItem = (VpnListItem *)lanListWidget->itemWidget(p_listWidgetItem); + p_lanItem->updateConnectionState(state); + } + +} + +void VpnPage::onConnectionStateChange(QString uuid, + NetworkManager::ActiveConnection::State state, + NetworkManager::ActiveConnection::Reason reason) +{ + //VpnPage函数内持续监听连接状态的变化并记录供其他函数调用获取状态 + if (!m_connectResourse->isVirtualConncection(uuid)) { + qDebug() << "[VpnPage] connection state change signal but not vpn"; + return; + } + + sendVpnStateChangeSignal(uuid, (ConnectState)state); + + if (m_activeConnectionMap.keys().contains(uuid) && state == NetworkManager::ActiveConnection::State::Activated) { + return; + } + + qDebug()<<"[VpnPage] connection uuid"<< uuid + << "state change slot:"<< state; + + KyConnectItem *p_newItem = nullptr; + QString deviceName = ""; + QString ssid = ""; + + if (state == NetworkManager::ActiveConnection::State::Activated) { + p_newItem = m_activeResourse->getActiveConnectionByUuid(uuid); + if (nullptr == p_newItem) { + qWarning()<<"[VpnPage] get active connection failed, connection uuid" << uuid; + return; + } + + ssid = p_newItem->m_connectName; + updateActivatedConnectionArea(p_newItem); + updateConnectionState(m_activeConnectionMap, m_listWidget, uuid, (ConnectState)state); + } else if (state == NetworkManager::ActiveConnection::State::Deactivated) { + p_newItem = m_connectResourse->getConnectionItemByUuid(uuid); + qDebug() << "[VpnPage] deactivated reason" << reason; + if (nullptr == p_newItem) { + qWarning()<<"[VpnPage] get active connection failed, connection uuid" << uuid; + return; + } + + ssid = p_newItem->m_connectName; + updateConnectionArea(p_newItem); + updateConnectionState(m_netConnectionMap, m_listWidget, uuid, (ConnectState)state); + } else if (state == NetworkManager::ActiveConnection::State::Activating) { + updateConnectionState(m_netConnectionMap, m_listWidget, uuid, (ConnectState)state); + } else if (state == NetworkManager::ActiveConnection::State::Deactivating) { + updateConnectionState(m_activeConnectionMap, m_listWidget, uuid, (ConnectState)state); + } + + Q_EMIT vpnActiveConnectionStateChanged(uuid, state); + + if (p_newItem) { + delete p_newItem; + p_newItem = nullptr; + } + + return; +} + +void VpnPage::getVirtualList(QVector &vector) +{ + QList netConnectList; + vector.clear(); + m_connectResourse->getVpnAndVirtualConnections(netConnectList); //未激活列表的显示 + if (!netConnectList.isEmpty()) { + for (int i = 0; i < netConnectList.size(); i++) { + KyConnectItem *p_newItem = nullptr; + KyConnectItem *p_netConnectionItem = netConnectList.at(i); + p_newItem = m_activeResourse->getActiveConnectionByUuid(p_netConnectionItem->m_connectUuid); + NetworkManager::ActiveConnection::State state = p_netConnectionItem->m_connectState; + if (p_newItem != nullptr) { + state = NetworkManager::ActiveConnection::Activated; + } + vector.append(QStringList() << netConnectList.at(i)->m_connectName + << netConnectList.at(i)->m_connectUuid + << netConnectList.at(i)->m_connectPath + << QString::number(state)); + } + } + return; +} + +void VpnPage::sendVpnUpdateSignal(KyConnectItem *p_connectItem) +{ + QStringList info; + info << p_connectItem->m_connectName << p_connectItem->m_connectUuid << p_connectItem->m_connectPath; + Q_EMIT vpnUpdate(info); + + return; +} + +void VpnPage::sendVpnAddSignal(KyConnectItem *p_connectItem) +{ + QStringList info; + KyConnectItem *p_newItem = nullptr; + p_newItem = m_activeResourse->getActiveConnectionByUuid(p_connectItem->m_connectUuid); + NetworkManager::ActiveConnection::State state = p_connectItem->m_connectState; + if (p_newItem != nullptr) { + state = NetworkManager::ActiveConnection::Activated; + } + info << p_connectItem->m_connectName + << p_connectItem->m_connectUuid + << p_connectItem->m_connectPath + << QString::number(state); + qDebug() << "[VpnPage] emit vpnAdd because addConnection "; + Q_EMIT vpnAdd(info); + + return; +} + +void VpnPage::sendVpnStateChangeSignal(QString uuid, ConnectState state) +{ + if (state == Activating || state == Deactivating) { + if (m_activeResourse->connectionIsVirtual(uuid)) { + return; + } + } + + Q_EMIT this->vpnConnectChanged(state); + + return; +} + +void VpnPage::updateConnectionProperty(KyConnectItem *p_connectItem) +{ + QString newUuid = p_connectItem->m_connectUuid; + + if (m_netConnectionMap.contains(newUuid)) { + QListWidgetItem *p_listWidgetItem = m_netConnectionMap.value(newUuid); + VpnListItem *p_lanItem = (VpnListItem*)m_listWidget->itemWidget(p_listWidgetItem); + if (p_connectItem->m_connectName != p_lanItem->getConnectionName()){ + //只要名字改变就要删除,重新插入,主要是为了排序 + deleteConnectionMapItem(m_netConnectionMap, m_listWidget, newUuid); + QListWidgetItem *p_sortListWidgetItem = insertNewItem(p_connectItem, m_listWidget); + if (m_netConnectionMap.contains(newUuid)) { + qDebug()<m_connectPath != p_lanItem->getConnectionPath()) { + p_lanItem->updateConnectionPath(p_connectItem->m_connectPath); + } + } else if (!m_activeConnectionMap.contains(newUuid)){ + if (p_connectItem->m_ifaceName.isEmpty()) { + QListWidgetItem *p_listWidgetItem = insertNewItem(p_connectItem, m_listWidget); + if (m_netConnectionMap.contains(newUuid)) { + qDebug()<m_connectUuid; + + if (m_activeConnectionMap.contains(newUuid)) { + QListWidgetItem *p_listWidgetItem = m_activeConnectionMap.value(newUuid); + VpnListItem *p_lanItem = (VpnListItem *)m_listWidget->itemWidget(p_listWidgetItem); + if (p_lanItem->getConnectionName() != p_connectItem->m_connectName) { + p_lanItem->updateConnectionName(p_connectItem->m_connectName); + } + + if (p_lanItem->getConnectionName() != p_connectItem->m_connectPath) { + p_lanItem->updateConnectionPath(p_connectItem->m_connectPath); + } + } + return; +} + +void VpnPage::onUpdateConnection(QString uuid) +{ + if (!m_connectResourse->isVirtualConncection(uuid)) { + return; + } + + qDebug() << "[VpnPage]:Connection property Changed." << Q_FUNC_INFO << __LINE__; + + KyConnectItem *p_newItem = nullptr; + if (m_connectResourse->isActivatedConnection(uuid)) { + p_newItem = m_activeResourse->getActiveConnectionByUuid(uuid); + if (nullptr == p_newItem) { + qWarning()<<"[VpnPage] get item failed, when update activate connection." + <<"connection uuid" << uuid; + return; + } + + updateActiveConnectionProperty(p_newItem); + } else { + p_newItem = m_connectResourse->getConnectionItemByUuid(uuid); + if (nullptr == p_newItem) { + qWarning()<<"[VpnPage] get item failed, when update connection." + <<"connection uuid"<type() == QEvent::MouseButtonRelease) { + onShowControlCenter(); + } + } + + if (event->type() == QEvent::ActivationChange) { + if(QApplication::activeWindow() != this) { + hide(); + } + } + + return QWidget::eventFilter(watched, event); +} + +void VpnPage::deleteVpn(const QString &connUuid) +{ + qDebug() << "[VpnPage] deleteVpn" << connUuid; + if (connUuid == nullptr) { + return; + } + m_wiredConnectOperation->deleteWiredConnect(connUuid); +} + +void VpnPage::activateVpn(const QString& connUuid) +{ + if (m_netConnectionMap.contains(connUuid)) { + qDebug() << "[VpnPage] activateVpn" << connUuid; + m_wiredConnectOperation->activateVpnConnection(connUuid); + } +} + +void VpnPage::deactivateVpn(const QString& connUuid) +{ + qDebug() << "[VpnPage] deactivateVpn" << connUuid; + QString name(""); + m_wiredConnectOperation->deactivateWiredConnection(name, connUuid); +} + +void VpnPage::showDetailPage(QString devName, QString uuid) +{ +#ifdef VPN_DETAIL + KyConnectItem *p_item = nullptr; + bool isActive = true; + + if (m_connectResourse->isActivatedConnection(uuid)) { + p_item = m_activeResourse->getActiveConnectionByUuid(uuid); + isActive = true; + } else { + p_item = m_connectResourse->getConnectionItemByUuid(uuid); + isActive = false; + } + + if (nullptr == p_item) { + qWarning()<<"[VpnPage] GetConnectionItemByUuid is empty when showDetailPage." + <<"device name"<m_connectName, uuid, isActive, false, false); + netDetail->show(); + + delete p_item; + p_item = nullptr; +#endif +} + +void VpnPage::showUI() +{ + //2209中窗管在hide界面时会刷新属性,需要重新设置无图标属性 + QString platform = QGuiApplication::platformName(); + if(!platform.startsWith(QLatin1String("wayland"),Qt::CaseInsensitive)) { + const KWindowInfo info(this->winId(), NET::WMState); + if (!info.hasState(NET::SkipTaskbar) || !info.hasState(NET::SkipPager)) { + KWindowSystem::setState(this->winId(), NET::SkipTaskbar | NET::SkipPager); + } + } + + kdk::UkuiStyleHelper::self()->removeHeader(this); + resetPageHight(); + + showNormal(); + raise(); + activateWindow(); + resetWindowPosition(); + return; +} + +void VpnPage::resetWindowPosition() +{ + +#define MARGIN 4 +#define PANEL_TOP 1 +#define PANEL_LEFT 2 +#define PANEL_RIGHT 3 +//#define PANEL_BOTTOM 4 + if (!m_positionInterface) { + m_positionInterface = new QDBusInterface("org.ukui.panel", + "/panel/position", + "org.ukui.panel", + QDBusConnection::sessionBus()); + } + QRect rect; + QDBusReply reply = m_positionInterface->call("GetPrimaryScreenGeometry"); + //reply获取的参数共5个,分别是 主屏可用区域的起点x坐标,主屏可用区域的起点y坐标,主屏可用区域的宽度,主屏可用区域高度,任务栏位置 + if (!m_positionInterface->isValid() || !reply.isValid() || reply.value().size() < 5) { + qCritical() << QDBusConnection::sessionBus().lastError().message(); + kdk::WindowManager::setGeometry(this->windowHandle(), QRect(0, 0, this->width(), this->height())); + return; + } + QVariantList position_list = reply.value(); + int position = position_list.at(4).toInt(); + switch(position){ + case PANEL_TOP: + //任务栏位于上方 + rect = QRect(position_list.at(0).toInt() + position_list.at(2).toInt() - this->width() - MARGIN, + position_list.at(1).toInt() + MARGIN, + this->width(), this->height()); + break; + //任务栏位于左边 + case PANEL_LEFT: + rect = QRect(position_list.at(0).toInt() + MARGIN, + position_list.at(1).toInt() + reply.value().at(3).toInt() - this->height() - MARGIN, + this->width(), this->height()); + break; + //任务栏位于右边 + case PANEL_RIGHT: + rect = QRect(position_list.at(0).toInt() + position_list.at(2).toInt() - this->width() - MARGIN, + position_list.at(1).toInt() + reply.value().at(3).toInt() - this->height() - MARGIN, + this->width(), this->height()); + break; + //任务栏位于下方 + default: + rect = QRect(position_list.at(0).toInt() + position_list.at(2).toInt() - this->width() - MARGIN, + position_list.at(1).toInt() + reply.value().at(3).toInt() - this->height() - MARGIN, + this->width(), this->height()); + break; + } + kdk::WindowManager::setGeometry(this->windowHandle(), rect); + qDebug() << " Position of ukui-panel is " << position << "; Position of mainwindow is " << this->geometry() << "." << Q_FUNC_INFO << __LINE__; +} diff --git a/src/frontend/single-pages/vpnpage.h b/src/frontend/single-pages/vpnpage.h new file mode 100644 index 00000000..49000213 --- /dev/null +++ b/src/frontend/single-pages/vpnpage.h @@ -0,0 +1,137 @@ +/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * + * Copyright (C) 2022 Tianjin KYLIN Information Technology Co., Ltd. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. + * + */ +#ifndef VPNPAGE_H +#define VPNPAGE_H + +#include "divider.h" +#include +#include +#include +#include +#include +#include +#include + +#include + +#include "list-items/listitem.h" +#include "list-items/vpnlistitem.h" +#include "single-pages/singlepage.h" + +#define VPNPAGE_LAYOUT_MARGINS 0,0,0,0 +#define VPN_LIST_SPACING 0 +#define ITEM_HEIGHT 50 +#define ITEM_SPACE 16 +#define PAGE_SPACE 22 + +#define LOG_FLAG "[VpnPage]" + +#define VISIBLE "visible" +const QByteArray GSETTINGS_VPNICON_VISIBLE = "org.ukui.kylin-nm.vpnicon"; + +class VpnListItem; + +class VpnPage : public SinglePage +{ + Q_OBJECT +public: + explicit VpnPage(QWidget *parent = nullptr); + ~VpnPage(); + + //for dbus + void getVirtualList(QVector &vector); + void deleteVpn(const QString &connUuid); + void activateVpn(const QString& connUuid); + void deactivateVpn(const QString& connUuid); + void showDetailPage(QString devName, QString uuid); + +protected: + bool eventFilter(QObject *watched, QEvent *event); + +private: + void initUI(); + void initVpnArea(); + void resetPageHight(); + + inline void initDeviceCombox() { return; } + + QListWidgetItem *insertNewItem(KyConnectItem *itemData, QListWidget *listWidget); + QListWidgetItem *addNewItem(KyConnectItem *itemData, QListWidget *listWidget); + bool removeConnectionItem(QMap &connectMap, + QListWidget *lanListWidget, QString path); + + void constructActiveConnectionArea(); + + void updateConnectionArea(KyConnectItem *p_newItem); + void updateActivatedConnectionArea(KyConnectItem *p_newItem); + void updateConnectionState(QMap &connectMap, + QListWidget *lanListWidget, QString uuid, ConnectState state); + + void updateActiveConnectionProperty(KyConnectItem *p_connectItem); + void updateConnectionProperty(KyConnectItem *p_connectItem); + + void sendVpnUpdateSignal(KyConnectItem *p_connectItem); + void sendVpnAddSignal(KyConnectItem *p_connectItem); + void sendVpnStateChangeSignal(QString uuid, ConnectState state); + + void clearConnectionMap(QMap &connectMap, + QListWidget *lanListWidget); + void deleteConnectionMapItem(QMap &connectMap, + QListWidget *lanListWidget, QString uuid); + + void resetWindowPosition(); + + +Q_SIGNALS: + void vpnAdd(QStringList info); + void vpnRemove(QString dbusPath); + void vpnUpdate(QStringList info); + + void vpnActiveConnectionStateChanged(QString uuid, int status); + void vpnConnectChanged(int state); + +private Q_SLOTS: + void onConnectionStateChange(QString uuid, + NetworkManager::ActiveConnection::State state, + NetworkManager::ActiveConnection::Reason reason); + + void onAddConnection(QString uuid); + void onRemoveConnection(QString path); + void onUpdateConnection(QString uuid); + + void onShowControlCenter(); + +private: + KyWiredConnectOperation *m_wiredConnectOperation = nullptr; + KyActiveConnectResourse *m_activeResourse = nullptr; //激活的连接 + KyConnectResourse *m_connectResourse = nullptr; //未激活的连接 + + QMap m_netConnectionMap; + QMap m_activeConnectionMap; + + QDBusInterface * m_positionInterface = nullptr; + + + +public Q_SLOTS: + void showUI(); +}; + +#endif // LANPAGE_H diff --git a/src/frontend/tab-pages/lanpage.cpp b/src/frontend/tab-pages/lanpage.cpp index 55024ad1..6eab28ae 100644 --- a/src/frontend/tab-pages/lanpage.cpp +++ b/src/frontend/tab-pages/lanpage.cpp @@ -4,7 +4,7 @@ * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or + * the Free Software Foundation; either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, @@ -48,7 +48,7 @@ LanPage::LanPage(QWidget *parent) : TabPage(parent) initUI(); initLanDevice(); - initNetSwitch(); +// initNetSwitch(); initLanDeviceState(); initDeviceCombox(); @@ -78,10 +78,11 @@ LanPage::LanPage(QWidget *parent) : TabPage(parent) connect(m_wiredConnectOperation, &KyWiredConnectOperation::activateConnectionError, this, &LanPage::activateFailed); connect(m_wiredConnectOperation, &KyWiredConnectOperation::deactivateConnectionError, this, &LanPage::deactivateFailed); connect(m_wiredConnectOperation, &KyWiredConnectOperation::wiredEnabledChanged, this, &LanPage::onWiredEnabledChanged); - connect(m_netSwitch, &KSwitchButton::clicked, this, [=](bool checked) { - m_netSwitch->setChecked(!checked); - m_wiredConnectOperation->setWiredEnabled(checked); - }); + m_netSwitch->hide(); +// connect(m_netSwitch, &KSwitchButton::clicked, this, [=](bool checked) { +// m_netSwitch->setChecked(!checked); +// m_wiredConnectOperation->setWiredEnabled(checked); +// }); m_lanPagePtrMap.clear(); } @@ -144,60 +145,60 @@ void LanPage::initLanDeviceState() void LanPage::initNetSwitch() { - bool wiredGsetting = true; - bool wiredEnable = m_wiredConnectOperation->getWiredEnabled(); +// bool wiredGsetting = true; +// bool wiredEnable = m_wiredConnectOperation->getWiredEnabled(); - if (QGSettings::isSchemaInstalled(GSETTINGS_SCHEMA)) { - m_switchGsettings = new QGSettings(GSETTINGS_SCHEMA); - if (m_switchGsettings->keys().contains(WIRED_SWITCH)) { - wiredGsetting = m_switchGsettings->get(WIRED_SWITCH).toBool(); - connect(m_switchGsettings, &QGSettings::changed, this, &LanPage::onSwithGsettingsChanged); - if (wiredEnable != wiredGsetting) { - m_switchGsettings->set(WIRED_SWITCH, wiredEnable); - } - } - } else { - qDebug()<<"[LanPage] org.ukui.kylin-nm.switch is not installed!"; - } +// if (QGSettings::isSchemaInstalled(GSETTINGS_SCHEMA)) { +// m_switchGsettings = new QGSettings(GSETTINGS_SCHEMA); +// if (m_switchGsettings->keys().contains(WIRED_SWITCH)) { +// wiredGsetting = m_switchGsettings->get(WIRED_SWITCH).toBool(); +// connect(m_switchGsettings, &QGSettings::changed, this, &LanPage::onSwithGsettingsChanged); +// if (wiredEnable != wiredGsetting) { +// m_switchGsettings->set(WIRED_SWITCH, wiredEnable); +// } +// } +// } else { +// qDebug()<<"[LanPage] org.ukui.kylin-nm.switch is not installed!"; +// } - //从3.0升级上来 先读取老的配置文件来保证和升级前状态一致 - bool oldVersionState = true; - if (getOldVersionWiredSwitchState(oldVersionState)) { - if (wiredEnable != oldVersionState) { - wiredEnable = oldVersionState; - m_wiredConnectOperation->setWiredEnabled(oldVersionState); - } - } +// //从3.0升级上来 先读取老的配置文件来保证和升级前状态一致 +// bool oldVersionState = true; +// if (getOldVersionWiredSwitchState(oldVersionState)) { +// if (wiredEnable != oldVersionState) { +// wiredEnable = oldVersionState; +// m_wiredConnectOperation->setWiredEnabled(oldVersionState); +// } +// } - if (m_devList.count() == 0) { - qDebug() << "[wiredSwitch]:init not enable when no device"; - m_netSwitch->setChecked(false); - m_netSwitch->setCheckable(false); - } +// if (m_devList.count() == 0) { +// qDebug() << "[wiredSwitch]:init not enable when no device"; +// m_netSwitch->setChecked(false); +// m_netSwitch->setCheckable(false); +// } - qDebug() << "[wiredSwitch]:init state:" << wiredEnable; +// qDebug() << "[wiredSwitch]:init state:" << wiredEnable; - m_netSwitch->setChecked(wiredEnable); +// m_netSwitch->setChecked(wiredEnable); } void LanPage::onSwithGsettingsChanged(const QString &key) { - if (key == WIRED_SWITCH) { +// if (key == WIRED_SWITCH) { - bool wiredSwitch = m_switchGsettings->get(WIRED_SWITCH).toBool(); - qDebug()<<"[LanPage] SwitchButton statue changed to:" << wiredSwitch << m_netSwitch->isChecked(); +// bool wiredSwitch = m_switchGsettings->get(WIRED_SWITCH).toBool(); +// qDebug()<<"[LanPage] SwitchButton statue changed to:" << wiredSwitch << m_netSwitch->isChecked(); - if (wiredSwitch != m_wiredConnectOperation->getWiredEnabled()) { - m_wiredConnectOperation->setWiredEnabled(wiredSwitch); - return; - } +// if (wiredSwitch != m_wiredConnectOperation->getWiredEnabled()) { +// m_wiredConnectOperation->setWiredEnabled(wiredSwitch); +// return; +// } - m_netSwitch->setChecked(wiredSwitch); +// m_netSwitch->setChecked(wiredSwitch); - initLanDeviceState(); - initDeviceCombox(); - initLanArea(); - } +// initLanDeviceState(); +// initDeviceCombox(); +// initLanArea(); +// } } void LanPage::getEnabledDevice(QStringList &enableDeviceList) @@ -236,7 +237,7 @@ void LanPage::initDeviceCombox() m_deviceComboBox->clear(); - if (m_netSwitch->isChecked()) { + if (!m_devList.isEmpty()) { int enableDeviceCount = m_enableDeviceList.count(); if (enableDeviceCount > 1) { for (int index = 0; index < enableDeviceCount; ++index) { @@ -395,7 +396,7 @@ void LanPage::constructConnectionArea() void LanPage::initLanArea() { - if (!m_netSwitch->isChecked() || m_currentDeviceName.isEmpty()) { + if (/*!m_netSwitch->isChecked() || */m_currentDeviceName.isEmpty()) { m_activatedNetDivider->hide(); m_activatedNetFrame->hide(); @@ -506,7 +507,7 @@ void LanPage::addDeviceForCombox(QString deviceName) disconnect(m_deviceComboBox, QOverload::of(&QComboBox::currentIndexChanged), this, &LanPage::onDeviceComboxIndexChanged); - if (m_netSwitch->isChecked()) { +// if (m_netSwitch->isChecked()) { if (1 == m_enableDeviceList.count()) { //1、从无到有添加第一块有线网卡 //2、有多快网卡,但是没有使能 @@ -526,7 +527,7 @@ void LanPage::addDeviceForCombox(QString deviceName) //5、有多快网卡且使能了多块网卡 m_deviceComboBox->addItem(deviceName); } - } +// } connect(m_deviceComboBox, QOverload::of(&QComboBox::currentIndexChanged), this, &LanPage::onDeviceComboxIndexChanged); @@ -543,11 +544,11 @@ void LanPage::onDeviceAdd(QString deviceName, NetworkManager::Device::Type devic return; } - if (m_devList.count() == 0) {// 有线网卡从无到有,打开开关 - bool wiredSwitch = m_switchGsettings->get(WIRED_SWITCH).toBool(); - m_netSwitch->setCheckable(true); - m_netSwitch->setChecked(wiredSwitch); - } +// if (m_devList.count() == 0) {// 有线网卡从无到有,打开开关 +// bool wiredSwitch = m_switchGsettings->get(WIRED_SWITCH).toBool(); +// m_netSwitch->setCheckable(true); +// m_netSwitch->setChecked(wiredSwitch); +// } qDebug() << "[LanPage] Begin add device:" << deviceName; @@ -570,7 +571,13 @@ void LanPage::deleteDeviceFromCombox(QString deviceName) disconnect(m_deviceComboBox, QOverload::of(&QComboBox::currentIndexChanged), this, &LanPage::onDeviceComboxIndexChanged); - if (m_netSwitch->isChecked()) { + + if (m_devList.isEmpty()) { + m_tipsLabel->hide(); + m_deviceFrame->hide(); + m_deviceComboBox->hide(); + } +// if (m_netSwitch->isChecked()) { if (0 == m_enableDeviceList.count()) { //1、没有使能任何网卡 goto l_out; @@ -610,7 +617,7 @@ void LanPage::deleteDeviceFromCombox(QString deviceName) } } } - } +// } l_out: connect(m_deviceComboBox, QOverload::of(&QComboBox::currentIndexChanged), @@ -628,11 +635,11 @@ void LanPage::onDeviceRemove(QString deviceName) qDebug() << "[LanPage] deviceRemove:" << deviceName; m_devList.removeOne(deviceName); - if (m_devList.count() == 0) { - m_netSwitch->setChecked(false); - m_netSwitch->setCheckable(false); - qDebug() << "[wiredSwitch]set not enable after device remove"; - } +// if (m_devList.count() == 0) { +// m_netSwitch->setChecked(false); +// m_netSwitch->setCheckable(false); +// qDebug() << "[wiredSwitch]set not enable after device remove"; +// } QString nowDevice = m_currentDeviceName; deleteDeviceFromCombox(deviceName); @@ -778,7 +785,7 @@ void LanPage::initUI() m_inactivatedLanListWidget->setPalette(pal); m_settingsLabel->installEventFilter(this); - m_netSwitch->installEventFilter(this); +// m_netSwitch->installEventFilter(this); m_activatedLanListWidget->installEventFilter(this); m_inactivatedLanListWidget->installEventFilter(this); @@ -1045,7 +1052,6 @@ void LanPage::sendLanStateChangeSignal(QString uuid, ConnectState state) return; } } - Q_EMIT this->lanConnectChanged(state); return; @@ -1181,7 +1187,7 @@ bool LanPage::eventFilter(QObject *watched, QEvent *event) if (event->type() == QEvent::MouseButtonRelease) { onShowControlCenter(); } - } else if(watched == m_netSwitch){ + }/* else if(watched == m_netSwitch){ if (event->type() == QEvent::MouseButtonRelease) { qDebug()<<"[LanPage] On lan switch button clicked! Status:" <isChecked() <<"devices count:"<type() == QEvent::FocusIn) { if (m_activatedLanListWidget->currentItem() != nullptr) { @@ -1214,16 +1220,16 @@ bool LanPage::eventFilter(QObject *watched, QEvent *event) void LanPage::onWiredEnabledChanged(bool enabled) { - if (m_devList.isEmpty()) { - qDebug() << "[LanPage] have no device to use " << Q_FUNC_INFO << __LINE__; - return; - } +// if (m_devList.isEmpty()) { +// qDebug() << "[LanPage] have no device to use " << Q_FUNC_INFO << __LINE__; +// return; +// } - if (m_netSwitch->isChecked() == enabled) { - return; - } else { - m_switchGsettings->set(WIRED_SWITCH, enabled); - } +// if (m_netSwitch->isChecked() == enabled) { +// return; +// } else { +// m_switchGsettings->set(WIRED_SWITCH, enabled); +// } } void LanPage::activateWired(const QString& devName, const QString& connUuid) @@ -1276,6 +1282,8 @@ void LanPage::showDetailPage(QString devName, QString uuid) NetDetail *netDetail = new NetDetail(devName, p_item->m_connectName, uuid, isActive, false, false); m_lanPagePtrMap.insert(p_item->m_connectPath, netDetail); netDetail->show(); + KWindowSystem::raiseWindow(netDetail->winId()); + netDetail->centerToScreen(); connect(netDetail, &NetDetail::detailPageClose, [&](QString deviceName, QString lanName, QString lanUuid){ if (lanUuid.isEmpty()) { @@ -1351,4 +1359,3 @@ void LanPage::showRate() onSetNetSpeed(m_activatedLanListWidget, m_activeConnectionMap.contains(EMPTY_SSID), m_currentDeviceName); }); } - diff --git a/src/frontend/tab-pages/lanpage.h b/src/frontend/tab-pages/lanpage.h index bbb3c8b5..1e67f17e 100644 --- a/src/frontend/tab-pages/lanpage.h +++ b/src/frontend/tab-pages/lanpage.h @@ -4,7 +4,7 @@ * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or + * the Free Software Foundation; either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, @@ -134,7 +134,6 @@ private Q_SLOTS: void onShowControlCenter(); void onWiredEnabledChanged(bool); - private: QListWidget * m_activatedLanListWidget = nullptr; QListWidget * m_inactivatedLanListWidget = nullptr; @@ -154,7 +153,6 @@ private: QGSettings *m_switchGsettings = nullptr; QMap m_lanPagePtrMap; - }; #endif // LANPAGE_H diff --git a/src/frontend/tab-pages/tabpage.cpp b/src/frontend/tab-pages/tabpage.cpp index fb1363ca..4644d397 100644 --- a/src/frontend/tab-pages/tabpage.cpp +++ b/src/frontend/tab-pages/tabpage.cpp @@ -4,7 +4,7 @@ * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or + * the Free Software Foundation; either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, diff --git a/src/frontend/tab-pages/tabpage.h b/src/frontend/tab-pages/tabpage.h index e3e24f77..462e38b7 100644 --- a/src/frontend/tab-pages/tabpage.h +++ b/src/frontend/tab-pages/tabpage.h @@ -4,7 +4,7 @@ * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or + * the Free Software Foundation; either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, diff --git a/src/frontend/tab-pages/wlanpage.cpp b/src/frontend/tab-pages/wlanpage.cpp index 49bd5778..5d1f506c 100644 --- a/src/frontend/tab-pages/wlanpage.cpp +++ b/src/frontend/tab-pages/wlanpage.cpp @@ -4,7 +4,7 @@ * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or + * the Free Software Foundation; either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, @@ -29,6 +29,7 @@ #define AP_SCAN_INTERVAL (20*1000) #define ICON_REFRESH_INTERVAL (5*1000) + #define LOG_FLAG "[WlanPage]" #define LAN_PAGE_INDEX 0 @@ -942,7 +943,6 @@ void WlanPage::sendApStateChangeSignal(QString uuid, { bool ret = false; ret = m_connectResource->isApConnection(uuid); - if (!ret) { return; } @@ -1600,7 +1600,6 @@ void WlanPage::showNonePwd() return; } - void WlanPage::showRate() { //定时获取网速 @@ -1632,6 +1631,8 @@ void WlanPage::showHiddenWlanPage(QString devName) m_joinHiddenWiFiPagePtrMap.insert(devName, hiddenWiFi); hiddenWiFi->show(); + KWindowSystem::raiseWindow(hiddenWiFi->winId()); + hiddenWiFi->centerToScreen(); } void WlanPage::showDetailPage(QString devName, QString ssid) @@ -1661,6 +1662,8 @@ void WlanPage::showDetailPage(QString devName, QString ssid) } }); netDetail->show(); + KWindowSystem::raiseWindow(netDetail->winId()); + netDetail->centerToScreen(); return; } diff --git a/src/frontend/tab-pages/wlanpage.h b/src/frontend/tab-pages/wlanpage.h index 41d55246..dd26c361 100644 --- a/src/frontend/tab-pages/wlanpage.h +++ b/src/frontend/tab-pages/wlanpage.h @@ -4,7 +4,7 @@ * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or + * the Free Software Foundation; either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, diff --git a/src/frontend/tools/divider.cpp b/src/frontend/tools/divider.cpp index 94fd5565..164a9d0b 100644 --- a/src/frontend/tools/divider.cpp +++ b/src/frontend/tools/divider.cpp @@ -4,7 +4,7 @@ * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or + * the Free Software Foundation; either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, diff --git a/src/frontend/tools/divider.h b/src/frontend/tools/divider.h index 7c57278f..2d493000 100644 --- a/src/frontend/tools/divider.h +++ b/src/frontend/tools/divider.h @@ -4,7 +4,7 @@ * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or + * the Free Software Foundation; either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, diff --git a/src/frontend/tools/infobutton.cpp b/src/frontend/tools/infobutton.cpp index c10663d8..3c1902c1 100644 --- a/src/frontend/tools/infobutton.cpp +++ b/src/frontend/tools/infobutton.cpp @@ -4,7 +4,7 @@ * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or + * the Free Software Foundation; either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, diff --git a/src/frontend/tools/infobutton.h b/src/frontend/tools/infobutton.h index 34e57891..308d70a4 100644 --- a/src/frontend/tools/infobutton.h +++ b/src/frontend/tools/infobutton.h @@ -4,7 +4,7 @@ * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or + * the Free Software Foundation; either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, diff --git a/src/frontend/tools/kylable.cpp b/src/frontend/tools/kylable.cpp index 175c8e20..46229b8e 100644 --- a/src/frontend/tools/kylable.cpp +++ b/src/frontend/tools/kylable.cpp @@ -4,7 +4,7 @@ * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or + * the Free Software Foundation; either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, @@ -21,6 +21,7 @@ #include #include #include + #include #include @@ -89,7 +90,6 @@ void FixLabel::changedLabelSlot() { } } - KyLable::KyLable(QWidget *parent) : QLabel(parent) { connect(qApp, &QApplication::paletteChanged, this, &KyLable::onPaletteChanged); diff --git a/src/frontend/tools/kylable.h b/src/frontend/tools/kylable.h index 5d228563..7907198b 100644 --- a/src/frontend/tools/kylable.h +++ b/src/frontend/tools/kylable.h @@ -4,7 +4,7 @@ * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or + * the Free Software Foundation; either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, diff --git a/src/frontend/tools/listitemedit.cpp b/src/frontend/tools/listitemedit.cpp index 4d47a2d0..9da6577b 100644 --- a/src/frontend/tools/listitemedit.cpp +++ b/src/frontend/tools/listitemedit.cpp @@ -4,7 +4,7 @@ * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or + * the Free Software Foundation; either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, diff --git a/src/frontend/tools/listitemedit.h b/src/frontend/tools/listitemedit.h index 901b51a6..fc7becfb 100644 --- a/src/frontend/tools/listitemedit.h +++ b/src/frontend/tools/listitemedit.h @@ -4,7 +4,7 @@ * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or + * the Free Software Foundation; either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, diff --git a/src/frontend/tools/radioitembutton.cpp b/src/frontend/tools/radioitembutton.cpp index 25f99042..27cd57c5 100644 --- a/src/frontend/tools/radioitembutton.cpp +++ b/src/frontend/tools/radioitembutton.cpp @@ -4,7 +4,7 @@ * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or + * the Free Software Foundation; either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, diff --git a/src/frontend/tools/radioitembutton.h b/src/frontend/tools/radioitembutton.h index 1904f7da..eacf0786 100644 --- a/src/frontend/tools/radioitembutton.h +++ b/src/frontend/tools/radioitembutton.h @@ -4,7 +4,7 @@ * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or + * the Free Software Foundation; either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, @@ -67,6 +67,7 @@ private: QVariantAnimation * m_animation = nullptr; QPixmap m_pixmap; + QGSettings *m_styleGSettings = nullptr; void refreshButtonIcon(); diff --git a/src/frontend/wificonfigdialog.cpp b/src/frontend/wificonfigdialog.cpp new file mode 100644 index 00000000..a6b10965 --- /dev/null +++ b/src/frontend/wificonfigdialog.cpp @@ -0,0 +1,219 @@ +/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * + * Copyright (C) 2022 Tianjin KYLIN Information Technology Co., Ltd. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. + * + */ +#include "wificonfigdialog.h" +#include "ui_wificonfigdialog.h" +#include "utils.h" + +#include +#include +#include +#include + +#include +#include + +WiFiConfigDialog::WiFiConfigDialog(QWidget *parent) : + QDialog(parent), + ui(new Ui::WiFiConfigDialog) +{ + ui->setupUi(this); + + initTransparentState(); //初始化窗口透明度的GSetting方法 + + this->setWindowFlags(Qt::FramelessWindowHint); //Qt::WindowStaysOnTopHint + this->setWindowTitle(tr("WLAN Authentication"));//"Wifi 认证" + this->setAttribute(Qt::WA_TranslucentBackground); + this->setWindowIcon(QIcon::fromTheme("kylin-network", QIcon(":/res/x/setup.png")) ); + + QPainterPath path; + auto rect = this->rect(); + rect.adjust(1, 1, -1, -1); + path.addRoundedRect(rect, 6, 6); + setProperty("blurRegion", QRegion(path.toFillPolygon().toPolygon())); + KWindowEffects::enableBlurBehind(this->winId(), true, QRegion(path.toFillPolygon().toPolygon())); + + ui->lbTitle->setText(tr("Input WLAN Information Please")); //输入Wi-Fi名称和密码后点击确定 + ui->lbWifiId->setText(tr("WLAN ID:")); //Wi-Fi连接名称: + ui->lbWifiName->setText(tr("WLAN Name:")); //Wi-Fi名称: + ui->lbWifiPassord->setText(tr("Password:")); //Wi-Fi密码: + ui->btnCancel->setText(tr("Cancl")); + ui->btnOk->setText(tr("Ok")); + ui->leWifiId->setContextMenuPolicy(Qt::NoContextMenu); + ui->leWiFiName->setContextMenuPolicy(Qt::NoContextMenu); + + ui->leWifiPassword->setContextMenuPolicy(Qt::NoContextMenu); + ui->leWifiPassword ->setEchoMode(QLineEdit::Password); + + ui->checkBoxPwd->setStyleSheet(checkBoxQss); + ui->checkBoxPwd->setFocusPolicy(Qt::NoFocus); + + ui->leWifiId->setContextMenuPolicy(Qt::NoContextMenu); //禁止LineEdit的右键菜单 + ui->leWiFiName->setContextMenuPolicy(Qt::NoContextMenu); + ui->leWifiPassword->setContextMenuPolicy(Qt::NoContextMenu); + + this->setEnableOfBtn(); + this->setFixedSize(474, 320); +} + +WiFiConfigDialog::~WiFiConfigDialog() +{ + delete ui; +} + +void WiFiConfigDialog::paintEvent(QPaintEvent *event) +{ + double trans = this->getTransparentData(); + + QStyleOption opt; + opt.init(this); + QPainter p(this); + style()->drawPrimitive(QStyle::PE_Widget, &opt, &p, this); + + QRect rect = this->rect(); + p.setRenderHint(QPainter::Antialiasing); // 反锯齿; + p.setBrush(opt.palette.color(QPalette::Base)); + p.setOpacity(trans); + p.setPen(Qt::NoPen); + p.drawRoundedRect(rect, 6, 6); + QWidget::paintEvent(event); +} + +//创建获取窗口透明度信息的GSetting的对象 +void WiFiConfigDialog::initTransparentState() +{ + if (QGSettings::isSchemaInstalled("org.ukui.control-center.personalise")) { + m_transparency_gsettings = new QGSettings("org.ukui.control-center.personalise"); + } +} + +//使用GSetting获取当前窗口应该使用的透明度 +double WiFiConfigDialog::getTransparentData() +{ + if (!m_transparency_gsettings) { + return 0.7; + } + + QStringList keys = m_transparency_gsettings->keys(); + if (keys.contains("transparency")) { + double tp = m_transparency_gsettings->get("transparency").toDouble(); + return tp; + } else { + return 0.7; + } +} + +void WiFiConfigDialog::on_btnCancel_clicked() +{ + ui->leWiFiName->setText(""); + ui->leWifiPassword->setText(""); + hide(); +} + +void WiFiConfigDialog::on_btnOk_clicked() +{ + QFuture < void > future1 = QtConcurrent::run([=](){ + this->toConfigWifi(); + }); + hide(); +} + +void WiFiConfigDialog::toConfigWifi() +{ + QString connName = ui->leWiFiName->text(); + QString password = ui->leWifiPassword->text(); + + QString strConntype = "nmcli connection modify '" + connName + "' wifi-sec.psk-flags 0"; + Utils::m_system(strConntype.toUtf8().data()); + + QString tmpPath = "/tmp/kylin-nm-btoutput-" + QDir::home().dirName(); + QString cmdStr = "export LANG='en_US.UTF-8';export LANGUAGE='en_US';nmcli device wifi connect '" + connName + "' password '" + password + "' > " + tmpPath; + Utils::m_system(cmdStr.toUtf8().data()); + + QFile file(tmpPath); + if (!file.open(QIODevice::ReadOnly | QIODevice::Text)) { + qDebug()<<"Can't open the file /tmp/kylin-nm-btoutput in function toConfigWifi !"; + } + QString line = file.readLine(); + file.close(); + qDebug()<<"connect_wifi_result: "<< line; + + if (line.indexOf("successfully") != -1) { + QString strConntype = "nmcli connection modify '" + connName + "' wifi-sec.psk-flags 2"; + system(strConntype.toUtf8().data()); + } else { + QString cmd = "export LANG='en_US.UTF-8';export LANGUAGE='en_US';nmcli connection delete '" + ui->leWifiId->text() + "'"; + int status = system(cmd.toUtf8().data()); + qDebug()<<"executed cmd="<= QT_VERSION_CHECK(5, 12, 0)) QApplication::setAttribute(Qt::AA_EnableHighDpiScaling); QApplication::setAttribute(Qt::AA_UseHighDpiPixmaps); +#endif +#if (QT_VERSION >= QT_VERSION_CHECK(5, 14, 0)) + QApplication::setHighDpiScaleFactorRoundingPolicy(Qt::HighDpiScaleFactorRoundingPolicy::PassThrough); +#endif // QApplication a(argc, argv); QString id = QString("kylin-nm"+ QLatin1String(getenv("DISPLAY"))); diff --git a/src/src.pro b/src/src.pro index 11f82c09..bfeaabda 100644 --- a/src/src.pro +++ b/src/src.pro @@ -19,7 +19,8 @@ PKGCONFIG +=kysdk-sysinfo INCLUDEPATH += /usr/include/KF5/NetworkManagerQt -LIBS += -L/usr/lib/ -lgsettings-qt -lX11 -lKF5NetworkManagerQt -lukui-log4qt -lkysec +LIBS += -L/usr/lib/ -lgsettings-qt -lX11 -lKF5NetworkManagerQt -lukui-log4qt +#LIBS += -lkysec CONFIG(release, debug|release) { !system($$PWD/translate_generation.sh): error("Failed to generate translation") @@ -43,7 +44,7 @@ INSTALLS += target \ # any feature of Qt which has been marked as deprecated (the exact warnings # depend on your compiler). Please consult the documentation of the # deprecated API in order to know how to port your code away from it. -DEFINES += QT_DEPRECATED_WARNINGS WITHKYSEC +DEFINES += QT_DEPRECATED_WARNINGS # You can also make your code fail to compile if you use deprecated APIs. # In order to do so, uncomment the following line. diff --git a/src/translations/kylin-nm_bo.ts b/src/translations/kylin-nm_bo.ts index 1e696a5f..1f8dd342 100644 --- a/src/translations/kylin-nm_bo.ts +++ b/src/translations/kylin-nm_bo.ts @@ -68,7 +68,7 @@ - + Address conflict @@ -313,23 +313,23 @@ - + Invalid address - + Invalid subnet mask - - + + Required - + Address conflict @@ -337,53 +337,53 @@ Ipv6Page - + Address - + Subnet prefix Length - + Default Gateway - + IPv6Config - + Auto(DHCP) - + Manual - - + + Required - + Invalid address - + Invalid gateway - + Address conflict @@ -429,38 +429,38 @@ LanListItem - + Not connected - + Wired Device not carried - - - + + + Disconnect - - - + + + Connect - - + + Property - - + + Delete @@ -468,12 +468,7 @@ LanPage - - No ethernet device avaliable - - - - + LAN @@ -483,33 +478,33 @@ - + Activated LAN - + Inactivated LAN - + Wired Device not carried - + Connected: - + (Limited) - + Not Connected @@ -530,43 +525,44 @@ MainWindow - + + kylin-nm - + LAN - + WLAN - + Settings - - + + Network tool - + Network Card - + Not connected to the network - + Show MainWindow @@ -602,102 +598,102 @@ - + Detail - + Security - - + + Config - + Confirm - + Cancel - + Forget this network - + IPv4 - + IPv6 - + Add LAN Connect - + Connect Hidden WLAN - + Delete this network - - - + + + None + + - - Auto - + start check ipv4 address conflict - + start check ipv6 address conflict - + this wifi no support enterprise type - + this wifi no support None type - + this wifi no support WPA2 type - + this wifi no support WPA3 type @@ -809,14 +805,14 @@ - - - - - - - - + + + + + + + + None @@ -904,26 +900,26 @@ - - - + + + Choose a CA certificate - - - + + + CA Files (*.pem *.der *.p12 *.crt *.cer *.pfx) - + Choose a PAC file - + PAC Files (*.pac) @@ -961,49 +957,6 @@ - - WiFiConfigDialog - - - Dialog - - - - - WLAN Authentication - - - - - Input WLAN Information Please - - - - - WLAN ID: - - - - - WLAN Name: - - - - - Password: - - - - - Cancl - - - - - Ok - - - WlanListItem @@ -1013,36 +966,36 @@ - - - - + + + + Disconnect - - - - + + + + Connect - - + + Property - - + + Forget - + Auto Connect @@ -1058,32 +1011,32 @@ WlanPage - + WLAN - + Activated WLAN - + Other WLAN - + Connected: - + Not Connected - + No wireless network card detected @@ -1101,17 +1054,17 @@ main - + kylinnm - + show kylin-nm wifi page - + show kylin-nm lan page diff --git a/src/translations/kylin-nm_bo_CN.ts b/src/translations/kylin-nm_bo_CN.ts index 99b3acda..8067c616 100644 --- a/src/translations/kylin-nm_bo_CN.ts +++ b/src/translations/kylin-nm_bo_CN.ts @@ -98,7 +98,7 @@ ཁ་ཆད་བཞག་པའི་སྒོ་ཆེན། - + Address conflict ཤག་གནས་གདོང་གཏུག་ @@ -629,23 +629,23 @@ ལག་དེབ། - + Invalid address རྩིས་འགྲོ་མེད་པའི་ས་གནས། - + Invalid subnet mask རྩིས་འགྲོ་མེད་པའི་དྲ་བ་འགེབས་སྲུང་བྱེད་པ། - - + + Required ངེས་པར་དུ་སྐོང་དགོས། - + Address conflict ཤག་གནས་གདོང་གཏུག་ @@ -653,22 +653,22 @@ Ipv6Page - + IPv6Config IPv6ཁུང་ཙི། - + Address སྡོད་གནས། - + Subnet prefix Length ཡན་ལག་དྲ་རྒྱའི་སྔོན་སྒྲིག་གི་རིང་ཚད། - + Default Gateway ཁ་ཆད་བཞག་པའི་སྒོ་ཆེན། @@ -681,33 +681,33 @@ ཚབ་བྱེད་རང་བཞིན་གྱི་DNS - + Auto(DHCP) རང་འགུལ་(DHCP) - + Manual ལག་དེབ། - - + + Required ངེས་པར་དུ་སྐོང་དགོས། - + Invalid address རྩིས་འགྲོ་མེད་པའི་ས་གནས། - + Invalid gateway རྩིས་འགྲོ་མེད་པའི་དྲ་བའི་འགག་སྒོ། - + Address conflict ཤག་གནས་གདོང་གཏུག་ @@ -757,38 +757,38 @@ LanListItem - + Not connected འབྲེལ་མཐུད་མི་བྱེད་པ། - + Wired Device not carried སྐུད་ཡོད་སྒྲིག་ཆས་འཁྱེར་མེད་པ། - - - + + + Disconnect འབྲེལ་ཐག་ཆད་པ། - - - + + + Connect སྦྲེལ་མཐུད་བྱེད་པ - - + + Property ངོ་བོ། - - + + Delete དྲ་རྒྱ་དེ་བསུབ་དགོས། @@ -796,12 +796,11 @@ LanPage - No ethernet device avaliable - ཨེ་ཙི་དྲ་རྒྱའི་སྒྲིག་ཆས་ལ་བཙན་འཛུལ་བྱས་མི་ཆོག། + ཨེ་ཙི་དྲ་རྒྱའི་སྒྲིག་ཆས་ལ་བཙན་འཛུལ་བྱས་མི་ཆོག། - + LAN སྐུད་ཡོད་དྲ་བ། @@ -811,12 +810,12 @@ གདོང་གཏུག་རྒྱུན་ལྡན་ལྟར་དྲ་རྒྱ་དང་འབྲེལ་མཐུད་བྱེད་ཐབས་བྲལ་བ་རེད།! - + Activated LAN ངའི་དྲ་རྒྱ། - + Inactivated LAN དྲ་བ་གཞན་དག @@ -825,7 +824,7 @@ སྐུད་ཡོད་དྲ་བ་ཆད་སོང་། - + Wired Device not carried སྐུད་ཡོད་སྒྲིག་ཆས་འཁྱེར་མེད་པ། @@ -834,18 +833,18 @@ སྐུད་ཡོད་དྲ་བ་སྦྲེལ་ཡོད། - + Connected: འབྲེལ་མཐུད་བྱུང་ཡོད།: - + Not Connected འབྲེལ་མཐུད་མ་བྱས་པ། - + (Limited) (དྲ་བར་ཚོད་འཛིན་ཐེབས་པ་རེད།) @@ -866,46 +865,47 @@ MainWindow - + + kylin-nm དྲ་རྒྱའི་ཡོ་བྱད། - + LAN 有线网络 སྐུད་ཡོད་དྲ་བ། - + WLAN 无线局域网 སྐུད་མེད་ཅུས་ཁོངས་ཀྱི་དྲ་བ། - + Show MainWindow རླུང་གཙོ་བོ་མངོན་པར་བྱས་ཡོད། - + Settings 设置网络项 སྒྲིག་བཀོད། - - + + Network tool དྲ་རྒྱའི་ལག་ཆ་ - + Network Card དྲ་བྱང་། - + Not connected to the network དྲ་རྒྱ་དང་སྦྲེལ་མཐུད་མ་བྱས་པ། @@ -945,22 +945,22 @@ དྲ་རྒྱའི་གསལ་འདེབས་གནས་ཚུལ། - + Detail ཞིབ་ཕྲའི་གནས་ཚུལ། - + IPv4 IPv4 - + IPv6 IPv6 - + Security བདེ་འཇགས། @@ -969,62 +969,62 @@ 关闭 - - + + Config བཀོད་སྒྲིག་བཅས་བྱ་དགོས། - + Confirm གཏན་འཁེལ་བྱ་དགོས། - + Cancel ཕྱིར་འཐེན། - + Forget this network དྲ་རྒྱ་འདི་བརྗེད་སོང་། - + Delete this network དྲ་རྒྱ་དེ་བསུབ་དགོས། - + Add LAN Connect སྐུད་ཡོད་དྲ་བ་ཁ་སྣོན་བྱ་དགོས། - + Connect Hidden WLAN ཧའེ་ཏེན་ཝེ་ལན་དང་འབྲེལ་མཐུད་བྱེད་པ། - - - + + + None གཅིག་ཀྱང་མེད། + + - - Auto རང་འགུལ་གྱིས་རླངས་ - + start check ipv4 address conflict ipv4ས་གནས་ཀྱི་འགལ་བ་ལ་ཞིབ་བཤེར་བྱེད་འགོ་ཚུགས། - + start check ipv6 address conflict ipv6གནས་ཡུལ་དང་འགལ་བར་ཞིབ་བཤེར་བྱེད་འགོ་ཚུགས། @@ -1037,22 +1037,22 @@ ipv6ཐག་གཅོད་གདོང་གཏུག་བྱུང་བ་རེད།! - + this wifi no support enterprise type wifiལ་རྒྱབ་སྐྱོར་མེད་པའི་ཁེ་ལས་ཀྱི་རིགས་དབྱིབས། - + this wifi no support None type wifiལ་རྒྱབ་སྐྱོར་མི་བྱེད་པར་རིགས་དབྱིབས་གཅིག་ཀྱང་མེད། - + this wifi no support WPA2 type wifiལ་རྒྱབ་སྐྱོར་མི་བྱེད་པའི་WPA2རིགས་དབྱིབས་ - + this wifi no support WPA3 type wifiལ་རྒྱབ་སྐྱོར་མི་བྱེད་པའི་WPA3རིགས་དབྱིབས་ @@ -1251,14 +1251,14 @@ - - - - - - - - + + + + + + + + None གཅིག་ཀྱང་མེད། @@ -1316,16 +1316,16 @@ ཐེངས་རེར་གསང་བ་འདི་འདྲི་རྩད་བྱེད་ཐེངས་རེ་ཡིན། - - - + + + Choose a CA certificate CAཡི་དཔང་ཡིག་འདེམས་པ། - - - + + + CA Files (*.pem *.der *.p12 *.crt *.cer *.pfx) CA དཔང་ཡིག (*.pem *.der *.p12 *.crt *.cer *.pfx) @@ -1366,13 +1366,13 @@ དེ་གཉིས་ཀ - + Choose a PAC file 选择一个PAC文件 PACཡིག་ཆ་ཞིག་བདམས་པ། - + PAC Files (*.pac) PAC文件(*.pac) PACཡིག་ཆ།(*.pac) @@ -1421,44 +1421,32 @@ WiFiConfigDialog - - Dialog - - - - WLAN Authentication - སྐུད་མེད་བདེན་དཔང་ར་སྤྲོད། + སྐུད་མེད་བདེན་དཔང་ར་སྤྲོད། - Input WLAN Information Please - སྐུད་མེད་ཆ་འཕྲིན་ནང་འཇུག་གནང་རོགས། + སྐུད་མེད་ཆ་འཕྲིན་ནང་འཇུག་གནང་རོགས། - WLAN ID: - WLAN ID: + WLAN ID: - WLAN Name: - སྐུད་མེད་མིང་།: + སྐུད་མེད་མིང་།: - Password: - གསང་གྲངས་ནི།: + གསང་གྲངས་ནི།: - Cancl - ཁན་ཁེ་ལན། + ཁན་ཁེ་ལན། - Ok - འགྲིགས། + འགྲིགས། @@ -1470,36 +1458,36 @@ - - - - + + + + Disconnect འབྲེལ་ཐག་ཆད་པ། - - - - + + + + Connect སྦྲེལ་མཐུད་བྱེད་པ - - + + Forget བརྗེད་པ། - - + + Property ངོ་བོ། - + Auto Connect རང་འགུལ་གྱིས་སྦྲེལ་མཐུད་ @@ -1519,22 +1507,22 @@ WlanPage - + WLAN སྐུད་མེད་ཅུས་ཁོངས་ཀྱི་དྲ་བ། - + No wireless network card detected སྐུད་མེད་དྲ་རྒྱའི་བྱང་བུ་མ་རྙེད་པ། - + Activated WLAN ངའི་དྲ་རྒྱ། - + Other WLAN དྲ་བ་གཞན་དག @@ -1553,12 +1541,12 @@ སྐུད་མེད་དྲ་རྒྱ་ཆད་སོང་། - + Connected: འབྲེལ་མཐུད་བྱུང་ཡོད།: - + Not Connected འབྲེལ་མཐུད་མ་བྱས་པ། @@ -1625,17 +1613,17 @@ main - + kylinnm - + show kylin-nm wifi page སྐུད་མེད་དྲ་རྒྱའི་ངོས་མངོན་པར་བྱས་ཡོད། - + show kylin-nm lan page སྐུད་ཡོད་དྲ་རྒྱའི་ཤོག་ངོས་མངོན་པར་བྱས་ཡོད། diff --git a/src/translations/kylin-nm_mn.ts b/src/translations/kylin-nm_mn.ts index 8bf0d3dd..1a536303 100644 --- a/src/translations/kylin-nm_mn.ts +++ b/src/translations/kylin-nm_mn.ts @@ -98,7 +98,7 @@ ᠠᠶᠠᠳᠠᠯ ᠨᠧᠲ ᠪᠤᠭᠤᠮᠳᠠ - + Address conflict ᠬᠠᠶᠢᠭ ᠤ᠋ᠨ ᠮᠦᠷᠬᠦᠯᠳᠦᠬᠡᠨ @@ -613,23 +613,23 @@ ᠭᠠᠷ᠎ᠢᠶᠠᠷ ᠬᠦᠳᠡᠯᠭᠡᠬᠦ᠌ - + Invalid address ᠬᠦᠴᠦᠨ ᠦᠬᠡᠢ ᠬᠠᠶᠢᠭ - + Invalid subnet mask ᠬᠦᠴᠦᠨ ᠦᠬᠡᠢ ᠬᠤᠪᠢᠶᠠᠷᠢ ᠰᠦᠯᠵᠢᠶᠡᠨ ᠤ᠋ ᠬᠠᠯᠬᠠᠪᠴᠢ - - + + Required ᠡᠷᠬᠡᠪᠰᠢ ᠳᠠᠭᠯᠠᠬᠤ - + Address conflict ᠬᠠᠶᠢᠭ ᠤ᠋ᠨ ᠮᠦᠷᠬᠦᠯᠳᠦᠬᠡᠨ @@ -637,22 +637,22 @@ Ipv6Page - + IPv6Config IPv6 ᠳᠤᠬᠢᠷᠠᠭᠤᠯᠭ᠎ᠠ - + Address ᠬᠠᠶᠢᠭ - + Subnet prefix Length ᠬᠤᠪᠢᠶᠠᠷᠢ ᠰᠦᠯᠵᠢᠶᠡᠨ ᠤ᠋ ᠤᠭᠳᠤᠪᠤᠷᠢ ᠵᠢᠨ ᠤᠷᠳᠤ - + Default Gateway ᠠᠶᠠᠳᠠᠯ ᠨᠧᠲ ᠪᠤᠭᠤᠮᠳᠠ @@ -665,33 +665,33 @@ ᠪᠡᠯᠡᠳᠬᠡᠯ ᠰᠤᠩᠭᠤᠯᠳᠠ DNS - + Auto(DHCP) ᠠᠦ᠋ᠲ᠋ᠤ᠋ (DHCP) - + Manual ᠭᠠᠷ᠎ᠢᠶᠠᠷ ᠬᠦᠳᠡᠯᠭᠡᠬᠦ᠌ - - + + Required ᠡᠷᠬᠡᠪᠰᠢ ᠳᠠᠭᠯᠠᠬᠤ - + Invalid address ᠬᠦᠴᠦᠨ ᠦᠬᠡᠢ ᠬᠠᠶᠢᠭ - + Invalid gateway ᠬᠦᠴᠦᠨ ᠦᠬᠡᠢ ᠨᠧᠲ ᠪᠤᠭᠤᠮᠳᠠ - + Address conflict ᠬᠠᠶᠢᠭ ᠤ᠋ᠨ ᠮᠦᠷᠬᠦᠯᠳᠦᠬᠡᠨ @@ -737,38 +737,38 @@ LanListItem - + Not connected ᠴᠦᠷᠬᠡᠯᠡᠭᠡ ᠦᠬᠡᠢ - + Wired Device not carried ᠰᠦᠯᠵᠢᠶᠡᠨ ᠤ᠋ ᠤᠳᠠᠰᠤ ᠵᠠᠯᠭᠠᠭ᠎ᠠ ᠦᠬᠡᠢ - - - + + + Disconnect ᠳᠠᠰᠤᠯᠬᠤ - - - + + + Connect ᠴᠦᠷᠬᠡᠯᠡᠬᠡ - - + + Property ᠬᠠᠷᠢᠶᠠᠯᠠᠯ - - + + Delete ᠲᠤᠰ ᠰᠦᠯᠵᠢᠶ᠎ᠡ ᠵᠢ ᠬᠠᠰᠤᠬᠤ @@ -776,12 +776,11 @@ LanPage - No ethernet device avaliable - ᠤᠳᠠᠰᠤᠳᠤ ᠳᠦᠬᠦᠬᠡᠷᠦᠮᠵᠢ ᠵᠢ ᠪᠠᠢᠴᠠᠭᠠᠵᠤ ᠤᠯᠤᠭᠰᠠᠨ ᠦᠬᠡᠢ + ᠤᠳᠠᠰᠤᠳᠤ ᠳᠦᠬᠦᠬᠡᠷᠦᠮᠵᠢ ᠵᠢ ᠪᠠᠢᠴᠠᠭᠠᠵᠤ ᠤᠯᠤᠭᠰᠠᠨ ᠦᠬᠡᠢ - + LAN ᠤᠳᠠᠰᠤᠳᠤ ᠲᠤᠤᠷ ᠰᠦᠯᠵᠢᠶ᠎ᠡ @@ -791,12 +790,12 @@ ᠮᠦᠷᠬᠦᠯᠳᠦᠬᠦ᠂ ᠰᠦᠯᠵᠢᠶᠡᠨ ᠳ᠋ᠤ᠌ ᠬᠡᠪ ᠤ᠋ᠨ ᠴᠦᠷᠬᠡᠯᠡᠵᠤ ᠴᠢᠳᠠᠬᠤ ᠥᠬᠡᠢ! - + Activated LAN ᠮᠢᠨᠤ ᠲᠤᠤᠷ ᠰᠦᠯᠵᠢᠶ᠎ᠡ - + Inactivated LAN ᠪᠤᠰᠤᠳ ᠲᠤᠤᠷ ᠰᠦᠯᠵᠢᠶ᠎ᠡ @@ -805,7 +804,7 @@ ᠤᠳᠠᠰᠤᠳᠤ ᠲᠤᠤᠷ ᠰᠦᠯᠵᠢᠶ᠎ᠡ ᠵᠢ ᠨᠢᠭᠡᠨᠳᠡ ᠳᠠᠰᠤᠯᠪᠠ - + Wired Device not carried ᠰᠦᠯᠵᠢᠶᠡᠨ ᠤ᠋ ᠤᠳᠠᠰᠤ ᠵᠠᠯᠭᠠᠭ᠎ᠠ ᠦᠬᠡᠢ @@ -814,18 +813,18 @@ ᠤᠳᠠᠰᠤᠳᠤ ᠲᠤᠤᠷ ᠰᠦᠯᠵᠢᠶ᠎ᠡ ᠵᠢ ᠨᠢᠭᠡᠨᠳᠡ ᠴᠦᠷᠬᠡᠯᠡᠪᠡ - + Connected: ᠴᠥᠷᠬᠡᠯᠡᠪᠡ: - + Not Connected ᠴᠥᠷᠬᠡᠯᠡᠭᠡ ᠥᠬᠡᠢ - + (Limited) ( ᠰᠦᠯᠵᠢᠶ᠎ᠡ ᠬᠢᠵᠠᠭᠠᠷᠯᠠᠭᠳᠠᠪᠠ) @@ -846,46 +845,47 @@ MainWindow - + + kylin-nm ᠲᠤᠤᠷ ᠰᠦᠯᠵᠢᠶᠡᠨ ᠤ᠋ ᠪᠠᠭᠠᠵᠢ - + LAN 有线网络 ᠤᠳᠠᠰᠤᠳᠤ ᠰᠦᠯᠵᠢᠶ᠎ᠡ - + WLAN 无线局域网 ᠤᠳᠠᠰᠤ ᠦᠬᠡᠢ ᠬᠡᠰᠡᠭ ᠰᠦᠯᠵᠢᠶ᠎ᠡ - + Show MainWindow ᠲᠤᠤᠷ ᠰᠦᠯᠵᠢᠶᠡᠨ ᠤ᠋ ᠪᠠᠭᠠᠵᠢ ᠵᠢ ᠨᠡᠬᠡᠬᠡᠬᠦ - + Settings ᠲᠤᠤᠷ ᠰᠦᠯᠵᠢᠶᠡᠨ ᠤ᠋ ᠲᠦᠷᠦᠯ ᠢ᠋ ᠳᠤᠬᠢᠷᠠᠭᠤᠯᠬᠤ ᠲᠤᠤᠷ ᠰᠦᠯᠵᠢᠶᠡᠨ ᠤ᠋ ᠲᠦᠷᠦᠯ ᠢ᠋ ᠳᠤᠬᠢᠷᠠᠭᠤᠯᠬᠤ - - + + Network tool ᠰᠦᠯᠵᠢᠶᠡᠨ ᠤ᠋ ᠪᠠᠭᠠᠵᠢ - + Network Card ᠰᠦᠯᠵᠢᠶᠡᠨ ᠤ᠋ ᠺᠠᠷᠲ - + Not connected to the network ᠰᠦᠯᠵᠢᠶᠡᠨ ᠳ᠋ᠤ᠌ ᠴᠥᠷᠬᠡᠯᠡᠭᠡ ᠥᠬᠡᠢ @@ -921,22 +921,22 @@ ᠲᠤᠤᠷ ᠰᠦᠯᠵᠢᠶᠡᠨ ᠤ᠋ ᠰᠠᠨᠠᠭᠤᠯᠤᠮᠵᠢ ᠵᠢᠨ ᠮᠡᠳᠡᠭᠡ - + Detail ᠳᠡᠯᠭᠡᠷᠡᠩᠭᠦᠢ ᠠᠭᠤᠯᠭ᠎ᠠ - + IPv4 IPv4 - + IPv6 IPv6 - + Security ᠠᠮᠤᠷ ᠳᠦᠪᠰᠢᠨ @@ -945,62 +945,62 @@ 关闭 - - + + Config ᠳᠤᠬᠢᠷᠠᠭᠤᠯᠭ᠎ᠠ - + Confirm ᠪᠠᠳᠤᠯᠠᠬᠤ - + Cancel ᠦᠬᠡᠢᠰᠬᠡᠬᠦ - + Forget this network ᠲᠤᠰ ᠲᠤᠤᠷ ᠰᠦᠯᠵᠢᠶ᠎ᠡ ᠵᠢ ᠮᠠᠷᠳᠠᠬᠤ - + Delete this network ᠲᠤᠰ ᠰᠦᠯᠵᠢᠶ᠎ᠡ ᠵᠢ ᠬᠠᠰᠤᠬᠤ - + Add LAN Connect ᠤᠳᠠᠰᠤᠳᠤ ᠲᠤᠤᠷ ᠰᠦᠯᠵᠢᠶ᠎ᠡ ᠨᠡᠮᠡᠬᠦ - + Connect Hidden WLAN ᠨᠢᠭᠤᠴᠠᠯᠠᠭᠰᠠᠨ WLAN ᠲᠤ᠌/ ᠳ᠋ᠤ᠌ ᠴᠦᠷᠬᠡᠯᠡᠬᠦ - - - + + + None ᠦᠬᠡᠢ + + - - Auto ᠠᠦ᠋ᠲ᠋ᠤ᠋ - + start check ipv4 address conflict ipv4 ᠬᠠᠶᠢᠭ ᠤ᠋ᠨ ᠮᠦᠷᠬᠦᠯᠳᠦᠬᠡᠨ ᠢ᠋ ᠪᠠᠢᠴᠠᠭᠠᠵᠤ ᠡᠬᠢᠯᠡᠪᠡ - + start check ipv6 address conflict ipv6 ᠬᠠᠶᠢᠭ ᠤ᠋ᠨ ᠮᠦᠷᠬᠦᠯᠳᠦᠬᠡᠨ ᠢ᠋ ᠪᠠᠢᠴᠠᠭᠠᠵᠤ ᠡᠬᠢᠯᠡᠪᠡ @@ -1013,22 +1013,22 @@ ipv6 ᠬᠠᠶᠢᠭ ᠮᠦᠷᠬᠦᠯᠳᠦᠬᠡᠨ ᠲᠠᠢ! - + this wifi no support enterprise type ᠲᠤᠰ wifi ᠠᠵᠤ ᠠᠬᠤᠢᠯᠠᠯ ᠤ᠋ᠨ ᠰᠦᠯᠵᠢᠶᠡᠨ ᠤ᠋ ᠲᠦᠷᠦᠯ ᠢ᠋ ᠳᠡᠮᠵᠢᠬᠦ ᠦᠬᠡᠢ - + this wifi no support None type ᠲᠤᠰ wifi ᠬᠤᠭᠤᠰᠤᠨ ᠬᠡᠯᠪᠡᠷᠢ ᠵᠢ ᠳᠡᠮᠵᠢᠬᠦ ᠦᠬᠡᠢ - + this wifi no support WPA2 type ᠲᠤᠰ wifiWPA2 ᠳᠦᠷᠦᠯ ᠢ᠋ ᠳᠡᠮᠵᠢᠬᠦ ᠦᠬᠡᠢ - + this wifi no support WPA3 type ᠲᠤᠰ wifiWPA3 ᠳᠦᠷᠦᠯ ᠢ᠋ ᠳᠡᠮᠵᠢᠬᠦ ᠦᠬᠡᠢ @@ -1227,14 +1227,14 @@ - - - - - - - - + + + + + + + + None ᠦᠬᠡᠢ @@ -1292,16 +1292,16 @@ ᠤᠳᠠᠭ᠎ᠠ ᠪᠦᠷᠢ ᠲᠤᠰ ᠨᠢᠭᠤᠴᠠ ᠺᠣᠳ᠋ ᠢ᠋ ᠠᠰᠠᠭᠤᠨ ᠯᠠᠪᠯᠠᠬᠤ - - - + + + Choose a CA certificate ᠨᠢᠭᠡ CA ᠬᠡᠷᠡᠴᠢᠯᠡᠯ ᠰᠤᠩᠭᠤᠬᠤ - - - + + + CA Files (*.pem *.der *.p12 *.crt *.cer *.pfx) CA ᠬᠡᠷᠡᠴᠢᠯᠡᠯ (*.pem *.der *.p12 *.crt *.cer *.pfx) @@ -1336,12 +1336,12 @@ ᠬᠣᠶᠠᠭᠤᠯᠠ ᠵᠢ ᠠᠭᠤᠰᠤᠯᠴᠠᠭᠤᠯᠵᠤ ᠬᠡᠷᠡᠭᠯᠡᠬᠦ - + Choose a PAC file ᠨᠢᠭᠡ PAC ᠹᠠᠢᠯ ᠰᠣᠩᠭᠣᠬᠤ - + PAC Files (*.pac) PAC ᠹᠠᠢᠯ (*.pac) @@ -1382,44 +1382,32 @@ WiFiConfigDialog - - Dialog - - - - WLAN Authentication - WLAN ᠬᠡᠷᠡᠴᠢᠯᠡᠯ + WLAN ᠬᠡᠷᠡᠴᠢᠯᠡᠯ - Input WLAN Information Please - WLAN ᠰᠤᠷᠠᠭ ᠵᠠᠩᠬᠢ ᠵᠢ ᠤᠷᠤᠭᠤᠯᠤᠭᠠᠷᠠᠢ + WLAN ᠰᠤᠷᠠᠭ ᠵᠠᠩᠬᠢ ᠵᠢ ᠤᠷᠤᠭᠤᠯᠤᠭᠠᠷᠠᠢ - WLAN ID: - WLAN ID: + WLAN ID: - WLAN Name: - WLAN ᠨᠡᠷᠡᠢᠳᠦᠯ: + WLAN ᠨᠡᠷᠡᠢᠳᠦᠯ: - Password: - ᠨᠢᠭᠤᠴᠠ ᠺᠤᠳ᠋: + ᠨᠢᠭᠤᠴᠠ ᠺᠤᠳ᠋: - Cancl - ᠦᠬᠡᠢᠰᠬᠡᠬᠦ + ᠦᠬᠡᠢᠰᠬᠡᠬᠦ - Ok - Ok + Ok @@ -1431,36 +1419,36 @@ - - - - + + + + Disconnect ᠳᠠᠰᠤᠯᠬᠤ - - - - + + + + Connect ᠴᠦᠷᠬᠡᠯᠡᠬᠡ - - + + Forget ᠲᠤᠰ ᠲᠤᠤᠷ ᠰᠦᠯᠵᠢᠶ᠎ᠡ ᠵᠢ ᠮᠠᠷᠳᠠᠬᠤ - - + + Property ᠬᠠᠷᠢᠶᠠᠯᠠᠯ - + Auto Connect ᠲᠤᠰ ᠲᠤᠤᠷ ᠰᠦᠯᠵᠢᠶᠡᠨ ᠳ᠋ᠤ᠌ ᠠᠦ᠋ᠲ᠋ᠤ᠋ ᠪᠡᠷ ᠵᠠᠯᠭᠠᠬᠤ @@ -1480,22 +1468,22 @@ WlanPage - + WLAN ᠤᠳᠠᠰᠤ ᠦᠬᠡᠢ ᠬᠡᠰᠡᠭ ᠰᠦᠯᠵᠢᠶ᠎ᠡ - + No wireless network card detected ᠤᠳᠠᠰᠤ ᠦᠬᠡᠢ ᠰᠦᠯᠵᠢᠶᠡᠨ ᠺᠠᠷᠲ᠎ᠢ ᠬᠢᠨᠠᠨ ᠬᠡᠮᠵᠢᠵᠤ ᠤᠯᠤᠭᠰᠠᠨ ᠦᠬᠡᠢ - + Activated WLAN ᠮᠢᠨᠤ ᠲᠤᠤᠷ ᠰᠦᠯᠵᠢᠶ᠎ᠡ - + Other WLAN ᠪᠤᠰᠤᠳ ᠰᠦᠯᠵᠢᠶ᠎ᠡ @@ -1514,12 +1502,12 @@ ᠤᠳᠠᠰᠤ ᠦᠬᠡᠢ ᠲᠤᠤᠷ ᠰᠦᠯᠵᠢᠶ᠎ᠡ ᠵᠢ ᠳᠠᠰᠤᠯᠪᠠ - + Connected: ᠴᠥᠷᠬᠡᠯᠡᠪᠡ: - + Not Connected ᠴᠥᠷᠬᠡᠯᠡᠭᠡ ᠥᠬᠡᠢ @@ -1586,17 +1574,17 @@ main - + kylinnm - + show kylin-nm wifi page - + show kylin-nm lan page diff --git a/src/translations/kylin-nm_tr.ts b/src/translations/kylin-nm_tr.ts index dd371e3a..e79ac137 100644 --- a/src/translations/kylin-nm_tr.ts +++ b/src/translations/kylin-nm_tr.ts @@ -166,7 +166,7 @@ - + Address conflict @@ -1332,23 +1332,23 @@ Elle - + Invalid address - + Invalid subnet mask - - + + Required - + Address conflict @@ -1356,53 +1356,53 @@ Ipv6Page - + Address - + Subnet prefix Length - + Default Gateway - + IPv6Config - + Auto(DHCP) Oto(DHCP) - + Manual Elle - - + + Required - + Invalid address - + Invalid gateway - + Address conflict @@ -1455,38 +1455,38 @@ LanListItem - + Not connected Bağlanamadı - + Wired Device not carried - - - + + + Disconnect Bağlantıyı Kes - - - + + + Connect - - + + Property - - + + Delete @@ -1494,12 +1494,7 @@ LanPage - - No ethernet device avaliable - - - - + LAN @@ -1509,33 +1504,33 @@ - + Activated LAN - + Inactivated LAN - + Wired Device not carried - + Connected: - + (Limited) - + Not Connected @@ -1556,7 +1551,8 @@ MainWindow - + + kylin-nm @@ -1577,33 +1573,33 @@ Gizli Ağı Bağlan - + LAN - + WLAN WLAN - + Settings - - + + Network tool - + Network Card - + Not connected to the network @@ -1620,7 +1616,7 @@ HotSpot - + Show MainWindow Ana Pencereyi Göster @@ -1744,102 +1740,102 @@ - + Detail - + Security - - + + Config Ayar - + Confirm - + Cancel - + Forget this network - + IPv4 IPv6 adresi: {4?} - + IPv6 IPv6 adresi: {6?} - + Add LAN Connect - + Connect Hidden WLAN - + Delete this network - - - + + + None Yok + + - - Auto Oto - + start check ipv4 address conflict - + start check ipv6 address conflict - + this wifi no support enterprise type - + this wifi no support None type - + this wifi no support WPA2 type - + this wifi no support WPA3 type @@ -2149,14 +2145,14 @@ - - - - - - - - + + + + + + + + None Yok @@ -2244,26 +2240,26 @@ Her ikisi de - - - + + + Choose a CA certificate - - - + + + CA Files (*.pem *.der *.p12 *.crt *.cer *.pfx) - + Choose a PAC file - + PAC Files (*.pac) @@ -2311,44 +2307,8 @@ WiFiConfigDialog - - Dialog - - - - - WLAN Authentication - - - - - Input WLAN Information Please - - - - - WLAN ID: - - - - - WLAN Name: - - - - - Password: - - - - - Cancl - - - - Ok - Tamam + Tamam @@ -2360,36 +2320,36 @@ - - - - + + + + Disconnect Bağlantıyı Kes - - - - + + + + Connect - - + + Property - - + + Forget - + Auto Connect @@ -2405,32 +2365,32 @@ WlanPage - + WLAN WLAN - + Activated WLAN - + Other WLAN - + Connected: - + Not Connected - + No wireless network card detected @@ -2463,17 +2423,17 @@ main - + kylinnm - + show kylin-nm wifi page - + show kylin-nm lan page diff --git a/src/translations/kylin-nm_zh_CN.ts b/src/translations/kylin-nm_zh_CN.ts index fe037c5e..eb2b23a9 100644 --- a/src/translations/kylin-nm_zh_CN.ts +++ b/src/translations/kylin-nm_zh_CN.ts @@ -98,7 +98,7 @@ 默认网关 - + Address conflict 地址冲突 @@ -629,23 +629,23 @@ 手动 - + Invalid address 无效的IP地址 - + Invalid subnet mask 无效的子网掩码 - - + + Required 必填 - + Address conflict 地址冲突 @@ -653,22 +653,22 @@ Ipv6Page - + IPv6Config IPv6 配置 - + Address 地址 - + Subnet prefix Length 子网前缀长度 - + Default Gateway 默认网关 @@ -681,33 +681,33 @@ 备选 DNS - + Auto(DHCP) 自动 - + Manual 手动 - - + + Required 必填 - + Invalid address 无效的IP地址 - + Invalid gateway 无效的网关地址 - + Address conflict 地址冲突 @@ -757,38 +757,38 @@ LanListItem - + Not connected 未连接 - + Wired Device not carried 未插入网线 - - - + + + Disconnect 断开 - - - + + + Connect 连接 - - + + Property 属性 - - + + Delete 删除此网络 @@ -796,12 +796,11 @@ LanPage - No ethernet device avaliable - 未检测到有线设备 + 未检测到有线设备 - + LAN 有线网络 @@ -811,12 +810,12 @@ 冲突,无法正常连接到网络! - + Activated LAN 我的网络 - + Inactivated LAN 其他网络 @@ -825,7 +824,7 @@ 有线网络已断开 - + Wired Device not carried 未插入网线 @@ -834,18 +833,18 @@ 有线网络已连接 - + Connected: 已连接: - + Not Connected 未连接 - + (Limited) (网络受限) @@ -866,46 +865,47 @@ MainWindow - + + kylin-nm 网络工具 - + LAN 有线网络 有线网络 - + WLAN 无线局域网 无线局域网 - + Show MainWindow 打开网络工具 - + Settings 设置网络项 设置网络项 - - + + Network tool 网络工具 - + Network Card 网卡 - + Not connected to the network 未连接网络 @@ -941,22 +941,22 @@ 网络提示消息 - + Detail 详情 - + IPv4 IPv4 - + IPv6 IPv6 - + Security 安全 @@ -965,62 +965,62 @@ 关闭 - - + + Config 配置 - + Confirm 确定 - + Cancel 取消 - + Forget this network 忘记此网络 - + Delete this network 删除此网络 - + Add LAN Connect 添加有线网络 - + Connect Hidden WLAN 连接到隐藏 WLAN - - - + + + None + + - - Auto 自动 - + start check ipv4 address conflict 开始检测 ipv4 地址冲突 - + start check ipv6 address conflict 开始检测 ipv6 地址冲突 @@ -1033,22 +1033,22 @@ ipv6地址冲突! - + this wifi no support enterprise type 此 wifi 不支持企业网类型 - + this wifi no support None type 此 wifi 不支持空类型 - + this wifi no support WPA2 type 此 wifi 不支持 WPA2 类型 - + this wifi no support WPA3 type 此 wifi 不支持 WPA3 类型 @@ -1247,14 +1247,14 @@ - - - - - - - - + + + + + + + + None @@ -1312,16 +1312,16 @@ 每次询问这个密码 - - - + + + Choose a CA certificate 选择一个 CA 证书 - - - + + + CA Files (*.pem *.der *.p12 *.crt *.cer *.pfx) CA 证书 (*.pem *.der *.p12 *.crt *.cer *.pfx) @@ -1356,12 +1356,12 @@ 两者兼用 - + Choose a PAC file 选择一个 PAC 文件 - + PAC Files (*.pac) PAC 文件(*.pac) @@ -1406,49 +1406,6 @@ 未插入网线 - - WiFiConfigDialog - - - Dialog - - - - - WLAN Authentication - - - - - Input WLAN Information Please - - - - - WLAN ID: - - - - - WLAN Name: - - - - - Password: - - - - - Cancl - - - - - Ok - - - WlanListItem @@ -1458,36 +1415,36 @@ - - - - + + + + Disconnect 断开 - - - - + + + + Connect 连接 - - + + Forget 忘记此网络 - - + + Property 属性 - + Auto Connect 自动加入该网络 @@ -1507,22 +1464,22 @@ WlanPage - + WLAN 无线局域网 - + No wireless network card detected 未检测到无线网卡 - + Activated WLAN 我的网络 - + Other WLAN 其他网络 @@ -1541,12 +1498,12 @@ 无线网络已断开 - + Connected: 已连接: - + Not Connected 未连接 @@ -1613,17 +1570,17 @@ main - + kylinnm - + show kylin-nm wifi page - + show kylin-nm lan page