Merge branch 'yhkylin/v101' of https://gitlab2.kylin.com/kylinos-src/kylin-nm into v101-local

This commit is contained in:
chenxuechao 2023-02-13 11:14:26 +08:00
commit e5ad300564
44 changed files with 829 additions and 432 deletions

38
debian/changelog vendored
View File

@ -1,3 +1,41 @@
kylin-nm (3.20.1.17-0k0.7) v101; urgency=medium
* BUG号
- #153983 【整机生态-SP1-2209-第二阶段】【特殊机型】【T323】跑reboot过程中出现任务栏网络图标丢失的情况
* 需求号:无
* 其他改动:
* 影响域:无
-- zhaoshixu <zhaoshixu@kylinos.cn> Thu, 09 Feb 2023 17:52:00 +0800
kylin-nm (3.20.1.17-0k0.6) v101; urgency=medium
* BUG号
- #113072【任务栏】在任务栏网络页面的右侧右击未连接的网络列表“连接”按钮显示被遮挡
- #151281【rc8.3走查】【托盘】【网络】呼出右键菜单无需取消选择
- #156615【设计】存在多个连接其他网络弹窗
- #156764【网络连接】托盘和控制面板中可以同时打开两个属性界面。
* 需求号:无
* 其他改动:
* 影响域:选中效果 加入网络页面 属性页
-- zhaoshixu <zhaoshixu@kylinos.cn> Fri, 03 Feb 2023 14:39:12 +0800
kylin-nm (3.20.1.17-0k0.5) v101; urgency=medium
* BUG号
- #148868【控制面板-网络】移动热点连接设备列表条目文字显示未居中,下边缘为直角
- #155087【控制面板】英文模式下网络模块搜索不到内容
- #154969【网络代理】深色主题下应用代理显示异常
- #154699【防火墙】【网络模式配置】右键删除此网络或者忘记此网络防火墙公用专用网络后仍然显示为“使用中”
- #154628【网络】由浅色主题更改深色主题后悬浮到已添加的有线网络窗口主题颜色异常
- #155602【网络连接】深色模式下设置-网络-无线局域网界面的加载动态图标未反白
* 需求号:无
* 其他改动:
* 影响域:主题样式 控制面板搜索
-- zhaoshixu <zhaoshixu@kylinos.cn> Tue, 17 Jan 2023 13:51:52 +0800
kylin-nm (3.20.1.17-0k0.4) v101; urgency=medium
* BUG号

View File

@ -34,11 +34,7 @@ AddNetBtn::AddNetBtn(bool isWlan, QWidget *parent) : QPushButton(parent)
this->setMaximumSize(QSize(16777215, 60));
this->setProperty("useButtonPalette", true);
this->setFlat(true);
QPalette pal = this->palette();
QColor color = pal.color(QPalette::Button);
color.setAlphaF(0.5);
pal.setColor(QPalette::Button, color);
this->setPalette(pal);
QHBoxLayout *addLyt = new QHBoxLayout;
QLabel *iconLabel = new QLabel();
@ -62,7 +58,6 @@ AddNetBtn::AddNetBtn(bool isWlan, QWidget *parent) : QPushButton(parent)
addLyt->addStretch();
this->setLayout(addLyt);
}
AddNetBtn::~AddNetBtn()
@ -84,12 +79,17 @@ void AddNetBtn::leaveEvent(QEvent *event){
void AddNetBtn::paintEvent(QPaintEvent *event)
{
QPalette pal = this->palette();
QPalette pal = qApp->palette();
QPainter painter(this);
painter.setRenderHint(QPainter:: Antialiasing, true); //设置渲染,启动反锯齿
painter.setPen(Qt::NoPen);
painter.setBrush(pal.color(QPalette::Base));
painter.setBrush(this->palette().base().color());
QColor color = pal.color(QPalette::Button);
color.setAlphaF(0.5);
pal.setColor(QPalette::Button, color);
this->setPalette(pal);
QRect rect = this->rect();
QPainterPath path;

View File

@ -49,4 +49,5 @@ TRANSLATIONS += \
translations/zh_CN.ts \
translations/tr.ts \
translations/bo.ts\
translations/bo_CN.ts
translations/bo_CN.ts \
translations/en_US.ts

View File

@ -4,7 +4,7 @@
<context>
<name>BlacklistItem</name>
<message>
<location filename="../blacklistitem.cpp" line="49"/>
<location filename="../blacklistitem.cpp" line="50"/>
<source>Remove</source>
<translation type="unfinished"></translation>
</message>
@ -12,7 +12,7 @@
<context>
<name>BlacklistPage</name>
<message>
<location filename="../blacklistpage.cpp" line="45"/>
<location filename="../blacklistpage.cpp" line="47"/>
<source>Blacklist</source>
<translation type="unfinished"></translation>
</message>
@ -20,7 +20,7 @@
<context>
<name>ConnectDevListItem</name>
<message>
<location filename="../connectdevlistitem.cpp" line="49"/>
<location filename="../connectdevlistitem.cpp" line="50"/>
<source>drag into blacklist</source>
<translation type="unfinished"></translation>
</message>
@ -28,7 +28,7 @@
<context>
<name>ConnectdevPage</name>
<message>
<location filename="../connectdevpage.cpp" line="46"/>
<location filename="../connectdevpage.cpp" line="48"/>
<source>Connect device</source>
<translation type="unfinished"></translation>
</message>
@ -56,79 +56,69 @@
<context>
<name>MobileHotspotWidget</name>
<message>
<location filename="../mobilehotspotwidget.cpp" line="59"/>
<location filename="../mobilehotspotwidget.cpp" line="61"/>
<source>ukui control center</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../mobilehotspotwidget.cpp" line="62"/>
<location filename="../mobilehotspotwidget.cpp" line="64"/>
<source>ukui control center desktop message</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../mobilehotspotwidget.cpp" line="138"/>
<location filename="../mobilehotspotwidget.cpp" line="149"/>
<source>wirless switch is close or no wireless device</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../mobilehotspotwidget.cpp" line="142"/>
<source>start to close hotspot</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../mobilehotspotwidget.cpp" line="151"/>
<location filename="../mobilehotspotwidget.cpp" line="169"/>
<source>hotpots name or device is invalid</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../mobilehotspotwidget.cpp" line="158"/>
<source>start to open hotspot </source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../mobilehotspotwidget.cpp" line="489"/>
<location filename="../mobilehotspotwidget.cpp" line="490"/>
<source>Contains at least 8 characters</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../mobilehotspotwidget.cpp" line="205"/>
<location filename="../mobilehotspotwidget.cpp" line="223"/>
<source>Hotspot</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../mobilehotspotwidget.cpp" line="295"/>
<location filename="../mobilehotspotwidget.cpp" line="610"/>
<location filename="../mobilehotspotwidget.cpp" line="310"/>
<location filename="../mobilehotspotwidget.cpp" line="605"/>
<source>hotspot already close</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../mobilehotspotwidget.cpp" line="435"/>
<location filename="../mobilehotspotwidget.cpp" line="436"/>
<source>Open</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../mobilehotspotwidget.cpp" line="456"/>
<location filename="../mobilehotspotwidget.cpp" line="457"/>
<source>Wi-Fi Name</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../mobilehotspotwidget.cpp" line="477"/>
<location filename="../mobilehotspotwidget.cpp" line="478"/>
<source>Password</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../mobilehotspotwidget.cpp" line="518"/>
<location filename="../mobilehotspotwidget.cpp" line="519"/>
<source>Frequency band</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../mobilehotspotwidget.cpp" line="544"/>
<location filename="../mobilehotspotwidget.cpp" line="545"/>
<source>Net card</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../mobilehotspotwidget.cpp" line="639"/>
<location filename="../mobilehotspotwidget.cpp" line="647"/>
<location filename="../mobilehotspotwidget.cpp" line="635"/>
<location filename="../mobilehotspotwidget.cpp" line="643"/>
<source>hotspot already open</source>
<translation type="unfinished"></translation>
</message>

View File

@ -4,7 +4,7 @@
<context>
<name>BlacklistItem</name>
<message>
<location filename="../blacklistitem.cpp" line="49"/>
<location filename="../blacklistitem.cpp" line="50"/>
<source>Remove</source>
<translation></translation>
</message>
@ -12,7 +12,7 @@
<context>
<name>BlacklistPage</name>
<message>
<location filename="../blacklistpage.cpp" line="45"/>
<location filename="../blacklistpage.cpp" line="47"/>
<source>Blacklist</source>
<translation></translation>
</message>
@ -20,7 +20,7 @@
<context>
<name>ConnectDevListItem</name>
<message>
<location filename="../connectdevlistitem.cpp" line="49"/>
<location filename="../connectdevlistitem.cpp" line="50"/>
<source>drag into blacklist</source>
<translation></translation>
</message>
@ -28,7 +28,7 @@
<context>
<name>ConnectdevPage</name>
<message>
<location filename="../connectdevpage.cpp" line="46"/>
<location filename="../connectdevpage.cpp" line="48"/>
<source>Connect device</source>
<translation></translation>
</message>
@ -56,27 +56,26 @@
<context>
<name>MobileHotspotWidget</name>
<message>
<location filename="../mobilehotspotwidget.cpp" line="59"/>
<location filename="../mobilehotspotwidget.cpp" line="61"/>
<source>ukui control center</source>
<translation></translation>
</message>
<message>
<location filename="../mobilehotspotwidget.cpp" line="62"/>
<location filename="../mobilehotspotwidget.cpp" line="64"/>
<source>ukui control center desktop message</source>
<translation>ukui </translation>
</message>
<message>
<location filename="../mobilehotspotwidget.cpp" line="138"/>
<location filename="../mobilehotspotwidget.cpp" line="149"/>
<source>wirless switch is close or no wireless device</source>
<translation></translation>
</message>
<message>
<location filename="../mobilehotspotwidget.cpp" line="142"/>
<source>start to close hotspot</source>
<translation></translation>
<translation type="vanished"></translation>
</message>
<message>
<location filename="../mobilehotspotwidget.cpp" line="151"/>
<location filename="../mobilehotspotwidget.cpp" line="169"/>
<source>hotpots name or device is invalid</source>
<translation></translation>
</message>
@ -85,54 +84,53 @@
<translation type="vanished">!</translation>
</message>
<message>
<location filename="../mobilehotspotwidget.cpp" line="158"/>
<source>start to open hotspot </source>
<translation> </translation>
<translation type="vanished"> </translation>
</message>
<message>
<location filename="../mobilehotspotwidget.cpp" line="489"/>
<location filename="../mobilehotspotwidget.cpp" line="490"/>
<source>Contains at least 8 characters</source>
<translation></translation>
</message>
<message>
<location filename="../mobilehotspotwidget.cpp" line="205"/>
<location filename="../mobilehotspotwidget.cpp" line="223"/>
<source>Hotspot</source>
<translation></translation>
</message>
<message>
<location filename="../mobilehotspotwidget.cpp" line="295"/>
<location filename="../mobilehotspotwidget.cpp" line="610"/>
<location filename="../mobilehotspotwidget.cpp" line="310"/>
<location filename="../mobilehotspotwidget.cpp" line="605"/>
<source>hotspot already close</source>
<translation></translation>
</message>
<message>
<location filename="../mobilehotspotwidget.cpp" line="435"/>
<location filename="../mobilehotspotwidget.cpp" line="436"/>
<source>Open</source>
<translation></translation>
</message>
<message>
<location filename="../mobilehotspotwidget.cpp" line="456"/>
<location filename="../mobilehotspotwidget.cpp" line="457"/>
<source>Wi-Fi Name</source>
<translation>Wi-Fiཡི</translation>
</message>
<message>
<location filename="../mobilehotspotwidget.cpp" line="477"/>
<location filename="../mobilehotspotwidget.cpp" line="478"/>
<source>Password</source>
<translation></translation>
</message>
<message>
<location filename="../mobilehotspotwidget.cpp" line="518"/>
<location filename="../mobilehotspotwidget.cpp" line="519"/>
<source>Frequency band</source>
<translation></translation>
</message>
<message>
<location filename="../mobilehotspotwidget.cpp" line="544"/>
<location filename="../mobilehotspotwidget.cpp" line="545"/>
<source>Net card</source>
<translation></translation>
</message>
<message>
<location filename="../mobilehotspotwidget.cpp" line="639"/>
<location filename="../mobilehotspotwidget.cpp" line="647"/>
<location filename="../mobilehotspotwidget.cpp" line="635"/>
<location filename="../mobilehotspotwidget.cpp" line="643"/>
<source>hotspot already open</source>
<translation></translation>
</message>

View File

@ -0,0 +1,126 @@
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE TS>
<TS version="2.1" language="en">
<context>
<name>BlacklistItem</name>
<message>
<location filename="../blacklistitem.cpp" line="50"/>
<source>Remove</source>
<translation>Remove</translation>
</message>
</context>
<context>
<name>BlacklistPage</name>
<message>
<location filename="../blacklistpage.cpp" line="47"/>
<source>Blacklist</source>
<translation>Blacklist</translation>
</message>
</context>
<context>
<name>ConnectDevListItem</name>
<message>
<location filename="../connectdevlistitem.cpp" line="50"/>
<source>drag into blacklist</source>
<translation>drag into blacklist</translation>
</message>
</context>
<context>
<name>ConnectdevPage</name>
<message>
<location filename="../connectdevpage.cpp" line="48"/>
<source>Connect device</source>
<translation>Connect device</translation>
</message>
</context>
<context>
<name>MobileHotspot</name>
<message>
<location filename="../mobilehotspot.cpp" line="35"/>
<source>MobileHotspot</source>
<translation>MobileHotspot</translation>
</message>
<message>
<location filename="../mobilehotspot.cpp" line="101"/>
<source>mobilehotspot</source>
<translation>mobilehotspot</translation>
<extra-contents_path>/mobilehotspot/mobilehotspot</extra-contents_path>
</message>
<message>
<location filename="../mobilehotspot.cpp" line="103"/>
<source>mobilehotspot open</source>
<translation>mobilehotspot open</translation>
<extra-contents_path>/mobilehotspot/mobilehotspot open</extra-contents_path>
</message>
</context>
<context>
<name>MobileHotspotWidget</name>
<message>
<location filename="../mobilehotspotwidget.cpp" line="61"/>
<source>ukui control center</source>
<translation>ukui control center</translation>
</message>
<message>
<location filename="../mobilehotspotwidget.cpp" line="64"/>
<source>ukui control center desktop message</source>
<translation>ukui control center desktop message</translation>
</message>
<message>
<location filename="../mobilehotspotwidget.cpp" line="149"/>
<source>wirless switch is close or no wireless device</source>
<translation>wirless switch is close or no wireless device</translation>
</message>
<message>
<location filename="../mobilehotspotwidget.cpp" line="169"/>
<source>hotpots name or device is invalid</source>
<translation>hotpots name or device is invalid</translation>
</message>
<message>
<location filename="../mobilehotspotwidget.cpp" line="223"/>
<source>Hotspot</source>
<translation>Hotspot</translation>
</message>
<message>
<location filename="../mobilehotspotwidget.cpp" line="310"/>
<location filename="../mobilehotspotwidget.cpp" line="605"/>
<source>hotspot already close</source>
<translation>hotspot already close</translation>
</message>
<message>
<location filename="../mobilehotspotwidget.cpp" line="436"/>
<source>Open</source>
<translation>Open</translation>
</message>
<message>
<location filename="../mobilehotspotwidget.cpp" line="457"/>
<source>Wi-Fi Name</source>
<translation>Wi-Fi Name</translation>
</message>
<message>
<location filename="../mobilehotspotwidget.cpp" line="478"/>
<source>Password</source>
<translation>Password</translation>
</message>
<message>
<location filename="../mobilehotspotwidget.cpp" line="490"/>
<source>Contains at least 8 characters</source>
<translation>Contains at least 8 characters</translation>
</message>
<message>
<location filename="../mobilehotspotwidget.cpp" line="519"/>
<source>Frequency band</source>
<translation>Frequency band</translation>
</message>
<message>
<location filename="../mobilehotspotwidget.cpp" line="545"/>
<source>Net card</source>
<translation>Net card</translation>
</message>
<message>
<location filename="../mobilehotspotwidget.cpp" line="635"/>
<location filename="../mobilehotspotwidget.cpp" line="643"/>
<source>hotspot already open</source>
<translation>hotspot already open</translation>
</message>
</context>
</TS>

View File

@ -4,7 +4,7 @@
<context>
<name>BlacklistItem</name>
<message>
<location filename="../blacklistitem.cpp" line="49"/>
<location filename="../blacklistitem.cpp" line="50"/>
<source>Remove</source>
<translation type="unfinished"></translation>
</message>
@ -12,7 +12,7 @@
<context>
<name>BlacklistPage</name>
<message>
<location filename="../blacklistpage.cpp" line="45"/>
<location filename="../blacklistpage.cpp" line="47"/>
<source>Blacklist</source>
<translation type="unfinished"></translation>
</message>
@ -20,7 +20,7 @@
<context>
<name>ConnectDevListItem</name>
<message>
<location filename="../connectdevlistitem.cpp" line="49"/>
<location filename="../connectdevlistitem.cpp" line="50"/>
<source>drag into blacklist</source>
<translation type="unfinished"></translation>
</message>
@ -28,7 +28,7 @@
<context>
<name>ConnectdevPage</name>
<message>
<location filename="../connectdevpage.cpp" line="46"/>
<location filename="../connectdevpage.cpp" line="48"/>
<source>Connect device</source>
<translation type="unfinished"></translation>
</message>
@ -56,79 +56,69 @@
<context>
<name>MobileHotspotWidget</name>
<message>
<location filename="../mobilehotspotwidget.cpp" line="59"/>
<location filename="../mobilehotspotwidget.cpp" line="61"/>
<source>ukui control center</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../mobilehotspotwidget.cpp" line="62"/>
<location filename="../mobilehotspotwidget.cpp" line="64"/>
<source>ukui control center desktop message</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../mobilehotspotwidget.cpp" line="138"/>
<location filename="../mobilehotspotwidget.cpp" line="149"/>
<source>wirless switch is close or no wireless device</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../mobilehotspotwidget.cpp" line="142"/>
<source>start to close hotspot</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../mobilehotspotwidget.cpp" line="151"/>
<location filename="../mobilehotspotwidget.cpp" line="169"/>
<source>hotpots name or device is invalid</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../mobilehotspotwidget.cpp" line="158"/>
<source>start to open hotspot </source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../mobilehotspotwidget.cpp" line="489"/>
<location filename="../mobilehotspotwidget.cpp" line="490"/>
<source>Contains at least 8 characters</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../mobilehotspotwidget.cpp" line="205"/>
<location filename="../mobilehotspotwidget.cpp" line="223"/>
<source>Hotspot</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../mobilehotspotwidget.cpp" line="295"/>
<location filename="../mobilehotspotwidget.cpp" line="610"/>
<location filename="../mobilehotspotwidget.cpp" line="310"/>
<location filename="../mobilehotspotwidget.cpp" line="605"/>
<source>hotspot already close</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../mobilehotspotwidget.cpp" line="435"/>
<location filename="../mobilehotspotwidget.cpp" line="436"/>
<source>Open</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../mobilehotspotwidget.cpp" line="456"/>
<location filename="../mobilehotspotwidget.cpp" line="457"/>
<source>Wi-Fi Name</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../mobilehotspotwidget.cpp" line="477"/>
<location filename="../mobilehotspotwidget.cpp" line="478"/>
<source>Password</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../mobilehotspotwidget.cpp" line="518"/>
<location filename="../mobilehotspotwidget.cpp" line="519"/>
<source>Frequency band</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../mobilehotspotwidget.cpp" line="544"/>
<location filename="../mobilehotspotwidget.cpp" line="545"/>
<source>Net card</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../mobilehotspotwidget.cpp" line="639"/>
<location filename="../mobilehotspotwidget.cpp" line="647"/>
<location filename="../mobilehotspotwidget.cpp" line="635"/>
<location filename="../mobilehotspotwidget.cpp" line="643"/>
<source>hotspot already open</source>
<translation type="unfinished"></translation>
</message>

View File

@ -4,7 +4,7 @@
<context>
<name>BlacklistItem</name>
<message>
<location filename="../blacklistitem.cpp" line="49"/>
<location filename="../blacklistitem.cpp" line="50"/>
<source>Remove</source>
<translation></translation>
</message>
@ -12,7 +12,7 @@
<context>
<name>BlacklistPage</name>
<message>
<location filename="../blacklistpage.cpp" line="45"/>
<location filename="../blacklistpage.cpp" line="47"/>
<source>Blacklist</source>
<translation></translation>
</message>
@ -20,7 +20,7 @@
<context>
<name>ConnectDevListItem</name>
<message>
<location filename="../connectdevlistitem.cpp" line="49"/>
<location filename="../connectdevlistitem.cpp" line="50"/>
<source>drag into blacklist</source>
<translation></translation>
</message>
@ -28,7 +28,7 @@
<context>
<name>ConnectdevPage</name>
<message>
<location filename="../connectdevpage.cpp" line="46"/>
<location filename="../connectdevpage.cpp" line="48"/>
<source>Connect device</source>
<translation></translation>
</message>
@ -56,27 +56,26 @@
<context>
<name>MobileHotspotWidget</name>
<message>
<location filename="../mobilehotspotwidget.cpp" line="59"/>
<location filename="../mobilehotspotwidget.cpp" line="61"/>
<source>ukui control center</source>
<translation></translation>
</message>
<message>
<location filename="../mobilehotspotwidget.cpp" line="62"/>
<location filename="../mobilehotspotwidget.cpp" line="64"/>
<source>ukui control center desktop message</source>
<translation></translation>
</message>
<message>
<location filename="../mobilehotspotwidget.cpp" line="138"/>
<location filename="../mobilehotspotwidget.cpp" line="149"/>
<source>wirless switch is close or no wireless device</source>
<translation>线线</translation>
</message>
<message>
<location filename="../mobilehotspotwidget.cpp" line="142"/>
<source>start to close hotspot</source>
<translation></translation>
<translation type="vanished"></translation>
</message>
<message>
<location filename="../mobilehotspotwidget.cpp" line="151"/>
<location filename="../mobilehotspotwidget.cpp" line="169"/>
<source>hotpots name or device is invalid</source>
<translation></translation>
</message>
@ -85,54 +84,53 @@
<translation type="vanished"></translation>
</message>
<message>
<location filename="../mobilehotspotwidget.cpp" line="158"/>
<source>start to open hotspot </source>
<translation></translation>
<translation type="vanished"></translation>
</message>
<message>
<location filename="../mobilehotspotwidget.cpp" line="489"/>
<location filename="../mobilehotspotwidget.cpp" line="490"/>
<source>Contains at least 8 characters</source>
<translation>8</translation>
</message>
<message>
<location filename="../mobilehotspotwidget.cpp" line="205"/>
<location filename="../mobilehotspotwidget.cpp" line="223"/>
<source>Hotspot</source>
<translation></translation>
</message>
<message>
<location filename="../mobilehotspotwidget.cpp" line="295"/>
<location filename="../mobilehotspotwidget.cpp" line="610"/>
<location filename="../mobilehotspotwidget.cpp" line="310"/>
<location filename="../mobilehotspotwidget.cpp" line="605"/>
<source>hotspot already close</source>
<translation></translation>
</message>
<message>
<location filename="../mobilehotspotwidget.cpp" line="435"/>
<location filename="../mobilehotspotwidget.cpp" line="436"/>
<source>Open</source>
<translation></translation>
</message>
<message>
<location filename="../mobilehotspotwidget.cpp" line="456"/>
<location filename="../mobilehotspotwidget.cpp" line="457"/>
<source>Wi-Fi Name</source>
<translation>Wi-Fi名称</translation>
</message>
<message>
<location filename="../mobilehotspotwidget.cpp" line="477"/>
<location filename="../mobilehotspotwidget.cpp" line="478"/>
<source>Password</source>
<translation></translation>
</message>
<message>
<location filename="../mobilehotspotwidget.cpp" line="518"/>
<location filename="../mobilehotspotwidget.cpp" line="519"/>
<source>Frequency band</source>
<translation></translation>
</message>
<message>
<location filename="../mobilehotspotwidget.cpp" line="544"/>
<location filename="../mobilehotspotwidget.cpp" line="545"/>
<source>Net card</source>
<translation></translation>
</message>
<message>
<location filename="../mobilehotspotwidget.cpp" line="639"/>
<location filename="../mobilehotspotwidget.cpp" line="647"/>
<location filename="../mobilehotspotwidget.cpp" line="635"/>
<location filename="../mobilehotspotwidget.cpp" line="643"/>
<source>hotspot already open</source>
<translation></translation>
</message>

View File

@ -18,6 +18,8 @@
*
*/
#include "lanitem.h"
#include <QApplication>
#define FRAME_SPEED 150
#define LIMIT_TIME 60*1000
#define TOTAL_PAGE 8
@ -31,11 +33,6 @@ LanItem::LanItem(bool isAcitve, QWidget *parent)
this->setMinimumSize(550, 58);
this->setProperty("useButtonPalette", true);
this->setFlat(true);
QPalette pal = this->palette();
QColor color = pal.color(QPalette::Button);
color.setAlphaF(0.5);
pal.setColor(QPalette::Button, color);
this->setPalette(pal);
// setStyleSheet("QPushButton:!checked{background-color: palette(base)}");
QHBoxLayout *mLanLyt = new QHBoxLayout(this);
mLanLyt->setContentsMargins(16,0,16,0);
@ -44,6 +41,7 @@ LanItem::LanItem(bool isAcitve, QWidget *parent)
iconLabel->setProperty("useIconHighlightEffect", 0x2);
titileLabel = new FixLabel(this);
statusLabel = new QLabel(this);
statusLabel->setProperty("useIconHighlightEffect", 0x2);
statusLabel->setAlignment(Qt::AlignRight | Qt::AlignVCenter);
// statusLabel->setMinimumSize(36,36);
infoLabel = new GrayInfoButton(this);
@ -91,12 +89,17 @@ void LanItem::stopLoading(){
void LanItem::paintEvent(QPaintEvent *event)
{
QPalette pal = this->palette();
QPalette pal = qApp->palette();
QPainter painter(this);
painter.setRenderHint(QPainter:: Antialiasing, true); //设置渲染,启动反锯齿
painter.setPen(Qt::NoPen);
painter.setBrush(pal.color(QPalette::Base));
painter.setBrush(this->palette().base().color());
QColor color = pal.color(QPalette::Button);
color.setAlphaF(0.5);
pal.setColor(QPalette::Button, color);
this->setPalette(pal);
QRect rect = this->rect();

View File

@ -168,7 +168,9 @@ bool NetConnect::eventFilter(QObject *w, QEvent *e) {
if (!wiredSwitch->isCheckable()) {
showDesktopNotify(tr("No ethernet device avaliable"));
} else {
m_interface->call(QStringLiteral("setWiredSwitchEnable"), !wiredSwitch->isChecked());
if (m_interface != nullptr && m_interface->isValid()) {
m_interface->call(QStringLiteral("setWiredSwitchEnable"), !wiredSwitch->isChecked());
}
return true;
}
}
@ -242,7 +244,7 @@ void NetConnect::initComponent() {
//获取网卡列表
void NetConnect::getDeviceStatusMap(QMap<QString, bool> &map)
{
if (!m_interface->isValid()) {
if (m_interface == nullptr || !m_interface->isValid()) {
return;
}
qDebug() << "[NetConnect]call getDeviceListAndEnabled" << __LINE__;
@ -357,6 +359,9 @@ void NetConnect::runExternalApp() {
//激活
void NetConnect::activeConnect(QString ssid, QString deviceName, int type) {
if (m_interface == nullptr || !m_interface->isValid()) {
return;
}
qDebug() << "[NetConnect]call activateConnect" << __LINE__;
m_interface->call(QStringLiteral("activateConnect"),type, deviceName, ssid);
qDebug() << "[NetConnect]call activateConnect respond" << __LINE__;
@ -364,6 +369,9 @@ void NetConnect::activeConnect(QString ssid, QString deviceName, int type) {
//断开
void NetConnect::deActiveConnect(QString ssid, QString deviceName, int type) {
if (m_interface == nullptr || !m_interface->isValid()) {
return;
}
qDebug() << "[NetConnect]call deActivateConnect" << __LINE__;
m_interface->call(QStringLiteral("deActivateConnect"),type, deviceName, ssid);
qDebug() << "[NetConnect]call deActivateConnect respond" << __LINE__;
@ -377,7 +385,7 @@ void NetConnect::initNetListFromDevice(QString deviceName)
qDebug() << "[NetConnect]initNetListFromDevice " << deviceName << " not exist";
return;
}
if (!m_interface->isValid()) {
if (m_interface == nullptr || !m_interface->isValid()) {
return;
}
qDebug() << "[NetConnect]call getWiredList" << __LINE__;
@ -442,7 +450,7 @@ void NetConnect::addLanItem(ItemFrame *frame, QString devName, QStringList infoL
connect(lanItem->infoLabel, &GrayInfoButton::clicked, this, [=]{
// open landetail page
if (!m_interface->isValid()) {
if (m_interface == nullptr || !m_interface->isValid()) {
return;
}
qDebug() << "[NetConnect]call showPropertyWidget" << __LINE__;
@ -469,6 +477,9 @@ void NetConnect::addLanItem(ItemFrame *frame, QString devName, QStringList infoL
//增加设备
void NetConnect::addDeviceFrame(QString devName)
{
if (m_interface == nullptr || !m_interface->isValid()) {
return;
}
qDebug() << "[NetConnect]addDeviceFrame " << devName;
qDebug() << "[NetConnect]call getDeviceListAndEnabled" << __LINE__;
@ -528,7 +539,7 @@ void NetConnect::addDeviceFrame(QString devName)
});
connect(itemFrame->addLanWidget, &AddNetBtn::clicked, this, [=](){
if (m_interface->isValid()) {
if (m_interface != nullptr && m_interface->isValid()) {
qDebug() << "[NetConnect]call showCreateWiredConnectWidget" << devName << __LINE__;
m_interface->call(QStringLiteral("showCreateWiredConnectWidget"), devName);
qDebug() << "[NetConnect]call setDeviceEnable Respond" << __LINE__;
@ -725,7 +736,7 @@ void NetConnect::addOneLanFrame(ItemFrame *frame, QString deviceName, QStringLis
connect(lanItem->infoLabel, &GrayInfoButton::clicked, this, [=]{
// open landetail page
if (!m_interface->isValid()) {
if (m_interface == nullptr || !m_interface->isValid()) {
return;
}
qDebug() << "[NetConnect]call showPropertyWidget" << deviceName << connUuid << __LINE__;
@ -867,7 +878,7 @@ int NetConnect::getInsertPos(QString connName, QString deviceName)
{
qDebug() << "[NetConnect]getInsertPos" << connName << deviceName;
int index = 0;
if(!m_interface->isValid()) {
if(m_interface == nullptr || !m_interface->isValid()) {
index = 0;
} else {
qDebug() << "[NetConnect]call getWiredList" << __LINE__;

View File

@ -51,4 +51,5 @@ TRANSLATIONS += \
translations/zh_CN.ts \
translations/tr.ts \
translations/bo.ts \
translations/bo_CN.ts
translations/bo_CN.ts \
translations/en_US.ts

View File

@ -4,7 +4,12 @@
<context>
<name>AddNetBtn</name>
<message>
<location filename="../addnetbtn.cpp" line="22"/>
<location filename="../../component/AddBtn/addnetbtn.cpp" line="44"/>
<source>Add Others</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../component/AddBtn/addnetbtn.cpp" line="48"/>
<source>Add WiredNetork</source>
<translation type="unfinished"></translation>
</message>
@ -13,52 +18,52 @@
<name>NetConnect</name>
<message>
<location filename="../netconnect.ui" line="50"/>
<location filename="../netconnect.cpp" line="152"/>
<source>Wired Network</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../netconnect.ui" line="112"/>
<location filename="../netconnect.cpp" line="154"/>
<location filename="../netconnect.cpp" line="155"/>
<source>open</source>
<translation type="unfinished"></translation>
<extra-contents_path>/netconnect/open</extra-contents_path>
</message>
<message>
<location filename="../netconnect.ui" line="198"/>
<location filename="../netconnect.cpp" line="151"/>
<location filename="../netconnect.cpp" line="152"/>
<source>Advanced settings</source>
<translation type="unfinished"></translation>
<extra-contents_path>/netconnect/Advanced settings&quot;</extra-contents_path>
</message>
<message>
<location filename="../netconnect.cpp" line="63"/>
<location filename="../netconnect.cpp" line="64"/>
<source>ukui control center</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../netconnect.cpp" line="66"/>
<location filename="../netconnect.cpp" line="67"/>
<source>ukui control center desktop message</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../netconnect.cpp" line="80"/>
<source>WiredConnect</source>
<location filename="../netconnect.cpp" line="81"/>
<location filename="../netconnect.cpp" line="153"/>
<source>LAN</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../netconnect.cpp" line="177"/>
<location filename="../netconnect.cpp" line="169"/>
<source>No ethernet device avaliable</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../netconnect.cpp" line="426"/>
<location filename="../netconnect.cpp" line="833"/>
<location filename="../netconnect.cpp" line="429"/>
<location filename="../netconnect.cpp" line="850"/>
<source>connected</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../netconnect.cpp" line="490"/>
<location filename="../netconnect.cpp" line="493"/>
<source>card</source>
<translation type="unfinished"></translation>
</message>

View File

@ -4,7 +4,12 @@
<context>
<name>AddNetBtn</name>
<message>
<location filename="../addnetbtn.cpp" line="22"/>
<location filename="../../component/AddBtn/addnetbtn.cpp" line="44"/>
<source>Add Others</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../component/AddBtn/addnetbtn.cpp" line="48"/>
<source>Add WiredNetork</source>
<translation></translation>
</message>
@ -13,57 +18,56 @@
<name>NetConnect</name>
<message>
<location filename="../netconnect.ui" line="50"/>
<location filename="../netconnect.cpp" line="152"/>
<source>Wired Network</source>
<translation></translation>
</message>
<message>
<location filename="../netconnect.ui" line="112"/>
<location filename="../netconnect.cpp" line="154"/>
<location filename="../netconnect.cpp" line="155"/>
<source>open</source>
<translation></translation>
<extra-contents_path>/netconnect/open</extra-contents_path>
</message>
<message>
<location filename="../netconnect.ui" line="198"/>
<location filename="../netconnect.cpp" line="151"/>
<location filename="../netconnect.cpp" line="152"/>
<source>Advanced settings</source>
<translation></translation>
<extra-contents_path>/netconnect/Advanced settings&quot;</extra-contents_path>
</message>
<message>
<location filename="../netconnect.cpp" line="63"/>
<location filename="../netconnect.cpp" line="64"/>
<source>ukui control center</source>
<translation></translation>
</message>
<message>
<location filename="../netconnect.cpp" line="66"/>
<location filename="../netconnect.cpp" line="67"/>
<source>ukui control center desktop message</source>
<translation>ukui </translation>
</message>
<message>
<location filename="../netconnect.cpp" line="80"/>
<source>WiredConnect</source>
<translation></translation>
<translation type="vanished"></translation>
</message>
<message>
<location filename="../netconnect.cpp" line="81"/>
<location filename="../netconnect.cpp" line="153"/>
<source>LAN</source>
<translation></translation>
</message>
<message>
<location filename="../netconnect.cpp" line="177"/>
<location filename="../netconnect.cpp" line="169"/>
<source>No ethernet device avaliable</source>
<translation></translation>
</message>
<message>
<location filename="../netconnect.cpp" line="426"/>
<location filename="../netconnect.cpp" line="833"/>
<location filename="../netconnect.cpp" line="429"/>
<location filename="../netconnect.cpp" line="850"/>
<source>connected</source>
<translation></translation>
</message>
<message>
<location filename="../netconnect.cpp" line="490"/>
<location filename="../netconnect.cpp" line="493"/>
<source>card</source>
<translation></translation>
</message>

View File

@ -0,0 +1,71 @@
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE TS>
<TS version="2.1" language="en">
<context>
<name>AddNetBtn</name>
<message>
<location filename="../../component/AddBtn/addnetbtn.cpp" line="44"/>
<source>Add Others</source>
<translation>Add Others</translation>
</message>
<message>
<location filename="../../component/AddBtn/addnetbtn.cpp" line="48"/>
<source>Add WiredNetork</source>
<translation>Add WiredNetork</translation>
</message>
</context>
<context>
<name>NetConnect</name>
<message>
<location filename="../netconnect.ui" line="50"/>
<source>Wired Network</source>
<translation>Wired Network</translation>
</message>
<message>
<location filename="../netconnect.ui" line="112"/>
<location filename="../netconnect.cpp" line="155"/>
<source>open</source>
<translation>open</translation>
<extra-contents_path>/netconnect/open</extra-contents_path>
</message>
<message>
<location filename="../netconnect.ui" line="198"/>
<location filename="../netconnect.cpp" line="152"/>
<source>Advanced settings</source>
<translation>Advanced settings</translation>
<extra-contents_path>/netconnect/Advanced settings&quot;</extra-contents_path>
</message>
<message>
<location filename="../netconnect.cpp" line="64"/>
<source>ukui control center</source>
<translation>ukui control center</translation>
</message>
<message>
<location filename="../netconnect.cpp" line="67"/>
<source>ukui control center desktop message</source>
<translation>ukui control center desktop message</translation>
</message>
<message>
<location filename="../netconnect.cpp" line="81"/>
<location filename="../netconnect.cpp" line="153"/>
<source>LAN</source>
<translation>LAN</translation>
</message>
<message>
<location filename="../netconnect.cpp" line="169"/>
<source>No ethernet device avaliable</source>
<translation>No ethernet device avaliable</translation>
</message>
<message>
<location filename="../netconnect.cpp" line="429"/>
<location filename="../netconnect.cpp" line="850"/>
<source>connected</source>
<translation>connected</translation>
</message>
<message>
<location filename="../netconnect.cpp" line="493"/>
<source>card</source>
<translation>card</translation>
</message>
</context>
</TS>

View File

@ -4,7 +4,12 @@
<context>
<name>AddNetBtn</name>
<message>
<location filename="../addnetbtn.cpp" line="22"/>
<location filename="../../component/AddBtn/addnetbtn.cpp" line="44"/>
<source>Add Others</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../component/AddBtn/addnetbtn.cpp" line="48"/>
<source>Add WiredNetork</source>
<translation type="unfinished"></translation>
</message>
@ -13,52 +18,52 @@
<name>NetConnect</name>
<message>
<location filename="../netconnect.ui" line="50"/>
<location filename="../netconnect.cpp" line="152"/>
<source>Wired Network</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../netconnect.ui" line="112"/>
<location filename="../netconnect.cpp" line="154"/>
<location filename="../netconnect.cpp" line="155"/>
<source>open</source>
<translation type="unfinished"></translation>
<extra-contents_path>/netconnect/open</extra-contents_path>
</message>
<message>
<location filename="../netconnect.ui" line="198"/>
<location filename="../netconnect.cpp" line="151"/>
<location filename="../netconnect.cpp" line="152"/>
<source>Advanced settings</source>
<translation type="unfinished"></translation>
<extra-contents_path>/netconnect/Advanced settings&quot;</extra-contents_path>
</message>
<message>
<location filename="../netconnect.cpp" line="63"/>
<location filename="../netconnect.cpp" line="64"/>
<source>ukui control center</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../netconnect.cpp" line="66"/>
<location filename="../netconnect.cpp" line="67"/>
<source>ukui control center desktop message</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../netconnect.cpp" line="80"/>
<source>WiredConnect</source>
<location filename="../netconnect.cpp" line="81"/>
<location filename="../netconnect.cpp" line="153"/>
<source>LAN</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../netconnect.cpp" line="177"/>
<location filename="../netconnect.cpp" line="169"/>
<source>No ethernet device avaliable</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../netconnect.cpp" line="426"/>
<location filename="../netconnect.cpp" line="833"/>
<location filename="../netconnect.cpp" line="429"/>
<location filename="../netconnect.cpp" line="850"/>
<source>connected</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../netconnect.cpp" line="490"/>
<location filename="../netconnect.cpp" line="493"/>
<source>card</source>
<translation type="unfinished"></translation>
</message>

View File

@ -4,7 +4,12 @@
<context>
<name>AddNetBtn</name>
<message>
<location filename="../addnetbtn.cpp" line="22"/>
<location filename="../../component/AddBtn/addnetbtn.cpp" line="44"/>
<source>Add Others</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../component/AddBtn/addnetbtn.cpp" line="48"/>
<source>Add WiredNetork</source>
<translation>线</translation>
</message>
@ -13,57 +18,56 @@
<name>NetConnect</name>
<message>
<location filename="../netconnect.ui" line="50"/>
<location filename="../netconnect.cpp" line="152"/>
<source>Wired Network</source>
<translation>线</translation>
</message>
<message>
<location filename="../netconnect.ui" line="112"/>
<location filename="../netconnect.cpp" line="154"/>
<location filename="../netconnect.cpp" line="155"/>
<source>open</source>
<translation></translation>
<extra-contents_path>/netconnect/open</extra-contents_path>
</message>
<message>
<location filename="../netconnect.ui" line="198"/>
<location filename="../netconnect.cpp" line="151"/>
<location filename="../netconnect.cpp" line="152"/>
<source>Advanced settings</source>
<translation></translation>
<extra-contents_path>/netconnect/Advanced settings&quot;</extra-contents_path>
</message>
<message>
<location filename="../netconnect.cpp" line="63"/>
<location filename="../netconnect.cpp" line="64"/>
<source>ukui control center</source>
<translation></translation>
</message>
<message>
<location filename="../netconnect.cpp" line="66"/>
<location filename="../netconnect.cpp" line="67"/>
<source>ukui control center desktop message</source>
<translation></translation>
</message>
<message>
<location filename="../netconnect.cpp" line="80"/>
<source>WiredConnect</source>
<translation>线</translation>
<translation type="vanished">线</translation>
</message>
<message>
<location filename="../netconnect.cpp" line="80"/>
<location filename="../netconnect.cpp" line="81"/>
<location filename="../netconnect.cpp" line="153"/>
<source>LAN</source>
<translation>线</translation>
</message>
<message>
<location filename="../netconnect.cpp" line="177"/>
<location filename="../netconnect.cpp" line="169"/>
<source>No ethernet device avaliable</source>
<translation>线</translation>
</message>
<message>
<location filename="../netconnect.cpp" line="426"/>
<location filename="../netconnect.cpp" line="833"/>
<location filename="../netconnect.cpp" line="429"/>
<location filename="../netconnect.cpp" line="850"/>
<source>connected</source>
<translation></translation>
</message>
<message>
<location filename="../netconnect.cpp" line="490"/>
<location filename="../netconnect.cpp" line="493"/>
<source>card</source>
<translation></translation>
</message>

View File

@ -29,7 +29,7 @@ AppListWidget::AppListWidget(QString path, QWidget *parent)
AppListWidget::~AppListWidget()
{
delete m_dbusInterface;
}
/**
@ -79,8 +79,9 @@ void AppListWidget::onAppCheckStateChanged()
*/
void AppListWidget::AddAppProxyConfig()
{
if(!m_dbusInterface->isValid()) {
if(m_dbusInterface == nullptr || !m_dbusInterface->isValid()) {
qWarning ()<< "init AppProxy dbus error";
return;
}
qDebug() << "call QDBusInterface addAppIntoProxy";
@ -93,8 +94,9 @@ void AppListWidget::AddAppProxyConfig()
*/
void AppListWidget::RemoveAppProxyConfig()
{
if(!m_dbusInterface->isValid()) {
if(m_dbusInterface == nullptr || !m_dbusInterface->isValid()) {
qWarning ()<< "init AppProxy dbus error";
return;
}
qDebug() << "call QDBusInterface delAppIntoProxy";
@ -135,4 +137,7 @@ void AppListWidget::initDbus()
"/org/ukui/SettingsDaemon/AppProxy",
"org.ukui.SettingsDaemon.AppProxy",
QDBusConnection::sessionBus());
if(!m_dbusInterface->isValid()) {
qWarning() << qPrintable(QDBusConnection::sessionBus().lastError().message());
}
}

View File

@ -45,7 +45,7 @@
#define PROXY_HOST_KEY "host"
#define PROXY_PORT_KEY "port"
#define THEME_SCHAME "org.ukui.style"
#define FRAME_LAYOUT_MARGINS 16,0,16,0
#define FRAME_LAYOUT_SPACING 8
#define LABEL_WIDTH 136
@ -67,7 +67,8 @@ Proxy::Proxy() : mFirstLoad(true)
Proxy::~Proxy()
{
if (!mFirstLoad) {
plugin_leave();
plugin_leave();
delete m_appProxyDbus;
}
}
@ -702,6 +703,9 @@ void Proxy::initDbus()
"/org/ukui/SettingsDaemon/AppProxy",
"org.ukui.SettingsDaemon.AppProxy",
QDBusConnection::sessionBus());
if(!m_appProxyDbus->isValid()) {
qWarning() << qPrintable(QDBusConnection::sessionBus().lastError().message());
}
}
void Proxy::initAppProxyStatus()
@ -752,8 +756,11 @@ void Proxy::setAptProxy(QString host, QString port, bool status)
"/",
"com.control.center.interface",
QDBusConnection::systemBus());
if (mAptproxyDbus->isValid())
if (mAptproxyDbus->isValid()) {
QDBusReply<bool> reply = mAptproxyDbus->call("setaptproxy", host, port , status);
}
delete mAptproxyDbus;
mAptproxyDbus = nullptr;
}
QHash<QString, QVariant> Proxy::getAptProxy()
@ -786,6 +793,8 @@ QHash<QString, QVariant> Proxy::getAptProxy()
mAptInfo.insert(it.arg, it.out.variant());
}
}
delete mAptproxyDbus;
mAptproxyDbus = nullptr;
return mAptInfo;
}
@ -814,8 +823,9 @@ void Proxy::reboot()
"/org/gnome/SessionManager",
"org.gnome.SessionManager",
QDBusConnection::sessionBus());
rebootDbus->call("reboot");
if (rebootDbus->isValid()) {
rebootDbus->call("reboot");
}
delete rebootDbus;
rebootDbus = nullptr;
}
@ -841,8 +851,9 @@ QFrame *Proxy::setLine(QFrame *frame)
bool Proxy::getAppProxyState()
{
bool state = true;
if(!m_appProxyDbus->isValid()) {
if(m_appProxyDbus == nullptr || !m_appProxyDbus->isValid()) {
qWarning ()<< "init AppProxy dbus error";
return false;
}
//获取应用代理开启状态
@ -859,7 +870,7 @@ bool Proxy::getAppProxyState()
void Proxy::setAppProxyState(bool state)
{
if(!m_appProxyDbus->isValid()) {
if(m_appProxyDbus == nullptr || !m_appProxyDbus->isValid()) {
qWarning ()<< "init AppProxy dbus error";
return;
}
@ -881,6 +892,7 @@ QStringList Proxy::getAppProxyConf()
if(!dbusInterface.isValid()) {
qWarning ()<< "init AppProxy dbus error";
return info;
}
//获取应用代理配置信息
@ -903,11 +915,12 @@ QStringList Proxy::getAppProxyConf()
void Proxy::setAppProxyConf(QStringList list)
{
//AppProxyConf 必填项数量为3
if (list.count() < 3) {
return;
}
if(!m_appProxyDbus->isValid()) {
if(m_appProxyDbus == nullptr || !m_appProxyDbus->isValid()) {
qWarning ()<< "init AppProxy dbus error";
return;
}
@ -1160,18 +1173,22 @@ void Proxy::setAppListFrameUi(QWidget *widget)
m_allowAppProxyLabel->setText(tr("The following applications are allowed to use this configuration:")); //允许以下应用使用该配置:
m_appListWidget = new QListWidget(m_appListFrame);
m_appListWidget->setMinimumHeight(240);
m_appListWidget->setBackgroundRole(QPalette::Base);
m_appListWidget->setFocusPolicy(Qt::FocusPolicy::NoFocus);
m_appListWidget->setFrameShape(QFrame::Shape::Panel);
appListLayout->addWidget(m_allowAppProxyLabel);
appListLayout->addWidget(m_appListWidget);
QPalette mpal(m_appListWidget->palette());
mpal.setColor(QPalette::Base, qApp->palette().base().color());
mpal.setColor(QPalette::AlternateBase, qApp->palette().alternateBase().color());
m_appListWidget->setAlternatingRowColors(true);
m_appListWidget->setPalette(mpal);
onPaletteChanged();
const QByteArray style_id(THEME_SCHAME);
if (QGSettings::isSchemaInstalled(style_id)) {
QGSettings * styleGsettings = new QGSettings(style_id, QByteArray(), this);
connect(styleGsettings, &QGSettings::changed, this, [=](QString key){
if ("styleName" == key) {
onPaletteChanged();
}
});
}
}
void Proxy::appProxyInfoPadding()
@ -1240,7 +1257,6 @@ void Proxy::onAppProxyConfChanged()
{
if (!getipEditState(m_ipAddressLineEdit->text()) || m_portLineEdit->text().isEmpty()) {
return;
qDebug() << "onAppProxyConfChanged return";
}
if (m_ipAddressLineEdit->text().isEmpty()) {
@ -1257,8 +1273,6 @@ void Proxy::onAppProxyConfChanged()
m_appProxyInfo.append("");
m_appProxyInfo.append("");
}
qDebug() << m_appProxyInfo << Q_FUNC_INFO << __LINE__;
}
}
@ -1269,6 +1283,16 @@ void Proxy::onAppProxyConfEditFinished()
}
}
void Proxy::onPaletteChanged()
{
QPalette mpal(m_appListWidget->palette());
mpal.setColor(QPalette::Base, qApp->palette().base().color());
mpal.setColor(QPalette::AlternateBase, qApp->palette().alternateBase().color());
m_appListWidget->setBackgroundRole(QPalette::Base);
m_appListWidget->setAlternatingRowColors(true);
m_appListWidget->setPalette(mpal);
}
void Proxy::onappProxyEnableChanged(bool enable)
{
m_proxyTypeFrame->setVisible(enable);

View File

@ -262,8 +262,8 @@ private:
QFileSystemWatcher *mfileWatch_1;
QFileSystemWatcher *mfileWatch_2;
QDBusInterface *mAptproxyDbus;
QDBusInterface *m_appProxyDbus;
// QDBusInterface *mAptproxyDbus;
QDBusInterface *m_appProxyDbus = nullptr;
bool isExistSettings = false;
bool settingsCreate;
@ -277,6 +277,7 @@ private slots:
void onipEditStateChanged(); //IP地址无效提示
void onAppProxyConfChanged(); //应用代理配置信息变化
void onAppProxyConfEditFinished();
void onPaletteChanged();
// void onCancelBtnClicked();
// void onSaveBtnClicked();
// void setBtnEnable();

View File

@ -4,12 +4,12 @@
<context>
<name>AddNetBtn</name>
<message>
<location filename="../../component/AddBtn/addnetbtn.cpp" line="24"/>
<location filename="../../component/AddBtn/addnetbtn.cpp" line="44"/>
<source>Add Others</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../component/AddBtn/addnetbtn.cpp" line="27"/>
<location filename="../../component/AddBtn/addnetbtn.cpp" line="48"/>
<source>Add WiredNetork</source>
<translation type="unfinished"></translation>
</message>
@ -18,12 +18,12 @@
<name>WlanConnect</name>
<message>
<location filename="../wlanconnect.ui" line="14"/>
<location filename="../wlanconnect.cpp" line="140"/>
<source>WlanConnect</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../wlanconnect.ui" line="35"/>
<location filename="../wlanconnect.cpp" line="140"/>
<location filename="../wlanconnect.cpp" line="211"/>
<source>WLAN</source>
<translation type="unfinished"></translation>
@ -58,14 +58,14 @@
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../wlanconnect.cpp" line="374"/>
<location filename="../wlanconnect.cpp" line="1022"/>
<location filename="../wlanconnect.cpp" line="1084"/>
<location filename="../wlanconnect.cpp" line="362"/>
<location filename="../wlanconnect.cpp" line="1028"/>
<location filename="../wlanconnect.cpp" line="1090"/>
<source>connected</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../wlanconnect.cpp" line="959"/>
<location filename="../wlanconnect.cpp" line="965"/>
<source>card</source>
<translation type="unfinished"></translation>
</message>

View File

@ -4,12 +4,12 @@
<context>
<name>AddNetBtn</name>
<message>
<location filename="../../component/AddBtn/addnetbtn.cpp" line="43"/>
<location filename="../../component/AddBtn/addnetbtn.cpp" line="44"/>
<source>Add Others</source>
<translation></translation>
</message>
<message>
<location filename="../../component/AddBtn/addnetbtn.cpp" line="47"/>
<location filename="../../component/AddBtn/addnetbtn.cpp" line="48"/>
<source>Add WiredNetork</source>
<translation type="unfinished"></translation>
</message>
@ -18,12 +18,12 @@
<name>WlanConnect</name>
<message>
<location filename="../wlanconnect.ui" line="14"/>
<location filename="../wlanconnect.cpp" line="140"/>
<source>WlanConnect</source>
<translation></translation>
</message>
<message>
<location filename="../wlanconnect.ui" line="35"/>
<location filename="../wlanconnect.cpp" line="140"/>
<location filename="../wlanconnect.cpp" line="211"/>
<source>WLAN</source>
<translation></translation>
@ -58,14 +58,14 @@
<translation></translation>
</message>
<message>
<location filename="../wlanconnect.cpp" line="374"/>
<location filename="../wlanconnect.cpp" line="1022"/>
<location filename="../wlanconnect.cpp" line="1084"/>
<location filename="../wlanconnect.cpp" line="362"/>
<location filename="../wlanconnect.cpp" line="1028"/>
<location filename="../wlanconnect.cpp" line="1090"/>
<source>connected</source>
<translation></translation>
</message>
<message>
<location filename="../wlanconnect.cpp" line="959"/>
<location filename="../wlanconnect.cpp" line="965"/>
<source>card</source>
<translation></translation>
</message>

View File

@ -0,0 +1,73 @@
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE TS>
<TS version="2.1" language="zh_CN">
<context>
<name>AddNetBtn</name>
<message>
<location filename="../../component/AddBtn/addnetbtn.cpp" line="44"/>
<source>Add Others</source>
<translation>Add Others</translation>
</message>
<message>
<location filename="../../component/AddBtn/addnetbtn.cpp" line="48"/>
<source>Add WiredNetork</source>
<translation>Add WiredNetork</translation>
</message>
</context>
<context>
<name>WlanConnect</name>
<message>
<location filename="../wlanconnect.ui" line="14"/>
<source>WlanConnect</source>
<translation>WlanConnect</translation>
</message>
<message>
<location filename="../wlanconnect.ui" line="35"/>
<location filename="../wlanconnect.cpp" line="140"/>
<location filename="../wlanconnect.cpp" line="211"/>
<source>WLAN</source>
<translation>WLAN</translation>
</message>
<message>
<location filename="../wlanconnect.ui" line="94"/>
<location filename="../wlanconnect.cpp" line="213"/>
<source>open</source>
<translation>open</translation>
<extra-contents_path>/wlanconnect/open</extra-contents_path>
</message>
<message>
<location filename="../wlanconnect.ui" line="147"/>
<location filename="../wlanconnect.cpp" line="210"/>
<source>Advanced settings</source>
<translation>Advanced settings</translation>
<extra-contents_path>/wlanconnect/Advanced settings&quot;</extra-contents_path>
</message>
<message>
<location filename="../wlanconnect.cpp" line="123"/>
<source>ukui control center</source>
<translation>ukui control center</translation>
</message>
<message>
<location filename="../wlanconnect.cpp" line="126"/>
<source>ukui control center desktop message</source>
<translation>ukui control center desktop message</translation>
</message>
<message>
<location filename="../wlanconnect.cpp" line="228"/>
<source>No wireless network card detected</source>
<translation>No wireless network card detected</translation>
</message>
<message>
<location filename="../wlanconnect.cpp" line="362"/>
<location filename="../wlanconnect.cpp" line="1028"/>
<location filename="../wlanconnect.cpp" line="1090"/>
<source>connected</source>
<translation>connected</translation>
</message>
<message>
<location filename="../wlanconnect.cpp" line="965"/>
<source>card</source>
<translation>card</translation>
</message>
</context>
</TS>

View File

@ -4,12 +4,12 @@
<context>
<name>AddNetBtn</name>
<message>
<location filename="../../component/AddBtn/addnetbtn.cpp" line="24"/>
<location filename="../../component/AddBtn/addnetbtn.cpp" line="44"/>
<source>Add Others</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../component/AddBtn/addnetbtn.cpp" line="27"/>
<location filename="../../component/AddBtn/addnetbtn.cpp" line="48"/>
<source>Add WiredNetork</source>
<translation type="unfinished"></translation>
</message>
@ -18,12 +18,12 @@
<name>WlanConnect</name>
<message>
<location filename="../wlanconnect.ui" line="14"/>
<location filename="../wlanconnect.cpp" line="140"/>
<source>WlanConnect</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../wlanconnect.ui" line="35"/>
<location filename="../wlanconnect.cpp" line="140"/>
<location filename="../wlanconnect.cpp" line="211"/>
<source>WLAN</source>
<translation type="unfinished"></translation>
@ -58,14 +58,14 @@
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../wlanconnect.cpp" line="374"/>
<location filename="../wlanconnect.cpp" line="1022"/>
<location filename="../wlanconnect.cpp" line="1084"/>
<location filename="../wlanconnect.cpp" line="362"/>
<location filename="../wlanconnect.cpp" line="1028"/>
<location filename="../wlanconnect.cpp" line="1090"/>
<source>connected</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../wlanconnect.cpp" line="959"/>
<location filename="../wlanconnect.cpp" line="965"/>
<source>card</source>
<translation type="unfinished"></translation>
</message>

View File

@ -4,12 +4,12 @@
<context>
<name>AddNetBtn</name>
<message>
<location filename="../../component/AddBtn/addnetbtn.cpp" line="24"/>
<location filename="../../component/AddBtn/addnetbtn.cpp" line="44"/>
<source>Add Others</source>
<translation></translation>
</message>
<message>
<location filename="../../component/AddBtn/addnetbtn.cpp" line="27"/>
<location filename="../../component/AddBtn/addnetbtn.cpp" line="48"/>
<source>Add WiredNetork</source>
<translation type="unfinished"></translation>
</message>
@ -18,12 +18,12 @@
<name>WlanConnect</name>
<message>
<location filename="../wlanconnect.ui" line="14"/>
<location filename="../wlanconnect.cpp" line="140"/>
<source>WlanConnect</source>
<translation>线</translation>
</message>
<message>
<location filename="../wlanconnect.ui" line="35"/>
<location filename="../wlanconnect.cpp" line="140"/>
<location filename="../wlanconnect.cpp" line="211"/>
<source>WLAN</source>
<translation>线</translation>
@ -58,14 +58,14 @@
<translation>线</translation>
</message>
<message>
<location filename="../wlanconnect.cpp" line="374"/>
<location filename="../wlanconnect.cpp" line="1022"/>
<location filename="../wlanconnect.cpp" line="1084"/>
<location filename="../wlanconnect.cpp" line="362"/>
<location filename="../wlanconnect.cpp" line="1028"/>
<location filename="../wlanconnect.cpp" line="1090"/>
<source>connected</source>
<translation></translation>
</message>
<message>
<location filename="../wlanconnect.cpp" line="959"/>
<location filename="../wlanconnect.cpp" line="965"/>
<source>card</source>
<translation></translation>
</message>

View File

@ -227,7 +227,9 @@ bool WlanConnect::eventFilter(QObject *w, QEvent *e) {
if (!getSwitchBtnEnable()) {
showDesktopNotify(tr("No wireless network card detected"));
} else {
m_interface->call(QStringLiteral("setWirelessSwitchEnable"), !getSwitchBtnState());
if (m_interface != nullptr && m_interface->isValid()) {
m_interface->call(QStringLiteral("setWirelessSwitchEnable"), !getSwitchBtnState());
}
return true;
}
}
@ -298,7 +300,7 @@ void WlanConnect::initComponent() {
void WlanConnect::reScan()
{
qDebug() << "time to rescan wifi";
if (m_interface->isValid()) {
if (m_interface != nullptr && m_interface->isValid()) {
qDebug() << "[WlanConnect]call reScan" << __LINE__;
m_interface->call("reScan");
qDebug() << "[WlanConnect]call reScan respond" << __LINE__;
@ -312,7 +314,7 @@ void WlanConnect::updateList()
return;
}
qDebug() << "update list";
if(m_interface->isValid()) {
if(m_interface != nullptr && m_interface->isValid()) {
qDebug() << "[WlanConnect]call getWirelessList" << __LINE__;
QDBusMessage result = m_interface->call(QStringLiteral("getWirelessList"));
qDebug() << "[WlanConnect]call getWirelessList respond" << __LINE__;
@ -684,7 +686,7 @@ void WlanConnect::onNetworkRemove(QString deviceName, QString wlannName)
//获取设备列表=======================================================
void WlanConnect::getDeviceList(QStringList &list)
{
if (!m_interface->isValid()) {
if (m_interface == nullptr || !m_interface->isValid()) {
return;
}
qDebug() << "[WlanConnect]call getDeviceListAndEnabled" << __LINE__;
@ -703,7 +705,7 @@ void WlanConnect::getDeviceList(QStringList &list)
void WlanConnect::initSwtichState()
{
if (!m_interface->isValid()) {
if (m_interface == nullptr || !m_interface->isValid()) {
return;
}
@ -745,7 +747,7 @@ void WlanConnect::initNetListFromDevice(QString deviceName)
qDebug() << "[WlanConnect]initNetListFromDevice " << deviceName << " not exist";
return;
}
if (!m_interface->isValid()) {
if (m_interface == nullptr || !m_interface->isValid()) {
return;
}
qDebug() << "[WlanConnect]call getWirelessList" << __LINE__;
@ -878,6 +880,9 @@ void WlanConnect::showLayout(QVBoxLayout * layout) {
//获取应该插入哪个位置
int WlanConnect::sortWlanNet(QString deviceName, QString name, QString signal)
{
if (m_interface == nullptr || !m_interface->isValid()) {
return 0;
}
qDebug() << "[WlanConnect]call getWirelessList" << __LINE__;
QDBusMessage result = m_interface->call(QStringLiteral("getWirelessList"));
qDebug() << "[WlanConnect]call getWirelessList respond" << __LINE__;
@ -904,7 +909,7 @@ int WlanConnect::sortWlanNet(QString deviceName, QString name, QString signal)
}
void WlanConnect::activeConnect(QString netName, QString deviceName, int type) {
if (!m_interface->isValid()) {
if (m_interface == nullptr || !m_interface->isValid()) {
return;
}
qDebug() << "[WlanConnect]call activateConnect" << __LINE__;
@ -913,7 +918,7 @@ void WlanConnect::activeConnect(QString netName, QString deviceName, int type) {
}
void WlanConnect::deActiveConnect(QString netName, QString deviceName, int type) {
if (!m_interface->isValid()) {
if (m_interface == nullptr || !m_interface->isValid()) {
return;
}
qDebug() << "[WlanConnect]call deActivateConnect" << __LINE__;
@ -966,7 +971,7 @@ void WlanConnect::addDeviceFrame(QString devName)
deviceFrameMap.insert(devName, itemFrame);
connect(itemFrame->addWlanWidget, &AddNetBtn::clicked, this, [=](){
if (m_interface->isValid()) {
if (m_interface != nullptr && m_interface->isValid()) {
qDebug() << "[NetConnect]call showAddOtherWlanWidget" << devName << __LINE__;
m_interface->call(QStringLiteral("showAddOtherWlanWidget"), devName);
qDebug() << "[NetConnect]call setDeviceEnable Respond" << __LINE__;
@ -1034,7 +1039,7 @@ void WlanConnect::addOneWlanFrame(ItemFrame *frame, QString deviceName, QString
connect(wlanItem->infoLabel, &GrayInfoButton::clicked, this, [=]{
// open detail page
if (!m_interface->isValid()) {
if (m_interface == nullptr || !m_interface->isValid()) {
return;
}
qDebug() << "[WlanConnect]call showPropertyWidget" << __LINE__;

View File

@ -51,4 +51,5 @@ TRANSLATIONS += \
translations/zh_CN.ts \
translations/tr.ts \
translations/bo.ts \
translations/bo_CN.ts
translations/bo_CN.ts \
translations/en_US.ts

View File

@ -19,6 +19,7 @@
*/
#include "wlanitem.h"
#include <QPainter>
#include <QApplication>
#define FRAME_SPEED 150
#define LIMIT_TIME 60*1000
#define TOTAL_PAGE 8
@ -33,11 +34,7 @@ WlanItem::WlanItem(bool bAcitve, bool isLock, QWidget *parent)
this->setMinimumSize(550, 58);
this->setProperty("useButtonPalette", true);
this->setFlat(true);
QPalette pal = this->palette();
QColor color = pal.color(QPalette::Button);
color.setAlphaF(0.5);
pal.setColor(QPalette::Button, color);
this->setPalette(pal);
QHBoxLayout *mLanLyt = new QHBoxLayout(this);
mLanLyt->setContentsMargins(16,0,16,0);
mLanLyt->setSpacing(16);
@ -45,6 +42,7 @@ WlanItem::WlanItem(bool bAcitve, bool isLock, QWidget *parent)
iconLabel->setProperty("useIconHighlightEffect", 0x2);
titileLabel = new FixLabel(this);
statusLabel = new QLabel(this);
statusLabel->setProperty("useIconHighlightEffect", 0x2);
statusLabel->setAlignment(Qt::AlignRight | Qt::AlignVCenter);
// statusLabel->setMinimumSize(36,36);
infoLabel = new GrayInfoButton(this);
@ -64,7 +62,6 @@ WlanItem::WlanItem(bool bAcitve, bool isLock, QWidget *parent)
waitTimer = new QTimer(this);
connect(waitTimer, &QTimer::timeout, this, &WlanItem::updateIcon);
}
WlanItem::~WlanItem()
@ -94,12 +91,17 @@ void WlanItem::stopLoading(){
void WlanItem::paintEvent(QPaintEvent *event)
{
QPalette pal = this->palette();
QPalette pal = qApp->palette();
QPainter painter(this);
painter.setRenderHint(QPainter:: Antialiasing, true); //设置渲染,启动反锯齿
painter.setPen(Qt::NoPen);
painter.setBrush(pal.color(QPalette::Base));
painter.setBrush(this->palette().base().color());
QColor color = pal.color(QPalette::Button);
color.setAlphaF(0.5);
pal.setColor(QPalette::Button, color);
this->setPalette(pal);
QRect rect = this->rect();

View File

@ -36,14 +36,14 @@ KyNetworkDeviceResourse::KyNetworkDeviceResourse(QObject *parent) : QObject(pare
initDeviceMap();
connect(m_networkResourceInstance, &KyNetworkResourceManager::deviceAdd,
this, &KyNetworkDeviceResourse::onDeviceAdd, Qt::ConnectionType::DirectConnection);
this, &KyNetworkDeviceResourse::onDeviceAdd/*, Qt::ConnectionType::DirectConnection*/);
connect(m_networkResourceInstance, &KyNetworkResourceManager::deviceRemove,
this, &KyNetworkDeviceResourse::onDeviceRemove, Qt::ConnectionType::DirectConnection);
this, &KyNetworkDeviceResourse::onDeviceRemove/*, Qt::ConnectionType::DirectConnection*/);
connect(m_networkResourceInstance, &KyNetworkResourceManager::deviceUpdate,
this, &KyNetworkDeviceResourse::onDeviceUpdate, Qt::ConnectionType::DirectConnection);
this, &KyNetworkDeviceResourse::onDeviceUpdate/*, Qt::ConnectionType::DirectConnection*/);
connect(m_networkResourceInstance, &KyNetworkResourceManager::stateChanged,
this, &KyNetworkDeviceResourse::stateChanged, Qt::ConnectionType::DirectConnection);
this, &KyNetworkDeviceResourse::stateChanged/*, Qt::ConnectionType::DirectConnection*/);
connect(m_networkResourceInstance, &KyNetworkResourceManager::deviceCarrierChanage,
this, &KyNetworkDeviceResourse::carrierChanage);

View File

@ -26,6 +26,32 @@
#define LOG_FLAG "[KyNetworkResourceManager]"
QString enumToQstring(NetworkManager::AccessPoint::Capabilities cap, NetworkManager::AccessPoint::WpaFlags wpa_flags,NetworkManager::AccessPoint::WpaFlags rsn_flags)
{
QString out;
if ( (cap & NM_802_11_AP_FLAGS_PRIVACY)
&& (wpa_flags == NM_802_11_AP_SEC_NONE)
&& (rsn_flags == NM_802_11_AP_SEC_NONE)) {
out += "WEP ";
}
if (wpa_flags != NM_802_11_AP_SEC_NONE) {
out += "WPA1 ";
}
if ((rsn_flags & NM_802_11_AP_SEC_KEY_MGMT_PSK)
|| (rsn_flags & NM_802_11_AP_SEC_KEY_MGMT_802_1X)) {
out += "WPA2 ";
}
if (rsn_flags & NM_802_11_AP_SEC_KEY_MGMT_SAE) {
out += "WPA3 ";
}
if ( (wpa_flags & NM_802_11_AP_SEC_KEY_MGMT_802_1X)
|| (rsn_flags & NM_802_11_AP_SEC_KEY_MGMT_802_1X)) {
out += "802.1X ";
}
return out;
}
KyNetworkResourceManager* KyNetworkResourceManager::m_pInstance = nullptr;
KyNetworkResourceManager* KyNetworkResourceManager::getInstance()
@ -778,37 +804,46 @@ void KyNetworkResourceManager::onWifiNetworkUpdate(NetworkManager::WirelessNetwo
return;
}
bool bFlag = false;
QString devIface;
NetworkManager::Device::Ptr dev = findDeviceUni(net->device());
if(dev.isNull()) {
qDebug()<< LOG_FLAG << "device invalid";
bFlag = true;
} else {
devIface = dev->interfaceName();
}
if(bFlag) {
//device invalid
qDebug() << LOG_FLAG << "wifiNetworkDeviceDisappear";
Q_EMIT wifiNetworkDeviceDisappear();
return;
}
auto index = std::find(m_wifiNets.cbegin(), m_wifiNets.cend(), net);
if (m_wifiNets.cend() != index) {
if (net->accessPoints().isEmpty()) {
//Q_EMIT
bool bFlag = false;
QString devIface;
NetworkManager::Device::Ptr dev = findDeviceUni(net->device());
if(dev.isNull()) {
qDebug()<< LOG_FLAG << "device invalid";
bFlag = true;
} else {
devIface = dev->interfaceName();
}
//remove
auto pos = index - m_wifiNets.cbegin();
removeWifiNetwork(pos);
if(bFlag) {
//device invalid
qDebug() << LOG_FLAG << "wifiNetworkDeviceDisappear";
Q_EMIT wifiNetworkDeviceDisappear();
} else {
qDebug()<< LOG_FLAG << "wifiNetwork disappear" << net << net->ssid();
NetworkManager::AccessPoint::Ptr accessPoitPtr = net->referenceAccessPoint();
QByteArray rawSsid = accessPoitPtr->rawSsid();
QString wifiSsid = getSsidFromByteArray(rawSsid);
Q_EMIT wifiNetworkRemoved(devIface, wifiSsid);
}
qDebug()<< LOG_FLAG << "wifiNetwork disappear" << net << net->ssid();
NetworkManager::AccessPoint::Ptr accessPoitPtr = net->referenceAccessPoint();
QByteArray rawSsid = accessPoitPtr->rawSsid();
QString wifiSsid = getSsidFromByteArray(rawSsid);
Q_EMIT wifiNetworkRemoved(devIface, wifiSsid);
} else {
qDebug()<< LOG_FLAG << "wifiNetworkPropertyChange " << net << net->ssid();
Q_EMIT wifiNetworkPropertyChange(net);
NetworkManager::AccessPoint::Ptr accessPointPtr = net->referenceAccessPoint();
if (accessPointPtr.isNull()) {
return;
}
QByteArray rawSsid = accessPointPtr->rawSsid();
QString wifiSsid = getSsidFromByteArray(rawSsid);
QString bssid = accessPointPtr->hardwareAddress();
QString secuType = enumToQstring(accessPointPtr->capabilities(),
accessPointPtr->wpaFlags(),
accessPointPtr->rsnFlags());
Q_EMIT wifiNetworkPropertyChange(devIface, wifiSsid, net->signalStrength(), bssid, secuType);
}
}

View File

@ -45,6 +45,8 @@
#include <QInputDialog>
#include <QMetaEnum>
QString enumToQstring(NetworkManager::AccessPoint::Capabilities cap, NetworkManager::AccessPoint::WpaFlags wpa_flags,NetworkManager::AccessPoint::WpaFlags rsn_flags);
class KyNetworkResourceManager : public QObject
{
Q_OBJECT
@ -122,7 +124,7 @@ Q_SIGNALS:
//to KyWirelessNetResource
void wifiNetworkRemoved(QString, QString);
void wifiNetworkAdded(QString, QString);
void wifiNetworkPropertyChange(NetworkManager::WirelessNetwork * net);
void wifiNetworkPropertyChange(QString, QString, int, QString, QString);
void wifiNetworkSecuChange(NetworkManager::AccessPoint *);
void wifiNetworkDeviceDisappear();
void wifiEnabledChanged(bool);

View File

@ -27,31 +27,6 @@ const QString WPA3 = "WPA3";
#define FREQ_5GHZ 5000
QString enumToQstring(NetworkManager::AccessPoint::Capabilities cap, NetworkManager::AccessPoint::WpaFlags wpa_flags,NetworkManager::AccessPoint::WpaFlags rsn_flags)
{
QString out;
if ( (cap & NM_802_11_AP_FLAGS_PRIVACY)
&& (wpa_flags == NM_802_11_AP_SEC_NONE)
&& (rsn_flags == NM_802_11_AP_SEC_NONE)) {
out += "WEP ";
}
if (wpa_flags != NM_802_11_AP_SEC_NONE) {
out += "WPA1 ";
}
if ((rsn_flags & NM_802_11_AP_SEC_KEY_MGMT_PSK)
|| (rsn_flags & NM_802_11_AP_SEC_KEY_MGMT_802_1X)) {
out += "WPA2 ";
}
if (rsn_flags & NM_802_11_AP_SEC_KEY_MGMT_SAE) {
out += "WPA3 ";
}
if ( (wpa_flags & NM_802_11_AP_SEC_KEY_MGMT_802_1X)
|| (rsn_flags & NM_802_11_AP_SEC_KEY_MGMT_802_1X)) {
out += "802.1X ";
}
return out;
}
KyWirelessNetItem::KyWirelessNetItem(NetworkManager::WirelessNetwork::Ptr net)
{
m_networkResourceInstance = KyNetworkResourceManager::getInstance();

View File

@ -25,8 +25,6 @@
#include "kylinnetworkresourcemanager.h"
#include "kywirelessconnectoperation.h"
QString enumToQstring(NetworkManager::AccessPoint::Capabilities, NetworkManager::AccessPoint::WpaFlags, NetworkManager::AccessPoint::WpaFlags);
class KyWirelessNetItem
{
public:

View File

@ -61,15 +61,15 @@ KyWirelessNetResource::KyWirelessNetResource(QObject *parent)
//TODO:connect device signal
connect(m_networkResourceInstance, &KyNetworkResourceManager::wifiNetworkAdded,
this, &KyWirelessNetResource::onWifiNetworkAdded, Qt::ConnectionType::DirectConnection);
this, &KyWirelessNetResource::onWifiNetworkAdded/*, Qt::ConnectionType::DirectConnection*/);
connect(m_networkResourceInstance, &KyNetworkResourceManager::wifiNetworkRemoved,
this, &KyWirelessNetResource::onWifiNetworkRemoved, Qt::ConnectionType::DirectConnection);
this, &KyWirelessNetResource::onWifiNetworkRemoved/*, Qt::ConnectionType::DirectConnection*/);
connect(m_networkResourceInstance, &KyNetworkResourceManager::wifiNetworkPropertyChange,
this, &KyWirelessNetResource::onWifiNetworkPropertyChange, Qt::ConnectionType::DirectConnection);
this, &KyWirelessNetResource::onWifiNetworkPropertyChange/*, Qt::ConnectionType::DirectConnection*/);
connect(m_networkResourceInstance, &KyNetworkResourceManager::wifiNetworkSecuChange,
this, &KyWirelessNetResource::onWifiNetworkSecuChange, Qt::ConnectionType::DirectConnection);
this, &KyWirelessNetResource::onWifiNetworkSecuChange/*, Qt::ConnectionType::DirectConnection*/);
connect(m_networkResourceInstance, &KyNetworkResourceManager::wifiNetworkDeviceDisappear,
this, &KyWirelessNetResource::onWifiNetworkDeviceDisappear, Qt::ConnectionType::DirectConnection);
this, &KyWirelessNetResource::onWifiNetworkDeviceDisappear/*, Qt::ConnectionType::DirectConnection*/);
connect(m_networkResourceInstance, &KyNetworkResourceManager::connectionAdd,
this, &KyWirelessNetResource::onConnectionAdd);
@ -457,50 +457,36 @@ void KyWirelessNetResource::onWifiNetworkSecuChange(NetworkManager::AccessPoint
}
void KyWirelessNetResource::onWifiNetworkPropertyChange(NetworkManager::WirelessNetwork * net)
void KyWirelessNetResource::onWifiNetworkPropertyChange(QString interface, QString ssid, int signal, QString bssid, QString sec)
{
if (nullptr == net) {
return;
}
qDebug() << "onWifiNetworkPropertyChange" << net->ssid();
NetworkManager::AccessPoint::Ptr accessPointPtr = net->referenceAccessPoint();
QByteArray rawSsid = accessPointPtr->rawSsid();
QString wifiSsid = getSsidFromByteArray(rawSsid);
if (m_WifiNetworkList.contains(interface)) {
QList<KyWirelessNetItem>::iterator iter = m_WifiNetworkList[interface].begin();
while (iter != m_WifiNetworkList[interface].end()) {
qDebug() << iter->m_NetSsid;
if (iter->m_NetSsid == ssid) {
// qDebug()<< LOG_FLAG <<"recive properity changed signal, sender is" << iter->m_NetSsid;
if (iter->m_signalStrength != signal) {
iter->m_signalStrength = signal;
Q_EMIT signalStrengthChange(interface, ssid, iter->m_signalStrength);
}
if (net->device().isEmpty()) {
return;
}
if (iter->m_bssid != bssid) {
qDebug() << "bssid";
iter->m_bssid = bssid;
Q_EMIT bssidChange(interface, ssid, iter->m_bssid);
}
QString devIface = m_networkResourceInstance->findDeviceUni(net->device())->interfaceName();
if (m_WifiNetworkList.contains(devIface)) {
QList<KyWirelessNetItem>::iterator iter = m_WifiNetworkList[devIface].begin();
while (iter != m_WifiNetworkList[devIface].end()) {
if (iter->m_NetSsid == wifiSsid) {
// qDebug()<< LOG_FLAG <<"recive properity changed signal, sender is" << iter->m_NetSsid;
if (iter->m_signalStrength != net->signalStrength()) {
iter->m_signalStrength = net->signalStrength();
Q_EMIT signalStrengthChange(devIface, wifiSsid, iter->m_signalStrength);
}
if (iter->m_secuType != sec) {
iter->setKySecuType(sec);
Q_EMIT secuTypeChange(interface, ssid, sec);
}
if (iter->m_bssid != accessPointPtr->hardwareAddress()) {
iter->m_bssid = accessPointPtr->hardwareAddress();
Q_EMIT bssidChange(devIface, wifiSsid, iter->m_bssid);
}
break;
}
QString secuType = enumToQstring(accessPointPtr->capabilities(),
accessPointPtr->wpaFlags(),
accessPointPtr->rsnFlags());
if (iter->m_secuType != secuType) {
//qDebug() << "!!!!secuTypeChange" << wifiSsid << iter->m_secuType << "change to " << secuType;
iter->setKySecuType(secuType);
Q_EMIT secuTypeChange(devIface, wifiSsid, secuType);
}
break;
}
iter++;
}
iter++;
}
}
}

View File

@ -63,7 +63,7 @@ private:
public Q_SLOTS:
void onWifiNetworkAdded(QString, QString);
void onWifiNetworkRemoved(QString, QString);
void onWifiNetworkPropertyChange(NetworkManager::WirelessNetwork * net);
void onWifiNetworkPropertyChange(QString interface, QString ssid, int signal, QString bssid, QString sec);
void onWifiNetworkSecuChange(NetworkManager::AccessPoint *accessPointPtr);
void onWifiNetworkDeviceDisappear();

View File

@ -148,8 +148,7 @@ void LanListItem::onRightButtonClicked()
m_menu->addAction(new QAction(tr("Property"), this));
m_menu->addAction(new QAction(tr("Delete"), this));
m_menu->move(cursor().pos());
m_menu->show();
m_menu->popup(cursor().pos());
return;
}
@ -178,15 +177,15 @@ void LanListItem::onInfoButtonClicked()
return;
}
if(netDetail != nullptr){
netDetail->activateWindow();
return;
}
// if(netDetail != nullptr){
// netDetail->activateWindow();
// return;
// }
qDebug()<< LOG_FLAG << "the info button of lan is clicked! uuid = "
<< m_lanConnectItem.m_connectUuid << "; name = " << m_lanConnectItem.m_connectName
<< "." <<Q_FUNC_INFO << __LINE__;
#if 0
bool isActivated = false;
if (Activated == m_lanConnectItem.m_connectState) {
isActivated = true;
@ -202,7 +201,8 @@ void LanListItem::onInfoButtonClicked()
});
netDetail->show();
Q_EMIT this->detailShow(true);
#endif
Q_EMIT this->detailShow(m_deviceName, m_lanConnectItem.m_connectUuid);
return;
}

View File

@ -276,8 +276,8 @@ void ListItem::initUI()
m_lbLoadDown->setFont(font);
m_lbLoadUp->setText("0KB/s");
m_lbLoadDown->setText("0KB/s");
m_lbLoadDownImg->setPixmap(QPixmap(":/res/x/load-down.png"));
m_lbLoadUpImg->setPixmap(QPixmap(":/res/x/load-up.png"));
m_lbLoadDownImg->setPixmap(QPixmap(QLatin1String(":/res/x/load-down.png")));
m_lbLoadUpImg->setPixmap(QPixmap(QLatin1String(":/res/x/load-up.png")));
m_hItemLayout->addWidget(m_netButton);
m_hItemLayout->addWidget(m_nameLabel);

View File

@ -137,7 +137,7 @@ public Q_SLOTS:
virtual void onMenuTriggered(QAction *action)=0;
Q_SIGNALS:
void detailShow(bool isShow);
void detailShow(QString, QString);
};
#endif // LISTITEM_H

View File

@ -184,8 +184,8 @@ void WlanListItem::onRightButtonClicked()
m_menu->addAction(new QAction(tr("Forget"), this));
}
m_menu->move(cursor().pos());
m_menu->show();
// m_menu->move(cursor().pos());
m_menu->popup(cursor().pos());
return;
}
@ -465,17 +465,17 @@ void WlanListItem::refreshIcon(bool isActivated)
void WlanListItem::onInfoButtonClicked()
{
//ZJP_TODO 呼出无线详情页
if(netDetail != nullptr){
netDetail->activateWindow();
return;
}
// if(netDetail != nullptr){
// netDetail->activateWindow();
// return;
// }
qDebug() << LOG_FLAG << "Net active or not:"<< m_connectState;
qDebug() << LOG_FLAG << "On wlan info button clicked! ssid = "
<< m_wirelessNetItem.m_NetSsid << "; name = "
<< m_wirelessNetItem.m_connName << "." <<Q_FUNC_INFO << __LINE__;
#if 0
bool isActive = false;
if (Activated == m_connectState) {
isActive = true;
@ -490,7 +490,8 @@ void WlanListItem::onInfoButtonClicked()
}
});
netDetail->show();
Q_EMIT this->detailShow(true);
#endif
Q_EMIT this->detailShow(m_wlanDevice, m_wirelessNetItem.m_NetSsid);
}
void WlanListItem::onNetButtonClicked()

View File

@ -829,35 +829,7 @@ void MainWindow::showCreateWiredConnectWidget(const QString devName)
void MainWindow::showAddOtherWlanWidget(QString devName)
{
qDebug() << "showAddOtherWlanWidget! devName = " << devName;
if (m_addOtherPagePtrMap.contains(devName)) {
if (m_addOtherPagePtrMap[devName] != nullptr) {
qDebug() << "showAddOtherWlanWidget" << devName << "already create,just raise";
KWindowSystem::raiseWindow(m_addOtherPagePtrMap[devName]->winId());
return;
}
}
#if 0
NetDetail *netDetail = new NetDetail(devName, "", "", false, true, true, this);
connect(netDetail, &NetDetail::createPageClose, [&](QString interfaceName){
if (m_addOtherPagePtrMap.contains(interfaceName)) {
m_addOtherPagePtrMap[interfaceName] = nullptr;
}
});
m_addOtherPagePtrMap.insert(devName, netDetail);
netDetail->show();
#endif
JoinHiddenWiFiPage *hiddenWiFi =new JoinHiddenWiFiPage(devName);
connect(hiddenWiFi, &JoinHiddenWiFiPage::hiddenWiFiPageClose, [&](QString interfaceName){
if (m_addOtherPagePtrMap.contains(interfaceName)) {
m_addOtherPagePtrMap[interfaceName] = nullptr;
}
});
m_addOtherPagePtrMap.insert(devName, hiddenWiFi);
connect(hiddenWiFi, &JoinHiddenWiFiPage::showWlanList, this, &MainWindow::onShowMainWindow);
hiddenWiFi->show();
m_wlanWidget->showAddOtherPage(devName);
}
void MainWindow::getWirelessDeviceCap(QMap<QString, int> &map)

View File

@ -152,6 +152,7 @@ private:
void initUI();
void initDbusConnnect();
void initTrayIcon();
void resetTrayIconTool();
void initWindowTheme();
void resetWindowTheme();
@ -194,8 +195,6 @@ private:
IconActiveType iconStatus = IconActiveType::NOT_CONNECTED;
QMap<QString, NetDetail*> m_createPagePtrMap;
// QMap<QString, NetDetail*> m_addOtherPagePtrMap;
QMap<QString, JoinHiddenWiFiPage*> m_addOtherPagePtrMap;
public Q_SLOTS:
void onShowMainWindow(int type);

View File

@ -37,6 +37,9 @@ NetworkModeConfig::NetworkModeConfig(QObject *parent) : QObject(parent)
"/firewall",
"com.ksc.defender.firewall",
QDBusConnection::systemBus());
if(!m_dbusInterface->isValid()) {
qWarning() << qPrintable(QDBusConnection::sessionBus().lastError().message());
}
}
int NetworkModeConfig::getNetworkModeConfig(QString uuid)
@ -46,8 +49,9 @@ int NetworkModeConfig::getNetworkModeConfig(QString uuid)
return -1;
}
if(!m_dbusInterface->isValid()) {
qWarning ()<< "init com.ksc.defender dbus error";
if(m_dbusInterface == nullptr || !m_dbusInterface->isValid()) {
qWarning () << "com.ksc.defender dbus is invalid";
return -1;
}
QDBusReply<int> reply = m_dbusInterface->call("get_networkModeConfig", uuid);
@ -61,8 +65,9 @@ int NetworkModeConfig::getNetworkModeConfig(QString uuid)
void NetworkModeConfig::setNetworkModeConfig(QString uuid, QString cardName, QString ssid, int mode)
{
if(!m_dbusInterface->isValid()) {
qWarning ()<< "init com.ksc.defender dbus error";
if(m_dbusInterface == nullptr || !m_dbusInterface->isValid()) {
qWarning () << "com.ksc.defender dbus is invalid";
return;
}
QDBusReply<int> reply = m_dbusInterface->call("set_networkModeConfig", uuid, cardName, ssid, mode);
@ -75,8 +80,9 @@ void NetworkModeConfig::setNetworkModeConfig(QString uuid, QString cardName, QSt
int NetworkModeConfig::breakNetworkConnect(QString uuid, QString cardName, QString ssid)
{
if(!m_dbusInterface->isValid()) {
qWarning ()<< "init com.ksc.defender dbus error";
if(m_dbusInterface == nullptr || !m_dbusInterface->isValid()) {
qWarning () << "com.ksc.defender dbus is invalid";
return -1;
}
QDBusReply<int> reply = m_dbusInterface->call("break_networkConnect", uuid, cardName, ssid);

View File

@ -769,6 +769,12 @@ void LanPage::initUI()
m_inactivatedLanListWidget->setProperty("needTranslucent", true);
m_inactivatedAreaLayout->addWidget(m_inactivatedLanListWidget);
connect(m_inactivatedLanListWidget, &QListWidget::currentItemChanged, this, [=]() {
if (m_inactivatedLanListWidget->currentItem() != nullptr) {
m_inactivatedLanListWidget->currentItem()->setSelected(false);
}
});
QPalette pal = m_activatedLanListWidget->palette();
pal.setBrush(QPalette::Base, QColor(0,0,0,0)); //背景透明
m_activatedLanListWidget->setPalette(pal);
@ -776,6 +782,8 @@ void LanPage::initUI()
m_settingsLabel->installEventFilter(this);
m_netSwitch->installEventFilter(this);
m_activatedLanListWidget->installEventFilter(this);
m_inactivatedLanListWidget->installEventFilter(this);
showRate();
}
@ -795,7 +803,7 @@ QListWidgetItem *LanPage::insertNewItem(KyConnectItem *itemData, QListWidget *li
}
QListWidgetItem *p_sortListWidgetItem = new QListWidgetItem();
p_sortListWidgetItem->setFlags(p_sortListWidgetItem->flags() & (~Qt::ItemIsSelectable)); //设置不可被选中
// p_sortListWidgetItem->setFlags(p_sortListWidgetItem->flags() & (~Qt::ItemIsSelectable)); //设置不可被选中
p_sortListWidgetItem->setSizeHint(QSize(listWidget->width(),ITEM_HEIGHT));
listWidget->insertItem(index, p_sortListWidgetItem);
@ -803,14 +811,14 @@ QListWidgetItem *LanPage::insertNewItem(KyConnectItem *itemData, QListWidget *li
LanListItem *p_sortLanItem = nullptr;
p_sortLanItem = new LanListItem(itemData, m_currentDeviceName);
listWidget->setItemWidget(p_sortListWidgetItem, p_sortLanItem);
connect(p_sortLanItem, &LanListItem::detailShow, this, &LanPage::showDetailPage);
return p_sortListWidgetItem;
}
QListWidgetItem *LanPage::addNewItem(KyConnectItem *itemData, QListWidget *listWidget)
{
QListWidgetItem *p_listWidgetItem = new QListWidgetItem();
p_listWidgetItem->setFlags(p_listWidgetItem->flags() & (~Qt::ItemIsSelectable));
// p_listWidgetItem->setFlags(p_listWidgetItem->flags() & (~Qt::ItemIsSelectable));
p_listWidgetItem->setSizeHint(QSize(listWidget->width(), ITEM_HEIGHT));
listWidget->addItem(p_listWidgetItem);
LanListItem *p_lanItem = nullptr;
@ -824,6 +832,7 @@ QListWidgetItem *LanPage::addNewItem(KyConnectItem *itemData, QListWidget *listW
}
listWidget->setItemWidget(p_listWidgetItem, p_lanItem);
connect(p_lanItem, &LanListItem::detailShow, this, &LanPage::showDetailPage);
return p_listWidgetItem;
}
@ -1219,6 +1228,20 @@ bool LanPage::eventFilter(QObject *watched, QEvent *event)
}
}
} else if (watched == m_activatedLanListWidget) {
//去掉无右键菜单显示时的选中效果
if (event->type() == QEvent::FocusIn) {
if (m_activatedLanListWidget->currentItem() != nullptr) {
m_activatedLanListWidget->currentItem()->setSelected(false);
}
}
} else if (watched == m_inactivatedLanListWidget) {
//去掉无右键菜单显示时的选中效果
if (event->type() == QEvent::FocusIn) {
if (m_inactivatedLanListWidget->currentItem() != nullptr) {
m_inactivatedLanListWidget->currentItem()->setSelected(false);
}
}
}
return QWidget::eventFilter(watched, event);

View File

@ -87,6 +87,7 @@ WlanPage::WlanPage(QWidget *parent) : TabPage(parent)
}
});
m_wlanPagePtrMap.clear();
m_joinHiddenWiFiPagePtrMap.clear();
}
bool WlanPage::eventFilter(QObject *w, QEvent *e)
@ -104,6 +105,20 @@ bool WlanPage::eventFilter(QObject *w, QEvent *e)
//检测不到无线网卡不再触发click信号
}
}
} else if (w == m_activatedNetListWidget) {
//去掉无右键菜单显示时的选中效果
if (e->type() == QEvent::FocusIn) {
if (m_activatedNetListWidget->currentItem() != nullptr) {
m_activatedNetListWidget->currentItem()->setSelected(false);
}
}
} else if (w == m_inactivatedNetListWidget) {
//去掉无右键菜单显示时的选中效果
if (e->type() == QEvent::FocusIn) {
if (m_inactivatedNetListWidget->currentItem() != nullptr) {
m_inactivatedNetListWidget->currentItem()->setSelected(false);
}
}
}
return QWidget::eventFilter(w,e);
}
@ -138,6 +153,12 @@ void WlanPage::initWlanUI()
addWlanMoreItem();
m_inactivatedAreaLayout->addWidget(m_inactivatedNetListWidget);
connect(m_inactivatedNetListWidget, &QListWidget::currentItemChanged, this, [=]() {
if (m_inactivatedNetListWidget->currentItem() != nullptr) {
m_inactivatedNetListWidget->currentItem()->setSelected(false);
}
});
QPalette pal = m_activatedNetListWidget->palette();
pal.setBrush(QPalette::Base, QColor(0,0,0,0)); //背景透明
m_activatedNetListWidget->setPalette(pal);
@ -145,6 +166,8 @@ void WlanPage::initWlanUI()
m_settingsLabel->installEventFilter(this);
m_netSwitch->installEventFilter(this);
m_activatedNetListWidget->installEventFilter(this);
m_inactivatedNetListWidget->installEventFilter(this);
showRate();
}
@ -256,7 +279,7 @@ QListWidgetItem *WlanPage::addEmptyItem(QListWidget *wirelessListWidget)
{
WlanListItem *p_wlanItem = new WlanListItem();
QListWidgetItem *p_listWidgetItem = new QListWidgetItem();
p_listWidgetItem->setFlags(p_listWidgetItem->flags() & (~Qt::ItemIsSelectable)); //设置不可被选中
// p_listWidgetItem->setFlags(p_listWidgetItem->flags() & (~Qt::ItemIsSelectable)); //设置不可被选中
p_listWidgetItem->setSizeHint(QSize(wirelessListWidget->width(), p_wlanItem->height()));
wirelessListWidget->addItem(p_listWidgetItem);
wirelessListWidget->setItemWidget(p_listWidgetItem, p_wlanItem);
@ -272,9 +295,10 @@ QListWidgetItem *WlanPage::addNewItem(KyWirelessNetItem &wirelessNetItem,
m_currentDevice,
m_connectResource->isApConnection(wirelessNetItem.m_connectUuid));
connect(p_wlanItem, &WlanListItem::itemHeightChanged, this, &WlanPage::onItemHeightChanged);
connect(p_wlanItem, &WlanListItem::detailShow, this, &WlanPage::showDetailPage);
QListWidgetItem *p_listWidgetItem = new QListWidgetItem();
p_listWidgetItem->setFlags(p_listWidgetItem->flags() & (~Qt::ItemIsSelectable));
// p_listWidgetItem->setFlags(p_listWidgetItem->flags() & (~Qt::ItemIsSelectable));
p_listWidgetItem->setSizeHint(QSize(wirelessListWidget->width(), p_wlanItem->height()));
wirelessListWidget->addItem(p_listWidgetItem);
wirelessListWidget->setItemWidget(p_listWidgetItem, p_wlanItem);
@ -288,9 +312,10 @@ QListWidgetItem *WlanPage::insertNewItem(KyWirelessNetItem &wirelessNetItem,
{
WlanListItem *p_wlanItem = new WlanListItem(wirelessNetItem, m_currentDevice);
connect(p_wlanItem, &WlanListItem::itemHeightChanged, this, &WlanPage::onItemHeightChanged);
connect(p_wlanItem, &WlanListItem::detailShow, this, &WlanPage::showDetailPage);
QListWidgetItem *p_listWidgetItem = new QListWidgetItem();
p_listWidgetItem->setFlags(p_listWidgetItem->flags() & (~Qt::ItemIsSelectable));
// p_listWidgetItem->setFlags(p_listWidgetItem->flags() & (~Qt::ItemIsSelectable));
p_listWidgetItem->setSizeHint(QSize(wirelessListWidget->width(), p_wlanItem->height()));
wirelessListWidget->insertItem(row, p_listWidgetItem);
wirelessListWidget->setItemWidget(p_listWidgetItem, p_wlanItem);
@ -308,9 +333,10 @@ QListWidgetItem *WlanPage::insertNewItemWithSort(KyWirelessNetItem &wirelessNetI
// << "signal strength" << wirelessNetItem.m_signalStrength;
WlanListItem *p_sortWlanItem = new WlanListItem(wirelessNetItem, m_currentDevice);
connect(p_sortWlanItem, &WlanListItem::itemHeightChanged, this, &WlanPage::onItemHeightChanged);
connect(p_sortWlanItem, &WlanListItem::detailShow, this, &WlanPage::showDetailPage);
QListWidgetItem *p_sortListWidgetItem = new QListWidgetItem();
p_sortListWidgetItem->setFlags(p_sortListWidgetItem->flags() & (~Qt::ItemIsSelectable));
// p_sortListWidgetItem->setFlags(p_sortListWidgetItem->flags() & (~Qt::ItemIsSelectable));
p_sortListWidgetItem->setSizeHint(QSize(p_ListWidget->width(), p_sortWlanItem->height()));
// qDebug() << "insertNewItemWithSort, count" << p_ListWidget->count();
@ -361,10 +387,8 @@ void WlanPage::clearWirelessNetItemMap(QMap<QString, QListWidgetItem*> &wireless
wirelessListWidget->removeItemWidget(p_listWidgetItem);
delete p_wlanItem;
p_wlanItem = nullptr;
delete p_listWidgetItem;
p_listWidgetItem = nullptr;
iter = wirelessNetItem.erase(iter);
}
@ -392,10 +416,8 @@ void WlanPage::deleteWirelessItemFormMap(QMap<QString, QListWidgetItem*> &wirele
wirelessListWidget->takeItem(wirelessListWidget->row(p_listWidgetItem));
delete p_wlanItem;
p_wlanItem = nullptr;
delete p_listWidgetItem;
p_listWidgetItem = nullptr;
if (m_inactivatedNetListWidget->count() <= MAX_ITEMS) {
m_inactivatedNetListWidget->setFixedWidth(MIN_WIDTH);
@ -755,6 +777,12 @@ void WlanPage::onDeviceRemove(QString deviceName)
QString originalDeviceName = m_currentDevice;
if (m_joinHiddenWiFiPagePtrMap.contains(deviceName)) {
if (m_joinHiddenWiFiPagePtrMap[deviceName] != nullptr) {
m_joinHiddenWiFiPagePtrMap[deviceName]->close();
}
}
m_devList.removeOne(deviceName);
deleteDeviceFromCombox(deviceName);
@ -959,6 +987,7 @@ void WlanPage::onConnectionStateChanged(QString uuid,
if (ssid.isEmpty()) {
qDebug()<< LOG_FLAG << "ssid or devicename is empty"
<< "devicename"<< devName <<"ssid"<<ssid;
NetworkModeConfig::getInstance()->breakNetworkConnect(uuid, devName, ssid);
return;
}
@ -1121,24 +1150,8 @@ void WlanPage::requestScan()
void WlanPage::onHiddenWlanClicked()
{
// qDebug() << "[wlanPage] AddHideWifi Clicked! " << Q_FUNC_INFO << __LINE__ ;
// NetDetail *netDetail = new NetDetail(m_currentDevice, "", "", false, true, true);
// netDetail->show();
if(m_hiddenWiFi != nullptr){
m_hiddenWiFi->activateWindow();
return;
}
m_hiddenWiFi = new JoinHiddenWiFiPage(m_currentDevice);
connect(m_hiddenWiFi, &JoinHiddenWiFiPage::showWlanList, this, &WlanPage::showMainWindow);
connect(m_hiddenWiFi, &JoinHiddenWiFiPage::destroyed, [&](){
if (m_hiddenWiFi != nullptr) {
m_hiddenWiFi = nullptr;
}
});
m_hiddenWiFi->show();
qDebug() << "[wlanPage] AddHideWifi Clicked! " << Q_FUNC_INFO << __LINE__ ;
showHiddenWlanPage(m_currentDevice);
}
void WlanPage::showControlCenter()
@ -1247,6 +1260,7 @@ void WlanPage::onRefreshIconTimer()
WlanListItem *p_sortWlanItem = new WlanListItem(sortItem, m_currentDevice);
connect(p_sortWlanItem, &WlanListItem::itemHeightChanged, this, &WlanPage::onItemHeightChanged);
connect(p_sortWlanItem, &WlanListItem::detailShow, this, &WlanPage::showDetailPage);
m_inactivatedNetListWidget->insertItem(sortRow, p_sortListWidgetItem);
m_inactivatedNetListWidget->setItemWidget(p_sortListWidgetItem, p_sortWlanItem);
updateWlanItemState(m_inactivatedNetListWidget, p_sortListWidgetItem, Deactivated);
@ -1511,6 +1525,28 @@ void WlanPage::showRate()
});
}
void WlanPage::showHiddenWlanPage(QString devName)
{
if (m_joinHiddenWiFiPagePtrMap.contains(devName)) {
if (m_joinHiddenWiFiPagePtrMap[devName] != nullptr) {
qDebug() << "[WlanPage] showAddOtherWlanWidget" << devName << "already create,just raise";
KWindowSystem::raiseWindow(m_joinHiddenWiFiPagePtrMap[devName]->winId());
return;
}
}
JoinHiddenWiFiPage *hiddenWiFi =new JoinHiddenWiFiPage(devName);
connect(hiddenWiFi, &JoinHiddenWiFiPage::hiddenWiFiPageClose, [&](QString interfaceName){
if (m_joinHiddenWiFiPagePtrMap.contains(interfaceName)) {
m_joinHiddenWiFiPagePtrMap[interfaceName] = nullptr;
}
});
connect(hiddenWiFi, &JoinHiddenWiFiPage::showWlanList, this, &WlanPage::showMainWindow);
m_joinHiddenWiFiPagePtrMap.insert(devName, hiddenWiFi);
hiddenWiFi->show();
}
void WlanPage::showDetailPage(QString devName, QString ssid)
{
KyWirelessNetItem wirelessNetItem;
@ -1541,6 +1577,11 @@ void WlanPage::showDetailPage(QString devName, QString ssid)
return;
}
void WlanPage::showAddOtherPage(QString devName)
{
showHiddenWlanPage(devName);
}
bool WlanPage::checkWlanStatus(NetworkManager::ActiveConnection::State state)
{
if (m_activatedConnectResource->checkWirelessStatus(state)) {

View File

@ -66,6 +66,7 @@ public:
void deactivateWirelessConnection(const QString& devName, const QString& ssid);
void showDetailPage(QString devName, QString uuid);
void showAddOtherPage(QString devName);
bool checkWlanStatus(NetworkManager::ActiveConnection::State state);
@ -145,6 +146,8 @@ private:
void showRate();
void showHiddenWlanPage(QString devName);
QListWidgetItem *addEmptyItem(QListWidget *wirelessListWidget);
QListWidgetItem *addNewItem(KyWirelessNetItem &wirelessNetItem,
QListWidget *wirelessListWidget);
@ -231,8 +234,8 @@ private:
QTimer *m_scanTimer = nullptr;
QTimer *m_refreshIconTimer = nullptr;
JoinHiddenWiFiPage *m_hiddenWiFi = nullptr;
QMap<QString, QMap<QString, NetDetail*>> m_wlanPagePtrMap;
QMap<QString, JoinHiddenWiFiPage*> m_joinHiddenWiFiPagePtrMap;
};
#endif // WLANPAGE_H