kylin-network-manager for UKUI3.0

This commit is contained in:
chenlelin 2020-02-18 14:01:09 +08:00
parent e6d53e8cbc
commit f007a8fda4
51 changed files with 2759 additions and 1123 deletions

View File

@ -195,8 +195,7 @@ void BackThread::execConnWifiPWD(QString connName, QString password){
system(cmd.toUtf8().data());
QFile file("/tmp/kylin-nm-btoutput");
if(!file.open(QIODevice::ReadOnly | QIODevice::Text))
{
if(!file.open(QIODevice::ReadOnly | QIODevice::Text)){
syslog(LOG_DEBUG, "Can't open the file /tmp/kylin-nm-btoutput !");
qDebug()<<"Can't open the file /tmp/kylin-nm-btoutput !"<<endl;
}

View File

@ -1 +1 @@
d0ea598f653671ec7ae29f02cfe8a223bb295ffb
063b3688b29c269bac25fe162b774cd18111ad17

View File

@ -5,9 +5,9 @@ Version: 1.0.4-1
Auto-Built-Package: debug-symbols
Architecture: amd64
Maintainer: Kylin Team <team+kylin@tracker.debian.org>
Installed-Size: 2150
Installed-Size: 2513
Depends: kylin-nm (= 1.0.4-1)
Section: debug
Priority: optional
Description: debug symbols for kylin-nm
Build-Ids: d0ea598f653671ec7ae29f02cfe8a223bb295ffb
Build-Ids: 063b3688b29c269bac25fe162b774cd18111ad17

View File

@ -1 +1 @@
c48517cf1b116f015acf8816247d5b42 usr/lib/debug/.build-id/d0/ea598f653671ec7ae29f02cfe8a223bb295ffb.debug
01f1f57cd381771bd8181ce5baa6a75b usr/lib/debug/.build-id/06/3b3688b29c269bac25fe162b774cd18111ad17.debug

View File

@ -0,0 +1,133 @@
#include "dlghotspotcreate.h"
#include "ui_dlghotspotcreate.h"
DlgHotspotCreate::DlgHotspotCreate(QString wiFiCardName, QWidget *parent) :
wirelessCardName(wiFiCardName),
QDialog(parent),
ui(new Ui::DlgHotspotCreate)
{
ui->setupUi(this);
this->setWindowFlags(Qt::FramelessWindowHint);
this->setStyleSheet("background-color:white;");
ui->lbLeftup->setStyleSheet("QLabel{background-color:#266ab5;}");
ui->lbLeftupIcon->setStyleSheet("QLabel{background-image:url(:/res/h/no-pwd-wifi.png);background-color:transparent;}");
ui->lbLeftupTitle->setStyleSheet("QLabel{font-size:12px;color:#ffffff;background-color:transparent;}");
ui->btnCancel->setStyleSheet("QPushButton{border:1px solid #aaaaaa;background-color:#f5f5f5;}"
"QPushButton:Hover{border:2px solid #629ee8;background-color:#eeeeee;}"
"QPushButton:Pressed{border:1px solid #aaaaaa;background-color:#d8d8d8;}");
ui->btnOk->setStyleSheet("QPushButton{border:1px solid #aaaaaa;background-color:#f5f5f5;}"
"QPushButton:Hover{border:2px solid #629ee8;background-color:#eeeeee;}"
"QPushButton:Pressed{border:1px solid #aaaaaa;background-color:#d8d8d8;}");
ui->checkBoxPwd->setStyleSheet("QCheckBox::indicator {width: 18px; height: 9px;}"
"QCheckBox::indicator:checked {image: url(:/res/h/show-pwd.png);}"
"QCheckBox::indicator:unchecked {image: url(:/res/h/hide-pwd.png);}");
ui->lbLeftupTitle->setText(tr("Create Hotspot")); //创建个人热点
ui->lbNetName->setText(tr("Network name")); //网络名称:
ui->lbSecurity->setText(tr("Wi-Fi security")); //Wi-Fi 安全性:
ui->lbPassword->setText(tr("Password")); //密码:
ui->btnCancel->setText(tr("Cancel")); //取消
ui->btnOk->setText(tr("Ok")); //确定
ui->btnOk->setEnabled(false);
ui->cbxSecurity->addItem(tr("None")); //无
ui->cbxSecurity->addItem(tr("WPA & WPA2 Personal")); //WPA 及 WPA2 个人
ui->cbxSecurity->setCurrentIndex(1);
connect(ui->cbxSecurity,SIGNAL(currentIndexChanged(QString)),this,SLOT(changeDialog()));
}
DlgHotspotCreate::~DlgHotspotCreate()
{
delete ui;
}
void DlgHotspotCreate::mousePressEvent(QMouseEvent *event){
if(event->button() == Qt::LeftButton){
this->isPress = true;
this->winPos = this->pos();
this->dragPos = event->globalPos();
event->accept();
}
}
void DlgHotspotCreate::mouseReleaseEvent(QMouseEvent *event){
this->isPress = false;
this->setWindowOpacity(1);
}
void DlgHotspotCreate::mouseMoveEvent(QMouseEvent *event){
if(this->isPress){
this->move(this->winPos - (this->dragPos - event->globalPos()));
this->setWindowOpacity(0.9);
event->accept();
}
}
void DlgHotspotCreate::on_btnCancel_clicked()
{
this->close();
emit btnHotspotState();
}
void DlgHotspotCreate::on_btnOk_clicked()
{
//nmcli device wifi hotspot [ifname ifname] [con-name name] [ssid SSID] [band {a | bg}] [channel channel] [password password]
//example: nmcli device wifi hotspot ifname wlan0 con-name MyHostspot ssid MyHostspotSSID password 12345678
QString str;
if(ui->cbxSecurity->currentIndex() == 0 ){
str = "nmcli device wifi hotspot ifname " + wirelessCardName + " con-name " + ui->leNetName->text() + " ssid " + ui->leNetName->text() + "SSID";
}else{
str = "nmcli device wifi hotspot ifname " + wirelessCardName + " con-name " + ui->leNetName->text() + " ssid " + ui->leNetName->text() + " password " + ui->lePassword->text();
}
system(str.toUtf8().data());
this->close();
emit updateHotspotList();
}
void DlgHotspotCreate::on_checkBoxPwd_stateChanged(int arg1)
{
if (arg1 == 0) {
ui->lePassword ->setEchoMode(QLineEdit::Password);
} else {
ui->lePassword->setEchoMode(QLineEdit::Normal);
}
}
void DlgHotspotCreate::on_leNetName_textEdited(const QString &arg1)
{
if(ui->cbxSecurity->currentIndex() == 0 ){
if (ui->leNetName->text() == ""){
ui->btnOk->setEnabled(false);
} else {
ui->btnOk->setEnabled(true);
}
}else{
if (ui->leNetName->text() == "" || ui->lePassword->text().size() < 5){
ui->btnOk->setEnabled(false);
} else {
ui->btnOk->setEnabled(true);
}
}
}
void DlgHotspotCreate::on_lePassword_textEdited(const QString &arg1)
{
if (ui->leNetName->text() == "" || ui->lePassword->text().size() < 5){
ui->btnOk->setEnabled(false);
} else {
ui->btnOk->setEnabled(true);
}
}
void DlgHotspotCreate::changeDialog()
{
if(ui->cbxSecurity->currentIndex()==0){
ui->lbPassword->setEnabled(false);
ui->lePassword->setEnabled(false);
ui->checkBoxPwd->setEnabled(false);
} else {
ui->lbPassword->setEnabled(true);
ui->lePassword->setEnabled(true);
ui->checkBoxPwd->setEnabled(true);
}
}

View File

@ -0,0 +1,51 @@
#ifndef DLGHOTSPOTCREATE_H
#define DLGHOTSPOTCREATE_H
#include <QDialog>
#include <QMouseEvent>
#include <QDebug>
namespace Ui {
class DlgHotspotCreate;
}
class DlgHotspotCreate : public QDialog
{
Q_OBJECT
public:
explicit DlgHotspotCreate(QString wiFiCardName, QWidget *parent = nullptr);
~DlgHotspotCreate();
public slots:
void changeDialog();
private slots:
void on_btnCancel_clicked();
void on_btnOk_clicked();
void on_checkBoxPwd_stateChanged(int arg1);
void on_leNetName_textEdited(const QString &arg1);
void on_lePassword_textEdited(const QString &arg1);
private:
Ui::DlgHotspotCreate *ui;
QString wirelessCardName;
void mousePressEvent(QMouseEvent *event);
void mouseReleaseEvent(QMouseEvent *event);
void mouseMoveEvent(QMouseEvent *event);
bool isPress;
QPoint winPos;
QPoint dragPos;
signals:
void updateHotspotList();
void btnHotspotState();
};
#endif // DLGHOTSPOTCREATE_H

View File

@ -0,0 +1,169 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>DlgHotspotCreate</class>
<widget class="QDialog" name="DlgHotspotCreate">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>432</width>
<height>250</height>
</rect>
</property>
<property name="windowTitle">
<string>Dialog</string>
</property>
<widget class="QLabel" name="lbLeftup">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>120</width>
<height>32</height>
</rect>
</property>
<property name="text">
<string/>
</property>
</widget>
<widget class="QLabel" name="lbLeftupIcon">
<property name="geometry">
<rect>
<x>9</x>
<y>9</y>
<width>16</width>
<height>16</height>
</rect>
</property>
<property name="text">
<string/>
</property>
</widget>
<widget class="QLabel" name="lbLeftupTitle">
<property name="geometry">
<rect>
<x>34</x>
<y>6</y>
<width>80</width>
<height>20</height>
</rect>
</property>
<property name="text">
<string/>
</property>
</widget>
<widget class="QPushButton" name="btnCancel">
<property name="geometry">
<rect>
<x>215</x>
<y>210</y>
<width>90</width>
<height>30</height>
</rect>
</property>
<property name="text">
<string/>
</property>
</widget>
<widget class="QPushButton" name="btnOk">
<property name="geometry">
<rect>
<x>315</x>
<y>210</y>
<width>90</width>
<height>30</height>
</rect>
</property>
<property name="text">
<string/>
</property>
</widget>
<widget class="QLabel" name="lbSecurity">
<property name="geometry">
<rect>
<x>76</x>
<y>60</y>
<width>90</width>
<height>20</height>
</rect>
</property>
<property name="text">
<string/>
</property>
</widget>
<widget class="QComboBox" name="cbxSecurity">
<property name="geometry">
<rect>
<x>175</x>
<y>55</y>
<width>200</width>
<height>32</height>
</rect>
</property>
</widget>
<widget class="QLabel" name="lbNetName">
<property name="geometry">
<rect>
<x>76</x>
<y>105</y>
<width>90</width>
<height>20</height>
</rect>
</property>
<property name="text">
<string/>
</property>
</widget>
<widget class="QLineEdit" name="leNetName">
<property name="geometry">
<rect>
<x>175</x>
<y>100</y>
<width>200</width>
<height>32</height>
</rect>
</property>
</widget>
<widget class="QLabel" name="lbPassword">
<property name="geometry">
<rect>
<x>76</x>
<y>150</y>
<width>90</width>
<height>20</height>
</rect>
</property>
<property name="text">
<string/>
</property>
</widget>
<widget class="QLineEdit" name="lePassword">
<property name="geometry">
<rect>
<x>175</x>
<y>145</y>
<width>200</width>
<height>32</height>
</rect>
</property>
<property name="echoMode">
<enum>QLineEdit::Password</enum>
</property>
</widget>
<widget class="QCheckBox" name="checkBoxPwd">
<property name="geometry">
<rect>
<x>350</x>
<y>157</y>
<width>18</width>
<height>9</height>
</rect>
</property>
<property name="text">
<string/>
</property>
</widget>
</widget>
<resources/>
<connections/>
</ui>

View File

@ -26,6 +26,8 @@ KylinDBus::KylinDBus(MainWindow *mainWindow, QObject *parent) :QObject(parent)
getObjectPath(); //获取dbus中 lan 与 WiFi 的device路径
getPhysicalCarrierState(0); //初始化获取网线插入状态
getLanHwAddressState(); //获取有线网Mac地址
getWiredCardName();
QDBusConnection::systemBus().connect(QString("org.freedesktop.NetworkManager"),
QString("/org/freedesktop/NetworkManager"),
@ -42,7 +44,7 @@ KylinDBus::KylinDBus(MainWindow *mainWindow, QObject *parent) :QObject(parent)
QString("org.freedesktop.NetworkManager.Device.Wired"),
QString("PropertiesChanged"), this, SLOT(onLanPropertyChanged(QVariantMap) ) );
if (wiredPath.path() != ""){
if (wirelessPath.path() != ""){
QDBusConnection::systemBus().connect(QString("org.freedesktop.NetworkManager"),
QString(wirelessPath.path()),
QString("org.freedesktop.NetworkManager.Device.Wireless"),
@ -52,6 +54,7 @@ KylinDBus::KylinDBus(MainWindow *mainWindow, QObject *parent) :QObject(parent)
QString(wirelessPath.path()),
QString("org.freedesktop.NetworkManager.Device.Wireless"),
QString("AccessPointAdded"), this, SLOT(onAccessPointAdded(QDBusObjectPath) ) );
getWirelessCardName();//获取无线网卡名称
}
time = new QTimer(this);
@ -95,10 +98,8 @@ void KylinDBus::getPhysicalCarrierState(int n)
QDBusReply<QVariant> reply = interface.call("Get", "org.freedesktop.NetworkManager.Device.Wired", "Carrier");
if (reply.value().toString() == "true"){
qDebug()<<"physical carrier is found: "<<reply.value().toString();
isWiredCableOn = true;
} else if (reply.value().toString() == "false"){
qDebug()<<"physical carrier is not found: "<<reply.value().toString();
isWiredCableOn = false;
} else {
syslog(LOG_ERR, "Error occured when get the property 'Carrier' of Wired");
@ -108,6 +109,135 @@ void KylinDBus::getPhysicalCarrierState(int n)
if (n == 1){ this->mw->onPhysicalCarrierChanged(isWiredCableOn);}
}
void KylinDBus::getLanHwAddressState()
{
QDBusInterface lanInterface( "org.freedesktop.NetworkManager",
wiredPath.path(),
"org.freedesktop.DBus.Properties",
QDBusConnection::systemBus() );
QDBusReply<QVariant> lanReply = lanInterface.call("Get", "org.freedesktop.NetworkManager.Device.Wired", "HwAddress");
dbusLanMac = lanReply.value().toString();
}
void KylinDBus::getWiredCardName()
{
QDBusInterface lanInterface( "org.freedesktop.NetworkManager",
wiredPath.path(),
"org.freedesktop.DBus.Properties",
QDBusConnection::systemBus() );
QDBusReply<QVariant> lanReply = lanInterface.call("Get", "org.freedesktop.NetworkManager.Device", "Interface");
dbusLanCardName = lanReply.value().toString();
}
void KylinDBus::getWirelessCardName()
{
QDBusInterface lanInterface( "org.freedesktop.NetworkManager",
wirelessPath.path(),
"org.freedesktop.DBus.Properties",
QDBusConnection::systemBus() );
QDBusReply<QVariant> lanReply = lanInterface.call("Get", "org.freedesktop.NetworkManager.Device", "Interface");
dbusWiFiCardName = lanReply.value().toString();
}
void KylinDBus::getLanIp(QString netName)
{
QDBusInterface m_interface("org.freedesktop.NetworkManager",
"/org/freedesktop/NetworkManager/Settings",
"org.freedesktop.NetworkManager.Settings",
QDBusConnection::systemBus() );
QDBusReply<QList<QDBusObjectPath>> m_reply = m_interface.call("ListConnections");
QList<QDBusObjectPath> m_objNets = m_reply.value();
foreach (QDBusObjectPath objNet, m_objNets){
QDBusInterface m_interface("org.freedesktop.NetworkManager",
objNet.path(),
"org.freedesktop.NetworkManager.Settings.Connection",
QDBusConnection::systemBus());
QDBusMessage reply = m_interface.call("GetSettings");
const QDBusArgument &dbusArg = reply.arguments().at( 0 ).value<QDBusArgument>();
//DBus type : a{sa{sv}}, a map with a key of QString, which maps to another map of QString,QVariant
QMap<QString,QMap<QString,QVariant>> map;
dbusArg >> map;
//方法一
for (int i =0;i<2;i++){
if(map.values().at(1).values().at(i).toString() == netName){
dbusLanIpv4 = map.values().at(2).values().at(4).toString();
dbusLanIpv6 = map.values().at(3).values().at(5).toString();
break;
}
}
// //方法二,仅供参考,暂不能用
// for(QString key : map.keys() ){
// QMap<QString,QVariant> innerMap = map.value(key);
// qDebug() << "Key: " << key;
// if (key == "ipv4") {
// for (QString inner_key : innerMap.keys()){
// qDebug() << " " << inner_key << ":" << innerMap.value(inner_key);
// }
// }
// }
}
}
void KylinDBus::getWifiMac(QString netName, int num)
{
dbusWifiMac = "";
QDBusInterface interface( "org.freedesktop.NetworkManager",
wirelessPath.path(),
"org.freedesktop.NetworkManager.Device.Wireless",
QDBusConnection::systemBus() );
QDBusReply<QList<QDBusObjectPath>> reply = interface.call("GetAllAccessPoints");
QList<QDBusObjectPath> objPaths = reply.value();
int n = 0;
foreach (QDBusObjectPath objPath, objPaths){
if (n == num){
QDBusInterface path_interface( "org.freedesktop.NetworkManager",
objPath.path(),
"org.freedesktop.DBus.Properties",
QDBusConnection::systemBus() );
QDBusReply<QVariant> path_reply = path_interface.call("Get", "org.freedesktop.NetworkManager.AccessPoint", "HwAddress");
dbusWifiMac = path_reply.value().toString();
}
n += 1;
}
}
void KylinDBus::getActWifiMac(QString netName)
{
dbusWifiMac = "";
QDBusInterface m_interface("org.freedesktop.NetworkManager",
"/org/freedesktop/NetworkManager/Settings",
"org.freedesktop.NetworkManager.Settings",
QDBusConnection::systemBus() );
QDBusReply<QList<QDBusObjectPath>> m_reply = m_interface.call("ListConnections");
QList<QDBusObjectPath> m_objNets = m_reply.value();
foreach (QDBusObjectPath objNet, m_objNets){
QDBusInterface m_interface("org.freedesktop.NetworkManager",
objNet.path(),
"org.freedesktop.NetworkManager.Settings.Connection",
QDBusConnection::systemBus());
QDBusMessage reply = m_interface.call("GetSettings");
const QDBusArgument &dbusArg = reply.arguments().at( 0 ).value<QDBusArgument>();
QMap<QString,QMap<QString,QVariant>> map;
dbusArg >> map;
if (map.values().at(0).values().size() >= 5){
if(map.values().at(2).values().at(0).toString() == netName){
dbusWifiMac = map.values().at(0).values().at(3).toString();
}
}
}
}
int KylinDBus::getAccessPointsNumber()
{
QDBusInterface interface( "org.freedesktop.NetworkManager",
@ -119,7 +249,7 @@ int KylinDBus::getAccessPointsNumber()
QList<QDBusObjectPath> objPaths = reply.value();
// foreach (QDBusObjectPath objPath, objPaths){
// qDebug()<<"*****path is: "<<objPath.path(); //列出每一个objectPath
// qDebug()<<"debug: *****path is: "<<objPath.path(); //列出每一个objectPath
// }
return objPaths.size();

View File

@ -32,12 +32,24 @@ public:
bool isWiredCableOn = false;
bool isWirelessCardOn = false;
QString dbusLanCardName;
QString dbusLanIpv4 = "";
QString dbusLanIpv6 = "";
QString dbusLanMac = "";
QString dbusWiFiCardName;
QString dbusWifiMac = "";
public slots:
void onLanPropertyChanged(QVariantMap qvm);
void onWifiPropertyChanged(QVariantMap qvm);
void onAccessPointAdded(QDBusObjectPath objPath);
void getPhysicalCarrierState(int n);
void getLanHwAddressState();
void getWiredCardName();
void getWirelessCardName();
void getLanIp(QString netName);
void getWifiMac(QString netName, int num);
void getActWifiMac(QString netName);
void slot_timeout();
private:

View File

@ -12,6 +12,7 @@ TARGET = kylin-nm
#CONFIG += link_pkgconfig
#PKGCONFIG += libnm glib-2.0 gio-2.0 dbus-glib-1
#PKGCONFIG += Qt5Svg
target.path = /usr/bin
@ -56,7 +57,9 @@ SOURCES += \
wireless-security/dlgconnhidwifiwep.cpp \
wireless-security/dlgconnhidwifileap.cpp \
wireless-security/dlgconnhidwifiwpa.cpp \
kylin-dbus-interface.cpp
kylin-dbus-interface.cpp \
hot-spot/dlghotspotcreate.cpp \
networkspeed.cpp
HEADERS += \
mainwindow.h \
@ -78,7 +81,9 @@ HEADERS += \
wireless-security/dlgconnhidwifileap.h \
wireless-security/dlgconnhidwifiwpa.h \
wireless-security/kylinheadfile.h \
kylin-dbus-interface.h
kylin-dbus-interface.h \
hot-spot/dlghotspotcreate.h \
networkspeed.h
FORMS += \
mainwindow.ui \
@ -94,7 +99,8 @@ FORMS += \
wireless-security/dlgconnhidwifisecpwd.ui \
wireless-security/dlgconnhidwifiwep.ui \
wireless-security/dlgconnhidwifileap.ui \
wireless-security/dlgconnhidwifiwpa.ui
wireless-security/dlgconnhidwifiwpa.ui \
hot-spot/dlghotspotcreate.ui
RESOURCES += \
nmqrc.qrc

View File

@ -20,11 +20,11 @@
LoadingDiv::LoadingDiv(QWidget *parent) : QWidget(parent)
{
this->resize(316, 467);
this->resize(480, 500);
this->loadingGif = new QLabel(this);
this->loadingGif->resize(96, 96);
this->loadingGif->move(this->width() / 2 - 96 / 2, this->height() / 2 - 96 / 2);
this->loadingGif->move(this->width() / 2 - 96 / 2 + 20, this->height() / 2 - 96 / 2);
this->loadingGif->show();

File diff suppressed because it is too large Load Diff

View File

@ -30,6 +30,9 @@
#include <QScreen>
#include <QMenu>
#include <QAction>
#include <QWidgetAction>
#include <QHBoxLayout>
#include <QPainter>
#include <QDebug>
#include <QString>
#include <QTimer>
@ -49,6 +52,7 @@
#include "ksimplenm.h"
#include "loadingdiv.h"
#include "networkspeed.h"
#include "kylin-dbus-interface.h"
#include "kylin-network-interface.h"
@ -77,12 +81,15 @@ public:
void changeTimerState();
void checkIsWirelessDeviceOn();
void init_widget_action(QWidget *wid, QString iconstr, QString textstr);
QIcon iconLanOnline, iconLanOffline;
QIcon iconWifiFull, iconWifiHigh, iconWifiMedium, iconWifiLow;
QIcon iconConnecting;
QList<QIcon> loadIcons;
QString mwBandWidth;
KylinDBus *objKyDBus;
NetworkSpeed *objNetSpeed;
//状态设置,0为假1为真
int is_update_wifi_list = 0; //是否是update wifi列表而不是load wifi列表
@ -93,6 +100,10 @@ public:
int is_wireless_adapter_ready = 1; //主机是否插入无线网卡
int is_keep_wifi_turn_on_state = 1; //是否要执行wifi开关变为打开样式
int is_stop_check_net_state = 0; //是否要在进行其他操作时停止检查网络状态
int is_fly_mode_on = 0; //是否打开飞行模式
int is_hot_sopt_on = 0; //是否已经打开热点
QString currSelNetName = ""; //当前ScrollArea中选中的网络名称
public slots:
void onPhysicalCarrierChanged(bool flag);
@ -103,12 +114,20 @@ public slots:
void onWirelessDeviceRemoved(QDBusObjectPath objPath);
void getLanBandWidth();
void oneLanFormSelected(QString lanName);
void oneTopLanFormSelected(QString lanName);
void oneWifiFormSelected(QString wifiName);
void oneTopWifiFormSelected(QString wifiName);
void on_btnHotspot_clicked();
void on_btnHotspotState();
private:
void checkSingle();
void getActiveInfo();
void initNetwork();
void createTrayIcon();
void moveBottomRight();
void handleIconClicked();
bool checkLanOn();
bool checkWlOn();
void getLanList();
@ -122,32 +141,32 @@ private:
QDesktopWidget desktop;
KSimpleNM *ksnm;
ConfForm *confForm;
QWidget *topLanListWidget;
QWidget *topWifiListWidget;
QWidget *lanListWidget;
QWidget *wifiListWidget;
QWidget *optWifiWidget;
QLabel *lbLoadDown;
QLabel *lbLoadUp;
QScrollArea *scrollAreal, *scrollAreaw;
QLabel *lbLanList, *lbWifiList;
QLabel *lbTopLanList, *lbTopWifiList, *lbLanList, *lbWifiList;
QSystemTrayIcon *trayIcon;
QMenu *trayIconMenu;
QWidgetAction *mShowWindow;
QWidgetAction *mAdvConf;
QWidget *wid;
QWidget *wid_new;
QAction *m_miniSizeAction;
QAction *m_quitAction;
QString lname, wname; // 以太网卡和无线网卡名称
// 以太网卡和无线网卡名称
QString lname, wname;
QString btnOffQss, btnOnQss, btnBgOffQss, btnBgOnQss; // 主界面按钮底色
//当前ScrollArea中选中的网络名称
QString currSelNetName = "";
QStringList oldLanSlist; //上一次获取Lan列表
// 主界面按钮底色
QString btnOffQss, btnOnQss;
//上一次获取Lan列表
QStringList oldLanSlist;
//上一次获取wifi列表
QStringList oldWifiSlist;
QStringList oldWifiSlist; //上一次获取wifi列表
//循环检测网络连接状态
QTimer *iconTimer;
@ -158,11 +177,19 @@ private:
QTimer *checkIfLanConnect;
QTimer *checkIfWifiConnect;
QTimer *checkIfNetworkOn;
QTimer *setNetSpeed;
int currentIconIndex;
int activeWifiSignalLv;
long int start_rcv_rates = 0; //保存开始时的流量计数
long int end_rcv_rates = 0; //保存结束时的流量计数
long int start_tx_rates = 0; //保存开始时的流量计数
long int end_tx_rates = 0; //保存结束时的流量计数
private slots:
void iconActivated(QSystemTrayIcon::ActivationReason reason);
bool nativeEvent(const QByteArray &eventType, void *message, long *result);
void on_btnNet_clicked();
@ -175,12 +202,11 @@ private slots:
void loadWifiListDone(QStringList slist);
void updateWifiListDone(QStringList slist);
void on_showWindowAction();
void on_btnAdvConf_clicked();
void on_btnNetList_pressed();
void on_btnWifiList_pressed();
void oneLanFormSelected(QString lanName);
void oneWifiFormSelected(QString wifiName);
void activeLanDisconn();
void activeWifiDisconn();
void activeStartLoading();
@ -188,6 +214,7 @@ private slots:
void on_btnAdvConf_pressed();
void on_btnAdvConf_released();
void on_checkWifiListChanged();
void on_setNetSpeed();
void on_isLanConnect();
void on_isWifiConnect();
void on_isNetOn();
@ -203,6 +230,8 @@ private slots:
void connWifiDone(int connFlag);
void iconStep();
void on_btnFlyMode_clicked();
signals:
void deleteRedundantNet();
};

View File

@ -6,8 +6,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>316</width>
<height>467</height>
<width>480</width>
<height>515</height>
</rect>
</property>
<property name="windowTitle">
@ -19,83 +19,18 @@
<rect>
<x>1</x>
<y>1</y>
<width>314</width>
<height>38</height>
<width>41</width>
<height>513</height>
</rect>
</property>
<widget class="QPushButton" name="btnWifiList">
<property name="geometry">
<rect>
<x>158</x>
<y>8</y>
<width>90</width>
<height>22</height>
</rect>
</property>
<property name="text">
<string/>
</property>
</widget>
<widget class="QPushButton" name="btnNetList">
<property name="geometry">
<rect>
<x>67</x>
<y>8</y>
<width>90</width>
<height>22</height>
</rect>
</property>
<property name="text">
<string/>
</property>
</widget>
</widget>
<widget class="QLabel" name="lbBtnNetBG">
<property name="geometry">
<rect>
<x>4</x>
<y>403</y>
<width>90</width>
<height>60</height>
</rect>
</property>
<property name="text">
<string/>
</property>
</widget>
<widget class="QLabel" name="lbLanImg">
<property name="geometry">
<rect>
<x>10</x>
<y>410</y>
<width>22</width>
<height>22</height>
</rect>
</property>
<property name="text">
<string/>
</property>
</widget>
<widget class="QLabel" name="lbBtnNetT1">
<property name="geometry">
<rect>
<x>40</x>
<y>412</y>
<width>55</width>
<height>18</height>
</rect>
</property>
<property name="text">
<string/>
</property>
</widget>
<widget class="QLabel" name="lbBtnNetT2">
<property name="geometry">
<rect>
<x>10</x>
<y>440</y>
<width>55</width>
<height>18</height>
<x>1</x>
<y>200</y>
<width>37</width>
<height>37</height>
</rect>
</property>
<property name="text">
@ -105,10 +40,10 @@
<widget class="QPushButton" name="btnNet">
<property name="geometry">
<rect>
<x>4</x>
<y>403</y>
<width>90</width>
<height>60</height>
<x>2</x>
<y>200</y>
<width>37</width>
<height>37</height>
</rect>
</property>
<property name="text">
@ -118,49 +53,10 @@
<widget class="QLabel" name="lbBtnWifiBG">
<property name="geometry">
<rect>
<x>98</x>
<y>403</y>
<width>90</width>
<height>60</height>
</rect>
</property>
<property name="text">
<string/>
</property>
</widget>
<widget class="QLabel" name="lbWifiImg">
<property name="geometry">
<rect>
<x>103</x>
<y>410</y>
<width>22</width>
<height>22</height>
</rect>
</property>
<property name="text">
<string/>
</property>
</widget>
<widget class="QLabel" name="lbBtnWifiT1">
<property name="geometry">
<rect>
<x>132</x>
<y>412</y>
<width>55</width>
<height>18</height>
</rect>
</property>
<property name="text">
<string/>
</property>
</widget>
<widget class="QLabel" name="lbBtnWifiT2">
<property name="geometry">
<rect>
<x>103</x>
<y>440</y>
<width>55</width>
<height>18</height>
<x>410</x>
<y>20</y>
<width>50</width>
<height>24</height>
</rect>
</property>
<property name="text">
@ -170,10 +66,10 @@
<widget class="QPushButton" name="btnWifi">
<property name="geometry">
<rect>
<x>98</x>
<y>403</y>
<width>90</width>
<height>60</height>
<x>410</x>
<y>20</y>
<width>50</width>
<height>24</height>
</rect>
</property>
<property name="text">
@ -183,21 +79,21 @@
<widget class="QLabel" name="lbBtnConfBG">
<property name="geometry">
<rect>
<x>222</x>
<y>403</y>
<width>90</width>
<height>60</height>
<x>2</x>
<y>460</y>
<width>37</width>
<height>37</height>
</rect>
</property>
<property name="text">
<string/>
</property>
</widget>
<widget class="QLabel" name="lbConfImg">
<widget class="QLabel" name="lbBtnConfImg">
<property name="geometry">
<rect>
<x>227</x>
<y>410</y>
<x>10</x>
<y>468</y>
<width>22</width>
<height>22</height>
</rect>
@ -206,32 +102,257 @@
<string/>
</property>
</widget>
<widget class="QLabel" name="lbBtnConfT2">
<property name="geometry">
<rect>
<x>227</x>
<y>440</y>
<width>70</width>
<height>18</height>
</rect>
</property>
<property name="text">
<string/>
</property>
</widget>
<widget class="QPushButton" name="btnAdvConf">
<property name="geometry">
<rect>
<x>222</x>
<y>403</y>
<width>90</width>
<height>60</height>
<x>2</x>
<y>460</y>
<width>37</width>
<height>37</height>
</rect>
</property>
<property name="text">
<string/>
</property>
</widget>
<widget class="QPushButton" name="btnHotspot">
<property name="geometry">
<rect>
<x>2</x>
<y>348</y>
<width>37</width>
<height>37</height>
</rect>
</property>
<property name="text">
<string/>
</property>
</widget>
<widget class="QPushButton" name="btnFlyMode">
<property name="geometry">
<rect>
<x>2</x>
<y>395</y>
<width>37</width>
<height>37</height>
</rect>
</property>
<property name="text">
<string/>
</property>
</widget>
<widget class="QLabel" name="lbNetwork">
<property name="geometry">
<rect>
<x>61</x>
<y>22</y>
<width>80</width>
<height>20</height>
</rect>
</property>
<property name="text">
<string/>
</property>
</widget>
<widget class="QLabel" name="lbBtnWifiBall">
<property name="geometry">
<rect>
<x>438</x>
<y>22</y>
<width>20</width>
<height>20</height>
</rect>
</property>
<property name="text">
<string/>
</property>
</widget>
<widget class="QLabel" name="lbHotImg">
<property name="geometry">
<rect>
<x>11</x>
<y>359</y>
<width>19</width>
<height>19</height>
</rect>
</property>
<property name="text">
<string/>
</property>
</widget>
<widget class="QLabel" name="lbFlyImg">
<property name="geometry">
<rect>
<x>11</x>
<y>405</y>
<width>19</width>
<height>19</height>
</rect>
</property>
<property name="text">
<string/>
</property>
</widget>
<widget class="QLabel" name="lbNetListBG">
<property name="geometry">
<rect>
<x>2</x>
<y>10</y>
<width>37</width>
<height>37</height>
</rect>
</property>
<property name="text">
<string/>
</property>
</widget>
<widget class="QLabel" name="lbWifiListBG">
<property name="geometry">
<rect>
<x>1</x>
<y>57</y>
<width>37</width>
<height>37</height>
</rect>
</property>
<property name="text">
<string/>
</property>
</widget>
<widget class="QLabel" name="lbNetListImg">
<property name="geometry">
<rect>
<x>10</x>
<y>20</y>
<width>19</width>
<height>19</height>
</rect>
</property>
<property name="text">
<string/>
</property>
</widget>
<widget class="QLabel" name="lbWifiListImg">
<property name="geometry">
<rect>
<x>10</x>
<y>67</y>
<width>19</width>
<height>19</height>
</rect>
</property>
<property name="text">
<string/>
</property>
</widget>
<widget class="QLabel" name="lbHotBG">
<property name="geometry">
<rect>
<x>2</x>
<y>348</y>
<width>37</width>
<height>37</height>
</rect>
</property>
<property name="text">
<string/>
</property>
</widget>
<widget class="QLabel" name="lbFlyBG">
<property name="geometry">
<rect>
<x>2</x>
<y>395</y>
<width>37</width>
<height>37</height>
</rect>
</property>
<property name="text">
<string/>
</property>
</widget>
<widget class="QPushButton" name="btnNetList">
<property name="geometry">
<rect>
<x>2</x>
<y>10</y>
<width>37</width>
<height>37</height>
</rect>
</property>
<property name="text">
<string/>
</property>
</widget>
<widget class="QPushButton" name="btnWifiList">
<property name="geometry">
<rect>
<x>2</x>
<y>57</y>
<width>37</width>
<height>37</height>
</rect>
</property>
<property name="text">
<string/>
</property>
</widget>
<widget class="Line" name="line">
<property name="geometry">
<rect>
<x>2</x>
<y>442</y>
<width>35</width>
<height>1</height>
</rect>
</property>
<property name="styleSheet">
<string notr="true">background-color: rgba(255, 255, 255,0.06);</string>
</property>
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
</widget>
<widget class="Line" name="line_2">
<property name="geometry">
<rect>
<x>41</x>
<y>0</y>
<width>1</width>
<height>515</height>
</rect>
</property>
<property name="styleSheet">
<string notr="true">background-color: rgba(255, 255, 255,0.06);</string>
</property>
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
</widget>
<zorder>wdgHead</zorder>
<zorder>lbFlyBG</zorder>
<zorder>lbHotBG</zorder>
<zorder>lbFlyImg</zorder>
<zorder>lbHotImg</zorder>
<zorder>lbBtnNetBG</zorder>
<zorder>btnNet</zorder>
<zorder>lbBtnWifiBG</zorder>
<zorder>lbBtnConfBG</zorder>
<zorder>lbBtnConfImg</zorder>
<zorder>btnAdvConf</zorder>
<zorder>btnHotspot</zorder>
<zorder>btnFlyMode</zorder>
<zorder>lbBtnWifiBall</zorder>
<zorder>btnWifi</zorder>
<zorder>lbNetListBG</zorder>
<zorder>lbWifiListBG</zorder>
<zorder>lbWifiListImg</zorder>
<zorder>lbNetListImg</zorder>
<zorder>btnNetList</zorder>
<zorder>btnWifiList</zorder>
<zorder>lbNetwork</zorder>
<zorder>line</zorder>
<zorder>line_2</zorder>
</widget>
</widget>
<layoutdefault spacing="6" margin="11"/>

71
network-speed.cpp Normal file
View File

@ -0,0 +1,71 @@
#include "networkspeed.h"
//NetworkSpeed::NetworkSpeed(QObject *parent) :QObject(parent)
//{
// qDebug()<<"debug: this is creator function of class NetworkSpeed";
//}
int NetworkSpeed::getCurrentDownloadRates(char *netname, long *save_rate, long *tx_rate)
{
FILE * net_dev_file; //文件指针
char buffer[1024]; //文件中的内容暂存在字符缓冲区里
size_t bytes_read; //实际读取的内容大小
char * match; //用以保存所匹配字符串及之后的内容
int counter = 0;
int i = 0;
char tmp_value[128];
if((NULL == netname)||(NULL == save_rate)||(NULL == tx_rate))
{
printf("bad param\n");
return -1;
}
if ( (net_dev_file=fopen("/proc/net/dev", "r")) == NULL ) //打开文件/pro/net/dev/,我们要读取的数据就是它啦
{
printf("open file /proc/net/dev/ error!\n");
return -1;
}
memset(buffer,0,sizeof(buffer));
while(fgets(buffer,sizeof(buffer),net_dev_file) != NULL)
{
match = strstr(buffer,netname);
if(NULL == match)
{
//printf("no eth0 keyword to find!\n");
continue;
}
else
{
//printf("%s\n",buffer);
match = match + strlen(netname) + strlen(":");/*地址偏移到冒号*/
sscanf(match,"%ld ",save_rate);
memset(tmp_value,0,sizeof(tmp_value));
sscanf(match,"%s ",tmp_value);
match = match + strlen(tmp_value);
for(i=0;i<strlen(buffer);i++)
{
if(0x20 == *match)
{
match ++;
}
else
{
if(8 == counter)
{
sscanf(match,"%ld ",tx_rate);
}
memset(tmp_value,0,sizeof(tmp_value));
sscanf(match,"%s ",tmp_value);
match = match + strlen(tmp_value);
counter ++;
}
}
//printf("%s save_rate:%ld tx_rate:%ld\n",netname,*save_rate,*tx_rate);
}
}
return 0;/*返回成功*/
}

60
networkspeed.cpp Normal file
View File

@ -0,0 +1,60 @@
#include "networkspeed.h"
NetworkSpeed::NetworkSpeed(QObject *parent) :QObject(parent)
{
qDebug()<<"debug: this is creator function of class NetworkSpeed";
}
int NetworkSpeed::getCurrentDownloadRates(char *netname, long *save_rate, long *tx_rate)
{
FILE * net_dev_file; //文件指针
char buffer[1024]; //文件中的内容暂存在字符缓冲区里
size_t bytes_read; //实际读取的内容大小
char * match; //用以保存所匹配字符串及之后的内容
int counter = 0;
int i = 0;
char tmp_value[128];
if((NULL == netname)||(NULL == save_rate)||(NULL == tx_rate)){
printf("bad param\n");
return -1;
}
if ( (net_dev_file=fopen("/proc/net/dev", "r")) == NULL ){ //打开文件/pro/net/dev/,从中读取流量数据
printf("open file /proc/net/dev/ error!\n");
return -1;
}
memset(buffer,0,sizeof(buffer));
while(fgets(buffer,sizeof(buffer),net_dev_file) != NULL){
match = strstr(buffer,netname);
if(NULL == match){
//printf("no eth0 keyword to find!\n");
continue;
}else{
//printf("%s\n",buffer);
match = match + strlen(netname) + strlen(":"); //地址偏移到冒号
sscanf(match,"%ld ",save_rate);
memset(tmp_value,0,sizeof(tmp_value));
sscanf(match,"%s ",tmp_value);
match = match + strlen(tmp_value);
for(i=0;i<strlen(buffer);i++){
if(0x20 == *match){
match ++;
} else{
if(8 == counter){
sscanf(match,"%ld ",tx_rate);
}
memset(tmp_value,0,sizeof(tmp_value));
sscanf(match,"%s ",tmp_value);
match = match + strlen(tmp_value);
counter ++;
}
}
//printf("%s save_rate:%ld tx_rate:%ld\n",netname,*save_rate,*tx_rate);
}
}
return 0; //返回成功
}

21
networkspeed.h Normal file
View File

@ -0,0 +1,21 @@
#ifndef NETWORKSPEED_H
#define NETWORKSPEED_H
#include <QObject>
#include <QDebug>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
class NetworkSpeed : public QObject
{
Q_OBJECT
public:
explicit NetworkSpeed(QObject *parent = nullptr);
int getCurrentDownloadRates(char *netname,long int * save_rate,long int * tx_rate); //获取当前的流量,参数为将获取到的流量保
};
#endif // NETWORKSPEED_H

View File

@ -69,5 +69,27 @@
<file>res/h/no-pwd-wifi.png</file>
<file>translations/kylin-nm_bo.qm</file>
<file>translations/kylin-nm_zh_CN.qm</file>
<file>res/x/fly-mode-off.svg</file>
<file>res/x/fly-mode-on.svg</file>
<file>res/x/hot-spot-off.svg</file>
<file>res/x/hot-spot-on.svg</file>
<file>res/x/net-list-bg.svg</file>
<file>res/x/wifi-list-bg.svg</file>
<file>res/x/load-down.png</file>
<file>res/x/load-up.png</file>
<file>res/l/network-offline.png</file>
<file>res/l/network-offline.svg</file>
<file>res/l/network-online.png</file>
<file>res/l/network-online.svg</file>
<file>res/w/wifi-full.png</file>
<file>res/w/wifi-full-pwd.png</file>
<file>res/w/wifi-high.png</file>
<file>res/w/wifi-high-pwd.png</file>
<file>res/w/wifi-low.png</file>
<file>res/w/wifi-low-pwd.png</file>
<file>res/w/wifi-medium.png</file>
<file>res/w/wifi-medium-pwd.png</file>
<file>res/w/wifi-none.png</file>
<file>res/w/wifi-none-pwd.png</file>
</qresource>
</RCC>

View File

@ -29,49 +29,72 @@ OneConnForm::OneConnForm(QWidget *parent, MainWindow *mainWindow, ConfForm *conf
{
ui->setupUi(this);
ui->lbPassword->setText(tr("Input password"));//"输入密码:"
ui->btnConf->setText(tr("Config"));//"设置"
ui->btnConnSub->setText(tr("Config"));//"设置"
ui->btnConn->setText(tr("Connect"));//"连接"
ui->btnConnPWD->setText(tr("Connect"));//"连接"
ui->btnDisConn->setText(tr("Disconnect"));//"断开连接"
ui->btnHideConn->setText(tr("Connect"));//"连接"
ui->lbConned->setAlignment(Qt::AlignLeft);
ui->lbLoadUp->setAlignment(Qt::AlignLeft);
ui->lbLoadDown->setAlignment(Qt::AlignLeft);
ui->lePassword->setEchoMode(QLineEdit::Password);
ui->wbg->hide();
ui->lbPassword->hide();
ui->btnConnPWD->setEnabled(false);
ui->lbInfo->setStyleSheet("QLabel{font-size:14px;color:rgba(255,255,255,0.57);}");
ui->wbg->setStyleSheet("#wbg{border-radius:4px;background-color:rgba(255,255,255,0);}");
// "#wbg:Hover{border-radius:4px;background-color:rgba(255,255,255,0.1);}");
ui->wbg_2->setStyleSheet("#wbg_2{border-radius:4px;background-color:rgba(255,255,255,0.1);}");
ui->wbg_3->setStyleSheet("#wbg_3{border-radius:4px;background-color:rgba(255,255,255,0.1);}");
ui->lbName->setStyleSheet("QLabel{font-size:14px;color:rgba(255,255,255,0.91);}");
ui->lbConned->setStyleSheet("QLabel{font-size:14px;color:rgba(255,255,255,0.57);}");
ui->lbLoadUp->setStyleSheet("QLabel{font-size:14px;color:rgba(255,255,255,0.57);}");
ui->lbLoadDown->setStyleSheet("QLabel{font-size:14px;color:rgba(255,255,255,0.57);}");
ui->lePassword->setStyleSheet("QLineEdit{border:2px solid rgba(28, 47, 146, 1);border-radius:4px;"
"background:rgba(0,0,0,0.2);color:rgba(255,255,255,0.35);font-size:14px;}");
ui->checkBoxPwd->setStyleSheet("QCheckBox::indicator {width: 18px; height: 9px;}"
"QCheckBox::indicator:checked {image: url(:/res/h/show-pwd.png);}"
"QCheckBox::indicator:unchecked {image: url(:/res/h/hide-pwd.png);}");
ui->btnConnSub->setStyleSheet("QPushButton{border:0px;border-radius:4px;background-color:rgba(61,107,229,1);color:white;font-size:14px;}"
"QPushButton:Hover{border:0px solid rgba(255,255,255,0.2);border-radius:4px;background-color:rgba(107,142,235,1);}"
"QPushButton:Pressed{border-radius:4px;background-color:rgba(50,87,202,1);}");
ui->btnConn->setStyleSheet("QPushButton{border:0px;border-radius:4px;background-color:rgba(61,107,229,1);color:white;font-size:14px;}"
"QPushButton:Hover{border:0px solid rgba(255,255,255,0.2);border-radius:4px;background-color:rgba(107,142,235,1);}"
"QPushButton:Pressed{border-radius:4px;background-color:rgba(50,87,202,1);}");
ui->btnConnPWD->setStyleSheet("QPushButton{border:0px;border-radius:4px;background-color:rgba(61,107,229,1);color:white;font-size:14px;}"
"QPushButton:Hover{border:0px solid rgba(255,255,255,0.2);border-radius:4px;background-color:rgba(107,142,235,1);}"
"QPushButton:Pressed{border-radius:4px;background-color:rgba(50,87,202,1);}");
ui->btnDisConn->setStyleSheet("QPushButton{border:0px;border-radius:4px;background-color:rgba(255,255,255,0.12);color:white;font-size:14px;}"
"QPushButton:Hover{border:0px solid rgba(255,255,255,0.2);border-radius:4px;background-color:rgba(255,255,255,0.2);}"
"QPushButton:Pressed{border-radius:4px;background-color:rgba(255,255,255,0.08);}");
ui->btnHideConn->setStyleSheet("QPushButton{border:0px;border-radius:4px;background-color:rgba(61,107,229,1);color:white;font-size:14px;}"
"QPushButton:Hover{border:0px solid rgba(255,255,255,0.2);border-radius:4px;background-color:rgba(107,142,235,1);}"
"QPushButton:Pressed{border-radius:4px;background-color:rgba(50,87,202,1);}");
ui->lbLoadDownImg->setStyleSheet("QLabel{background-image:url(:/res/x/load-down.png);}");
ui->lbLoadUpImg->setStyleSheet("QLabel{background-image:url(:/res/x/load-up.png);}");
ui->checkBoxPwd->setFocusPolicy(Qt::NoFocus);
ui->btnConnSub->setFocusPolicy(Qt::NoFocus);
ui->btnConn->setFocusPolicy(Qt::NoFocus);
ui->btnConnPWD->setFocusPolicy(Qt::NoFocus);
ui->btnDisConn->setFocusPolicy(Qt::NoFocus);
ui->btnHideConn->setFocusPolicy(Qt::NoFocus);
ui->wbg->show();
ui->wbg_2->hide();
ui->wbg_3->hide();
ui->lbName->show();
ui->lbInfo->hide();
ui->lePassword->hide();
ui->checkBoxPwd->hide();
ui->btnConf->hide();
ui->btnConnSub->hide();
ui->btnConn->hide();
ui->btnDisConn->hide();
ui->btnConnPWD->hide();
ui->btnHideConn->hide();
ui->lbConned->setAlignment(Qt::AlignRight);
ui->wbg->setStyleSheet("#wbg{background-color:#3593b5;}");
ui->lbName->setStyleSheet("QLabel{font-size:13px;color:#ffffff;}");
ui->lbPassword->setStyleSheet("QLabel{font-size:13px;color:#ffffff;}");
ui->lbSafe->setStyleSheet("QLabel{font-size:13px;color:#aaaaaa;}");
ui->lbConned->setStyleSheet("QLabel{font-size:13px;color:#ffffff;}");
ui->lePassword->setStyleSheet("QLineEdit{border: 1px solid #cccccc;background-color:#ffffff;}");
ui->checkBoxPwd->setStyleSheet("QCheckBox::indicator {width: 18px; height: 9px;}"
"QCheckBox::indicator:checked {image: url(:/res/h/show-pwd.png);}"
"QCheckBox::indicator:unchecked {image: url(:/res/h/hide-pwd.png);}");
ui->btnConf->setStyleSheet("QPushButton{border:0px;background-color:rgba(0,0,0,0.4);color:white;font-size:12px;}"
"QPushButton:Hover{border:1px solid rgba(255,255,255,0.2);background-color:rgba(0,0,0,0.2);}"
"QPushButton:Pressed{background-color:rgba(0,0,0,0.6);}");
ui->btnConn->setStyleSheet("QPushButton{border:0px;background-color:rgba(0,0,0,0.4);color:white;font-size:12px;}"
"QPushButton:Hover{border:1px solid rgba(255,255,255,0.2);background-color:rgba(0,0,0,0.2);}"
"QPushButton:Pressed{background-color:rgba(0,0,0,0.6);}");
ui->btnConnPWD->setStyleSheet("QPushButton{border:0px;background-color:rgba(0,0,0,0.4);color:white;font-size:12px;}"
"QPushButton:Hover{border:1px solid rgba(255,255,255,0.2);background-color:rgba(0,0,0,0.2);}"
"QPushButton:Pressed{background-color:rgba(0,0,0,0.6);}");
ui->btnDisConn->setStyleSheet("QPushButton{border:0px;background-color:rgba(0,0,0,0.4);color:white;font-size:12px;}"
"QPushButton:Hover{border:1px solid rgba(255,255,255,0.2);background-color:rgba(0,0,0,0.2);}"
"QPushButton:Pressed{background-color:rgba(0,0,0,0.6);}");
ui->btnHideConn->setStyleSheet("QPushButton{border:0px;background-color:rgba(0,0,0,0.4);color:white;font-size:12px;}"
"QPushButton:Hover{border:1px solid rgba(255,255,255,0.2);background-color:rgba(0,0,0,0.2);}"
"QPushButton:Pressed{background-color:rgba(0,0,0,0.6);}");
ui->line->show();
ui->lbLoadDownImg->hide();
ui->lbLoadUpImg->hide();
this->mw = mainWindow;
this->cf = confForm;
@ -80,9 +103,14 @@ OneConnForm::OneConnForm(QWidget *parent, MainWindow *mainWindow, ConfForm *conf
this->isSelected = false;
this->isActive = false;
ui->wbg->setAttribute(Qt::WA_Hover,true);//开启悬停事件
ui->wbg->installEventFilter(this); //安装事件过滤器
ui->btnConn->setAttribute(Qt::WA_Hover,true);//开启悬停事件
ui->btnConn->installEventFilter(this); //安装事件过滤器
connect(ui->lePassword, SIGNAL(returnPressed()), this, SLOT(on_btnConnPWD_clicked()));
ui->btnConn->setShortcut(Qt::Key_Return);//将字母区回车键与登录按钮绑定在一起
ui->btnHideConn->setShortcut(Qt::Key_Return);
// ui->btnHideConn->setShortcut(Qt::Key_Return);
}
OneConnForm::~OneConnForm()
@ -94,126 +122,151 @@ void OneConnForm::mousePressEvent(QMouseEvent *){
emit selectedOneWifiForm(wifiName);
}
//事件过滤器
bool OneConnForm::eventFilter(QObject *obj, QEvent *event)
{
if(obj == ui->wbg) {
if(event->type() == QEvent::HoverEnter) {
ui->btnConn->show();
ui->wbg->setStyleSheet("#wbg{border-radius:4px;background-color:rgba(255,255,255,0.1);}");
return true;
} else if(event->type() == QEvent::HoverLeave){
ui->btnConn->hide();
ui->wbg->setStyleSheet("#wbg{border-radius:4px;background-color:rgba(255,255,255,0);}");
return true;
}
}
if(obj == ui->btnConn) {
if(event->type() == QEvent::HoverEnter) {
ui->wbg->hide();
ui->btnConn->show();
return true;
} else if(event->type() == QEvent::HoverLeave){
ui->wbg->show();
return true;
}
}
return QWidget::eventFilter(obj,event);
}
// 是否当前连接的网络,字体设置不同
void OneConnForm::setAct(bool isAct){
if(isAct){
ui->lbName->setStyleSheet("QLabel{font-size:14px;color:#ffffff;}");
ui->lbSafe->setStyleSheet("QLabel{font-size:14px;color:#aaaaaa;}");
ui->lbConned->show();
ui->btnConf->show();
}else{
ui->lbName->setStyleSheet("QLabel{font-size:12px;color:#ffffff;}");
ui->lbSafe->setStyleSheet("QLabel{font-size:12px;color:#aaaaaa;}");
ui->lbName->setStyleSheet("QLabel{font-size:14px;color:#ffffff;}");
ui->lbConned->hide();
ui->btnConf->hide();
}
isActive = isAct;
}
// 是否选中
//点击窗口最上面的item时
void OneConnForm::setTopItem(bool isSelected){
if(isSelected){
resize(422, 148);
ui->wbg_3->show();
ui->lbInfo->show();
this->isSelected = true;
}else{
resize(422, 60);
ui->lePassword->setText("");
ui->wbg_3->hide();
ui->lbInfo->hide();
this->isSelected = false;
}
ui->wbg->hide();
ui->wbg_2->hide();
ui->lbSignal->show();
ui->lePassword->hide();
ui->checkBoxPwd->hide();
ui->line->hide();
ui->btnConn->hide();
ui->btnConnPWD->hide();
ui->btnHideConn->hide();
ui->lbLoadUpImg->show();
ui->lbLoadDownImg->show();
if (isConnected){
// ui->lbLoadUp->setText("0Kb/s");
// ui->lbLoadDown->setText("0Kb/s");
ui->lbLoadUp->hide();
ui->lbLoadDown->hide();
ui->btnDisConn->show();
}else{
// ui->lbLoadUp->setText("0Kb/s");
// ui->lbLoadDown->setText("0Kb/s");
ui->lbLoadUp->hide();
ui->lbLoadDown->hide();
ui->btnDisConn->hide();
}
}
// 点击窗口下面的item时
void OneConnForm::setSelected(bool isSelected){
if(isSelected){
resize(314, 111);
ui->wbg->show();
// ui->btnConf->show();
if(isActive){
ui->btnHideConn->hide();
ui->btnDisConn->show();
}else{
ui->btnHideConn->hide();
ui->btnConn->show();
}
resize(422, 148);
ui->line->hide();
ui->wbg->hide();
ui->wbg_2->hide();
ui->wbg_3->show();
ui->lbInfo->show();
ui->btnConn->show();
ui->btnConnSub->show();
this->isSelected = true;
}else{
resize(314, 60);
resize(422, 60);
ui->lePassword->setText("");
ui->wbg->hide();
if(isActive){
ui->btnConf->show();
}else{
ui->btnConf->hide();
}
ui->btnConn->hide();
ui->btnDisConn->hide();
ui->btnHideConn->hide();
ui->lbPassword->hide();
ui->lePassword->hide();
ui->checkBoxPwd->hide();
ui->btnConnPWD->hide();
ui->lbName->show();
ui->lbSafe->show();
ui->lbSignal->show();
ui->lbPoint->show();
this->isSelected = false;
}
}
// 是否选中连接隐藏Wifi小窗口
void OneConnForm::setHideSelected(bool isSelected){
if(isSelected){
resize(314, 111);
ui->line->show();
ui->wbg->show();
ui->btnConf->hide();
ui->wbg_2->hide();
ui->wbg_3->hide();
ui->lbInfo->hide();
ui->btnConn->hide();
ui->btnDisConn->hide();
ui->btnHideConn->show();
ui->lbPassword->hide();
ui->lePassword->hide();
ui->checkBoxPwd->hide();
ui->btnConnPWD->hide();
ui->lbName->show();
ui->lbSafe->show();
ui->lbSignal->show();
ui->lbPoint->hide();
this->isSelected = true;
} else {
resize(314, 60);
ui->wbg->hide();
ui->btnConf->hide();
ui->btnConn->hide();
ui->btnDisConn->hide();
ui->btnHideConn->hide();
ui->lbPassword->hide();
ui->lePassword->hide();
ui->checkBoxPwd->hide();
ui->btnConnPWD->hide();
ui->lbName->show();
ui->lbSafe->show();
ui->lbSignal->show();
ui->lbPoint->hide();
ui->btnConnSub->hide();
this->isSelected = false;
}
ui->lePassword->hide();
ui->checkBoxPwd->hide();
ui->btnConnPWD->hide();
ui->lbSignal->show();
ui->btnDisConn->hide();
ui->btnHideConn->hide();
}
// 点击连接隐藏wifi的item时
void OneConnForm::setHideItem(bool isHideItem, bool isShowHideBtn){
if (isHideItem){
ui->lbName->move(14, 20);
ui->wbg->hide();
ui->btnConn->hide();
} else {
ui->lbName->move(62, 8);
ui->wbg->show();
ui->btnConn->show();
}
if (isShowHideBtn){
ui->btnHideConn->show();
} else{
ui->btnHideConn->hide();
}
}
void OneConnForm::setConnedString(QString str){
ui->lbConned->setText(str);
}
void OneConnForm::setSafeString(QString str){
ui->lbSafe->setText(str);
}
void OneConnForm::setShowPoint(bool flag){
if(flag){
ui->lbPoint->show();
void OneConnForm::setConnedString(bool showLable, QString str, QString str1){
if (!showLable){
ui->lbConned->setText(str1);
ui->lbConned->hide();
ui->lbName->move(63, 18);
}else{
ui->lbPoint->hide();
ui->lbConned->setText(str);
}
}
@ -232,77 +285,71 @@ QString OneConnForm::getName()
return ui->lbName->text();
}
void OneConnForm::setSafe(QString safe){
if(safe == "--"){
this->isSafe = false;
ui->lbSafe->setText(tr("Public"));//"开放"
}else{
this->isSafe = true;
ui->lbSafe->setText(tr("Safe"));//"安全"
}
}
void OneConnForm::setRate(QString rate){
QString txt(tr("Rate"));//"速率"
this->setToolTip("<span style=\"font-size:13px;border:0px;background-color:#3593b5;color:white;\">&nbsp; " + txt + ": " + rate + " &nbsp;</span>");
QString rateStr = rate.split(" ").at(0);
int rateNum = rateStr.toInt();
if(rateNum >= 180){
ui->lbPoint->setStyleSheet("QLabel{background:url(:/res/s/pgood.png);}");
}
if(rateNum >= 100 && rateNum < 180){
ui->lbPoint->setStyleSheet("QLabel{background:url(:/res/s/pnormal.png);}");
}
if(rateNum <100){
ui->lbPoint->setStyleSheet("QLabel{background:url(:/res/s/pbad.png);}");
}
}
void OneConnForm::setSignal(QString lv){
void OneConnForm::setSignal(QString lv, QString secu){
int signal = lv.toInt();
if (secu == "--" || secu == ""){
hasPwd = false;
}else{
hasPwd = true;
}
if(signal > 75){
if(this->isSafe){
ui->lbSignal->setStyleSheet("QLabel{background:url(:/res/s/wifi-full-secure.png);}");
if(hasPwd){
ui->lbSignal->setStyleSheet("QLabel{background:url(:/res/w/wifi-full-pwd.png);}");
}else{
ui->lbSignal->setStyleSheet("QLabel{background:url(:/res/s/wifi-full.png);}");
ui->lbSignal->setStyleSheet("QLabel{background:url(:/res/w/wifi-full.png);}");
}
signalLv = 1;
}
if(signal > 55 && signal <= 75){
if(this->isSafe){
ui->lbSignal->setStyleSheet("QLabel{background:url(:/res/s/wifi-high-secure.png);}");
if(hasPwd){
ui->lbSignal->setStyleSheet("QLabel{background:url(:/res/w/wifi-high-pwd.png);}");
}else{
ui->lbSignal->setStyleSheet("QLabel{background:url(:/res/s/wifi-high.png);}");
ui->lbSignal->setStyleSheet("QLabel{background:url(:/res/w/wifi-high.png);}");
}
signalLv = 2;
}
if(signal > 35 && signal <= 55){
if(this->isSafe){
ui->lbSignal->setStyleSheet("QLabel{background:url(:/res/s/wifi-medium-secure.png);}");
if(hasPwd){
ui->lbSignal->setStyleSheet("QLabel{background:url(:/res/w/wifi-medium-pwd.png);}");
}else{
ui->lbSignal->setStyleSheet("QLabel{background:url(:/res/s/wifi-medium.png);}");
ui->lbSignal->setStyleSheet("QLabel{background:url(:/res/w/wifi-medium.png);}");
}
signalLv = 3;
}
if(signal > 15 && signal <= 35){
if(this->isSafe){
ui->lbSignal->setStyleSheet("QLabel{background:url(:/res/s/wifi-low-secure.png);}");
if(hasPwd){
ui->lbSignal->setStyleSheet("QLabel{background:url(:/res/w/wifi-low-pwd.png);}");
}else{
ui->lbSignal->setStyleSheet("QLabel{background:url(:/res/s/wifi-low.png);}");
ui->lbSignal->setStyleSheet("QLabel{background:url(:/res/w/wifi-low.png);}");
}
signalLv = 4;
}
if(signal <= 15){
if(this->isSafe){
ui->lbSignal->setStyleSheet("QLabel{background:url(:/res/s/wifi-none-secure.png);}");
if(hasPwd){
ui->lbSignal->setStyleSheet("QLabel{background:url(:/res/w/wifi-none-pwd.png);}");
}else{
ui->lbSignal->setStyleSheet("QLabel{background:url(:/res/s/wifi-none.png);}");
ui->lbSignal->setStyleSheet("QLabel{background:url(:/res/w/wifi-none.png);}");
}
signalLv = 4;
}
}
void OneConnForm::slotConnWifi(){
void OneConnForm::setWifiInfo(QString str1, QString str2, QString str3)
{
QString str = "Wi-Fi安全性" + str1 + "\n信号强度:" + str2 + "%\n物理地址(MAC)" + str3;
ui->lbInfo->setText(str);
}
void OneConnForm::slotConnWifi()
{
mw->startLoading();
emit sigConnWifi(ui->lbName->text());
}
@ -311,55 +358,31 @@ void OneConnForm::slotConnWifiPWD(){
emit sigConnWifiPWD(ui->lbName->text(), ui->lePassword->text());
}
//点击后设置wifi网络
void OneConnForm::on_btnConf_clicked()
void OneConnForm::on_btnConnSub_clicked()
{
QPoint pos = QCursor::pos();
QRect primaryGeometry;
for (QScreen *screen : qApp->screens()) {
if (screen->geometry().contains(pos)) {
primaryGeometry = screen->geometry();
}
}
if (primaryGeometry.isEmpty()) {
primaryGeometry = qApp->primaryScreen()->geometry();
if (ui->lbConned->text() == "--" || ui->lbConned->text() == " "){
on_btnConnPWD_clicked();
return;
}
mw->is_stop_check_net_state = 1;
QThread *t = new QThread();
BackThread *bt = new BackThread();
QString connProp = bt->getConnProp(ui->lbName->text());
QStringList propList = connProp.split("|");
QString v4method, addr, mask, gateway, dns;
foreach (QString line, propList) {
if(line.startsWith("method:")){
v4method = line.split(":").at(1);
}
if(line.startsWith("addr:")){
addr = line.split(":").at(1);
}
if(line.startsWith("mask:")){
mask = line.split(":").at(1);
}
if(line.startsWith("gateway:")){
gateway= line.split(":").at(1);
}
if(line.startsWith("dns:")){
dns = line.split(":").at(1);
}
}
// qDebug()<<v4method<<addr<<mask<<gateway<<dns;
cf->setProp(ui->lbName->text(), v4method, addr, mask, gateway, dns, this->isActive);
cf->move(primaryGeometry.width() / 2 - cf->width() / 2, primaryGeometry.height() / 2 - cf->height() / 2);
cf->show();
cf->raise();
bt->moveToThread(t);
connect(t, SIGNAL(finished()), t, SLOT(deleteLater()));
connect(t, SIGNAL(started()), this, SLOT(slotConnWifi()));
connect(this, SIGNAL(sigConnWifi(QString)), bt, SLOT(execConnWifi(QString)));
connect(bt, SIGNAL(connDone(int)), mw, SLOT(connWifiDone(int)));
connect(bt, SIGNAL(connDone(int)), this, SLOT(slotConnWifiResult(int)));
connect(bt, SIGNAL(btFinish()), t, SLOT(quit()));
t->start();
}
//点击后断开wifi网络
void OneConnForm::on_btnDisConn_clicked()
{
mw->is_stop_check_net_state = 1;
mw->on_btnHotspotState();
kylin_network_set_con_down(ui->lbName->text().toUtf8().data());
disconnect(this, SIGNAL(selectedOneWifiForm(QString)), mw, SLOT(oneWifiFormSelected(QString)));
emit disconnActiveWifi();
@ -368,6 +391,11 @@ void OneConnForm::on_btnDisConn_clicked()
//无需密码的wifi连接
void OneConnForm::on_btnConn_clicked()
{
if (ui->lbConned->text() == "--" || ui->lbConned->text() == " "){
on_btnConnPWD_clicked();
return;
}
mw->is_stop_check_net_state = 1;
QThread *t = new QThread();
BackThread *bt = new BackThread();
@ -406,24 +434,59 @@ void OneConnForm::on_btnHideConn_clicked()
connHidWifi->show();
}
//设置密码隐藏或可见
void OneConnForm::on_checkBoxPwd_stateChanged(int arg1)
{
if (arg1 == 0) {
ui->lePassword ->setEchoMode(QLineEdit::Password);
} else {
ui->lePassword->setEchoMode(QLineEdit::Normal);
}
}
void OneConnForm::on_lePassword_textEdited(const QString &arg1)
{
if (ui->lePassword->text().size() < 5){
ui->lePassword->setStyleSheet("QLineEdit{border:2px solid rgba(28, 47, 146, 1);border-radius:4px;"
"background:rgba(0,0,0,0.2);color:rgba(255,255,255,0.35);font-size:14px;}");
ui->btnConnPWD->setStyleSheet("QPushButton{border:0px;border-radius:4px;background-color:rgba(255,255,255,0.12);color:white;font-size:14px;}"
"QPushButton:Hover{border:0px solid rgba(255,255,255,0.2);border-radius:4px;background-color:rgba(0,0,0,0.2);}"
"QPushButton:Pressed{border-radius:4px;background-color:rgba(0,0,0,0.6);}");
ui->btnConnPWD->setEnabled(false);
} else {
ui->lePassword->setStyleSheet("QLineEdit{border:2px solid rgba(28, 47, 146, 1);border-radius:4px;"
"background:rgba(0,0,0,0.2);color:rgba(255,255,255,1);font-size:14px;}");
ui->btnConnPWD->setStyleSheet("QPushButton{border:0px;border-radius:4px;background-color:rgba(61,107,229,1);color:white;font-size:14px;}"
"QPushButton:Hover{border:0px solid rgba(255,255,255,0.2);border-radius:4px;background-color:rgba(107,142,235,1);}"
"QPushButton:Pressed{border-radius:4px;background-color:rgba(50,87,202,1);}");
ui->btnConnPWD->setEnabled(true);
}
}
// Wifi连接结果0成功 1失败 2没有配置文件
void OneConnForm::slotConnWifiResult(int connFlag){
qDebug()<<"Function slotConnWifiResult receives a number: "<<connFlag;
if(connFlag == 2){
// 无此wifi配置需要输入密码创建配置文件尝试连接
ui->lbPassword->show();
mw->currSelNetName = "";
emit selectedOneWifiForm(ui->lbName->text());
resize(422, 118);
ui->wbg->hide();
ui->wbg_2->show();
ui->wbg_3->hide();
ui->lbInfo->hide();
ui->btnHideConn->hide();
ui->btnDisConn->hide();
ui->btnConn->hide();
ui->btnConnSub->hide();
ui->lbInfo->hide();
ui->lePassword->show();
ui->checkBoxPwd->show();
ui->btnConnPWD->show();
ui->lbName->hide();
ui->lbSafe->hide();
ui->lbSignal->hide();
ui->lbPoint->hide();
ui->btnConf->hide();
ui->btnConn->hide();
ui->btnDisConn->hide();
this->isSelected = true;
}
if(connFlag == 1){
@ -437,15 +500,7 @@ void OneConnForm::slotConnWifiResult(int connFlag){
// 设置全局变量当前连接Wifi的信号强度
currentActWifiSignalLv = signalLv;
mw->stopLoading();
}
//设置密码隐藏或可见
void OneConnForm::on_checkBoxPwd_stateChanged(int arg1)
{
if (arg1 == 0) {
ui->lePassword ->setEchoMode(QLineEdit::Password);
} else {
ui->lePassword->setEchoMode(QLineEdit::Normal);
if (connFlag != 0){
mw->stopLoading();
}
}

View File

@ -46,24 +46,24 @@ public:
explicit OneConnForm(QWidget *parent = 0, MainWindow *mw = 0, ConfForm *confForm = 0, KSimpleNM *ksnm = 0);
~OneConnForm();
void setSignal(QString lv);
void setSignal(QString lv, QString secu);
void setName(QString name);
void setSpecialName(QString name);
QString getName();
void setSafe(QString safe);
void setRate(QString rate);
void setWifiInfo(QString str1, QString str2, QString str3);
void setSelected(bool isSelected);
void setHideSelected(bool isSelected);
void setHideItem(bool isHideItem, bool isShowHideBtn);
void setTopItem(bool isSelected);
void setAct(bool isAct);
void setSafeString(QString str);
void setConnedString(QString str);
void setShowPoint(bool flag);
void setConnedString(bool showLable, QString str, QString str1);
QString wifiName;
bool isSelected;
bool isActive;
bool isConnected;
int signalLv;
signals:
@ -76,10 +76,9 @@ signals:
protected:
void mousePressEvent(QMouseEvent *event);
bool eventFilter(QObject *obj, QEvent *event);
private slots:
void on_btnConf_clicked();
void on_btnConn_clicked();
void on_btnDisConn_clicked();
@ -93,12 +92,16 @@ private slots:
void on_checkBoxPwd_stateChanged(int arg1);
void on_lePassword_textEdited(const QString &arg1);
void on_btnConnSub_clicked();
private:
Ui::OneConnForm *ui;
MainWindow *mw;
ConfForm *cf;
KSimpleNM *ks;
bool isSafe;
bool hasPwd;
};
#endif // ONECONNFORM_H

View File

@ -6,7 +6,7 @@
<rect>
<x>0</x>
<y>0</y>
<width>314</width>
<width>422</width>
<height>60</height>
</rect>
</property>
@ -16,7 +16,7 @@
<widget class="QLabel" name="lbName">
<property name="geometry">
<rect>
<x>62</x>
<x>63</x>
<y>8</y>
<width>190</width>
<height>20</height>
@ -26,13 +26,13 @@
<string/>
</property>
</widget>
<widget class="QPushButton" name="btnConf">
<widget class="QPushButton" name="btnConnSub">
<property name="geometry">
<rect>
<x>21</x>
<y>70</y>
<width>129</width>
<height>32</height>
<x>316</x>
<y>14</y>
<width>100</width>
<height>34</height>
</rect>
</property>
<property name="text">
@ -42,10 +42,10 @@
<widget class="QPushButton" name="btnConn">
<property name="geometry">
<rect>
<x>162</x>
<y>70</y>
<width>129</width>
<height>32</height>
<x>316</x>
<y>14</y>
<width>100</width>
<height>34</height>
</rect>
</property>
<property name="text">
@ -55,7 +55,7 @@
<widget class="QLabel" name="lbSignal">
<property name="geometry">
<rect>
<x>15</x>
<x>14</x>
<y>14</y>
<width>32</width>
<height>32</height>
@ -65,35 +65,12 @@
<string/>
</property>
</widget>
<widget class="QLabel" name="lbSafe">
<property name="geometry">
<rect>
<x>62</x>
<y>31</y>
<width>80</width>
<height>18</height>
</rect>
</property>
<property name="text">
<string/>
</property>
</widget>
<widget class="QLineEdit" name="lePassword">
<property name="geometry">
<rect>
<x>100</x>
<y>20</y>
<width>190</width>
<height>30</height>
</rect>
</property>
</widget>
<widget class="QLabel" name="lbConned">
<property name="geometry">
<rect>
<x>180</x>
<y>19</y>
<width>90</width>
<x>63</x>
<y>31</y>
<width>140</width>
<height>20</height>
</rect>
</property>
@ -101,13 +78,137 @@
<string/>
</property>
</widget>
<widget class="QLabel" name="lbPoint">
<widget class="QWidget" name="wbg_2" native="true">
<property name="geometry">
<rect>
<x>280</x>
<y>25</y>
<width>10</width>
<height>10</height>
<x>0</x>
<y>0</y>
<width>422</width>
<height>118</height>
</rect>
</property>
<widget class="QLineEdit" name="lePassword">
<property name="geometry">
<rect>
<x>64</x>
<y>72</y>
<width>352</width>
<height>30</height>
</rect>
</property>
</widget>
<widget class="QCheckBox" name="checkBoxPwd">
<property name="geometry">
<rect>
<x>390</x>
<y>83</y>
<width>18</width>
<height>9</height>
</rect>
</property>
<property name="text">
<string/>
</property>
</widget>
</widget>
<widget class="QPushButton" name="btnDisConn">
<property name="geometry">
<rect>
<x>316</x>
<y>14</y>
<width>100</width>
<height>34</height>
</rect>
</property>
<property name="text">
<string/>
</property>
</widget>
<widget class="QPushButton" name="btnConnPWD">
<property name="geometry">
<rect>
<x>316</x>
<y>14</y>
<width>100</width>
<height>34</height>
</rect>
</property>
<property name="text">
<string/>
</property>
</widget>
<widget class="QPushButton" name="btnHideConn">
<property name="geometry">
<rect>
<x>316</x>
<y>14</y>
<width>100</width>
<height>34</height>
</rect>
</property>
<property name="text">
<string/>
</property>
</widget>
<widget class="QWidget" name="wbg_3" native="true">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>422</width>
<height>148</height>
</rect>
</property>
<widget class="QLabel" name="lbInfo">
<property name="geometry">
<rect>
<x>63</x>
<y>71</y>
<width>230</width>
<height>61</height>
</rect>
</property>
<property name="text">
<string/>
</property>
</widget>
</widget>
<widget class="Line" name="line">
<property name="geometry">
<rect>
<x>0</x>
<y>58</y>
<width>422</width>
<height>1</height>
</rect>
</property>
<property name="styleSheet">
<string notr="true">background-color: rgba(255, 255, 255,0.06);</string>
</property>
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
</widget>
<widget class="QLabel" name="lbLoadDownImg">
<property name="geometry">
<rect>
<x>115</x>
<y>33</y>
<width>16</width>
<height>16</height>
</rect>
</property>
<property name="text">
<string/>
</property>
</widget>
<widget class="QLabel" name="lbLoadUpImg">
<property name="geometry">
<rect>
<x>190</x>
<y>33</y>
<width>16</width>
<height>16</height>
</rect>
</property>
<property name="text">
@ -119,90 +220,53 @@
<rect>
<x>0</x>
<y>0</y>
<width>314</width>
<height>111</height>
<width>422</width>
<height>60</height>
</rect>
</property>
</widget>
<widget class="QPushButton" name="btnDisConn">
<widget class="QLabel" name="lbLoadDown">
<property name="geometry">
<rect>
<x>162</x>
<y>70</y>
<width>129</width>
<height>32</height>
</rect>
</property>
<property name="text">
<string/>
</property>
</widget>
<widget class="QLabel" name="lbPassword">
<property name="geometry">
<rect>
<x>25</x>
<y>25</y>
<width>70</width>
<height>18</height>
</rect>
</property>
<property name="text">
<string/>
</property>
</widget>
<widget class="QPushButton" name="btnConnPWD">
<property name="geometry">
<rect>
<x>162</x>
<y>70</y>
<width>129</width>
<height>32</height>
</rect>
</property>
<property name="text">
<string/>
</property>
</widget>
<widget class="QPushButton" name="btnHideConn">
<property name="geometry">
<rect>
<x>162</x>
<y>70</y>
<width>129</width>
<height>32</height>
</rect>
</property>
<property name="text">
<string/>
</property>
</widget>
<widget class="QCheckBox" name="checkBoxPwd">
<property name="geometry">
<rect>
<x>260</x>
<x>132</x>
<y>31</y>
<width>18</width>
<height>9</height>
<width>65</width>
<height>20</height>
</rect>
</property>
<property name="text">
<string/>
</property>
</widget>
<zorder>wbg</zorder>
<widget class="QLabel" name="lbLoadUp">
<property name="geometry">
<rect>
<x>207</x>
<y>31</y>
<width>65</width>
<height>20</height>
</rect>
</property>
<property name="text">
<string/>
</property>
</widget>
<zorder>lbLoadUp</zorder>
<zorder>lbLoadDown</zorder>
<zorder>wbg_3</zorder>
<zorder>wbg_2</zorder>
<zorder>lbName</zorder>
<zorder>btnConf</zorder>
<zorder>btnConn</zorder>
<zorder>lbSignal</zorder>
<zorder>lbSafe</zorder>
<zorder>lbConned</zorder>
<zorder>lbPoint</zorder>
<zorder>btnDisConn</zorder>
<zorder>lbPassword</zorder>
<zorder>line</zorder>
<zorder>lbLoadDownImg</zorder>
<zorder>lbLoadUpImg</zorder>
<zorder>wbg</zorder>
<zorder>btnConnSub</zorder>
<zorder>btnConn</zorder>
<zorder>btnConnPWD</zorder>
<zorder>btnDisConn</zorder>
<zorder>btnHideConn</zorder>
<zorder>lePassword</zorder>
<zorder>checkBoxPwd</zorder>
</widget>
<resources/>
<connections/>

View File

@ -28,30 +28,47 @@ OneLancForm::OneLancForm(QWidget *parent, MainWindow *mainWindow, ConfForm *conf
{
ui->setupUi(this);
ui->btnConf->setText(tr("Config"));//"设置"
ui->btnConnSub->setText(tr("Config"));//"设置"
ui->btnConn->setText(tr("Connect"));//"连接"
ui->btnDisConn->setText(tr("Disconnect"));//"断开连接"
ui->lbConned->setAlignment(Qt::AlignLeft);
ui->lbLoadUp->setAlignment(Qt::AlignLeft);
ui->lbLoadDown->setAlignment(Qt::AlignLeft);
ui->lbInfo->setStyleSheet("QLabel{font-size:14px;color:rgba(255,255,255,0.57);}");
ui->wbg->setStyleSheet("#wbg{border-radius:4px;background-color:rgba(255,255,255,0.1);}");
ui->wbg_2->setStyleSheet("#wbg_2{border-radius:4px;background-color:rgba(255,255,255,0);}");
//"#wbg_2:Hover{border-radius:4px;background-color:rgba(255,255,255,0.1);}");
ui->lbName->setStyleSheet("QLabel{font-size:14px;color:rgba(255,255,255,0.91);}");
ui->lbConned->setStyleSheet("QLabel{font-size:14px;color:rgba(255,255,255,0.57);}");
ui->lbLoadUp->setStyleSheet("QLabel{font-size:14px;color:rgba(255,255,255,0.57);}");
ui->lbLoadDown->setStyleSheet("QLabel{font-size:14px;color:rgba(255,255,255,0.57);}");
ui->btnConnSub->setStyleSheet("QPushButton{border:0px;border-radius:4px;background-color:rgba(61,107,229,1);color:white;font-size:14px;}"
"QPushButton:Hover{border:0px solid rgba(255,255,255,0.2);border-radius:4px;background-color:rgba(107,142,235,1);}"
"QPushButton:Pressed{border-radius:4px;background-color:rgba(50,87,202,1);}");
ui->btnConn->setStyleSheet("QPushButton{border:0px;border-radius:4px;background-color:rgba(61,107,229,1);color:white;font-size:14px;}"
"QPushButton:Hover{border:0px solid rgba(255,255,255,0.2);border-radius:4px;background-color:rgba(107,142,235,1);}"
"QPushButton:Pressed{border-radius:4px;background-color:rgba(50,87,202,1);}");
ui->btnDisConn->setStyleSheet("QPushButton{border:0px;border-radius:4px;background-color:rgba(255,255,255,0.12);color:white;font-size:14px;}"
"QPushButton:Hover{border:0px solid rgba(255,255,255,0.2);border-radius:4px;background-color:rgba(255,255,255,0.2);}"
"QPushButton:Pressed{border-radius:4px;background-color:rgba(255,255,255,0.08);}");
ui->lbLoadDownImg->setStyleSheet("QLabel{background-image:url(:/res/x/load-down.png);}");
ui->lbLoadUpImg->setStyleSheet("QLabel{background-image:url(:/res/x/load-up.png);}");
ui->btnConnSub->setFocusPolicy(Qt::NoFocus);
ui->btnConn->setFocusPolicy(Qt::NoFocus);
ui->btnDisConn->setFocusPolicy(Qt::NoFocus);
ui->wbg->hide();
ui->btnConf->hide();
ui->wbg_2->show();
ui->lbName->show();
ui->btnConnSub->hide();
ui->btnConn->hide();
ui->btnDisConn->hide();
ui->lbConned->setAlignment(Qt::AlignRight);
ui->wbg->setStyleSheet("#wbg{background-color:#3593b5;}");
ui->lbName->setStyleSheet("QLabel{font-size:13px;color:#ffffff;}");
ui->lbBandWidth->setStyleSheet("QLabel{font-size:12px;color:#aaaaaa;}");
ui->lbConned->setStyleSheet("QLabel{font-size:13px;color:#ffffff;}");
ui->btnConf->setStyleSheet("QPushButton{border:0px;background-color:rgba(0,0,0,0.4);color:white;font-size:12px;}"
"QPushButton:Hover{border:1px solid rgba(255,255,255,0.2);background-color:rgba(0,0,0,0.2);}"
"QPushButton:Pressed{background-color:rgba(0,0,0,0.6);}");
ui->btnConn->setStyleSheet("QPushButton{border:0px;background-color:rgba(0,0,0,0.4);color:white;font-size:12px;}"
"QPushButton:Hover{border:1px solid rgba(255,255,255,0.2);background-color:rgba(0,0,0,0.2);}"
"QPushButton:Pressed{background-color:rgba(0,0,0,0.6);}");
ui->btnDisConn->setStyleSheet("QPushButton{border:0px;background-color:rgba(0,0,0,0.4);color:white;font-size:12px;}"
"QPushButton:Hover{border:1px solid rgba(255,255,255,0.2);background-color:rgba(0,0,0,0.2);}"
"QPushButton:Pressed{background-color:rgba(0,0,0,0.6);}");
ui->line->show();
ui->lbLoadDownImg->hide();
ui->lbLoadUpImg->hide();
this->mw = mainWindow;
this->cf = confForm;
@ -60,6 +77,12 @@ OneLancForm::OneLancForm(QWidget *parent, MainWindow *mainWindow, ConfForm *conf
this->isSelected = false;
this->isActive = false;
ui->wbg_2->setAttribute(Qt::WA_Hover,true);//开启悬停事件
ui->wbg_2->installEventFilter(this); //安装事件过滤器
ui->btnConn->setAttribute(Qt::WA_Hover,true);//开启悬停事件
ui->btnConn->installEventFilter(this); //安装事件过滤器
srand((unsigned)time(NULL));
}
@ -72,44 +95,107 @@ void OneLancForm::mousePressEvent(QMouseEvent *){
emit selectedOneLanForm(lanName);
}
//事件过滤器
bool OneLancForm::eventFilter(QObject *obj, QEvent *event)
{
if(obj == ui->wbg_2) {
if(event->type() == QEvent::HoverEnter) {
ui->btnConn->show();
ui->wbg_2->setStyleSheet("#wbg_2{border-radius:4px;background-color:rgba(255,255,255,0.1);}");
return true;
} else if(event->type() == QEvent::HoverLeave){
ui->btnConn->hide();
ui->wbg_2->setStyleSheet("#wbg_2{border-radius:4px;background-color:rgba(255,255,255,0);}");
return true;
}
}
if(obj == ui->btnConn) {
if(event->type() == QEvent::HoverEnter) {
ui->wbg_2->hide();
ui->btnConn->show();
return true;
} else if(event->type() == QEvent::HoverLeave){
ui->wbg_2->show();
return true;
}
}
return QWidget::eventFilter(obj,event);
}
// 是否当前连接的网络,字体设置不同
void OneLancForm::setAct(bool isAct){
if(isAct){
ui->lbName->setStyleSheet("QLabel{font-size:14px;color:#ffffff;}");
ui->lbConned->show();
ui->btnConf->show();
ui->btnConnSub->hide();
}else{
ui->lbName->setStyleSheet("QLabel{font-size:12px;color:#ffffff;}");
ui->lbName->setStyleSheet("QLabel{font-size:14px;color:#ffffff;}");
ui->lbConned->hide();
ui->btnConf->hide();
ui->btnConnSub->hide();
}
isActive = isAct;
}
// 是否选中
void OneLancForm::setSelected(bool isSelected){
void OneLancForm::setSelected(bool isSelected)
{
if(isSelected){
resize(314, 111);
resize(422, 168);
ui->wbg->show();
ui->btnConf->show();
if(isActive){
ui->btnDisConn->show();
}else{
ui->btnConn->show();
}
ui->wbg_2->hide();
ui->line->hide();
ui->btnConn->show();
ui->btnConnSub->show();
this->isSelected = true;
}else{
resize(314, 60);
resize(422, 60);
ui->wbg->hide();
ui->btnConf->hide();
ui->wbg_2->show();
ui->line->show();
ui->btnConn->hide();
ui->btnDisConn->hide();
ui->lbName->show();
ui->btnConnSub->hide();
this->isSelected = false;
}
ui->btnDisConn->hide();
}
void OneLancForm::setTopItem(bool isSelected)
{
if(isSelected){
resize(422, 168);
ui->wbg->show();
ui->btnConnSub->hide();
this->isSelected = true;
}else{
resize(422, 60);
ui->wbg->hide();
ui->btnConnSub->hide();
this->isSelected = false;
}
if (isConnected){
// ui->lbLoadUp->setText("0Kb/s");
// ui->lbLoadDown->setText("0Kb/s");
ui->lbLoadUp->hide();
ui->lbLoadDown->hide();
ui->btnDisConn->show();
} else {
// ui->lbLoadUp->setText("0Kb/s");
// ui->lbLoadDown->setText("0Kb/s");
ui->lbLoadUp->hide();
ui->lbLoadDown->hide();
ui->btnDisConn->hide();
}
ui->btnConn->hide();
ui->wbg_2->hide();
ui->line->hide();
ui->lbLoadUpImg->show();
ui->lbLoadDownImg->show();
}
void OneLancForm::setName(QString name){
@ -117,91 +203,40 @@ void OneLancForm::setName(QString name){
lanName = name;
}
void OneLancForm::setConnedString(QString str){
ui->lbConned->setText(str);
void OneLancForm::setConnedString(bool showLable, QString str){
if (!showLable){
ui->lbConned->hide();
ui->lbName->move(63, 18);
}else{
ui->lbConned->setText(str);
}
}
void OneLancForm::setLanInfo(QString str1, QString str2, QString str3, QString str4)
{
QString str = "IPv4地址" + str1 + "\nIPv6地址" + str2 + "\n带宽:" + str3 + " \n物理地址(MAC)" + str4;
ui->lbInfo->setText(str);
}
void OneLancForm::setIcon(bool isOn){
if(isOn){
ui->lbIcon->setStyleSheet("QLabel{background:url(:/res/s/network-line.png);}");
ui->lbIcon->setStyleSheet("QLabel{background:url(:/res/l/network-online.png);}");
}else{
ui->lbIcon->setStyleSheet("QLabel{background:url(:/res/s/network-offline.png);}");
ui->lbIcon->setStyleSheet("QLabel{background:url(:/res/l/network-offline.png);}");
}
}
void OneLancForm::setBandWidth(QString bandWidth){
ui->lbBandWidth->setText(bandWidth);
if(bandWidth == "--"){
ui->lbPoint->setStyleSheet("QLabel{background:url(:/res/s/pbad.png);}");
}else{
if(bandWidth != ""){
QString rateStr = bandWidth.mid(0, bandWidth.indexOf("Mb"));
int rateNum = rateStr.toInt();
if(rateNum >= 1000){
ui->lbPoint->setStyleSheet("QLabel{background:url(:/res/s/pgood.png);}");
}
if(rateNum >= 100 && rateNum < 1000){
ui->lbPoint->setStyleSheet("QLabel{background:url(:/res/s/pnormal.png);}");
}
if(rateNum < 100){
ui->lbPoint->setStyleSheet("QLabel{background:url(:/res/s/pbad.png);}");
}
}
}
}
void OneLancForm::setShowPoint(bool flag){
if(flag){
ui->lbPoint->show();
}else{
ui->lbPoint->hide();
}
}
void OneLancForm::on_btnConf_clicked()
void OneLancForm::on_btnConnSub_clicked()
{
QPoint pos = QCursor::pos();
QRect primaryGeometry;
for (QScreen *screen : qApp->screens()) {
if (screen->geometry().contains(pos)) {
primaryGeometry = screen->geometry();
}
}
if (primaryGeometry.isEmpty()) {
primaryGeometry = qApp->primaryScreen()->geometry();
}
QThread *t = new QThread();
BackThread *bt = new BackThread();
QString connProp = bt->getConnProp(ui->lbName->text());
QStringList propList = connProp.split("|");
QString v4method, addr, mask, gateway, dns;
foreach (QString line, propList) {
if(line.startsWith("method:")){
v4method = line.split(":").at(1);
}
if(line.startsWith("addr:")){
addr = line.split(":").at(1);
}
if(line.startsWith("mask:")){
mask = line.split(":").at(1);
}
if(line.startsWith("gateway:")){
gateway= line.split(":").at(1);
}
if(line.startsWith("dns:")){
dns = line.split(":").at(1);
}
}
// qDebug()<<v4method<<addr<<mask<<gateway<<dns;
cf->setProp(ui->lbName->text(), v4method, addr, mask, gateway, dns, this->isActive);
cf->move(primaryGeometry.width() / 2 - cf->width() / 2, primaryGeometry.height() / 2 - cf->height() / 2);
cf->show();
cf->raise();
bt->moveToThread(t);
connect(t, SIGNAL(finished()), t, SLOT(deleteLater()));
connect(t, SIGNAL(started()), this, SLOT(slotConnLan()));
connect(this, SIGNAL(sigConnLan(QString)), bt, SLOT(execConnLan(QString)));
connect(bt, SIGNAL(connDone(int)), mw, SLOT(connLanDone(int)));
connect(bt, SIGNAL(btFinish()), t, SLOT(quit()));
t->start();
}
void OneLancForm::slotConnLan(){

View File

@ -22,6 +22,7 @@
#include <QWidget>
#include <QScreen>
#include <QThread>
#include <QEvent>
#include "confform.h"
#include "kylin-network-interface.h"
@ -44,16 +45,17 @@ public:
void setName(QString name);
void setIcon(bool isOn);
void setBandWidth(QString bandWidth);
void setLanInfo(QString str1, QString str2, QString str3, QString str4);
void setSelected(bool isSelected);
void setTopItem(bool isSelected);
void setAct(bool isAct);
void setConnedString(QString str);
void setShowPoint(bool flag);
void setConnedString(bool showLable, QString str);
bool isSelected;
bool isActive;
bool isConnected;
QString lanName;
signals:
@ -65,11 +67,11 @@ signals:
protected:
void mousePressEvent(QMouseEvent *event);
bool eventFilter(QObject *obj, QEvent *event);
private slots:
void on_btnConf_clicked();
void on_btnConn_clicked();
void on_btnConnSub_clicked();
void on_btnDisConn_clicked();
void slotConnLan();

View File

@ -6,7 +6,7 @@
<rect>
<x>0</x>
<y>0</y>
<width>314</width>
<width>422</width>
<height>60</height>
</rect>
</property>
@ -16,7 +16,7 @@
<widget class="QLabel" name="lbName">
<property name="geometry">
<rect>
<x>62</x>
<x>63</x>
<y>8</y>
<width>190</width>
<height>20</height>
@ -29,23 +29,23 @@
<widget class="QPushButton" name="btnConn">
<property name="geometry">
<rect>
<x>162</x>
<y>70</y>
<width>129</width>
<height>32</height>
<x>316</x>
<y>14</y>
<width>100</width>
<height>34</height>
</rect>
</property>
<property name="text">
<string/>
</property>
</widget>
<widget class="QPushButton" name="btnConf">
<widget class="QPushButton" name="btnConnSub">
<property name="geometry">
<rect>
<x>21</x>
<y>70</y>
<width>129</width>
<height>32</height>
<x>316</x>
<y>14</y>
<width>100</width>
<height>34</height>
</rect>
</property>
<property name="text">
@ -55,10 +55,10 @@
<widget class="QPushButton" name="btnDisConn">
<property name="geometry">
<rect>
<x>162</x>
<y>70</y>
<width>129</width>
<height>32</height>
<x>316</x>
<y>14</y>
<width>100</width>
<height>34</height>
</rect>
</property>
<property name="text">
@ -68,9 +68,9 @@
<widget class="QLabel" name="lbConned">
<property name="geometry">
<rect>
<x>180</x>
<y>19</y>
<width>90</width>
<x>63</x>
<y>31</y>
<width>52</width>
<height>20</height>
</rect>
</property>
@ -83,15 +83,28 @@
<rect>
<x>0</x>
<y>0</y>
<width>314</width>
<height>111</height>
<width>422</width>
<height>168</height>
</rect>
</property>
<widget class="QLabel" name="lbInfo">
<property name="geometry">
<rect>
<x>63</x>
<y>71</y>
<width>238</width>
<height>85</height>
</rect>
</property>
<property name="text">
<string/>
</property>
</widget>
</widget>
<widget class="QLabel" name="lbIcon">
<property name="geometry">
<rect>
<x>15</x>
<x>14</x>
<y>14</y>
<width>32</width>
<height>32</height>
@ -101,41 +114,97 @@
<string/>
</property>
</widget>
<widget class="QLabel" name="lbBandWidth">
<widget class="Line" name="line">
<property name="geometry">
<rect>
<x>62</x>
<x>0</x>
<y>58</y>
<width>422</width>
<height>1</height>
</rect>
</property>
<property name="styleSheet">
<string notr="true">background-color: rgba(255, 255, 255,0.06);</string>
</property>
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
</widget>
<widget class="QLabel" name="lbLoadDownImg">
<property name="geometry">
<rect>
<x>115</x>
<y>33</y>
<width>16</width>
<height>16</height>
</rect>
</property>
<property name="text">
<string/>
</property>
</widget>
<widget class="QLabel" name="lbLoadUpImg">
<property name="geometry">
<rect>
<x>190</x>
<y>33</y>
<width>16</width>
<height>16</height>
</rect>
</property>
<property name="text">
<string/>
</property>
</widget>
<widget class="QLabel" name="lbLoadDown">
<property name="geometry">
<rect>
<x>132</x>
<y>31</y>
<width>80</width>
<height>18</height>
<width>65</width>
<height>20</height>
</rect>
</property>
<property name="text">
<string/>
</property>
</widget>
<widget class="QLabel" name="lbPoint">
<widget class="QLabel" name="lbLoadUp">
<property name="geometry">
<rect>
<x>280</x>
<y>25</y>
<width>10</width>
<height>10</height>
<x>207</x>
<y>31</y>
<width>65</width>
<height>20</height>
</rect>
</property>
<property name="text">
<string/>
</property>
</widget>
<zorder>wbg</zorder>
<widget class="QWidget" name="wbg_2" native="true">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>422</width>
<height>60</height>
</rect>
</property>
</widget>
<zorder>lbLoadUp</zorder>
<zorder>lbLoadDown</zorder>
<zorder>lbName</zorder>
<zorder>btnConn</zorder>
<zorder>btnConf</zorder>
<zorder>btnDisConn</zorder>
<zorder>lbConned</zorder>
<zorder>lbIcon</zorder>
<zorder>lbBandWidth</zorder>
<zorder>lbPoint</zorder>
<zorder>line</zorder>
<zorder>lbLoadDownImg</zorder>
<zorder>lbLoadUpImg</zorder>
<zorder>wbg</zorder>
<zorder>wbg_2</zorder>
<zorder>btnConnSub</zorder>
<zorder>btnDisConn</zorder>
<zorder>btnConn</zorder>
</widget>
<resources/>
<connections/>

BIN
res/l/network-offline.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 506 B

23
res/l/network-offline.svg Normal file
View File

@ -0,0 +1,23 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Generator: Adobe Illustrator 24.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
<svg version="1.1" id="图层_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
viewBox="0 0 32 32" style="enable-background:new 0 0 32 32;" xml:space="preserve">
<style type="text/css">
.st0{fill:#607D8B;}
.st1{fill:#324347;}
.st2{fill:#4CAF50;}
.st3{fill:#03A9F4;}
.st4{fill:#324347;stroke:#324347;stroke-width:0.4;stroke-miterlimit:10;}
.st5{fill:#FA6056;}
.st6{fill:none;stroke:#FFFFFF;stroke-miterlimit:10;}
</style>
<rect x="15.4" y="21.7" class="st0" width="1.3" height="4.4"/>
<rect x="1.2" y="26.3" class="st0" width="29.6" height="0.9"/>
<path class="st1" d="M10.8,24.7h10.3c1.1,0,2,0.9,2,2v0c0,1.1-0.9,2-2,2H10.8c-1.1,0-2-0.9-2-2v0C8.9,25.5,9.7,24.7,10.8,24.7z"/>
<ellipse class="st2" cx="11.2" cy="26.6" rx="0.6" ry="0.6"/>
<rect x="1.4" y="3.8" class="st3" width="29.2" height="17.9"/>
<path class="st4" d="M1,3.4v18.7h30V3.4H1z M30.6,21.7H1.4V3.8h29.2V21.7z"/>
<circle class="st5" cx="26.5" cy="26.5" r="5.5"/>
<line class="st6" x1="24" y1="24" x2="29" y2="29"/>
<line class="st6" x1="29" y1="24" x2="24" y2="29"/>
</svg>

After

Width:  |  Height:  |  Size: 1.2 KiB

BIN
res/l/network-online.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 406 B

1
res/l/network-online.svg Normal file
View File

@ -0,0 +1 @@
<svg id="图层_1" data-name="图层 1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"><defs><style>.cls-1{fill:#607d8b;}.cls-2,.cls-5{fill:#324347;}.cls-3{fill:#4caf50;}.cls-4{fill:#03a9f4;}.cls-5{stroke:#324347;stroke-miterlimit:10;stroke-width:0.4px;}</style></defs><title>gnome-dev-ethernet32</title><rect class="cls-1" x="15.35" y="21.66" width="1.3" height="4.38"/><rect class="cls-1" x="15.54" y="11.96" width="0.92" height="29.61" transform="translate(42.77 10.77) rotate(90)"/><rect class="cls-2" x="8.87" y="24.67" width="14.26" height="3.93" rx="1.96"/><ellipse class="cls-3" cx="11.21" cy="26.64" rx="0.58" ry="0.59"/><rect class="cls-4" x="1.39" y="3.8" width="29.22" height="17.93"/><path class="cls-5" d="M1,3.4V22.12H31V3.4ZM30.61,21.73H1.39V3.8H30.61Z"/></svg>

After

Width:  |  Height:  |  Size: 785 B

BIN
res/w/wifi-full-pwd.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

BIN
res/w/wifi-full.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 557 B

BIN
res/w/wifi-high-pwd.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 682 B

BIN
res/w/wifi-high.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 605 B

BIN
res/w/wifi-low-pwd.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 651 B

BIN
res/w/wifi-low.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 589 B

BIN
res/w/wifi-medium-pwd.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 663 B

BIN
res/w/wifi-medium.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 606 B

BIN
res/w/wifi-none-pwd.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 634 B

BIN
res/w/wifi-none.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 565 B

19
res/x/fly-mode-off.svg Normal file
View File

@ -0,0 +1,19 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Generator: Adobe Illustrator 24.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
<svg version="1.1" id="图层_3" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
viewBox="0 0 19 19" style="enable-background:new 0 0 19 19;" xml:space="preserve">
<style type="text/css">
.st0{fill:#FFFFFF;}
.st1{fill:#E40000;}
</style>
<title>画板 1</title>
<path id="XMLID_235_" class="st0" d="M17.4,4.3c-0.8-1.2-3.4,0-6.2,1.7L8.1,4.4h0.1C8.3,4.3,8.4,4.1,8.3,4C8.2,3.8,8,3.7,7.9,3.8
L7.4,4.1l-3-1.6C4.1,2.4,3.7,2.4,3.6,2.7C3.4,3,3.5,3.3,3.8,3.6l4,4.7c-1.7,1.2-3.1,2.4-3.8,3l0,0l-2.7-0.8
c-0.3-0.1-0.7,0.1-0.8,0.4c0,0,1.2,1.2,1.6,2C2.6,13.7,3,15.3,3,15.3c0.3,0.1,0.7-0.1,0.8-0.4l0.4-1.7c0.1,0,0.1-0.1,0.2-0.1
C4.4,13,18.9,6.7,17.4,4.3L17.4,4.3z M12.8,13.1l0.2-3c-1.1,0.8-2.2,1.5-3.2,2.2l1.6,4.6c0.1,0.4,0.3,0.6,0.6,0.6s0.6-0.3,0.6-0.6
l0.2-3l0.3-0.2c0.2-0.1,0.2-0.3,0.1-0.4C13.1,13.1,13,13,12.8,13.1L12.8,13.1z"/>
<g id="_16">
<polygon class="st1" points="19,13.3 18.3,12.6 15.8,15.1 13.3,12.6 12.6,13.3 15.1,15.8 12.6,18.3 13.3,19 15.8,16.5 18.3,19
19,18.3 16.5,15.8 "/>
</g>
</svg>

After

Width:  |  Height:  |  Size: 1.2 KiB

14
res/x/fly-mode-on.svg Normal file
View File

@ -0,0 +1,14 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Generator: Adobe Illustrator 24.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
<svg version="1.1" id="图层_3" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
viewBox="0 0 19 19" style="enable-background:new 0 0 19 19;" xml:space="preserve">
<style type="text/css">
.st0{fill:#FFFFFF;}
</style>
<title>画板 1</title>
<path id="XMLID_235_" class="st0" d="M17.4,4.3c-0.8-1.2-3.4,0-6.2,1.7L8.1,4.4h0.1C8.3,4.3,8.4,4.1,8.3,4C8.2,3.8,8,3.7,7.9,3.8
L7.4,4.1l-3-1.6C4.1,2.4,3.7,2.4,3.6,2.7C3.4,3,3.5,3.3,3.8,3.6l4,4.7c-1.7,1.2-3.1,2.4-3.8,3l0,0l-2.7-0.8
c-0.3-0.1-0.7,0.1-0.8,0.4c0,0,1.2,1.2,1.6,2C2.6,13.7,3,15.3,3,15.3c0.3,0.1,0.7-0.1,0.8-0.4l0.4-1.7c0.1,0,0.1-0.1,0.2-0.1
C4.4,13,18.9,6.7,17.4,4.3L17.4,4.3z M12.8,13.1l0.2-3c-1.1,0.8-2.2,1.5-3.2,2.2l1.6,4.6c0.1,0.4,0.3,0.6,0.6,0.6s0.6-0.3,0.6-0.6
l0.2-3l0.3-0.2c0.2-0.1,0.2-0.3,0.1-0.4C13.1,13.1,13,13,12.8,13.1L12.8,13.1z"/>
</svg>

After

Width:  |  Height:  |  Size: 1005 B

22
res/x/hot-spot-off.svg Normal file
View File

@ -0,0 +1,22 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Generator: Adobe Illustrator 24.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
<svg version="1.1" id="图层_3" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
viewBox="0 0 19 19" style="enable-background:new 0 0 19 19;" xml:space="preserve">
<style type="text/css">
.st0{fill:#FFFFFF;}
.st1{fill:#E40000;}
</style>
<path class="st0" d="M11,4.1v1c2.1,0.6,3.4,2.8,2.8,4.9c-0.4,1.4-1.4,2.4-2.8,2.8v1c2.7-0.6,4.3-3.4,3.7-6C14.2,6,12.8,4.5,11,4.1z"
/>
<path class="st0" d="M13,1.6v1.1c3.5,1.7,5,5.8,3.3,9.3c-0.7,1.4-1.9,2.6-3.3,3.3v1.1c4.1-1.7,6.1-6.3,4.4-10.4
C16.6,4,15,2.4,13,1.6z"/>
<path class="st0" d="M4.3,7.8c-0.6,2.6,1,5.4,3.7,6v-1c-1.4-0.4-2.4-1.4-2.8-2.8C4.6,7.9,5.9,5.7,8,5.1v-1C6.2,4.5,4.8,6,4.3,7.8z"
/>
<path class="st0" d="M1.6,6c-1.7,4.1,0.3,8.7,4.4,10.4v-1.1c-1.4-0.7-2.6-1.9-3.3-3.3C1,8.5,2.5,4.4,6,2.7V1.6C4,2.4,2.4,4,1.6,6z"
/>
<circle class="st0" cx="9.5" cy="9" r="1.5"/>
<g id="_16">
<polygon class="st1" points="19,13.3 18.3,12.6 15.8,15.1 13.3,12.6 12.6,13.3 15.1,15.8 12.6,18.3 13.3,19 15.8,16.5 18.3,19
19,18.3 16.5,15.8 "/>
</g>
</svg>

After

Width:  |  Height:  |  Size: 1.2 KiB

17
res/x/hot-spot-on.svg Normal file
View File

@ -0,0 +1,17 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Generator: Adobe Illustrator 24.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
<svg version="1.1" id="图层_3" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
viewBox="0 0 19 19" style="enable-background:new 0 0 19 19;" xml:space="preserve">
<style type="text/css">
.st0{fill:#FFFFFF;}
</style>
<path class="st0" d="M11,4.1v1c2.1,0.6,3.4,2.8,2.8,4.9c-0.4,1.4-1.4,2.4-2.8,2.8v1c2.7-0.6,4.3-3.4,3.7-6C14.2,6,12.8,4.5,11,4.1z"
/>
<path class="st0" d="M13,1.6v1.1c3.5,1.7,5,5.8,3.3,9.3c-0.7,1.4-1.9,2.6-3.3,3.3v1.1c4.1-1.7,6.1-6.3,4.4-10.4
C16.6,4,15,2.4,13,1.6z"/>
<path class="st0" d="M4.3,7.8c-0.6,2.6,1,5.4,3.7,6v-1c-1.4-0.4-2.4-1.4-2.8-2.8C4.6,7.9,5.9,5.7,8,5.1v-1C6.2,4.5,4.8,6,4.3,7.8z"
/>
<path class="st0" d="M1.6,6c-1.7,4.1,0.3,8.7,4.4,10.4v-1.1c-1.4-0.7-2.6-1.9-3.3-3.3C1,8.5,2.5,4.4,6,2.7V1.6C4,2.4,2.4,4,1.6,6z"
/>
<circle class="st0" cx="9.5" cy="9" r="1.5"/>
</svg>

After

Width:  |  Height:  |  Size: 1003 B

BIN
res/x/load-down.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 192 B

BIN
res/x/load-up.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 194 B

16
res/x/net-list-bg.svg Normal file
View File

@ -0,0 +1,16 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Generator: Adobe Illustrator 24.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
<svg version="1.1" id="图层_3" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
viewBox="0 0 19 19" style="enable-background:new 0 0 19 19;" xml:space="preserve">
<style type="text/css">
.st0{fill:#FFFFFF;}
</style>
<g id="_x32_3">
<path class="st0" d="M2,6c0-0.6,0.4-1,1-1h8V4H3C1.9,4,1,4.9,1,6v6c0,1.1,0.9,2,2,2h5v2H5v1h7v-1H9v-2h4v-1H3c-0.6,0-1-0.4-1-1V6z"
/>
<rect x="14" y="2" class="st0" width="1" height="2"/>
<rect x="16" y="2" class="st0" width="1" height="2"/>
<path class="st0" d="M17,4v3c0,0.6-0.4,1-1,1h-1c-0.6,0-1-0.4-1-1V4h-1v3c0,1.1,0.9,2,2,2h0v8h1V9h0c1.1,0,2-0.9,2-2V4H17z"/>
<rect x="15" y="5" class="st0" width="1" height="2"/>
</g>
</svg>

After

Width:  |  Height:  |  Size: 867 B

15
res/x/wifi-list-bg.svg Normal file
View File

@ -0,0 +1,15 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Generator: Adobe Illustrator 24.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
<svg version="1.1" id="图层_3" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
viewBox="0 0 19 19" style="enable-background:new 0 0 19 19;" xml:space="preserve">
<style type="text/css">
.st0{fill:#FFFFFF;}
</style>
<title>画板 1</title>
<g id="_16">
<path class="st0" d="M9.5,17C8.7,17,8,16.3,8,15.5C8,14.7,8.7,14,9.5,14s1.5,0.7,1.5,1.5C11,16.3,10.3,17,9.5,17L9.5,17z"/>
<path class="st0" d="M6.7,12.2c1.5-1.5,3.8-1.5,5.3-0.1l0.1,0.1l0.7-0.7c-1.7-2-4.8-2-6.6-0.2l-0.1,0.1L6.7,12.2z"/>
<path class="st0" d="M4.3,9.2c2.9-2.9,7.4-3,10.4-0.1l0.1,0.1l0.7-0.7C12.3,5.2,7.1,5.2,3.8,8.4L3.7,8.5L4.3,9.2z"/>
<path class="st0" d="M1.7,6.3C6,2,12.9,1.9,17.1,6.2l0.1,0.1L18,5.5C13.3,0.8,5.8,0.8,1.1,5.4L1,5.5L1.7,6.3z"/>
</g>
</svg>

After

Width:  |  Height:  |  Size: 927 B

View File

@ -4,7 +4,7 @@
<context>
<name>BackThread</name>
<message>
<location filename="../backthread.cpp" line="209"/>
<location filename="../backthread.cpp" line="208"/>
<source>Confirm your Wi-Fi password</source>
<translation type="unfinished"></translation>
</message>
@ -1170,124 +1170,173 @@
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>DlgHotspotCreate</name>
<message>
<location filename="../dlghotspotcreate.ui" line="14"/>
<source>Dialog</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../dlghotspotcreate.cpp" line="26"/>
<source>Create Hotspot</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../dlghotspotcreate.cpp" line="27"/>
<source>Network name</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../dlghotspotcreate.cpp" line="28"/>
<source>Wi-Fi security</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../dlghotspotcreate.cpp" line="29"/>
<source>Password</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../dlghotspotcreate.cpp" line="30"/>
<source>Cancel</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../dlghotspotcreate.cpp" line="31"/>
<source>Ok</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../dlghotspotcreate.cpp" line="34"/>
<source>None</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../dlghotspotcreate.cpp" line="35"/>
<source>WPA &amp; WPA2 Personal</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>MainWindow</name>
<message>
<location filename="../mainwindow.ui" line="14"/>
<location filename="../mainwindow.cpp" line="188"/>
<location filename="../mainwindow.cpp" line="238"/>
<source>kylin-nm</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../mainwindow.cpp" line="124"/>
<source>Network</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../mainwindow.cpp" line="126"/>
<location filename="../mainwindow.cpp" line="174"/>
<location filename="../mainwindow.cpp" line="255"/>
<source>Advanced</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../mainwindow.cpp" line="128"/>
<location filename="../mainwindow.cpp" line="141"/>
<source>Ethernet</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../mainwindow.cpp" line="129"/>
<location filename="../mainwindow.cpp" line="147"/>
<source>Wifi</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../mainwindow.cpp" line="481"/>
<location filename="../mainwindow.cpp" line="486"/>
<location filename="../mainwindow.cpp" line="1595"/>
<location filename="../mainwindow.cpp" line="1601"/>
<location filename="../mainwindow.cpp" line="1662"/>
<location filename="../mainwindow.cpp" line="1669"/>
<source>Enabled</source>
<location filename="../mainwindow.cpp" line="162"/>
<source>HotSpot</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../mainwindow.cpp" line="490"/>
<location filename="../mainwindow.cpp" line="496"/>
<location filename="../mainwindow.cpp" line="500"/>
<location filename="../mainwindow.cpp" line="1639"/>
<location filename="../mainwindow.cpp" line="1643"/>
<location filename="../mainwindow.cpp" line="1702"/>
<location filename="../mainwindow.cpp" line="1722"/>
<location filename="../mainwindow.cpp" line="1746"/>
<source>Disabled</source>
<location filename="../mainwindow.cpp" line="168"/>
<source>FlyMode</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../mainwindow.cpp" line="666"/>
<location filename="../mainwindow.cpp" line="765"/>
<location filename="../mainwindow.cpp" line="1106"/>
<location filename="../mainwindow.cpp" line="1148"/>
<location filename="../mainwindow.cpp" line="1620"/>
<location filename="../mainwindow.cpp" line="1687"/>
<location filename="../mainwindow.cpp" line="1731"/>
<location filename="../mainwindow.cpp" line="823"/>
<location filename="../mainwindow.cpp" line="932"/>
<location filename="../mainwindow.cpp" line="1310"/>
<location filename="../mainwindow.cpp" line="1364"/>
<location filename="../mainwindow.cpp" line="1869"/>
<location filename="../mainwindow.cpp" line="1928"/>
<location filename="../mainwindow.cpp" line="1977"/>
<source>Not connected</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../mainwindow.cpp" line="668"/>
<location filename="../mainwindow.cpp" line="769"/>
<location filename="../mainwindow.cpp" line="1108"/>
<location filename="../mainwindow.cpp" line="1153"/>
<location filename="../mainwindow.cpp" line="1622"/>
<location filename="../mainwindow.cpp" line="1691"/>
<location filename="../mainwindow.cpp" line="1735"/>
<location filename="../mainwindow.cpp" line="825"/>
<location filename="../mainwindow.cpp" line="867"/>
<location filename="../mainwindow.cpp" line="934"/>
<location filename="../mainwindow.cpp" line="1005"/>
<location filename="../mainwindow.cpp" line="1119"/>
<location filename="../mainwindow.cpp" line="1312"/>
<location filename="../mainwindow.cpp" line="1367"/>
<location filename="../mainwindow.cpp" line="1871"/>
<location filename="../mainwindow.cpp" line="1930"/>
<location filename="../mainwindow.cpp" line="1979"/>
<source>Disconnected</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../mainwindow.cpp" line="677"/>
<location filename="../mainwindow.cpp" line="1117"/>
<location filename="../mainwindow.cpp" line="1631"/>
<location filename="../mainwindow.cpp" line="61"/>
<location filename="../mainwindow.cpp" line="797"/>
<location filename="../mainwindow.cpp" line="1296"/>
<location filename="../mainwindow.cpp" line="1855"/>
<source>Ethernet Networks</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../mainwindow.cpp" line="704"/>
<location filename="../mainwindow.cpp" line="814"/>
<location filename="../mainwindow.cpp" line="854"/>
<location filename="../mainwindow.cpp" line="990"/>
<source>Connected</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../mainwindow.cpp" line="776"/>
<location filename="../mainwindow.cpp" line="1160"/>
<location filename="../mainwindow.cpp" line="71"/>
<location filename="../mainwindow.cpp" line="906"/>
<location filename="../mainwindow.cpp" line="1350"/>
<source>Wifi Networks</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../mainwindow.cpp" line="1020"/>
<location filename="../mainwindow.cpp" line="254"/>
<source>Show MainWindow</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../mainwindow.cpp" line="866"/>
<location filename="../mainwindow.cpp" line="1004"/>
<location filename="../mainwindow.cpp" line="1118"/>
<source>None</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../mainwindow.cpp" line="1206"/>
<source>keep wired network switch is on before turning on wireless switch</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../mainwindow.cpp" line="1039"/>
<location filename="../mainwindow.cpp" line="1226"/>
<source>please insert the wireless network adapter</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../mainwindow.cpp" line="1083"/>
<location filename="../mainwindow.cpp" line="1280"/>
<source>Abnormal connection exist, program will delete it</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../mainwindow.cpp" line="1200"/>
<location filename="../mainwindow.cpp" line="1410"/>
<source>Conn Ethernet Success</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../mainwindow.cpp" line="1211"/>
<location filename="../mainwindow.cpp" line="1421"/>
<source>Conn Ethernet Fail</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../mainwindow.cpp" line="1331"/>
<location filename="../mainwindow.cpp" line="1541"/>
<source>Conn Wifi Success</source>
<translation type="unfinished"></translation>
</message>
@ -1301,48 +1350,33 @@
</message>
<message>
<location filename="../oneconnform.cpp" line="32"/>
<source>Input password</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../oneconnform.cpp" line="33"/>
<source>Config</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../oneconnform.cpp" line="33"/>
<location filename="../oneconnform.cpp" line="34"/>
<location filename="../oneconnform.cpp" line="35"/>
<location filename="../oneconnform.cpp" line="37"/>
<location filename="../oneconnform.cpp" line="36"/>
<source>Connect</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../oneconnform.cpp" line="36"/>
<location filename="../oneconnform.cpp" line="35"/>
<source>Disconnect</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../oneconnform.cpp" line="226"/>
<location filename="../oneconnform.cpp" line="269"/>
<source>Connect to Hidden Wi-Fi Network</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../oneconnform.cpp" line="238"/>
<source>Public</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../oneconnform.cpp" line="241"/>
<source>Safe</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../oneconnform.cpp" line="246"/>
<location filename="../oneconnform.cpp" line="279"/>
<source>Rate</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../oneconnform.cpp" line="431"/>
<location filename="../oneconnform.cpp" line="479"/>
<source>Conn Wifi Failed</source>
<translation type="unfinished"></translation>
</message>

Binary file not shown.

View File

@ -4,7 +4,7 @@
<context>
<name>BackThread</name>
<message>
<location filename="../backthread.cpp" line="209"/>
<location filename="../backthread.cpp" line="208"/>
<source>Confirm your Wi-Fi password</source>
<translation>Wi-Fi密码</translation>
</message>
@ -1170,109 +1170,170 @@
<translation type="unfinished">WPA WPA2 </translation>
</message>
</context>
<context>
<name>DlgHotspotCreate</name>
<message>
<location filename="../dlghotspotcreate.ui" line="14"/>
<source>Dialog</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../dlghotspotcreate.cpp" line="26"/>
<source>Create Hotspot</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../dlghotspotcreate.cpp" line="27"/>
<source>Network name</source>
<translation type="unfinished">:</translation>
</message>
<message>
<location filename="../dlghotspotcreate.cpp" line="28"/>
<source>Wi-Fi security</source>
<translation type="unfinished">Wi-Fi :</translation>
</message>
<message>
<location filename="../dlghotspotcreate.cpp" line="29"/>
<source>Password</source>
<translation type="unfinished">:</translation>
</message>
<message>
<location filename="../dlghotspotcreate.cpp" line="30"/>
<source>Cancel</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../dlghotspotcreate.cpp" line="31"/>
<source>Ok</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../dlghotspotcreate.cpp" line="34"/>
<source>None</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../dlghotspotcreate.cpp" line="35"/>
<source>WPA &amp; WPA2 Personal</source>
<translation type="unfinished">WPA WPA2 </translation>
</message>
</context>
<context>
<name>MainWindow</name>
<message>
<location filename="../mainwindow.ui" line="14"/>
<location filename="../mainwindow.cpp" line="188"/>
<location filename="../mainwindow.cpp" line="238"/>
<source>kylin-nm</source>
<translation></translation>
</message>
<message>
<location filename="../mainwindow.cpp" line="124"/>
<source>Network</source>
<translation></translation>
<translation type="vanished"></translation>
</message>
<message>
<location filename="../mainwindow.cpp" line="126"/>
<location filename="../mainwindow.cpp" line="174"/>
<location filename="../mainwindow.cpp" line="255"/>
<source>Advanced</source>
<translation></translation>
</message>
<message>
<location filename="../mainwindow.cpp" line="128"/>
<location filename="../mainwindow.cpp" line="141"/>
<source>Ethernet</source>
<translation>线</translation>
</message>
<message>
<location filename="../mainwindow.cpp" line="129"/>
<location filename="../mainwindow.cpp" line="147"/>
<source>Wifi</source>
<translation>线</translation>
</message>
<message>
<location filename="../mainwindow.cpp" line="481"/>
<location filename="../mainwindow.cpp" line="486"/>
<location filename="../mainwindow.cpp" line="1595"/>
<location filename="../mainwindow.cpp" line="1601"/>
<location filename="../mainwindow.cpp" line="1662"/>
<location filename="../mainwindow.cpp" line="1669"/>
<source>Enabled</source>
<translation></translation>
<translation type="vanished"></translation>
</message>
<message>
<location filename="../mainwindow.cpp" line="490"/>
<location filename="../mainwindow.cpp" line="496"/>
<location filename="../mainwindow.cpp" line="500"/>
<location filename="../mainwindow.cpp" line="1639"/>
<location filename="../mainwindow.cpp" line="1643"/>
<location filename="../mainwindow.cpp" line="1702"/>
<location filename="../mainwindow.cpp" line="1722"/>
<location filename="../mainwindow.cpp" line="1746"/>
<source>Disabled</source>
<translation></translation>
<translation type="vanished"></translation>
</message>
<message>
<location filename="../mainwindow.cpp" line="666"/>
<location filename="../mainwindow.cpp" line="765"/>
<location filename="../mainwindow.cpp" line="1106"/>
<location filename="../mainwindow.cpp" line="1148"/>
<location filename="../mainwindow.cpp" line="1620"/>
<location filename="../mainwindow.cpp" line="1687"/>
<location filename="../mainwindow.cpp" line="1731"/>
<location filename="../mainwindow.cpp" line="162"/>
<source>HotSpot</source>
<translation></translation>
</message>
<message>
<location filename="../mainwindow.cpp" line="168"/>
<source>FlyMode</source>
<translation></translation>
</message>
<message>
<location filename="../mainwindow.cpp" line="254"/>
<source>Show MainWindow</source>
<translation></translation>
</message>
<message>
<location filename="../mainwindow.cpp" line="823"/>
<location filename="../mainwindow.cpp" line="932"/>
<location filename="../mainwindow.cpp" line="1310"/>
<location filename="../mainwindow.cpp" line="1364"/>
<location filename="../mainwindow.cpp" line="1869"/>
<location filename="../mainwindow.cpp" line="1928"/>
<location filename="../mainwindow.cpp" line="1977"/>
<source>Not connected</source>
<translation></translation>
</message>
<message>
<location filename="../mainwindow.cpp" line="668"/>
<location filename="../mainwindow.cpp" line="769"/>
<location filename="../mainwindow.cpp" line="1108"/>
<location filename="../mainwindow.cpp" line="1153"/>
<location filename="../mainwindow.cpp" line="1622"/>
<location filename="../mainwindow.cpp" line="1691"/>
<location filename="../mainwindow.cpp" line="1735"/>
<location filename="../mainwindow.cpp" line="825"/>
<location filename="../mainwindow.cpp" line="867"/>
<location filename="../mainwindow.cpp" line="934"/>
<location filename="../mainwindow.cpp" line="1005"/>
<location filename="../mainwindow.cpp" line="1119"/>
<location filename="../mainwindow.cpp" line="1312"/>
<location filename="../mainwindow.cpp" line="1367"/>
<location filename="../mainwindow.cpp" line="1871"/>
<location filename="../mainwindow.cpp" line="1930"/>
<location filename="../mainwindow.cpp" line="1979"/>
<source>Disconnected</source>
<translation></translation>
</message>
<message>
<location filename="../mainwindow.cpp" line="677"/>
<location filename="../mainwindow.cpp" line="1117"/>
<location filename="../mainwindow.cpp" line="1631"/>
<location filename="../mainwindow.cpp" line="61"/>
<location filename="../mainwindow.cpp" line="797"/>
<location filename="../mainwindow.cpp" line="1296"/>
<location filename="../mainwindow.cpp" line="1855"/>
<source>Ethernet Networks</source>
<translation></translation>
</message>
<message>
<location filename="../mainwindow.cpp" line="704"/>
<location filename="../mainwindow.cpp" line="814"/>
<location filename="../mainwindow.cpp" line="854"/>
<location filename="../mainwindow.cpp" line="990"/>
<source>Connected</source>
<translation></translation>
</message>
<message>
<location filename="../mainwindow.cpp" line="776"/>
<location filename="../mainwindow.cpp" line="1160"/>
<location filename="../mainwindow.cpp" line="71"/>
<location filename="../mainwindow.cpp" line="906"/>
<location filename="../mainwindow.cpp" line="1350"/>
<source>Wifi Networks</source>
<translation></translation>
</message>
<message>
<location filename="../mainwindow.cpp" line="1020"/>
<location filename="../mainwindow.cpp" line="866"/>
<location filename="../mainwindow.cpp" line="1004"/>
<location filename="../mainwindow.cpp" line="1118"/>
<source>None</source>
<translation></translation>
</message>
<message>
<location filename="../mainwindow.cpp" line="1206"/>
<source>keep wired network switch is on before turning on wireless switch</source>
<translation>线线</translation>
</message>
<message>
<location filename="../mainwindow.cpp" line="1039"/>
<location filename="../mainwindow.cpp" line="1226"/>
<source>please insert the wireless network adapter</source>
<translation>线</translation>
</message>
<message>
<location filename="../mainwindow.cpp" line="1083"/>
<location filename="../mainwindow.cpp" line="1280"/>
<source>Abnormal connection exist, program will delete it</source>
<translation></translation>
</message>
@ -1285,17 +1346,17 @@
<translation type="vanished"> Wi-Fi列表</translation>
</message>
<message>
<location filename="../mainwindow.cpp" line="1200"/>
<location filename="../mainwindow.cpp" line="1410"/>
<source>Conn Ethernet Success</source>
<translation>线</translation>
</message>
<message>
<location filename="../mainwindow.cpp" line="1211"/>
<location filename="../mainwindow.cpp" line="1421"/>
<source>Conn Ethernet Fail</source>
<translation>线</translation>
</message>
<message>
<location filename="../mainwindow.cpp" line="1331"/>
<location filename="../mainwindow.cpp" line="1541"/>
<source>Conn Wifi Success</source>
<translation>线</translation>
</message>
@ -1308,49 +1369,46 @@
<translation>--</translation>
</message>
<message>
<location filename="../oneconnform.cpp" line="32"/>
<source>Input password</source>
<translation></translation>
<translation type="vanished"></translation>
</message>
<message>
<location filename="../oneconnform.cpp" line="33"/>
<location filename="../oneconnform.cpp" line="32"/>
<source>Config</source>
<translation></translation>
</message>
<message>
<location filename="../oneconnform.cpp" line="33"/>
<location filename="../oneconnform.cpp" line="34"/>
<location filename="../oneconnform.cpp" line="35"/>
<location filename="../oneconnform.cpp" line="37"/>
<location filename="../oneconnform.cpp" line="36"/>
<source>Connect</source>
<translation></translation>
</message>
<message>
<location filename="../oneconnform.cpp" line="36"/>
<location filename="../oneconnform.cpp" line="35"/>
<source>Disconnect</source>
<translation></translation>
<translation></translation>
</message>
<message>
<location filename="../oneconnform.cpp" line="226"/>
<location filename="../oneconnform.cpp" line="269"/>
<source>Connect to Hidden Wi-Fi Network</source>
<translation> Wi-Fi </translation>
</message>
<message>
<location filename="../oneconnform.cpp" line="238"/>
<source>Public</source>
<translation></translation>
<translation type="vanished"></translation>
</message>
<message>
<location filename="../oneconnform.cpp" line="241"/>
<source>Safe</source>
<translation></translation>
<translation type="vanished"></translation>
</message>
<message>
<location filename="../oneconnform.cpp" line="246"/>
<location filename="../oneconnform.cpp" line="279"/>
<source>Rate</source>
<translation></translation>
</message>
<message>
<location filename="../oneconnform.cpp" line="431"/>
<location filename="../oneconnform.cpp" line="479"/>
<source>Conn Wifi Failed</source>
<translation>线</translation>
</message>
@ -1375,7 +1433,7 @@
<message>
<location filename="../onelancform.cpp" line="33"/>
<source>Disconnect</source>
<translation></translation>
<translation></translation>
</message>
</context>
</TS>