diff --git a/README.md b/README.md
index 8a0baa36..33c85489 100644
--- a/README.md
+++ b/README.md
@@ -10,6 +10,6 @@
# BUILD KYLIN-NM
down the source sode
- install depend packages(writed in the cntrol files in the debian directory)
+ install dependency packages(see cntrol files in the debian directory)
execute debuild command in the root directory of project
execute sudo dpkg -i packagename.deb to install
diff --git a/kylin-nm.pro b/kylin-nm.pro
index 9b1a4dcf..44bc4ba4 100644
--- a/kylin-nm.pro
+++ b/kylin-nm.pro
@@ -55,6 +55,7 @@ SOURCES += \
src/loadingdiv.cpp \
src/main.cpp \
src/mainwindow.cpp \
+ src/notifysend.cpp \
src/oneconnform.cpp \
src/onelancform.cpp \
src/utils.cpp \
@@ -80,6 +81,7 @@ HEADERS += \
src/kylin-network-interface.h \
src/loadingdiv.h \
src/mainwindow.h \
+ src/notifysend.h \
src/oneconnform.h \
src/onelancform.h \
src/utils.h \
@@ -99,6 +101,7 @@ HEADERS += \
FORMS += \
src/confform.ui \
src/mainwindow.ui \
+ src/notifysend.ui \
src/oneconnform.ui \
src/onelancform.ui \
wireless-security/dlgconnhidwifi.ui \
diff --git a/nmqrc.qrc b/nmqrc.qrc
index 332cd1b5..7051d9fd 100644
--- a/nmqrc.qrc
+++ b/nmqrc.qrc
@@ -75,5 +75,7 @@
res/s/conning-a/7.png
res/s/conning-a/8.png
qss/style.qss
+ res/g/close_black.png
+ res/g/close_white.png
diff --git a/res/g/close_black.png b/res/g/close_black.png
new file mode 100644
index 00000000..237e5552
Binary files /dev/null and b/res/g/close_black.png differ
diff --git a/res/g/close_white.png b/res/g/close_white.png
new file mode 100644
index 00000000..0943a4bb
Binary files /dev/null and b/res/g/close_white.png differ
diff --git a/src/backthread.cpp b/src/backthread.cpp
index c8512aa6..4418fe3e 100644
--- a/src/backthread.cpp
+++ b/src/backthread.cpp
@@ -243,11 +243,6 @@ void BackThread::execConnWifiPWD(QString connName, QString password){
qDebug()<<"debug: in function execConnWifiPWD, wireless net state is: "<wstate);
syslog(LOG_DEBUG, "In function execConnWifiPWD, wireless net state is: %d", execGetIface()->wstate);
}else{
- QString txt(tr("Confirm your Wi-Fi password"));
- QString cmd = "export LANG='en_US.UTF-8';export LANGUAGE='en_US';notify-send '" + txt + "...' -t 3800";
- int status1 = system(cmd.toUtf8().data());
- if (status1 != 0){ syslog(LOG_ERR, "execute 'notify-send' in function 'execConnWifiPWD' failed");}
-
emit connDone(1);
}
diff --git a/src/confform.cpp b/src/confform.cpp
index b4e7fb1a..6a9365d9 100644
--- a/src/confform.cpp
+++ b/src/confform.cpp
@@ -126,6 +126,8 @@ ConfForm::ConfForm(QWidget *parent) :
ui->btnOk->setFocusPolicy(Qt::NoFocus);
ui->btnCreate->setFocusPolicy(Qt::NoFocus);
+ //m_notify = new NotifySend(); //显示桌面通知
+
// IP的正则格式限制
QRegExp rx("\\b(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\b");
ui->leAddr->setValidator(new QRegExpValidator(rx, this));
@@ -138,6 +140,7 @@ ConfForm::ConfForm(QWidget *parent) :
ConfForm::~ConfForm()
{
+ m_notify->deleteLater();
delete ui;
}
@@ -211,6 +214,7 @@ void ConfForm::on_btnCreate_clicked()
this->on_btnOk_clicked();
} else {
QString txt(tr("New network already created"));
+ //m_notify->execNotifySend(txt);
QString cmd = "export LANG='en_US.UTF-8';export LANGUAGE='en_US';notify-send '" + txt + "...' -t 3800";
int status1 = system(cmd.toUtf8().data());
if (status1 != 0){ syslog(LOG_ERR, "execute 'notify-send' in function 'execConnWifiPWD' failed");}
@@ -248,6 +252,7 @@ void ConfForm::on_btnOk_clicked()
}
QString txt(tr("New network settings already finished"));
+ //m_notify->execNotifySend(txt);
QString cmd = "export LANG='en_US.UTF-8';export LANGUAGE='en_US';notify-send '" + txt + "...' -t 3800";
int status1 = system(cmd.toUtf8().data());
if (status1 != 0){ syslog(LOG_ERR, "execute 'notify-send' in function 'execConnWifiPWD' failed");}
@@ -263,6 +268,7 @@ void ConfForm::on_btnOk_clicked()
// if (status != 0){ syslog(LOG_ERR, "execute 'nmcli connection up' in function 'on_btnOk_clicked' failed");}
QString txt(tr("New settings already effective"));
+ //m_notify->execNotifySend(txt);
QString cmd = "export LANG='en_US.UTF-8';export LANGUAGE='en_US';notify-send '" + txt + "' -t 3800";
int status1 = system(cmd.toUtf8().data());
if (status1 != 0){ syslog(LOG_ERR, "execute 'notify-send' in function 'on_btnOk_clicked' failed");}
diff --git a/src/confform.h b/src/confform.h
index c086a9db..807d7550 100644
--- a/src/confform.h
+++ b/src/confform.h
@@ -19,6 +19,8 @@
#ifndef CONFFORM_H
#define CONFFORM_H
+#include "notifysend.h"
+
#include
#include
#include
@@ -40,6 +42,8 @@ public:
void setProp(QString connName, QString v4method, QString addr, QString mask, QString gateway, QString dns, bool isActConf);
+ NotifySend *m_notify = nullptr;
+
public slots:
void cbTypeChanged(int index);
diff --git a/src/kylin-dbus-interface.cpp b/src/kylin-dbus-interface.cpp
index 5f7f2270..19ae9e44 100644
--- a/src/kylin-dbus-interface.cpp
+++ b/src/kylin-dbus-interface.cpp
@@ -33,7 +33,8 @@ KylinDBus::KylinDBus(MainWindow *mainWindow, QObject *parent) :QObject(parent)
getPhysicalCarrierState(0); //初始化获取网线插入状态
getLanHwAddressState(); //获取有线网Mac地址
getWiredCardName();
- getWifiSwitchState();
+ initTaskbarGsetting(); //初始化taskbar的GSetting方法
+ getWifiSwitchState(); //初始化wifi开关GSetting通信方法
QDBusConnection::systemBus().connect(QString("org.freedesktop.NetworkManager"),
QString("/org/freedesktop/NetworkManager"),
@@ -55,10 +56,14 @@ KylinDBus::KylinDBus(MainWindow *mainWindow, QObject *parent) :QObject(parent)
QString("org.freedesktop.NetworkManager.Settings"),
QString("ConnectionRemoved"), this, SLOT(onConnectionRemoved(QDBusObjectPath) ) );
- QDBusConnection::systemBus().connect(QString("org.freedesktop.NetworkManager"),
- QString(wiredPath.path()),
- QString("org.freedesktop.NetworkManager.Device.Wired"),
- QString("PropertiesChanged"), this, SLOT(onLanPropertyChanged(QVariantMap) ) );
+ if (wirelessPath.path() != ""){
+ QDBusConnection::systemBus().connect(QString("org.freedesktop.NetworkManager"),
+ QString(wiredPath.path()),
+ QString("org.freedesktop.NetworkManager.Device.Wired"),
+ QString("PropertiesChanged"), this, SLOT(onLanPropertyChanged(QVariantMap) ) );
+ } else {
+ qDebug()<<"Can not find wired device object path when using dbus.";
+ }
if (wirelessPath.path() != ""){
QDBusConnection::systemBus().connect(QString("org.freedesktop.NetworkManager"),
@@ -71,6 +76,8 @@ KylinDBus::KylinDBus(MainWindow *mainWindow, QObject *parent) :QObject(parent)
QString("org.freedesktop.NetworkManager.Device.Wireless"),
QString("AccessPointAdded"), this, SLOT(onAccessPointAdded(QDBusObjectPath) ) );
getWirelessCardName();//获取无线网卡名称
+ } else {
+ qDebug()<<"Can not find wireless device object path when using dbus.";
}
time = new QTimer(this);
@@ -80,6 +87,10 @@ KylinDBus::KylinDBus(MainWindow *mainWindow, QObject *parent) :QObject(parent)
QObject::connect(this, SIGNAL(updateWiredList(int)), mw, SLOT(onBtnNetListClicked(int)));
}
+
+///////////////////////////////////////////////////////////////////////////////
+//下方使用Dbus 进程通信方法
+
void KylinDBus::getObjectPath()
{
QDBusInterface m_interface( "org.freedesktop.NetworkManager",
@@ -88,6 +99,10 @@ void KylinDBus::getObjectPath()
QDBusConnection::systemBus() );
QDBusReply> obj_reply = m_interface.call("GetAllDevices");
+ if (!obj_reply.isValid()) {
+ qDebug()<<"execute dbus method 'GetAllDevices' is invalid in func getObjectPath()";
+ }
+
QList obj_paths = obj_reply.value();
foreach (QDBusObjectPath obj_path, obj_paths){
@@ -97,6 +112,10 @@ void KylinDBus::getObjectPath()
QDBusConnection::systemBus() );
QDBusReply reply = interface.call("Introspect");
+ if (!reply.isValid()) {
+ qDebug()<<"execute dbus method 'Introspect' is invalid in func getObjectPath()";
+ }
+
if(reply.value().indexOf("org.freedesktop.NetworkManager.Device.Wired") != -1){
wiredPath = obj_path;
} else if (reply.value().indexOf("org.freedesktop.NetworkManager.Device.Wireless") != -1){
@@ -115,16 +134,20 @@ void KylinDBus::getPhysicalCarrierState(int n)
QDBusReply reply = interface.call("Get", "org.freedesktop.NetworkManager.Device.Wired", "Carrier");
- if (reply.value().toString() == "true"){
- isWiredCableOn = true;
- } else if (reply.value().toString() == "false"){
- isWiredCableOn = false;
- } else {
+ try{
+ if (reply.value().toString() == "true"){
+ isWiredCableOn = true;
+ if (n == 1){ this->mw->onPhysicalCarrierChanged(isWiredCableOn);}
+ } else if (reply.value().toString() == "false"){
+ isWiredCableOn = false;
+ if (n == 1){ this->mw->onPhysicalCarrierChanged(isWiredCableOn);}
+ } else {
+ throw -1;
+ }
+ }catch(...){
syslog(LOG_ERR, "Error occurred when get the property 'Carrier' of Wired");
qDebug()<<"Error occurred when get the property 'Carrier' of Wired";
}
-
- if (n == 1){ this->mw->onPhysicalCarrierChanged(isWiredCableOn);}
}
void KylinDBus::getLanHwAddressState()
@@ -135,7 +158,11 @@ void KylinDBus::getLanHwAddressState()
QDBusConnection::systemBus() );
QDBusReply lanReply = lanInterface.call("Get", "org.freedesktop.NetworkManager.Device.Wired", "HwAddress");
- dbusLanMac = lanReply.value().toString();
+ if (!lanReply.isValid()) {
+ qDebug()<<"can not get the attribute 'HwAddress' in func getLanHwAddressState()";
+ } else {
+ dbusLanMac = lanReply.value().toString();
+ }
}
void KylinDBus::getWiredCardName()
@@ -146,7 +173,11 @@ void KylinDBus::getWiredCardName()
QDBusConnection::systemBus() );
QDBusReply lanReply = lanInterface.call("Get", "org.freedesktop.NetworkManager.Device", "Interface");
- dbusLanCardName = lanReply.value().toString();
+ if (!lanReply.isValid()) {
+ qDebug()<<"can not get the attribute 'Interface' in func getWiredCardName()";
+ } else {
+ dbusLanCardName = lanReply.value().toString();
+ }
}
void KylinDBus::getWirelessCardName()
@@ -157,7 +188,11 @@ void KylinDBus::getWirelessCardName()
QDBusConnection::systemBus() );
QDBusReply lanReply = lanInterface.call("Get", "org.freedesktop.NetworkManager.Device", "Interface");
- dbusWiFiCardName = lanReply.value().toString();
+ if (!lanReply.isValid()) {
+ qDebug()<<"can not get the attribute 'Interface' in func getWirelessCardName()";
+ } else {
+ dbusWiFiCardName = lanReply.value().toString();
+ }
}
void KylinDBus::getLanIp(QString netName)
@@ -442,26 +477,26 @@ void KylinDBus::onAccessPointAdded(QDBusObjectPath objPath)
//qDebug()<<"debug: &&&&&&&&&&&&&"< reply = interface.call("GetPanelPosition", str);
- return reply;
+void KylinDBus::initTaskbarGsetting()
+{
+ if(QGSettings::isSchemaInstalled("org.ukui.panel.settings")) {
+ m_tastbar_gsettings = new QGSettings("org.ukui.panel.settings");
+ }
}
-int KylinDBus::getTaskbarHeight(QString str)
+int KylinDBus::getTaskbarHeight()
{
- QDBusInterface interface( "com.ukui.panel.desktop",
- "/",
- "com.ukui.panel.desktop",
- QDBusConnection::sessionBus() );
+ int h = m_tastbar_gsettings->get("panelsize").toInt();
+ return h;
+}
- QDBusReply reply = interface.call("GetPanelSize", str);
- return reply;
+int KylinDBus::getTaskbarPos()
+{
+ int p = m_tastbar_gsettings->get("panelposition").toInt();
+ return p;
}
void KylinDBus::getWifiSwitchState()
diff --git a/src/kylin-dbus-interface.h b/src/kylin-dbus-interface.h
index 4a4cde66..a3c5f3ae 100644
--- a/src/kylin-dbus-interface.h
+++ b/src/kylin-dbus-interface.h
@@ -27,8 +27,10 @@ public:
void getObjectPath();
int getAccessPointsNumber();
int getLanConnState();
- int getTaskbarPos(QString str);
- int getTaskbarHeight(QString str);
+
+ void initTaskbarGsetting();
+ int getTaskbarHeight();
+ int getTaskbarPos();
void getWifiSwitchState();
bool getSwitchStatus(QString key);
@@ -71,6 +73,7 @@ private:
bool isRunningFunction = false;
QTimer *time = nullptr;
+ QGSettings *m_tastbar_gsettings = nullptr;
QGSettings *m_gsettings = nullptr;
signals:
diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp
index 5aee82b0..3117e52c 100644
--- a/src/mainwindow.cpp
+++ b/src/mainwindow.cpp
@@ -87,8 +87,8 @@ MainWindow::MainWindow(QWidget *parent) :
trayIcon->show();
objKyDBus = new KylinDBus(this);
-
objNetSpeed = new NetworkSpeed();
+ //m_notify = new NotifySend();
this->confForm = new ConfForm();
@@ -126,13 +126,22 @@ MainWindow::~MainWindow()
void MainWindow::checkSingle()
{
- //int fd = open("/tmp/kylin-nm-lock", O_WRONLY | O_CREAT | O_TRUNC, S_IRUSR | S_IWUSR);
+ int fd = 0;
+ try{
+ QStringList homePath = QStandardPaths::standardLocations(QStandardPaths::HomeLocation);
+ QString lockPath = homePath.at(0) + "/.config/kylin-nm-lock";
+ fd = open(lockPath.toUtf8().data(), O_WRONLY | O_CREAT | O_TRUNC, S_IRUSR | S_IWUSR);
- QStringList homePath = QStandardPaths::standardLocations(QStandardPaths::HomeLocation);
- QString lockPath = homePath.at(0) + "/.config/kylin-nm-lock";
- int fd = open(lockPath.toUtf8().data(), O_WRONLY | O_CREAT | O_TRUNC, S_IRUSR | S_IWUSR);
+ if (fd < 0) {
+ throw -1;
+ }
+ }catch(...){
+ fd = open("/tmp/kylin-nm-lock", O_WRONLY | O_CREAT | O_TRUNC, S_IRUSR | S_IWUSR);
+ if (fd < 0) {
+ exit(0);
+ }
+ }
- if (fd < 0) { exit(1); }
if (lockf(fd, F_TLOCK, 0)) {
syslog(LOG_ERR, "Can't lock single file, kylin-network-manager is already running!");
@@ -424,8 +433,10 @@ void MainWindow::initNetwork()
mwBandWidth = bt->execChkLanWidth(lname);
// 开关状态
- qDebug()<<"lstate ="<lstate<<" wstate ="<wstate ;
- syslog(LOG_DEBUG, "state of switch: lstate =%d wstate =%d", iface->lstate, iface->wstate);
+ qDebug()<<"state of network: '0' is connection, '1' is disconnection, '2' is net device off";
+ syslog(LOG_DEBUG, "state of network: '0' is connection, '1' is disconnection, '2' is switch off ");
+ qDebug()<<"current network state: lan state ="<lstate<<", wifi state ="<wstate ;
+ syslog(LOG_DEBUG, "current network state: lan state =%d, wifi state =%d", iface->lstate, iface->wstate);
ui->lbBtnNetBG->setStyleSheet(btnOnQss);
if(iface->wstate == 0 || iface->wstate == 1){
@@ -455,6 +466,7 @@ void MainWindow::initNetwork()
ui->btnNetList->setStyleSheet("QPushButton{border:0px solid rgba(255,255,255,0);background-color:rgba(255,255,255,0);}");
ui->btnWifiList->setStyleSheet("QPushButton{border:none;}");
} else {
+ objKyDBus->setWifiSwitchState(false); //通知控制面板wifi未开启
if(iface->lstate != 2){
if (iface->lstate == 0) {
connLanDone(3);
@@ -692,8 +704,9 @@ void MainWindow::handleIconClicked()
// qDebug()<<"deskDupRect: "<getTaskbarPos("position");
- int m = objKyDBus->getTaskbarHeight("height");
+ int m = objKyDBus->getTaskbarHeight();
+ int n = objKyDBus->getTaskbarPos();
+ qDebug()<<"aaaaaaaa "<move(availableGeometry.x() + availableGeometry.width() - this->width(), screenMainRect.y() + screenGeometry.height() - availableGeometry.height() + m + d);
} else if (n == 2){
//任务栏在左侧
- if (screenGeometry.x() == 0){//主屏在左侧
- this->move(screenGeometry.width() - availableGeometry.width() + m + d, screenMainRect.y() + screenMainRect.height() - this->height());
- }else{//主屏在右侧
- this->move(screenGeometry.width() - availableGeometry.width() + m + d,screenDupRect.y() + screenDupRect.height() - this->height());
- }
+ this->move(m + d, screenMainRect.y() + screenMainRect.height() - this->height());
+// if (screenGeometry.x() == 0){//主屏在左侧
+// this->move(screenGeometry.width() - availableGeometry.width() + m + d, screenMainRect.y() + screenMainRect.height() - this->height());
+// }else{//主屏在右侧
+// this->move(screenGeometry.width() - availableGeometry.width() + m + d,screenDupRect.y() + screenDupRect.height() - this->height());
+// }
} else if (n == 3){
//任务栏在右侧
- if (screenGeometry.x() == 0){//主屏在左侧
- this->move(screenMainRect.width() + screenDupRect.width() - this->width() - m - d, screenDupRect.y() + screenDupRect.height() - this->height());
- }else{//主屏在右侧
- this->move(availableGeometry.x() + availableGeometry.width() - this->width() - m - d, screenMainRect.y() + screenMainRect.height() - this->height());
- }
+ this->move(screenMainRect.width() - this->width() - m - d, screenDupRect.y() + screenDupRect.height() - this->height());
+// if (screenGeometry.x() == 0){//主屏在左侧
+// this->move(screenMainRect.width() + screenDupRect.width() - this->width() - m - d, screenDupRect.y() + screenDupRect.height() - this->height());
+// }else{//主屏在右侧
+// this->move(availableGeometry.x() + availableGeometry.width() - this->width() - m - d, screenMainRect.y() + screenMainRect.height() - this->height());
+// }
}
} else if(screenGeometry.width() == availableGeometry.width() ){
if (trayIcon->geometry().y() > availableGeometry.height()/2){
@@ -748,8 +763,8 @@ void MainWindow::showTrayIconMenu()
// QRect deskDupRect = desktopWidget->availableGeometry(1);//获取可用桌面大小
QRect screenDupRect = desktopWidget->screenGeometry(1);//获取设备屏幕大小
- int n = objKyDBus->getTaskbarPos("position");
- int m = objKyDBus->getTaskbarHeight("height");
+ int m = objKyDBus->getTaskbarHeight();
+ int n = objKyDBus->getTaskbarPos();
int d = 2; //窗口边沿到任务栏距离
int s = 80; //窗口边沿到屏幕边沿距离
@@ -759,17 +774,19 @@ void MainWindow::showTrayIconMenu()
}else if(n == 1){ //任务栏在上侧
trayIconMenu->move(availableGeometry.x() + availableGeometry.width() - trayIconMenu->width(), screenMainRect.y() + screenGeometry.height() - availableGeometry.height() + m + d);
} else if (n == 2){ //任务栏在左侧
- if (screenGeometry.x() == 0){//主屏在左侧
- trayIconMenu->move(screenGeometry.width() - availableGeometry.width() + m + d, screenMainRect.y() + screenMainRect.height() - trayIconMenu->height() - s);
- }else{//主屏在右侧
- trayIconMenu->move(screenGeometry.width() - availableGeometry.width() + m + d,screenDupRect.y() + screenDupRect.height() - trayIconMenu->height() - s);
- }
+ trayIconMenu->move(m + d, screenMainRect.y() + screenMainRect.height() - trayIconMenu->height() - s);
+// if (screenGeometry.x() == 0){//主屏在左侧
+// trayIconMenu->move(screenGeometry.width() - availableGeometry.width() + m + d, screenMainRect.y() + screenMainRect.height() - trayIconMenu->height() - s);
+// }else{//主屏在右侧
+// trayIconMenu->move(screenGeometry.width() - availableGeometry.width() + m + d,screenDupRect.y() + screenDupRect.height() - trayIconMenu->height() - s);
+// }
} else if (n == 3){ //任务栏在右侧
- if (screenGeometry.x() == 0){//主屏在左侧
- trayIconMenu->move(screenMainRect.width() + screenDupRect.width() - trayIconMenu->width() - m - d, screenDupRect.y() + screenDupRect.height() - trayIconMenu->height() - s);
- }else{//主屏在右侧
- trayIconMenu->move(availableGeometry.x() + availableGeometry.width() - trayIconMenu->width() - m - d, screenMainRect.y() + screenMainRect.height() - trayIconMenu->height() - s);
- }
+ trayIconMenu->move(screenMainRect.width() - trayIconMenu->width() - m - d, screenDupRect.y() + screenDupRect.height() - trayIconMenu->height() - s);
+// if (screenGeometry.x() == 0){//主屏在左侧
+// trayIconMenu->move(screenMainRect.width() + screenDupRect.width() - trayIconMenu->width() - m - d, screenDupRect.y() + screenDupRect.height() - trayIconMenu->height() - s);
+// }else{//主屏在右侧
+// trayIconMenu->move(availableGeometry.x() + availableGeometry.width() - trayIconMenu->width() - m - d, screenMainRect.y() + screenMainRect.height() - trayIconMenu->height() - s);
+// }
}
} else if(screenGeometry.width() == availableGeometry.width() ){
if (trayIcon->geometry().y() > availableGeometry.height()/2){ //任务栏在下侧
@@ -1126,8 +1143,8 @@ void MainWindow::onBtnWifiClicked(int flag)
if (is_fly_mode_on == 0){
on_btnWifiList_clicked();
is_stop_check_net_state = 1;
- objKyDBus->setWifiCardState(true);
- objKyDBus->setWifiSwitchState(true);
+ objKyDBus->setWifiCardState(true);
+ objKyDBus->setWifiSwitchState(true);
lbTopWifiList->show();
btnAddNet->show();
@@ -1189,6 +1206,7 @@ void MainWindow::onBtnWifiClicked(int flag)
}
QString txt(tr("please insert the wireless network adapter"));
+ //m_notify->execNotifySend(txt);
QString cmd = "export LANG='en_US.UTF-8';export LANGUAGE='en_US';notify-send '" + txt + "' -t 3800";
int status = system(cmd.toUtf8().data());
if (status != 0){ syslog(LOG_ERR, "execute 'notify-send' in function 'onBtnWifiClicked' failed");}
@@ -1249,9 +1267,10 @@ void MainWindow::onBtnNetListClicked(int flag)
QString line(buf);
if(line.indexOf("ethernet") != -1){
QString txt(tr("Abnormal connection exist, program will delete it"));//仍然有连接异常的有线网络,断开异常连接的网络
+ //m_notify->execNotifySend(txt);
QString cmd = "export LANG='en_US.UTF-8';export LANGUAGE='en_US';notify-send '" + txt + "...' -t 3800";
- int status = system(cmd.toUtf8().data());
- if (status != 0){ syslog(LOG_ERR, "execute 'notify-send' in function 'onBtnNetListClicked' failed");}
+ int status = system(cmd.toUtf8().data());
+ if (status != 0){ syslog(LOG_ERR, "execute 'notify-send' in function 'onBtnNetListClicked' failed");}
is_stop_check_net_state = 1;
this->startLoading();
@@ -2104,6 +2123,7 @@ void MainWindow::activeLanDisconn()
syslog(LOG_DEBUG, "Wired net is disconnected");
QString txt(tr("Wired net is disconnected"));
+ //m_notify->execNotifySend(txt);
QString cmd = "export LANG='en_US.UTF-8';export LANGUAGE='en_US';notify-send '" + txt + "...' -t 3800";
int status1 = system(cmd.toUtf8().data());
if (status1 != 0){ syslog(LOG_ERR, "execute 'notify-send' in function 'execConnWifiPWD' failed");}
@@ -2131,6 +2151,7 @@ void MainWindow::activeStartLoading()
syslog(LOG_DEBUG, "Wi-Fi is disconnected");
QString txt(tr("Wi-Fi is disconnected"));
+ //m_notify->execNotifySend(txt);
QString cmd = "export LANG='en_US.UTF-8';export LANGUAGE='en_US';notify-send '" + txt + "...' -t 3800";
int status1 = system(cmd.toUtf8().data());
if (status1 != 0){ syslog(LOG_ERR, "execute 'notify-send' in function 'execConnWifiPWD' failed");}
@@ -2330,9 +2351,13 @@ void MainWindow::on_setNetSpeed()
{
if (this->isVisible() && is_stop_check_net_state==0){
if (is_btnWifiList_clicked == 1){
- objNetSpeed->getCurrentDownloadRates(objKyDBus->dbusWiFiCardName.toUtf8().data(), &start_rcv_rates, &start_tx_rates);
+ if ( objNetSpeed->getCurrentDownloadRates(objKyDBus->dbusWiFiCardName.toUtf8().data(), &start_rcv_rates, &start_tx_rates) == -1){
+ start_rcv_rates = end_rcv_rates;
+ }
}else if(is_btnNetList_clicked == 1){
- objNetSpeed->getCurrentDownloadRates(objKyDBus->dbusLanCardName.toUtf8().data(), &start_rcv_rates, &start_tx_rates);
+ if ( objNetSpeed->getCurrentDownloadRates(objKyDBus->dbusLanCardName.toUtf8().data(), &start_rcv_rates, &start_tx_rates) == -1){
+ start_tx_rates = end_tx_rates;
+ }
}
long int delta_rcv = (start_rcv_rates - end_rcv_rates)/800;
@@ -2407,7 +2432,9 @@ void MainWindow::connLanDone(int connFlag)
this->is_wired_line_ready = 1;
this->is_by_click_connect = 1;
this->ksnm->execGetLanList();
+
QString txt(tr("Conn Ethernet Success"));
+ //m_notify->execNotifySend(txt);
QString cmd = "export LANG='en_US.UTF-8';export LANGUAGE='en_US';notify-send '" + txt + "' -t 3800";
int status = system(cmd.toUtf8().data());
if (status != 0){ syslog(LOG_ERR, "execute 'notify-send' in function 'connLanDone' failed");}
@@ -2420,10 +2447,10 @@ void MainWindow::connLanDone(int connFlag)
qDebug()<<"without net line connect to computer";
this->is_wired_line_ready = 0; //without net line connect to computer
QString txt(tr("Conn Ethernet Fail"));
+ //m_notify->execNotifySend(txt);
QString cmd = "export LANG='en_US.UTF-8';export LANGUAGE='en_US';notify-send '" + txt + "' -t 3800";
int status = system(cmd.toUtf8().data());
if (status != 0){ syslog(LOG_ERR, "execute 'notify-send' in function 'connLanDone' failed");}
-
}
if(connFlag == 3){
@@ -2542,6 +2569,7 @@ void MainWindow::connWifiDone(int connFlag)
this->is_by_click_connect = 1;
this->ksnm->execGetWifiList();
QString txt(tr("Conn Wifi Success"));
+ //m_notify->execNotifySend(txt);
QString cmd = "export LANG='en_US.UTF-8';export LANGUAGE='en_US';notify-send '" + txt + "' -t 3800";
int status = system(cmd.toUtf8().data());
if (status != 0){ syslog(LOG_ERR, "execute 'notify-send' in function 'connWifiDone' failed");}
@@ -2550,6 +2578,12 @@ void MainWindow::connWifiDone(int connFlag)
//checkIfWifiConnect->start(8000);
} else if (connFlag == 1) {
is_stop_check_net_state = 0;
+
+ QString txt(tr("Confirm your Wi-Fi password or usable of wireless card"));
+ //m_notify->execNotifySend(txt);
+ QString cmd = "export LANG='en_US.UTF-8';export LANGUAGE='en_US';notify-send '" + txt + "...' -t 3800";
+ int status1 = system(cmd.toUtf8().data());
+ if (status1 != 0){ syslog(LOG_ERR, "execute 'notify-send' in function 'execConnWifiPWD' failed");}
} else if (connFlag == 3) {
syslog(LOG_DEBUG, "Launch kylin-nm, Wi-Fi already connected");
//syslog(LOG_DEBUG, "Launch kylin-nm, Wi-Fi already connected, will check if Wi-Fi disconnected circularly");
@@ -2594,7 +2628,7 @@ void MainWindow::on_isWifiConnect()
if (count_loop >= 2){ count_loop = 1;}
}
}
- \
+
delete loop_iface;
delete loop_bt;
}
diff --git a/src/mainwindow.h b/src/mainwindow.h
index ee1d2171..db908b4d 100644
--- a/src/mainwindow.h
+++ b/src/mainwindow.h
@@ -25,6 +25,7 @@
#include "kylin-dbus-interface.h"
#include "kylin-network-interface.h"
#include "utils.h"
+#include "notifysend.h"
#include
#include
@@ -141,6 +142,7 @@ public:
QString mwBandWidth;
KylinDBus *objKyDBus = nullptr;
NetworkSpeed *objNetSpeed = nullptr;
+ NotifySend *m_notify = nullptr;
//状态设置,0为假,1为真
int is_update_wifi_list = 0; //是否是update wifi列表,而不是load wifi列表
@@ -305,6 +307,7 @@ private slots:
void onBtnAddNetClicked();
void onBtnCreateNetClicked();
+
signals:
void disConnSparedNet(QString type);
diff --git a/src/notifysend.cpp b/src/notifysend.cpp
new file mode 100644
index 00000000..3066f660
--- /dev/null
+++ b/src/notifysend.cpp
@@ -0,0 +1,54 @@
+#include "notifysend.h"
+#include "ui_notifysend.h"
+
+NotifySend::NotifySend(QWidget *parent) :
+ QWidget(parent),
+ ui(new Ui::NotifySend)
+{
+ ui->setupUi(this);
+
+ this->setWindowFlags(Qt::FramelessWindowHint | Qt::Popup);
+ this->setAttribute(Qt::WA_TranslucentBackground);
+
+ QPainterPath path;
+ auto rect = this->rect();
+ rect.adjust(1, 1, -1, -1);
+ path.addRoundedRect(rect, 4, 4);
+ setProperty("blurRegion", QRegion(path.toFillPolygon().toPolygon()));
+
+ this->setStyleSheet("QWidget{border:none;border-radius:4px;}");
+ ui->backwidget->setStyleSheet("QWidget{border:1px solid rgba(255, 255, 255, 0.05);border-radius:4px;background:rgba(19,19,20,0.7);}");
+ ui->lbColor->setStyleSheet("QLabel{border:none;background:rgba(61,107,229,1);}");
+ ui->leText->setStyleSheet("QLineEdit{border:none;background:transparent;font-size:14px;color:white;font-size:14px;}");
+ ui->btnClose->setStyleSheet("QPushButton{background-image:url(:/res/g/close_white.png);background-color:transparent;border:none;}");
+ ui->btnClose->setFocusPolicy(Qt::NoFocus);
+
+ QRect availableGeometry = qApp->primaryScreen()->availableGeometry();
+ int d = 10; //窗口上边沿到屏幕边沿距离
+ int s = 10; //窗口右边沿到屏幕边沿距离
+
+ this->move(availableGeometry.x() + availableGeometry.width() - this->width() - s, availableGeometry.y() + d);
+}
+
+NotifySend::~NotifySend()
+{
+ delete ui;
+}
+
+void NotifySend::execNotifySend(QString text)
+{
+ ui->leText->setText(text);
+ this->show();
+
+ QTimer::singleShot(4000, this, SLOT(closeNotifyDialog() ));
+}
+
+void NotifySend::closeNotifyDialog(){
+ ui->leText->setText("");
+ this->hide();
+}
+
+void NotifySend::on_btnClose_clicked()
+{
+ this->hide();
+}
diff --git a/src/notifysend.h b/src/notifysend.h
new file mode 100644
index 00000000..8a103135
--- /dev/null
+++ b/src/notifysend.h
@@ -0,0 +1,34 @@
+#ifndef NOTIFYSEND_H
+#define NOTIFYSEND_H
+
+#include
+#include
+#include
+
+namespace Ui {
+class NotifySend;
+}
+
+class NotifySend : public QWidget
+{
+ Q_OBJECT
+
+public:
+ explicit NotifySend(QWidget *parent = nullptr);
+ ~NotifySend();
+
+ void execNotifySend(QString text);
+
+private:
+ Ui::NotifySend *ui;
+
+private slots:
+ void closeNotifyDialog();
+
+ void on_btnClose_clicked();
+
+signals:
+ void timeout();
+};
+
+#endif // NOTIFYSEND_H
diff --git a/src/notifysend.ui b/src/notifysend.ui
new file mode 100644
index 00000000..4c23ef41
--- /dev/null
+++ b/src/notifysend.ui
@@ -0,0 +1,69 @@
+
+
+ NotifySend
+
+
+
+ 0
+ 0
+ 400
+ 70
+
+
+
+ Form
+
+
+
+
+ 0
+ 0
+ 60
+ 70
+
+
+
+
+
+
+
+
+
+ 360
+ 20
+ 30
+ 30
+
+
+
+
+
+
+
+
+
+ 80
+ 20
+ 260
+ 27
+
+
+
+
+
+
+ 0
+ 0
+ 400
+ 70
+
+
+
+ backwidget
+ lbColor
+ btnClose
+ leText
+
+
+
+
diff --git a/src/oneconnform.cpp b/src/oneconnform.cpp
index 0641be81..bcdbd522 100644
--- a/src/oneconnform.cpp
+++ b/src/oneconnform.cpp
@@ -112,6 +112,8 @@ OneConnForm::OneConnForm(QWidget *parent, MainWindow *mainWindow, ConfForm *conf
ui->btnInfo->setAttribute(Qt::WA_Hover,true);
ui->btnInfo->installEventFilter(this);
+ //m_notify = new NotifySend();
+
connect(ui->lePassword, SIGNAL(returnPressed()), this, SLOT(on_btnConnPWD_clicked()));
ui->btnConn->setShortcut(Qt::Key_Return);//将字母区回车键与登录按钮绑定在一起
@@ -123,6 +125,7 @@ OneConnForm::OneConnForm(QWidget *parent, MainWindow *mainWindow, ConfForm *conf
OneConnForm::~OneConnForm()
{
+ m_notify->deleteLater();
delete ui;
}
@@ -603,6 +606,7 @@ void OneConnForm::slotConnWifiResult(int connFlag){
// 使用配置文件连接失败,需要删除该配置文件
QString txt(tr("Conn Wifi Failed"));//"连接 Wifi 失败"
syslog(LOG_DEBUG, "Try to connect wifi named %s, but failed, will delete it's configuration file", ui->lbName->text().toUtf8().data());
+ //m_notify->execNotifySend(txt);
QString cmd = "export LANG='en_US.UTF-8';export LANGUAGE='en_US';nmcli connection delete '" + ui->lbName->text() + "';notify-send '" + txt + "...' -t 3800";
int status = system(cmd.toUtf8().data());
if (status != 0){ syslog(LOG_ERR, "execute 'nmcli connection delete' in function 'slotConnWifiResult' failed");}
diff --git a/src/oneconnform.h b/src/oneconnform.h
index ec10074f..32b2931c 100644
--- a/src/oneconnform.h
+++ b/src/oneconnform.h
@@ -31,6 +31,7 @@
#include "kylin-network-interface.h"
#include "backthread.h"
#include "ksimplenm.h"
+#include "notifysend.h"
#define FRAME_SPEED 150
#define LIMIT_TIME 30*1000
@@ -80,6 +81,7 @@ public:
void setLePassword();
+ NotifySend *m_notify = nullptr;
QString wifiName;
bool isSelected;
bool isActive;
diff --git a/src/utils.cpp b/src/utils.cpp
index 9f2c4226..3ffdc5a6 100644
--- a/src/utils.cpp
+++ b/src/utils.cpp
@@ -85,12 +85,14 @@ int NetworkSpeed::getCurrentDownloadRates(char *netname, long *save_rate, long *
char tmp_value[128];
if((NULL == netname)||(NULL == save_rate)||(NULL == tx_rate)){
- printf("bad param\n");
+ qDebug()<<"parameter pass to function getCurrentDownloadRates() error";
+ syslog(LOG_ERR, "parameter pass to function getCurrentDownloadRates() error");
return -1;
}
if ( (net_dev_file=fopen("/proc/net/dev", "r")) == NULL ){ //打开文件/pro/net/dev/,从中读取流量数据
- printf("open file /proc/net/dev/ error!\n");
+ qDebug()<<"error occured when try to open file /proc/net/dev/";
+ syslog(LOG_ERR, "error occured when try to open file /proc/net/dev/");
return -1;
}
memset(buffer,0,sizeof(buffer));
@@ -99,10 +101,9 @@ int NetworkSpeed::getCurrentDownloadRates(char *netname, long *save_rate, long *
match = strstr(buffer,netname);
if(NULL == match){
- //printf("no eth0 keyword to find!\n");
+ // qDebug()<<"No eth0 keyword to find!";
continue;
}else{
- //printf("%s\n",buffer);
match = match + strlen(netname) + strlen(":"); //地址偏移到冒号
sscanf(match,"%ld ",save_rate);
memset(tmp_value,0,sizeof(tmp_value));
@@ -121,7 +122,6 @@ int NetworkSpeed::getCurrentDownloadRates(char *netname, long *save_rate, long *
counter ++;
}
}
- //printf("%s save_rate:%ld tx_rate:%ld\n",netname,*save_rate,*tx_rate);
}
}
diff --git a/translations/kylin-nm_bo.ts b/translations/kylin-nm_bo.ts
index d7c7e9c7..d04ec70d 100644
--- a/translations/kylin-nm_bo.ts
+++ b/translations/kylin-nm_bo.ts
@@ -1,104 +1,96 @@
-
- BackThread
-
-
-
-
-
-
ConfForm
-
-
+
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
@@ -155,26 +147,6 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
DlgConnHidWifiLeap
@@ -1175,26 +1147,6 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
DlgHotspotCreate
@@ -1247,183 +1199,196 @@
MainWindow
-
-
+
+
-
-
+
+
-
-
+
+
-
-
+
+
-
+
-
+
-
-
-
-
-
-
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
-
+
-
-
+
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
+
+
+
+
+
-
+
-
+
-
+
-
+
-
+
-
+
+
+ NotifySend
+
+
+
+
+
+
OneConnForm
-
+
-
-
-
-
+
+
+
+
-
+
-
-
+
+
-
+
-
+
-
+
@@ -1431,24 +1396,24 @@
OneLancForm
-
+
-
-
+
+
-
+
-
-
+
+
diff --git a/translations/kylin-nm_zh_CN.qm b/translations/kylin-nm_zh_CN.qm
index 91ced1f0..ccee5390 100644
Binary files a/translations/kylin-nm_zh_CN.qm and b/translations/kylin-nm_zh_CN.qm differ
diff --git a/translations/kylin-nm_zh_CN.ts b/translations/kylin-nm_zh_CN.ts
index 5e4c8856..032507c6 100644
--- a/translations/kylin-nm_zh_CN.ts
+++ b/translations/kylin-nm_zh_CN.ts
@@ -4,91 +4,90 @@
BackThread
-
- 请再次确认Wi-Fi密码
+ 请再次确认Wi-Fi密码
ConfForm
-
-
+
+
编辑网络设置
-
+
网络名称:
-
+
编辑IP设置:
-
+
IP地址:
-
+
子网掩码:
-
+
默认网关:
-
+
首选DNS:
-
+
备选DNS:
-
+
网络设置
-
+
自动(DHCP)
-
+
手动
-
+
取消
-
+
保存
-
+
确定
-
+
已创建新的有线网络
-
+
新的网络配置已经完成
@@ -101,12 +100,12 @@
新的设置已经生效
-
+
新的设置已经生效
-
+
新建有线网络
@@ -159,24 +158,20 @@
WPA 及 WPA2 个人
-
- WEP 40/128 位密钥(十六进制或ASCII)
+ WEP 40/128 位密钥(十六进制或ASCII)
-
- WEP 128 位密码句
+ WEP 128 位密码句
-
- 动态 WEP (802.1x)
+ 动态 WEP (802.1x)
-
- WPA 及 WPA2 企业
+ WPA 及 WPA2 企业
@@ -1184,24 +1179,20 @@
WPA 及 WPA2 个人
-
- WEP 40/128 位密钥(十六进制或ASCII)
+ WEP 40/128 位密钥(十六进制或ASCII)
-
- WEP 128 位密码句
+ WEP 128 位密码句
-
- 动态 WEP (802.1x)
+ 动态 WEP (802.1x)
-
- WPA 及 WPA2 企业
+ WPA 及 WPA2 企业
@@ -1255,8 +1246,8 @@
MainWindow
-
-
+
+
网络工具
@@ -1265,14 +1256,14 @@
网络
-
-
+
+
网络配置
-
-
+
+
有线网络
@@ -1281,8 +1272,8 @@
加入网络
-
-
+
+
无线网络
@@ -1295,92 +1286,97 @@
已关闭
-
+
个人热点
-
+
飞行模式
-
+
显示网络连接界面
-
-
-
-
-
-
+
+
+
+
+
+
当前未连接任何网络
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
未连接
-
+
列表中无其他有线网络
-
+
未检测到其他无线网络
-
+
断开有线网络
-
+
断开无线网络
-
+
+
+ 请确认Wi-Fi密码或无线设备
+
+
+
可用有线网络列表
-
+
新建网络
-
+
加入网络
-
+
列表暂无可连接网络
-
-
+
+
已连接,
-
+
可用无线网络列表
@@ -1393,12 +1389,12 @@
打开无线网开关前保持有线网开关打开
-
+
请先插入无线网卡
-
+
正在断开异常连接的网络
@@ -1411,25 +1407,33 @@
正在更新 Wi-Fi列表
-
+
连接有线网络成功
-
+
连接有线网络失败
-
+
连接无线网络成功
+
+ NotifySend
+
+
+
+ --
+
+
OneConnForm
-
+
--
@@ -1442,26 +1446,26 @@
设置
-
-
-
-
+
+
+
+
连接
-
+
断开
-
-
+
+
输入密码...
-
+
连接到隐藏 Wi-Fi 网络
@@ -1478,12 +1482,12 @@
速率
-
+
无
-
+
连接无线网络失败
@@ -1491,7 +1495,7 @@
OneLancForm
-
+
--
@@ -1500,19 +1504,19 @@
设置
-
-
+
+
连接
-
+
断开
-
-
+
+
未配置
diff --git a/wireless-security/dlgconnhidwifi.cpp b/wireless-security/dlgconnhidwifi.cpp
index afaaed97..c5960b0f 100644
--- a/wireless-security/dlgconnhidwifi.cpp
+++ b/wireless-security/dlgconnhidwifi.cpp
@@ -94,11 +94,11 @@ DlgConnHidWifi::DlgConnHidWifi(int type, MainWindow *mainWindow, QWidget *parent
ui->cbxSecurity->addItem(tr("None")); //无
ui->cbxSecurity->addItem(tr("WPA & WPA2 Personal")); //WPA 及 WPA2 个人
- ui->cbxSecurity->addItem(tr("WEP 40/128-bit Key (Hex or ASCII)")); //WEP 40/128 位密钥(十六进制或ASCII)
- ui->cbxSecurity->addItem(tr("WEP 128-bit Passphrase")); //WEP 128 位密码句
- ui->cbxSecurity->addItem("LEAP");
- ui->cbxSecurity->addItem(tr("Dynamic WEP (802.1X)")); //动态 WEP (802.1x)
- ui->cbxSecurity->addItem(tr("WPA & WPA2 Enterprise")); //WPA 及 WPA2 企业
+// ui->cbxSecurity->addItem(tr("WEP 40/128-bit Key (Hex or ASCII)")); //WEP 40/128 位密钥(十六进制或ASCII)
+// ui->cbxSecurity->addItem(tr("WEP 128-bit Passphrase")); //WEP 128 位密码句
+// ui->cbxSecurity->addItem("LEAP");
+// ui->cbxSecurity->addItem(tr("Dynamic WEP (802.1X)")); //动态 WEP (802.1x)
+// ui->cbxSecurity->addItem(tr("WPA & WPA2 Enterprise")); //WPA 及 WPA2 企业
ui->cbxSecurity->setCurrentIndex(0);
connect(ui->cbxSecurity,SIGNAL(currentIndexChanged(QString)),this,SLOT(changeDialog()));
diff --git a/wireless-security/dlgconnhidwifi.ui b/wireless-security/dlgconnhidwifi.ui
index 32885f76..bd6906fb 100644
--- a/wireless-security/dlgconnhidwifi.ui
+++ b/wireless-security/dlgconnhidwifi.ui
@@ -56,7 +56,7 @@
76
- 176
+ 221
90
20
@@ -74,7 +74,7 @@
175
- 215
+ 170
182
32
@@ -92,7 +92,7 @@
76
- 221
+ 176
90
20
@@ -110,7 +110,7 @@
175
- 170
+ 215
182
32
diff --git a/wireless-security/dlgconnhidwifiwpa.cpp b/wireless-security/dlgconnhidwifiwpa.cpp
index 45d30de9..8cb8a173 100644
--- a/wireless-security/dlgconnhidwifiwpa.cpp
+++ b/wireless-security/dlgconnhidwifiwpa.cpp
@@ -100,11 +100,11 @@ DlgConnHidWifiWpa::DlgConnHidWifiWpa(int type, MainWindow *mainWindow, QWidget *
ui->cbxSecurity->addItem(tr("None")); //无
ui->cbxSecurity->addItem(tr("WPA & WPA2 Personal")); //WPA 及 WPA2 个人
- ui->cbxSecurity->addItem(tr("WEP 40/128-bit Key (Hex or ASCII)")); //WEP 40/128 位密钥(十六进制或ASCII)
- ui->cbxSecurity->addItem(tr("WEP 128-bit Passphrase")); //WEP 128 位密码句
- ui->cbxSecurity->addItem("LEAP");
- ui->cbxSecurity->addItem(tr("Dynamic WEP (802.1X)")); //动态 WEP (802.1x)
- ui->cbxSecurity->addItem(tr("WPA & WPA2 Enterprise")); //WPA 及 WPA2 企业
+// ui->cbxSecurity->addItem(tr("WEP 40/128-bit Key (Hex or ASCII)")); //WEP 40/128 位密钥(十六进制或ASCII)
+// ui->cbxSecurity->addItem(tr("WEP 128-bit Passphrase")); //WEP 128 位密码句
+// ui->cbxSecurity->addItem("LEAP");
+// ui->cbxSecurity->addItem(tr("Dynamic WEP (802.1X)")); //动态 WEP (802.1x)
+// ui->cbxSecurity->addItem(tr("WPA & WPA2 Enterprise")); //WPA 及 WPA2 企业
ui->cbxSecurity->setCurrentIndex(1);
connect(ui->cbxSecurity,SIGNAL(currentIndexChanged(QString)),this,SLOT(changeDialog()));
diff --git a/wireless-security/dlgconnhidwifiwpa.ui b/wireless-security/dlgconnhidwifiwpa.ui
index d8b5b4a5..1c6b36c5 100644
--- a/wireless-security/dlgconnhidwifiwpa.ui
+++ b/wireless-security/dlgconnhidwifiwpa.ui
@@ -17,7 +17,7 @@
76
- 176
+ 221
90
20
@@ -35,7 +35,7 @@
76
- 221
+ 176
90
20
@@ -125,7 +125,7 @@
175
- 215
+ 170
182
32
@@ -200,7 +200,7 @@
175
- 170
+ 215
182
32