Rename some files and class

This commit is contained in:
chenlelin 2020-11-24 15:41:24 +08:00
parent 68cd21dfcb
commit 8cf5b37009
38 changed files with 480 additions and 480 deletions

View File

@ -59,16 +59,16 @@ SOURCES += \
src/onelancform.cpp \
src/switchbutton.cpp \
src/utils.cpp \
wireless-security/dlgconnhidwifi.cpp \
wireless-security/dlgconnhidwifisecfast.cpp \
wireless-security/dlgconnhidwifisectunneltls.cpp \
wireless-security/dlgconnhidwifisecpeap.cpp \
wireless-security/dlgconnhidwifisectls.cpp \
wireless-security/dlgconnhidwifisecleap.cpp \
wireless-security/dlgconnhidwifisecpwd.cpp \
wireless-security/dlgconnhidwifiwep.cpp \
wireless-security/dlgconnhidwifileap.cpp \
wireless-security/dlgconnhidwifiwpa.cpp \
wireless-security/dlghidewifi.cpp \
wireless-security/dlghidewifieapfast.cpp \
wireless-security/dlghidewifieapleap.cpp \
wireless-security/dlghidewifieappeap.cpp \
wireless-security/dlghidewifieappwd.cpp \
wireless-security/dlghidewifieaptls.cpp \
wireless-security/dlghidewifieapttls.cpp \
wireless-security/dlghidewifileap.cpp \
wireless-security/dlghidewifiwep.cpp \
wireless-security/dlghidewifiwpa.cpp \
wireless-security/kylinheadfile.cpp \
hot-spot/dlghotspotcreate.cpp
@ -85,16 +85,16 @@ HEADERS += \
src/onelancform.h \
src/switchbutton.h \
src/utils.h \
wireless-security/dlgconnhidwifi.h \
wireless-security/dlgconnhidwifisecfast.h \
wireless-security/dlgconnhidwifisectunneltls.h \
wireless-security/dlgconnhidwifisecpeap.h \
wireless-security/dlgconnhidwifisectls.h \
wireless-security/dlgconnhidwifisecleap.h \
wireless-security/dlgconnhidwifisecpwd.h \
wireless-security/dlgconnhidwifiwep.h \
wireless-security/dlgconnhidwifileap.h \
wireless-security/dlgconnhidwifiwpa.h \
wireless-security/dlghidewifi.h \
wireless-security/dlghidewifieapfast.h \
wireless-security/dlghidewifieapleap.h \
wireless-security/dlghidewifieappeap.h \
wireless-security/dlghidewifieappwd.h \
wireless-security/dlghidewifieaptls.h \
wireless-security/dlghidewifieapttls.h \
wireless-security/dlghidewifileap.h \
wireless-security/dlghidewifiwep.h \
wireless-security/dlghidewifiwpa.h \
wireless-security/kylinheadfile.h \
hot-spot/dlghotspotcreate.h
@ -103,17 +103,17 @@ FORMS += \
src/mainwindow.ui \
src/oneconnform.ui \
src/onelancform.ui \
wireless-security/dlgconnhidwifi.ui \
wireless-security/dlgconnhidwifisecfast.ui \
wireless-security/dlgconnhidwifisectunneltls.ui \
wireless-security/dlgconnhidwifisecpeap.ui \
wireless-security/dlgconnhidwifisectls.ui \
wireless-security/dlgconnhidwifisecleap.ui \
wireless-security/dlgconnhidwifisecpwd.ui \
wireless-security/dlgconnhidwifiwep.ui \
wireless-security/dlgconnhidwifileap.ui \
wireless-security/dlgconnhidwifiwpa.ui \
hot-spot/dlghotspotcreate.ui
hot-spot/dlghotspotcreate.ui \
wireless-security/dlghidewifi.ui \
wireless-security/dlghidewifieapfast.ui \
wireless-security/dlghidewifieapleap.ui \
wireless-security/dlghidewifieappeap.ui \
wireless-security/dlghidewifieappwd.ui \
wireless-security/dlghidewifieaptls.ui \
wireless-security/dlghidewifieapttls.ui \
wireless-security/dlghidewifileap.ui \
wireless-security/dlghidewifiwep.ui \
wireless-security/dlghidewifiwpa.ui
RESOURCES += \
nmqrc.qrc

View File

@ -19,7 +19,7 @@
#include "mainwindow.h"
#include "ksimplenm.h"
#include "kylin-network-interface.h"
#include "wireless-security/dlgconnhidwifi.h"
#include "wireless-security/dlghidewifi.h"
#include <QTranslator>
#include <QLocale>

View File

@ -21,7 +21,7 @@
#include "oneconnform.h"
#include "onelancform.h"
#include "hot-spot/dlghotspotcreate.h"
#include "wireless-security/dlgconnhidwifi.h"
#include "wireless-security/dlghidewifi.h"
#include <KWindowEffects>
#include <QFont>
@ -1905,7 +1905,7 @@ void MainWindow::on_btnHotspot_clicked()
void MainWindow::onBtnAddNetClicked()
{
QApplication::setQuitOnLastWindowClosed(false);
DlgConnHidWifi *connHidWifi = new DlgConnHidWifi(0, this);
DlgHideWifi *connHidWifi = new DlgHideWifi(0, this);
connect(connHidWifi, SIGNAL(reSetWifiList() ), this, SLOT(on_btnWifiList_clicked()) );
connHidWifi->show();
}

View File

@ -21,7 +21,7 @@
#include "mainwindow.h"
#include "kylin-dbus-interface.h"
#include "kylin-network-interface.h"
#include "wireless-security/dlgconnhidwifi.h"
#include "wireless-security/dlghidewifi.h"
#include "utils.h"
#include <QtDBus/QDBusConnection>
@ -543,7 +543,7 @@ void OneConnForm::on_btnConnPWD_clicked()
void OneConnForm::on_btnHideConn_clicked()
{
QApplication::setQuitOnLastWindowClosed(false);
DlgConnHidWifi *connHidWifi = new DlgConnHidWifi(0, mw);
DlgHideWifi *connHidWifi = new DlgHideWifi(0, mw);
connect(connHidWifi, SIGNAL(reSetWifiList() ), mw, SLOT(on_btnWifiList_clicked()) );
connHidWifi->show();
}

View File

@ -111,7 +111,7 @@
</message>
</context>
<context>
<name>DlgConnHidWifi</name>
<name>DlgHideWifi</name>
<message>
<location filename="../wireless-security/dlgconnhidwifi.ui" line="14"/>
<source>Connect to Hidden Wi-Fi Network</source>
@ -169,7 +169,7 @@
</message>
</context>
<context>
<name>DlgConnHidWifiLeap</name>
<name>DlgHideWifiLeap</name>
<message>
<location filename="../wireless-security/dlgconnhidwifileap.ui" line="14"/>
<source>Connect to Hidden Wi-Fi Network</source>
@ -252,7 +252,7 @@
</message>
</context>
<context>
<name>DlgConnHidWifiSecFast</name>
<name>DlgHideWifiEapFast</name>
<message>
<location filename="../wireless-security/dlgconnhidwifisecfast.ui" line="14"/>
<source>Connect to Hidden Wi-Fi Network</source>
@ -386,7 +386,7 @@
</message>
</context>
<context>
<name>DlgConnHidWifiSecLeap</name>
<name>DlgHideWifiEapLeap</name>
<message>
<location filename="../wireless-security/dlgconnhidwifisecleap.ui" line="14"/>
<source>Connect to Hidden Wi-Fi Network</source>
@ -484,7 +484,7 @@
</message>
</context>
<context>
<name>DlgConnHidWifiSecPeap</name>
<name>DlgHideWifiEapPeap</name>
<message>
<location filename="../wireless-security/dlgconnhidwifisecpeap.ui" line="14"/>
<source>Connect to Hidden Wi-Fi Network</source>
@ -633,7 +633,7 @@
</message>
</context>
<context>
<name>DlgConnHidWifiSecPwd</name>
<name>DlgHideWifiEapPwd</name>
<message>
<location filename="../wireless-security/dlgconnhidwifisecpwd.ui" line="14"/>
<source>Connect to Hidden Wi-Fi Network</source>
@ -731,7 +731,7 @@
</message>
</context>
<context>
<name>DlgConnHidWifiSecTls</name>
<name>DlgHideWifiEapTls</name>
<message>
<location filename="../wireless-security/dlgconnhidwifisectls.ui" line="14"/>
<source>Connect to Hidden Wi-Fi Network</source>
@ -859,7 +859,7 @@
</message>
</context>
<context>
<name>DlgConnHidWifiSecTunnelTLS</name>
<name>DlgHideWifiEapTTLS</name>
<message>
<location filename="../wireless-security/dlgconnhidwifisectunneltls.ui" line="14"/>
<source>Connect to Hidden Wi-Fi Network</source>
@ -993,7 +993,7 @@
</message>
</context>
<context>
<name>DlgConnHidWifiWep</name>
<name>DlgHideWifiWep</name>
<message>
<location filename="../wireless-security/dlgconnhidwifiwep.ui" line="14"/>
<source>Connect to Hidden Wi-Fi Network</source>
@ -1096,7 +1096,7 @@
</message>
</context>
<context>
<name>DlgConnHidWifiWpa</name>
<name>DlgHideWifiWpa</name>
<message>
<location filename="../wireless-security/dlgconnhidwifiwpa.ui" line="14"/>
<source>Connect to Hidden Wi-Fi Network</source>

View File

@ -126,7 +126,7 @@
</message>
</context>
<context>
<name>DlgConnHidWifi</name>
<name>DlgHideWifi</name>
<message>
<location filename="../wireless-security/dlgconnhidwifi.cpp" line="70"/>
<source>Add Hidden Wi-Fi</source>
@ -196,7 +196,7 @@
</message>
</context>
<context>
<name>DlgConnHidWifiLeap</name>
<name>DlgHideWifiLeap</name>
<message>
<location filename="../wireless-security/dlgconnhidwifileap.ui" line="14"/>
<source>Connect to Hidden Wi-Fi Network</source>
@ -279,7 +279,7 @@
</message>
</context>
<context>
<name>DlgConnHidWifiSecFast</name>
<name>DlgHideWifiEapFast</name>
<message>
<location filename="../wireless-security/dlgconnhidwifisecfast.ui" line="14"/>
<source>Connect to Hidden Wi-Fi Network</source>
@ -413,7 +413,7 @@
</message>
</context>
<context>
<name>DlgConnHidWifiSecLeap</name>
<name>DlgHideWifiEapLeap</name>
<message>
<location filename="../wireless-security/dlgconnhidwifisecleap.ui" line="14"/>
<source>Connect to Hidden Wi-Fi Network</source>
@ -511,7 +511,7 @@
</message>
</context>
<context>
<name>DlgConnHidWifiSecPeap</name>
<name>DlgHideWifiEapPeap</name>
<message>
<location filename="../wireless-security/dlgconnhidwifisecpeap.ui" line="14"/>
<source>Connect to Hidden Wi-Fi Network</source>
@ -660,7 +660,7 @@
</message>
</context>
<context>
<name>DlgConnHidWifiSecPwd</name>
<name>DlgHideWifiEapPwd</name>
<message>
<location filename="../wireless-security/dlgconnhidwifisecpwd.ui" line="14"/>
<source>Connect to Hidden Wi-Fi Network</source>
@ -758,7 +758,7 @@
</message>
</context>
<context>
<name>DlgConnHidWifiSecTls</name>
<name>DlgHideWifiEapTls</name>
<message>
<location filename="../wireless-security/dlgconnhidwifisectls.ui" line="14"/>
<source>Connect to Hidden Wi-Fi Network</source>
@ -898,7 +898,7 @@
</message>
</context>
<context>
<name>DlgConnHidWifiSecTunnelTLS</name>
<name>DlgHideWifiEapTTLS</name>
<message>
<location filename="../wireless-security/dlgconnhidwifisectunneltls.ui" line="14"/>
<source>Connect to Hidden Wi-Fi Network</source>
@ -1032,7 +1032,7 @@
</message>
</context>
<context>
<name>DlgConnHidWifiWep</name>
<name>DlgHideWifiWep</name>
<message>
<location filename="../wireless-security/dlgconnhidwifiwep.ui" line="14"/>
<source>Connect to Hidden Wi-Fi Network</source>
@ -1135,7 +1135,7 @@
</message>
</context>
<context>
<name>DlgConnHidWifiWpa</name>
<name>DlgHideWifiWpa</name>
<message>
<location filename="../wireless-security/dlgconnhidwifiwpa.ui" line="14"/>
<source>Connect to Hidden Wi-Fi Network</source>

View File

@ -126,7 +126,7 @@
</message>
</context>
<context>
<name>DlgConnHidWifi</name>
<name>DlgHideWifi</name>
<message>
<location filename="../wireless-security/dlgconnhidwifi.cpp" line="70"/>
<source>Add Hidden Wi-Fi</source>
@ -196,7 +196,7 @@
</message>
</context>
<context>
<name>DlgConnHidWifiLeap</name>
<name>DlgHideWifiLeap</name>
<message>
<location filename="../wireless-security/dlgconnhidwifileap.ui" line="14"/>
<source>Connect to Hidden Wi-Fi Network</source>
@ -279,7 +279,7 @@
</message>
</context>
<context>
<name>DlgConnHidWifiSecFast</name>
<name>DlgHideWifiEapFast</name>
<message>
<location filename="../wireless-security/dlgconnhidwifisecfast.ui" line="14"/>
<source>Connect to Hidden Wi-Fi Network</source>
@ -413,7 +413,7 @@
</message>
</context>
<context>
<name>DlgConnHidWifiSecLeap</name>
<name>DlgHideWifiEapLeap</name>
<message>
<location filename="../wireless-security/dlgconnhidwifisecleap.ui" line="14"/>
<source>Connect to Hidden Wi-Fi Network</source>
@ -511,7 +511,7 @@
</message>
</context>
<context>
<name>DlgConnHidWifiSecPeap</name>
<name>DlgHideWifiEapPeap</name>
<message>
<location filename="../wireless-security/dlgconnhidwifisecpeap.ui" line="14"/>
<source>Connect to Hidden Wi-Fi Network</source>
@ -660,7 +660,7 @@
</message>
</context>
<context>
<name>DlgConnHidWifiSecPwd</name>
<name>DlgHideWifiEapPwd</name>
<message>
<location filename="../wireless-security/dlgconnhidwifisecpwd.ui" line="14"/>
<source>Connect to Hidden Wi-Fi Network</source>
@ -758,7 +758,7 @@
</message>
</context>
<context>
<name>DlgConnHidWifiSecTls</name>
<name>DlgHideWifiEapTls</name>
<message>
<location filename="../wireless-security/dlgconnhidwifisectls.ui" line="14"/>
<source>Connect to Hidden Wi-Fi Network</source>
@ -898,7 +898,7 @@
</message>
</context>
<context>
<name>DlgConnHidWifiSecTunnelTLS</name>
<name>DlgHideWifiEapTTLS</name>
<message>
<location filename="../wireless-security/dlgconnhidwifisectunneltls.ui" line="14"/>
<source>Connect to Hidden Wi-Fi Network</source>
@ -1032,7 +1032,7 @@
</message>
</context>
<context>
<name>DlgConnHidWifiWep</name>
<name>DlgHideWifiWep</name>
<message>
<location filename="../wireless-security/dlgconnhidwifiwep.ui" line="14"/>
<source>Connect to Hidden Wi-Fi Network</source>
@ -1135,7 +1135,7 @@
</message>
</context>
<context>
<name>DlgConnHidWifiWpa</name>
<name>DlgHideWifiWpa</name>
<message>
<location filename="../wireless-security/dlgconnhidwifiwpa.ui" line="14"/>
<source>Connect to Hidden Wi-Fi Network</source>

View File

@ -17,9 +17,9 @@
*/
#include "dlgconnhidwifi.h"
#include "dlghidewifi.h"
#include "kylinheadfile.h"
#include "ui_dlgconnhidwifi.h"
#include "ui_dlghidewifi.h"
#include "src/backthread.h"
#include "src/mainwindow.h"
#include "src/kylin-dbus-interface.h"
@ -29,10 +29,10 @@
#include <QStandardItemModel>
#include <QDir>
DlgConnHidWifi::DlgConnHidWifi(int type, MainWindow *mainWindow, QWidget *parent) :
DlgHideWifi::DlgHideWifi(int type, MainWindow *mainWindow, QWidget *parent) :
isUsed(type),
QDialog(parent),
ui(new Ui::DlgConnHidWifi)
ui(new Ui::DlgHideWifi)
{
ui->setupUi(this);
@ -78,7 +78,7 @@ DlgConnHidWifi::DlgConnHidWifi(int type, MainWindow *mainWindow, QWidget *parent
QString tmpPath = "/tmp/kylin-nm-connshow-" + QDir::home().dirName();
QString cmd = "nmcli connection show>" + tmpPath;
int status = system(cmd.toUtf8().data());
if (status != 0){ syslog(LOG_ERR, "execute 'nmcli connection show' in function 'DlgConnHidWifi' failed");}
if (status != 0){ syslog(LOG_ERR, "execute 'nmcli connection show' in function 'DlgHideWifi' failed");}
QFile file(tmpPath);
if(!file.open(QIODevice::ReadOnly | QIODevice::Text)){
qDebug()<<"Can't open the file!";
@ -124,12 +124,12 @@ DlgConnHidWifi::DlgConnHidWifi(int type, MainWindow *mainWindow, QWidget *parent
KWindowEffects::enableBlurBehind(this->winId(), true, QRegion(path.toFillPolygon().toPolygon()));
}
DlgConnHidWifi::~DlgConnHidWifi()
DlgHideWifi::~DlgHideWifi()
{
delete ui;
}
void DlgConnHidWifi::mousePressEvent(QMouseEvent *event){
void DlgHideWifi::mousePressEvent(QMouseEvent *event){
if(event->button() == Qt::LeftButton){
this->isPress = true;
this->winPos = this->pos();
@ -137,10 +137,10 @@ void DlgConnHidWifi::mousePressEvent(QMouseEvent *event){
event->accept();
}
}
void DlgConnHidWifi::mouseReleaseEvent(QMouseEvent *event){
void DlgHideWifi::mouseReleaseEvent(QMouseEvent *event){
this->isPress = false;
}
void DlgConnHidWifi::mouseMoveEvent(QMouseEvent *event){
void DlgHideWifi::mouseMoveEvent(QMouseEvent *event){
if(this->isPress){
this->move(this->winPos - (this->dragPos - event->globalPos()));
event->accept();
@ -148,46 +148,46 @@ void DlgConnHidWifi::mouseMoveEvent(QMouseEvent *event){
}
//切换到其他Wi-Fi安全类型
void DlgConnHidWifi::changeDialog()
void DlgHideWifi::changeDialog()
{
if(ui->cbxSecurity->currentIndex()==0){
qDebug()<<"it's not need to change dialog";
} else if(ui->cbxSecurity->currentIndex()==1) {
QApplication::setQuitOnLastWindowClosed(false);
this->hide();
DlgConnHidWifiWpa *connHidWifiWpa = new DlgConnHidWifiWpa(0, mw);
DlgHideWifiWpa *connHidWifiWpa = new DlgHideWifiWpa(0, mw);
connHidWifiWpa->show();
connect(connHidWifiWpa, SIGNAL(reSetWifiList() ), mw, SLOT(on_btnWifiList_clicked()) );
} else if(ui->cbxSecurity->currentIndex()==2) {
QApplication::setQuitOnLastWindowClosed(false);
this->hide();
DlgConnHidWifiSecPeap *connHidWifiSecPeap = new DlgConnHidWifiSecPeap(1, 0, mw);
connHidWifiSecPeap->show();
DlgHideWifiEapPeap *connHidWifiEapPeap = new DlgHideWifiEapPeap(1, 0, mw);
connHidWifiEapPeap->show();
} else if(ui->cbxSecurity->currentIndex()==3) {
QApplication::setQuitOnLastWindowClosed(false);
this->hide();
DlgConnHidWifiWep *connHidWifiWep = new DlgConnHidWifiWep(0);
DlgHideWifiWep *connHidWifiWep = new DlgHideWifiWep(0);
connHidWifiWep->show();
} else if(ui->cbxSecurity->currentIndex()==4) {
QApplication::setQuitOnLastWindowClosed(false);
this->hide();
DlgConnHidWifiWep *connHidWifiWep = new DlgConnHidWifiWep(1);
DlgHideWifiWep *connHidWifiWep = new DlgHideWifiWep(1);
connHidWifiWep->show();
} else if(ui->cbxSecurity->currentIndex()==5) {
QApplication::setQuitOnLastWindowClosed(false);
this->hide();
DlgConnHidWifiLeap *connHidWifiLeap = new DlgConnHidWifiLeap();
DlgHideWifiLeap *connHidWifiLeap = new DlgHideWifiLeap();
connHidWifiLeap->show();
} else {
QApplication::setQuitOnLastWindowClosed(false);
this->hide();
DlgConnHidWifiSecPeap *connHidWifiSecPeap = new DlgConnHidWifiSecPeap(0, 0, mw);
connHidWifiSecPeap->show();
DlgHideWifiEapPeap *connHidWifiEapPeap = new DlgHideWifiEapPeap(0, 0, mw);
connHidWifiEapPeap->show();
}
}
//同一 Wi-Fi安全类型的窗口变换
void DlgConnHidWifi::changeWindow(){
void DlgHideWifi::changeWindow(){
if (ui->cbxConn->currentIndex() == 0){
isUsed = ui->cbxConn->currentIndex();
ui->cbxConn->setCurrentIndex(0);
@ -214,15 +214,15 @@ void DlgConnHidWifi::changeWindow(){
if (txt.indexOf("wpa-psk") != -1) {
QApplication::setQuitOnLastWindowClosed(false);
this->hide();
DlgConnHidWifiWpa *connHidWifiWpa = new DlgConnHidWifiWpa(ui->cbxConn->currentIndex(), mw);
DlgHideWifiWpa *connHidWifiWpa = new DlgHideWifiWpa(ui->cbxConn->currentIndex(), mw);
connHidWifiWpa->show();
connect(connHidWifiWpa, SIGNAL(reSetWifiList() ), mw, SLOT(on_btnWifiList_clicked()) );
}
if (txt.indexOf("wpa-eap") != -1) {
QApplication::setQuitOnLastWindowClosed(false);
this->hide();
DlgConnHidWifiSecPeap *connHidWifiSecPeap = new DlgConnHidWifiSecPeap(1, ui->cbxConn->currentIndex(), mw);
connHidWifiSecPeap->show();
DlgHideWifiEapPeap *connHidWifiEapPeap = new DlgHideWifiEapPeap(1, ui->cbxConn->currentIndex(), mw);
connHidWifiEapPeap->show();
}
}else {
isUsed = ui->cbxConn->currentIndex();
@ -236,13 +236,13 @@ void DlgConnHidWifi::changeWindow(){
}
}
void DlgConnHidWifi::on_btnCancel_clicked()
void DlgHideWifi::on_btnCancel_clicked()
{
//this->close();
this->hide();
}
void DlgConnHidWifi::on_btnConnect_clicked()
void DlgHideWifi::on_btnConnect_clicked()
{
QThread *t = new QThread();
connect(t, SIGNAL(finished()), t, SLOT(deleteLater()));
@ -289,7 +289,7 @@ void DlgConnHidWifi::on_btnConnect_clicked()
this->hide();
}
void DlgConnHidWifi::on_leNetName_textEdited(const QString &arg1)
void DlgHideWifi::on_leNetName_textEdited(const QString &arg1)
{
if (ui->leNetName->text() == ""){
ui->btnConnect->setEnabled(false);
@ -298,12 +298,12 @@ void DlgConnHidWifi::on_leNetName_textEdited(const QString &arg1)
}
}
void DlgConnHidWifi::slotStartLoading()
void DlgHideWifi::slotStartLoading()
{
mw->startLoading();
}
void DlgConnHidWifi::on_execSecConn()
void DlgHideWifi::on_execSecConn()
{
QString str = "nmcli device wifi connect " + strWifiname + " password ''";
int status = system(str.toUtf8().data());
@ -312,14 +312,14 @@ void DlgConnHidWifi::on_execSecConn()
QTimer::singleShot(3*1000, this, SLOT(emitSignal() ));
}
void DlgConnHidWifi::emitSignal()
void DlgHideWifi::emitSignal()
{
emit reSetWifiList();
mw->stopLoading();
emit this->stopSignal();
}
void DlgConnHidWifi::paintEvent(QPaintEvent *event)
void DlgHideWifi::paintEvent(QPaintEvent *event)
{
KylinDBus mkylindbus;
double trans = mkylindbus.getTransparentData();

View File

@ -28,16 +28,16 @@
class MainWindow;
namespace Ui {
class DlgConnHidWifi;
class DlgHideWifi;
}
class DlgConnHidWifi : public QDialog
class DlgHideWifi : public QDialog
{
Q_OBJECT
public:
explicit DlgConnHidWifi(int type, MainWindow *mw = 0, QWidget *parent = 0);
~DlgConnHidWifi();
explicit DlgHideWifi(int type, MainWindow *mw = 0, QWidget *parent = 0);
~DlgHideWifi();
protected:
void paintEvent(QPaintEvent *event);
@ -63,7 +63,7 @@ signals:
void stopSignal();
private:
Ui::DlgConnHidWifi *ui;
Ui::DlgHideWifi *ui;
int isUsed;//=0 current wifi not used before; >=1 used
MainWindow *mw;
QString strWifiname;

View File

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>DlgConnHidWifi</class>
<widget class="QDialog" name="DlgConnHidWifi">
<class>DlgHideWifi</class>
<widget class="QDialog" name="DlgHideWifi">
<property name="geometry">
<rect>
<x>0</x>

View File

@ -17,16 +17,16 @@
*/
#include "dlgconnhidwifisecfast.h"
#include "ui_dlgconnhidwifisecfast.h"
#include "dlghidewifieapfast.h"
#include "ui_dlghidewifieapfast.h"
#include "kylinheadfile.h"
#include <sys/syslog.h>
DlgConnHidWifiSecFast::DlgConnHidWifiSecFast(int type, QWidget *parent) :
DlgHideWifiEapFast::DlgHideWifiEapFast(int type, QWidget *parent) :
WepOrWpa(type),
QDialog(parent),
ui(new Ui::DlgConnHidWifiSecFast)
ui(new Ui::DlgHideWifiEapFast)
{
ui->setupUi(this);
@ -99,7 +99,7 @@ DlgConnHidWifiSecFast::DlgConnHidWifiSecFast(int type, QWidget *parent) :
ui->cbxConn->addItem(tr("C_reate…")); //新建...
int status = system("nmcli connection show>/tmp/kylin-nm-connshow");
if (status != 0){ syslog(LOG_ERR, "execute 'nmcli connection show' in function 'DlgConnHidWifiSecFast' failed");}
if (status != 0){ syslog(LOG_ERR, "execute 'nmcli connection show' in function 'DlgHideWifiEapFast' failed");}
QFile file("/tmp/kylin-nm-connshow");
if(!file.open(QIODevice::ReadOnly | QIODevice::Text)){
qDebug()<<"Can't open the file!";
@ -158,12 +158,12 @@ DlgConnHidWifiSecFast::DlgConnHidWifiSecFast(int type, QWidget *parent) :
KWindowEffects::enableBlurBehind(this->winId(), true, QRegion(path.toFillPolygon().toPolygon()));
}
DlgConnHidWifiSecFast::~DlgConnHidWifiSecFast()
DlgHideWifiEapFast::~DlgHideWifiEapFast()
{
delete ui;
}
void DlgConnHidWifiSecFast::mousePressEvent(QMouseEvent *event){
void DlgHideWifiEapFast::mousePressEvent(QMouseEvent *event){
if(event->button() == Qt::LeftButton){
this->isPress = true;
this->winPos = this->pos();
@ -171,42 +171,42 @@ void DlgConnHidWifiSecFast::mousePressEvent(QMouseEvent *event){
event->accept();
}
}
void DlgConnHidWifiSecFast::mouseReleaseEvent(QMouseEvent *event){
void DlgHideWifiEapFast::mouseReleaseEvent(QMouseEvent *event){
this->isPress = false;
}
void DlgConnHidWifiSecFast::mouseMoveEvent(QMouseEvent *event){
void DlgHideWifiEapFast::mouseMoveEvent(QMouseEvent *event){
if(this->isPress){
this->move(this->winPos - (this->dragPos - event->globalPos()));
event->accept();
}
}
void DlgConnHidWifiSecFast::changeDialogSecu()
void DlgHideWifiEapFast::changeDialogSecu()
{
if(ui->cbxSecurity->currentIndex()==0){
QApplication::setQuitOnLastWindowClosed(false);
this->hide();
DlgConnHidWifi *connHidWifi = new DlgConnHidWifi(0);
DlgHideWifi *connHidWifi = new DlgHideWifi(0);
connHidWifi->show();
} else if(ui->cbxSecurity->currentIndex()==1) {
QApplication::setQuitOnLastWindowClosed(false);
this->hide();
DlgConnHidWifiWpa *connHidWifiWpa = new DlgConnHidWifiWpa(0);
DlgHideWifiWpa *connHidWifiWpa = new DlgHideWifiWpa(0);
connHidWifiWpa->show();
} else if(ui->cbxSecurity->currentIndex()==2) {
QApplication::setQuitOnLastWindowClosed(false);
this->hide();
DlgConnHidWifiWep *connHidWifiWep = new DlgConnHidWifiWep(0);
DlgHideWifiWep *connHidWifiWep = new DlgHideWifiWep(0);
connHidWifiWep->show();
} else if(ui->cbxSecurity->currentIndex()==3) {
QApplication::setQuitOnLastWindowClosed(false);
this->hide();
DlgConnHidWifiWep *connHidWifiWep = new DlgConnHidWifiWep(1);
DlgHideWifiWep *connHidWifiWep = new DlgHideWifiWep(1);
connHidWifiWep->show();
} else if(ui->cbxSecurity->currentIndex()==4) {
QApplication::setQuitOnLastWindowClosed(false);
this->hide();
DlgConnHidWifiLeap *connHidWifiLeap = new DlgConnHidWifiLeap();
DlgHideWifiLeap *connHidWifiLeap = new DlgHideWifiLeap();
connHidWifiLeap->show();
} else if(ui->cbxSecurity->currentIndex()==5) {
if (WepOrWpa == 1) {
@ -221,49 +221,49 @@ void DlgConnHidWifiSecFast::changeDialogSecu()
}
}
void DlgConnHidWifiSecFast::changeDialogAuth()
void DlgHideWifiEapFast::changeDialogAuth()
{
if(ui->cbxAuth->currentIndex()==0){
// QApplication::setQuitOnLastWindowClosed(false);
// this->hide();
// DlgConnHidWifiSecTls *connHidWifiSecTls = new DlgConnHidWifiSecTls(WepOrWpa);
// connHidWifiSecTls->show();
// DlgHideWifiEapTls *connHidWifiEapTls = new DlgHideWifiEapTls(WepOrWpa);
// connHidWifiEapTls->show();
} else if(ui->cbxAuth->currentIndex()==1) {
QApplication::setQuitOnLastWindowClosed(false);
this->hide();
DlgConnHidWifiSecLeap *connHidWifiSecLeap = new DlgConnHidWifiSecLeap(WepOrWpa);
connHidWifiSecLeap->show();
DlgHideWifiEapLeap *connHidWifiEapLeap = new DlgHideWifiEapLeap(WepOrWpa);
connHidWifiEapLeap->show();
} else if(ui->cbxAuth->currentIndex()==2) {
QApplication::setQuitOnLastWindowClosed(false);
this->hide();
DlgConnHidWifiSecPwd *connHidWifiSecPwd = new DlgConnHidWifiSecPwd(WepOrWpa);
connHidWifiSecPwd->show();
DlgHideWifiEapPwd *connHidWifiEapPwd = new DlgHideWifiEapPwd(WepOrWpa);
connHidWifiEapPwd->show();
} else if(ui->cbxAuth->currentIndex()==3) {
qDebug()<<"it's not need to change dialog";
} else if(ui->cbxAuth->currentIndex()==4) {
// QApplication::setQuitOnLastWindowClosed(false);
// this->hide();
// DlgConnHidWifiSecTunnelTLS *connHidWifiSecTuTls = new DlgConnHidWifiSecTunnelTLS(WepOrWpa);
// connHidWifiSecTuTls->show();
// DlgHideWifiEapTTLS *connHidWifiEapTTls = new DlgHideWifiEapTTLS(WepOrWpa);
// connHidWifiEapTTls->show();
} else {
// QApplication::setQuitOnLastWindowClosed(false);
// this->hide();
// DlgConnHidWifiSecPeap *connHidWifiSecPeap = new DlgConnHidWifiSecPeap(WepOrWpa);
// connHidWifiSecPeap->show();
// DlgHideWifiEapPeap *connHidWifiEapPeap = new DlgHideWifiEapPeap(WepOrWpa);
// connHidWifiEapPeap->show();
}
}
void DlgConnHidWifiSecFast::on_btnCancel_clicked()
void DlgHideWifiEapFast::on_btnCancel_clicked()
{
this->close();
}
void DlgConnHidWifiSecFast::on_btnConnect_clicked()
void DlgHideWifiEapFast::on_btnConnect_clicked()
{
this->close();
}
void DlgConnHidWifiSecFast::on_checkBoxAutoPCA_stateChanged(int arg1)
void DlgHideWifiEapFast::on_checkBoxAutoPCA_stateChanged(int arg1)
{
if (arg1 == 0) {
ui->cbxAutoPCA->setEnabled(false);
@ -272,7 +272,7 @@ void DlgConnHidWifiSecFast::on_checkBoxAutoPCA_stateChanged(int arg1)
}
}
void DlgConnHidWifiSecFast::on_checkBoxPwd_stateChanged(int arg1)
void DlgHideWifiEapFast::on_checkBoxPwd_stateChanged(int arg1)
{
if (arg1 == 0) {
ui->lePassword ->setEchoMode(QLineEdit::Password);
@ -281,7 +281,7 @@ void DlgConnHidWifiSecFast::on_checkBoxPwd_stateChanged(int arg1)
}
}
void DlgConnHidWifiSecFast::on_leNetName_textEdited(const QString &arg1)
void DlgHideWifiEapFast::on_leNetName_textEdited(const QString &arg1)
{
if (ui->leNetName->text() == ""){
ui->btnConnect->setEnabled(false);
@ -296,7 +296,7 @@ void DlgConnHidWifiSecFast::on_leNetName_textEdited(const QString &arg1)
}
}
void DlgConnHidWifiSecFast::on_leAnonyId_textEdited(const QString &arg1)
void DlgHideWifiEapFast::on_leAnonyId_textEdited(const QString &arg1)
{
if (ui->leNetName->text() == ""){
ui->btnConnect->setEnabled(false);
@ -311,7 +311,7 @@ void DlgConnHidWifiSecFast::on_leAnonyId_textEdited(const QString &arg1)
}
}
void DlgConnHidWifiSecFast::on_leUserName_textEdited(const QString &arg1)
void DlgHideWifiEapFast::on_leUserName_textEdited(const QString &arg1)
{
if (ui->leNetName->text() == ""){
ui->btnConnect->setEnabled(false);
@ -326,7 +326,7 @@ void DlgConnHidWifiSecFast::on_leUserName_textEdited(const QString &arg1)
}
}
void DlgConnHidWifiSecFast::on_lePassword_textEdited(const QString &arg1)
void DlgHideWifiEapFast::on_lePassword_textEdited(const QString &arg1)
{
if (ui->leNetName->text() == ""){
ui->btnConnect->setEnabled(false);
@ -341,7 +341,7 @@ void DlgConnHidWifiSecFast::on_lePassword_textEdited(const QString &arg1)
}
}
void DlgConnHidWifiSecFast::paintEvent(QPaintEvent *event)
void DlgHideWifiEapFast::paintEvent(QPaintEvent *event)
{
QStyleOption opt;
opt.init(this);

View File

@ -23,16 +23,16 @@
#include <QMouseEvent>
namespace Ui {
class DlgConnHidWifiSecFast;
class DlgHideWifiEapFast;
}
class DlgConnHidWifiSecFast : public QDialog
class DlgHideWifiEapFast : public QDialog
{
Q_OBJECT
public:
explicit DlgConnHidWifiSecFast(int type, QWidget *parent = 0);
~DlgConnHidWifiSecFast();
explicit DlgHideWifiEapFast(int type, QWidget *parent = 0);
~DlgHideWifiEapFast();
protected:
void paintEvent(QPaintEvent *event);
@ -59,7 +59,7 @@ private slots:
void on_lePassword_textEdited(const QString &arg1);
private:
Ui::DlgConnHidWifiSecFast *ui;
Ui::DlgHideWifiEapFast *ui;
int WepOrWpa = 0;//0 WEP;1WPA
void mousePressEvent(QMouseEvent *event);

View File

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>DlgConnHidWifiSecFast</class>
<widget class="QDialog" name="DlgConnHidWifiSecFast">
<class>DlgHideWifiEapFast</class>
<widget class="QDialog" name="DlgHideWifiEapFast">
<property name="geometry">
<rect>
<x>0</x>

View File

@ -17,16 +17,16 @@
*/
#include "dlgconnhidwifisecleap.h"
#include "ui_dlgconnhidwifisecleap.h"
#include "dlghidewifieapleap.h"
#include "ui_dlghidewifieapleap.h"
#include "kylinheadfile.h"
#include <sys/syslog.h>
DlgConnHidWifiSecLeap::DlgConnHidWifiSecLeap(int type, QWidget *parent) :
DlgHideWifiEapLeap::DlgHideWifiEapLeap(int type, QWidget *parent) :
WepOrWpa(type),
QDialog(parent),
ui(new Ui::DlgConnHidWifiSecLeap)
ui(new Ui::DlgHideWifiEapLeap)
{
ui->setupUi(this);
@ -82,7 +82,7 @@ DlgConnHidWifiSecLeap::DlgConnHidWifiSecLeap(int type, QWidget *parent) :
ui->cbxConn->addItem(tr("C_reate…")); //新建...
int status = system("nmcli connection show>/tmp/kylin-nm-connshow");
if (status != 0){ syslog(LOG_ERR, "execute 'nmcli connection show' in function 'DlgConnHidWifiSecLeap' failed");}
if (status != 0){ syslog(LOG_ERR, "execute 'nmcli connection show' in function 'DlgHideWifiEapLeap' failed");}
QFile file("/tmp/kylin-nm-connshow");
if(!file.open(QIODevice::ReadOnly | QIODevice::Text)){
qDebug()<<"Can't open the file!";
@ -128,12 +128,12 @@ DlgConnHidWifiSecLeap::DlgConnHidWifiSecLeap(int type, QWidget *parent) :
KWindowEffects::enableBlurBehind(this->winId(), true, QRegion(path.toFillPolygon().toPolygon()));
}
DlgConnHidWifiSecLeap::~DlgConnHidWifiSecLeap()
DlgHideWifiEapLeap::~DlgHideWifiEapLeap()
{
delete ui;
}
void DlgConnHidWifiSecLeap::mousePressEvent(QMouseEvent *event){
void DlgHideWifiEapLeap::mousePressEvent(QMouseEvent *event){
if(event->button() == Qt::LeftButton){
this->isPress = true;
this->winPos = this->pos();
@ -141,42 +141,42 @@ void DlgConnHidWifiSecLeap::mousePressEvent(QMouseEvent *event){
event->accept();
}
}
void DlgConnHidWifiSecLeap::mouseReleaseEvent(QMouseEvent *event){
void DlgHideWifiEapLeap::mouseReleaseEvent(QMouseEvent *event){
this->isPress = false;
}
void DlgConnHidWifiSecLeap::mouseMoveEvent(QMouseEvent *event){
void DlgHideWifiEapLeap::mouseMoveEvent(QMouseEvent *event){
if(this->isPress){
this->move(this->winPos - (this->dragPos - event->globalPos()));
event->accept();
}
}
void DlgConnHidWifiSecLeap::changeDialogSecu()
void DlgHideWifiEapLeap::changeDialogSecu()
{
if(ui->cbxSecurity->currentIndex()==0){
QApplication::setQuitOnLastWindowClosed(false);
this->hide();
DlgConnHidWifi *connHidWifi = new DlgConnHidWifi(0);
DlgHideWifi *connHidWifi = new DlgHideWifi(0);
connHidWifi->show();
} else if(ui->cbxSecurity->currentIndex()==1) {
QApplication::setQuitOnLastWindowClosed(false);
this->hide();
DlgConnHidWifiWpa *connHidWifiWpa = new DlgConnHidWifiWpa(0);
DlgHideWifiWpa *connHidWifiWpa = new DlgHideWifiWpa(0);
connHidWifiWpa->show();
} else if(ui->cbxSecurity->currentIndex()==2) {
QApplication::setQuitOnLastWindowClosed(false);
this->hide();
DlgConnHidWifiWep *connHidWifiWep = new DlgConnHidWifiWep(0);
DlgHideWifiWep *connHidWifiWep = new DlgHideWifiWep(0);
connHidWifiWep->show();
} else if(ui->cbxSecurity->currentIndex()==3) {
QApplication::setQuitOnLastWindowClosed(false);
this->hide();
DlgConnHidWifiWep *connHidWifiWep = new DlgConnHidWifiWep(1);
DlgHideWifiWep *connHidWifiWep = new DlgHideWifiWep(1);
connHidWifiWep->show();
} else if(ui->cbxSecurity->currentIndex()==4) {
QApplication::setQuitOnLastWindowClosed(false);
this->hide();
DlgConnHidWifiLeap *connHidWifiLeap = new DlgConnHidWifiLeap();
DlgHideWifiLeap *connHidWifiLeap = new DlgHideWifiLeap();
connHidWifiLeap->show();
} else if(ui->cbxSecurity->currentIndex()==5) {
if (WepOrWpa == 1) {
@ -191,49 +191,49 @@ void DlgConnHidWifiSecLeap::changeDialogSecu()
}
}
void DlgConnHidWifiSecLeap::changeDialogAuth()
void DlgHideWifiEapLeap::changeDialogAuth()
{
if(ui->cbxAuth->currentIndex()==0){
// QApplication::setQuitOnLastWindowClosed(false);
// this->hide();
// DlgConnHidWifiSecTls *connHidWifiSecTls = new DlgConnHidWifiSecTls(WepOrWpa);
// connHidWifiSecTls->show();
// DlgHideWifiEapTls *connHidWifiEapTls = new DlgHideWifiEapTls(WepOrWpa);
// connHidWifiEapTls->show();
} else if(ui->cbxAuth->currentIndex()==1) {
qDebug()<<"it's not need to change dialog";
} else if(ui->cbxAuth->currentIndex()==2) {
QApplication::setQuitOnLastWindowClosed(false);
this->hide();
DlgConnHidWifiSecPwd *connHidWifiSecPwd = new DlgConnHidWifiSecPwd(WepOrWpa);
connHidWifiSecPwd->show();
DlgHideWifiEapPwd *connHidWifiEapPwd = new DlgHideWifiEapPwd(WepOrWpa);
connHidWifiEapPwd->show();
} else if(ui->cbxAuth->currentIndex()==3) {
QApplication::setQuitOnLastWindowClosed(false);
this->hide();
DlgConnHidWifiSecFast *connHidWifiSecFast = new DlgConnHidWifiSecFast(WepOrWpa);
connHidWifiSecFast->show();
DlgHideWifiEapFast *connHidWifiEapFast = new DlgHideWifiEapFast(WepOrWpa);
connHidWifiEapFast->show();
} else if(ui->cbxAuth->currentIndex()==4) {
QApplication::setQuitOnLastWindowClosed(false);
this->hide();
DlgConnHidWifiSecTunnelTLS *connHidWifiSecTuTls = new DlgConnHidWifiSecTunnelTLS(WepOrWpa);
connHidWifiSecTuTls->show();
DlgHideWifiEapTTLS *connHidWifiEapTTls = new DlgHideWifiEapTTLS(WepOrWpa);
connHidWifiEapTTls->show();
} else {
// QApplication::setQuitOnLastWindowClosed(false);
// this->hide();
// DlgConnHidWifiSecPeap *connHidWifiSecPeap = new DlgConnHidWifiSecPeap(WepOrWpa);
// connHidWifiSecPeap->show();
// DlgHideWifiEapPeap *connHidWifiEapPeap = new DlgHideWifiEapPeap(WepOrWpa);
// connHidWifiEapPeap->show();
}
}
void DlgConnHidWifiSecLeap::on_btnCancel_clicked()
void DlgHideWifiEapLeap::on_btnCancel_clicked()
{
this->close();
}
void DlgConnHidWifiSecLeap::on_btnConnect_clicked()
void DlgHideWifiEapLeap::on_btnConnect_clicked()
{
this->close();
}
void DlgConnHidWifiSecLeap::on_checkBox_stateChanged(int arg1)
void DlgHideWifiEapLeap::on_checkBox_stateChanged(int arg1)
{
if (arg1 == 0) {
ui->lePassword ->setEchoMode(QLineEdit::Password);
@ -242,7 +242,7 @@ void DlgConnHidWifiSecLeap::on_checkBox_stateChanged(int arg1)
}
}
void DlgConnHidWifiSecLeap::on_leNetName_textEdited(const QString &arg1)
void DlgHideWifiEapLeap::on_leNetName_textEdited(const QString &arg1)
{
if (ui->leNetName->text() == ""){
ui->btnConnect->setEnabled(false);
@ -255,7 +255,7 @@ void DlgConnHidWifiSecLeap::on_leNetName_textEdited(const QString &arg1)
}
}
void DlgConnHidWifiSecLeap::on_leUserName_textEdited(const QString &arg1)
void DlgHideWifiEapLeap::on_leUserName_textEdited(const QString &arg1)
{
if (ui->leNetName->text() == ""){
ui->btnConnect->setEnabled(false);
@ -268,7 +268,7 @@ void DlgConnHidWifiSecLeap::on_leUserName_textEdited(const QString &arg1)
}
}
void DlgConnHidWifiSecLeap::on_lePassword_textEdited(const QString &arg1)
void DlgHideWifiEapLeap::on_lePassword_textEdited(const QString &arg1)
{
if (ui->leNetName->text() == ""){
ui->btnConnect->setEnabled(false);
@ -281,7 +281,7 @@ void DlgConnHidWifiSecLeap::on_lePassword_textEdited(const QString &arg1)
}
}
void DlgConnHidWifiSecLeap::paintEvent(QPaintEvent *event)
void DlgHideWifiEapLeap::paintEvent(QPaintEvent *event)
{
QStyleOption opt;
opt.init(this);

View File

@ -23,16 +23,16 @@
#include <QMouseEvent>
namespace Ui {
class DlgConnHidWifiSecLeap;
class DlgHideWifiEapLeap;
}
class DlgConnHidWifiSecLeap : public QDialog
class DlgHideWifiEapLeap : public QDialog
{
Q_OBJECT
public:
explicit DlgConnHidWifiSecLeap(int type, QWidget *parent = 0);
~DlgConnHidWifiSecLeap();
explicit DlgHideWifiEapLeap(int type, QWidget *parent = 0);
~DlgHideWifiEapLeap();
protected:
void paintEvent(QPaintEvent *event);
@ -55,7 +55,7 @@ private slots:
void on_lePassword_textEdited(const QString &arg1);
private:
Ui::DlgConnHidWifiSecLeap *ui;
Ui::DlgHideWifiEapLeap *ui;
int WepOrWpa = 0;//0 WEP;1WPA
void mousePressEvent(QMouseEvent *event);

View File

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>DlgConnHidWifiSecLeap</class>
<widget class="QDialog" name="DlgConnHidWifiSecLeap">
<class>DlgHideWifiEapLeap</class>
<widget class="QDialog" name="DlgHideWifiEapLeap">
<property name="geometry">
<rect>
<x>0</x>

View File

@ -17,8 +17,8 @@
*/
#include "dlgconnhidwifisecpeap.h"
#include "ui_dlgconnhidwifisecpeap.h"
#include "dlghidewifieappeap.h"
#include "ui_dlghidewifieappeap.h"
#include "kylinheadfile.h"
#include "src/mainwindow.h"
#include "src/kylin-dbus-interface.h"
@ -28,11 +28,11 @@
#include <QStandardItemModel>
#include <QDir>
DlgConnHidWifiSecPeap::DlgConnHidWifiSecPeap(int type, int beUsed, MainWindow *mainWindow, QWidget *parent) :
DlgHideWifiEapPeap::DlgHideWifiEapPeap(int type, int beUsed, MainWindow *mainWindow, QWidget *parent) :
WepOrWpa(type),
isUsed(beUsed),
QDialog(parent),
ui(new Ui::DlgConnHidWifiSecPeap)
ui(new Ui::DlgHideWifiEapPeap)
{
ui->setupUi(this);
@ -114,7 +114,7 @@ DlgConnHidWifiSecPeap::DlgConnHidWifiSecPeap(int type, int beUsed, MainWindow *m
ui->cbxConn->addItem("新建...");
int status = system("nmcli connection show>/tmp/kylin-nm-connshow");
if (status != 0){ syslog(LOG_ERR, "execute 'nmcli connection show' in function 'DlgConnHidWifiSecPeap' failed");}
if (status != 0){ syslog(LOG_ERR, "execute 'nmcli connection show' in function 'DlgHideWifiEapPeap' failed");}
QFile file("/tmp/kylin-nm-connshow");
if (!file.open(QIODevice::ReadOnly | QIODevice::Text)) {
qDebug()<<"Can't open the file!";
@ -198,12 +198,12 @@ DlgConnHidWifiSecPeap::DlgConnHidWifiSecPeap(int type, int beUsed, MainWindow *m
KWindowEffects::enableBlurBehind(this->winId(), true, QRegion(path.toFillPolygon().toPolygon()));
}
DlgConnHidWifiSecPeap::~DlgConnHidWifiSecPeap()
DlgHideWifiEapPeap::~DlgHideWifiEapPeap()
{
delete ui;
}
void DlgConnHidWifiSecPeap::mousePressEvent(QMouseEvent *event){
void DlgHideWifiEapPeap::mousePressEvent(QMouseEvent *event){
if (event->button() == Qt::LeftButton) {
this->isPress = true;
this->winPos = this->pos();
@ -211,10 +211,10 @@ void DlgConnHidWifiSecPeap::mousePressEvent(QMouseEvent *event){
event->accept();
}
}
void DlgConnHidWifiSecPeap::mouseReleaseEvent(QMouseEvent *event){
void DlgHideWifiEapPeap::mouseReleaseEvent(QMouseEvent *event){
this->isPress = false;
}
void DlgConnHidWifiSecPeap::mouseMoveEvent(QMouseEvent *event){
void DlgHideWifiEapPeap::mouseMoveEvent(QMouseEvent *event){
if (this->isPress) {
this->move(this->winPos - (this->dragPos - event->globalPos()));
event->accept();
@ -222,18 +222,18 @@ void DlgConnHidWifiSecPeap::mouseMoveEvent(QMouseEvent *event){
}
//切换到其他Wi-Fi安全类型
void DlgConnHidWifiSecPeap::changeDialogSecu()
void DlgHideWifiEapPeap::changeDialogSecu()
{
if (ui->cbxSecurity->currentIndex()==0) {
QApplication::setQuitOnLastWindowClosed(false);
this->hide();
DlgConnHidWifi *connHidWifi = new DlgConnHidWifi(0);
DlgHideWifi *connHidWifi = new DlgHideWifi(0);
connHidWifi->show();
connect(connHidWifi, SIGNAL(reSetWifiList() ), mw, SLOT(on_btnWifiList_clicked()) );
} else if(ui->cbxSecurity->currentIndex()==1) {
QApplication::setQuitOnLastWindowClosed(false);
this->hide();
DlgConnHidWifiWpa *connHidWifiWpa = new DlgConnHidWifiWpa(0);
DlgHideWifiWpa *connHidWifiWpa = new DlgHideWifiWpa(0);
connHidWifiWpa->show();
connect(connHidWifiWpa, SIGNAL(reSetWifiList() ), mw, SLOT(on_btnWifiList_clicked()) );
} else if(ui->cbxSecurity->currentIndex()==2) {
@ -244,17 +244,17 @@ void DlgConnHidWifiSecPeap::changeDialogSecu()
} else if(ui->cbxSecurity->currentIndex()==3) {
QApplication::setQuitOnLastWindowClosed(false);
this->hide();
DlgConnHidWifiWep *connHidWifiWep = new DlgConnHidWifiWep(0);
DlgHideWifiWep *connHidWifiWep = new DlgHideWifiWep(0);
connHidWifiWep->show();
} else if(ui->cbxSecurity->currentIndex()==4) {
QApplication::setQuitOnLastWindowClosed(false);
this->hide();
DlgConnHidWifiWep *connHidWifiWep = new DlgConnHidWifiWep(1);
DlgHideWifiWep *connHidWifiWep = new DlgHideWifiWep(1);
connHidWifiWep->show();
} else if(ui->cbxSecurity->currentIndex()==5) {
QApplication::setQuitOnLastWindowClosed(false);
this->hide();
DlgConnHidWifiLeap *connHidWifiLeap = new DlgConnHidWifiLeap();
DlgHideWifiLeap *connHidWifiLeap = new DlgHideWifiLeap();
connHidWifiLeap->show();
} else {
if (WepOrWpa == 1) {
@ -265,44 +265,44 @@ void DlgConnHidWifiSecPeap::changeDialogSecu()
}
//同一 Wi-Fi安全类型的Authentication变换
void DlgConnHidWifiSecPeap::changeDialogAuth()
void DlgHideWifiEapPeap::changeDialogAuth()
{
if (ui->cbxAuth->currentIndex()==0) {
QApplication::setQuitOnLastWindowClosed(false);
this->hide();
DlgConnHidWifiSecTls *connHidWifiSecTls = new DlgConnHidWifiSecTls(WepOrWpa, 0, mw);
connHidWifiSecTls->show();
DlgHideWifiEapTls *connHidWifiEapTls = new DlgHideWifiEapTls(WepOrWpa, 0, mw);
connHidWifiEapTls->show();
} else if(ui->cbxAuth->currentIndex()==1) {
QApplication::setQuitOnLastWindowClosed(false);
this->hide();
DlgConnHidWifiSecLeap *connHidWifiSecLeap = new DlgConnHidWifiSecLeap(WepOrWpa);
connHidWifiSecLeap->show();
DlgHideWifiEapLeap *connHidWifiEapLeap = new DlgHideWifiEapLeap(WepOrWpa);
connHidWifiEapLeap->show();
} else if(ui->cbxAuth->currentIndex()==2) {
QApplication::setQuitOnLastWindowClosed(false);
this->hide();
DlgConnHidWifiSecPwd *connHidWifiSecPwd = new DlgConnHidWifiSecPwd(WepOrWpa);
connHidWifiSecPwd->show();
DlgHideWifiEapPwd *connHidWifiEapPwd = new DlgHideWifiEapPwd(WepOrWpa);
connHidWifiEapPwd->show();
} else if(ui->cbxAuth->currentIndex()==3) {
QApplication::setQuitOnLastWindowClosed(false);
this->hide();
DlgConnHidWifiSecFast *connHidWifiSecFast = new DlgConnHidWifiSecFast(WepOrWpa);
connHidWifiSecFast->show();
DlgHideWifiEapFast *connHidWifiEapFast = new DlgHideWifiEapFast(WepOrWpa);
connHidWifiEapFast->show();
} else if(ui->cbxAuth->currentIndex()==4) {
QApplication::setQuitOnLastWindowClosed(false);
this->hide();
DlgConnHidWifiSecTunnelTLS *connHidWifiSecTuTls = new DlgConnHidWifiSecTunnelTLS(WepOrWpa);
connHidWifiSecTuTls->show();
DlgHideWifiEapTTLS *connHidWifiEapTTls = new DlgHideWifiEapTTLS(WepOrWpa);
connHidWifiEapTTls->show();
} else {
qDebug()<<"it's not need to change dialog";
}
}
//同一 Wi-Fi安全类型的窗口变换
void DlgConnHidWifiSecPeap::changeWindow(){
void DlgHideWifiEapPeap::changeWindow(){
if (ui->cbxConn->currentIndex() == 0) {
QApplication::setQuitOnLastWindowClosed(false);
this->hide();
DlgConnHidWifi *connHidWifi = new DlgConnHidWifi(0, mw);
DlgHideWifi *connHidWifi = new DlgHideWifi(0, mw);
connHidWifi->show();
connect(connHidWifi, SIGNAL(reSetWifiList() ), mw, SLOT(on_btnWifiList_clicked()) );
} else if (ui->cbxConn->currentIndex() >= 1) {
@ -323,7 +323,7 @@ void DlgConnHidWifiSecPeap::changeWindow(){
if (txt.indexOf("wpa-psk") != -1) {
QApplication::setQuitOnLastWindowClosed(false);
this->hide();
DlgConnHidWifiWpa *connHidWifiWpa = new DlgConnHidWifiWpa(ui->cbxConn->currentIndex(), mw);
DlgHideWifiWpa *connHidWifiWpa = new DlgHideWifiWpa(ui->cbxConn->currentIndex(), mw);
connHidWifiWpa->show();
connect(connHidWifiWpa, SIGNAL(reSetWifiList() ), mw, SLOT(on_btnWifiList_clicked()) );
}
@ -349,7 +349,7 @@ void DlgConnHidWifiSecPeap::changeWindow(){
} else {
QApplication::setQuitOnLastWindowClosed(false);
this->hide();
DlgConnHidWifi *connHidWifi = new DlgConnHidWifi(ui->cbxConn->currentIndex(), mw);
DlgHideWifi *connHidWifi = new DlgHideWifi(ui->cbxConn->currentIndex(), mw);
connHidWifi->show();
connect(connHidWifi, SIGNAL(reSetWifiList() ), mw, SLOT(on_btnWifiList_clicked()) );
}
@ -357,7 +357,7 @@ void DlgConnHidWifiSecPeap::changeWindow(){
}
//CA证书的Index变化
void DlgConnHidWifiSecPeap::on_cbxCA_currentIndexChanged(const QString &arg1)
void DlgHideWifiEapPeap::on_cbxCA_currentIndexChanged(const QString &arg1)
{
if (ui->cbxCA->currentIndex() == 0) {
ui->leCaPwd->setText("");
@ -370,18 +370,18 @@ void DlgConnHidWifiSecPeap::on_cbxCA_currentIndexChanged(const QString &arg1)
}
}
void DlgConnHidWifiSecPeap::on_btnCancel_clicked()
void DlgHideWifiEapPeap::on_btnCancel_clicked()
{
this->close();
}
void DlgConnHidWifiSecPeap::on_btnConnect_clicked()
void DlgHideWifiEapPeap::on_btnConnect_clicked()
{
this->close();
}
//是否显示密码
void DlgConnHidWifiSecPeap::on_checkBoxPwd_stateChanged(int arg1)
void DlgHideWifiEapPeap::on_checkBoxPwd_stateChanged(int arg1)
{
if (arg1 == 0) {
ui->leCaPwd->setEchoMode(QLineEdit::Password);
@ -391,7 +391,7 @@ void DlgConnHidWifiSecPeap::on_checkBoxPwd_stateChanged(int arg1)
}
//是否是不需要CA证书
void DlgConnHidWifiSecPeap::on_checkBoxCA_stateChanged(int arg1)
void DlgHideWifiEapPeap::on_checkBoxCA_stateChanged(int arg1)
{
if (arg1 == 0) {
ui->cbxCA->setCurrentIndex(0);
@ -407,7 +407,7 @@ void DlgConnHidWifiSecPeap::on_checkBoxCA_stateChanged(int arg1)
}
//是否显示密码
void DlgConnHidWifiSecPeap::on_checkBoxPwdSec_stateChanged(int arg1)
void DlgHideWifiEapPeap::on_checkBoxPwdSec_stateChanged(int arg1)
{
if (arg1 == 0) {
ui->lePassword->setEchoMode(QLineEdit::Password);
@ -417,7 +417,7 @@ void DlgConnHidWifiSecPeap::on_checkBoxPwdSec_stateChanged(int arg1)
}
//编辑网络名称
void DlgConnHidWifiSecPeap::on_leNetName_textEdited(const QString &arg1)
void DlgHideWifiEapPeap::on_leNetName_textEdited(const QString &arg1)
{
if (ui->leNetName->text() == "") {
ui->btnConnect->setEnabled(false);
@ -443,7 +443,7 @@ void DlgConnHidWifiSecPeap::on_leNetName_textEdited(const QString &arg1)
}
//编辑匿名身份
void DlgConnHidWifiSecPeap::on_leAnonyId_textEdited(const QString &arg1)
void DlgHideWifiEapPeap::on_leAnonyId_textEdited(const QString &arg1)
{
if (ui->leNetName->text() == "") {
ui->btnConnect->setEnabled(false);
@ -467,7 +467,7 @@ void DlgConnHidWifiSecPeap::on_leAnonyId_textEdited(const QString &arg1)
}
//编辑域名
void DlgConnHidWifiSecPeap::on_leDomain_textEdited(const QString &arg1)
void DlgHideWifiEapPeap::on_leDomain_textEdited(const QString &arg1)
{
if (ui->leNetName->text() == "") {
ui->btnConnect->setEnabled(false);
@ -491,7 +491,7 @@ void DlgConnHidWifiSecPeap::on_leDomain_textEdited(const QString &arg1)
}
//编辑CA证书密码
void DlgConnHidWifiSecPeap::on_leCaPwd_textEdited(const QString &arg1)
void DlgHideWifiEapPeap::on_leCaPwd_textEdited(const QString &arg1)
{
if (ui->leNetName->text() == "") {
ui->btnConnect->setEnabled(false);
@ -511,7 +511,7 @@ void DlgConnHidWifiSecPeap::on_leCaPwd_textEdited(const QString &arg1)
}
//编辑用户名
void DlgConnHidWifiSecPeap::on_leUserName_textEdited(const QString &arg1)
void DlgHideWifiEapPeap::on_leUserName_textEdited(const QString &arg1)
{
if (ui->leNetName->text() == "") {
ui->btnConnect->setEnabled(false);
@ -537,7 +537,7 @@ void DlgConnHidWifiSecPeap::on_leUserName_textEdited(const QString &arg1)
}
//编辑密码
void DlgConnHidWifiSecPeap::on_lePassword_textEdited(const QString &arg1)
void DlgHideWifiEapPeap::on_lePassword_textEdited(const QString &arg1)
{
if (ui->leNetName->text() == "") {
ui->btnConnect->setEnabled(false);
@ -562,7 +562,7 @@ void DlgConnHidWifiSecPeap::on_lePassword_textEdited(const QString &arg1)
}
}
void DlgConnHidWifiSecPeap::paintEvent(QPaintEvent *event)
void DlgHideWifiEapPeap::paintEvent(QPaintEvent *event)
{
KylinDBus mkylindbus;
double trans = mkylindbus.getTransparentData();

View File

@ -25,17 +25,17 @@
class MainWindow;
namespace Ui {
class DlgConnHidWifiSecPeap;
class DlgHideWifiEapPeap;
}
class DlgConnHidWifiSecPeap : public QDialog
class DlgHideWifiEapPeap : public QDialog
{
Q_OBJECT
public:
//type: 0是动态 WEP 1是企业wpa, beUsed:是否是之前已经连接过多网络
explicit DlgConnHidWifiSecPeap(int type, int beUsed, MainWindow *mw = 0, QWidget *parent = 0);
~DlgConnHidWifiSecPeap();
explicit DlgHideWifiEapPeap(int type, int beUsed, MainWindow *mw = 0, QWidget *parent = 0);
~DlgHideWifiEapPeap();
protected:
void paintEvent(QPaintEvent *event);
@ -71,7 +71,7 @@ private slots:
void on_lePassword_textEdited(const QString &arg1);
private:
Ui::DlgConnHidWifiSecPeap *ui;
Ui::DlgHideWifiEapPeap *ui;
int WepOrWpa = 0;//0 WEP;1 WPA
int isUsed;//=0 current wifi not used before; >=1 used
MainWindow *mw;

View File

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>DlgConnHidWifiSecPeap</class>
<widget class="QDialog" name="DlgConnHidWifiSecPeap">
<class>DlgHideWifiEapPeap</class>
<widget class="QDialog" name="DlgHideWifiEapPeap">
<property name="geometry">
<rect>
<x>0</x>

View File

@ -17,16 +17,16 @@
*/
#include "dlgconnhidwifisecpwd.h"
#include "ui_dlgconnhidwifisecpwd.h"
#include "dlghidewifieappwd.h"
#include "ui_dlghidewifieappwd.h"
#include "kylinheadfile.h"
#include <sys/syslog.h>
DlgConnHidWifiSecPwd::DlgConnHidWifiSecPwd(int type, QWidget *parent) :
DlgHideWifiEapPwd::DlgHideWifiEapPwd(int type, QWidget *parent) :
WepOrWpa(type),
QDialog(parent),
ui(new Ui::DlgConnHidWifiSecPwd)
ui(new Ui::DlgHideWifiEapPwd)
{
ui->setupUi(this);
@ -83,7 +83,7 @@ DlgConnHidWifiSecPwd::DlgConnHidWifiSecPwd(int type, QWidget *parent) :
ui->cbxConn->addItem(tr("C_reate…")); //新建...
int status = system("nmcli connection show>/tmp/kylin-nm-connshow");
if (status != 0){ syslog(LOG_ERR, "execute 'nmcli connection show' in function 'DlgConnHidWifiSecPwd' failed");}
if (status != 0){ syslog(LOG_ERR, "execute 'nmcli connection show' in function 'DlgHideWifiEapPwd' failed");}
QFile file("/tmp/kylin-nm-connshow");
if(!file.open(QIODevice::ReadOnly | QIODevice::Text)){
qDebug()<<"Can't open the file!";
@ -129,12 +129,12 @@ DlgConnHidWifiSecPwd::DlgConnHidWifiSecPwd(int type, QWidget *parent) :
KWindowEffects::enableBlurBehind(this->winId(), true, QRegion(path.toFillPolygon().toPolygon()));
}
DlgConnHidWifiSecPwd::~DlgConnHidWifiSecPwd()
DlgHideWifiEapPwd::~DlgHideWifiEapPwd()
{
delete ui;
}
void DlgConnHidWifiSecPwd::mousePressEvent(QMouseEvent *event){
void DlgHideWifiEapPwd::mousePressEvent(QMouseEvent *event){
if(event->button() == Qt::LeftButton){
this->isPress = true;
this->winPos = this->pos();
@ -142,42 +142,42 @@ void DlgConnHidWifiSecPwd::mousePressEvent(QMouseEvent *event){
event->accept();
}
}
void DlgConnHidWifiSecPwd::mouseReleaseEvent(QMouseEvent *event){
void DlgHideWifiEapPwd::mouseReleaseEvent(QMouseEvent *event){
this->isPress = false;
}
void DlgConnHidWifiSecPwd::mouseMoveEvent(QMouseEvent *event){
void DlgHideWifiEapPwd::mouseMoveEvent(QMouseEvent *event){
if(this->isPress){
this->move(this->winPos - (this->dragPos - event->globalPos()));
event->accept();
}
}
void DlgConnHidWifiSecPwd::changeDialogSecu()
void DlgHideWifiEapPwd::changeDialogSecu()
{
if(ui->cbxSecurity->currentIndex()==0){
QApplication::setQuitOnLastWindowClosed(false);
this->hide();
DlgConnHidWifi *connHidWifi = new DlgConnHidWifi(0);
DlgHideWifi *connHidWifi = new DlgHideWifi(0);
connHidWifi->show();
} else if(ui->cbxSecurity->currentIndex()==1) {
QApplication::setQuitOnLastWindowClosed(false);
this->hide();
DlgConnHidWifiWpa *connHidWifiWpa = new DlgConnHidWifiWpa(0);
DlgHideWifiWpa *connHidWifiWpa = new DlgHideWifiWpa(0);
connHidWifiWpa->show();
} else if(ui->cbxSecurity->currentIndex()==2) {
QApplication::setQuitOnLastWindowClosed(false);
this->hide();
DlgConnHidWifiWep *connHidWifiWep = new DlgConnHidWifiWep(0);
DlgHideWifiWep *connHidWifiWep = new DlgHideWifiWep(0);
connHidWifiWep->show();
} else if(ui->cbxSecurity->currentIndex()==3) {
QApplication::setQuitOnLastWindowClosed(false);
this->hide();
DlgConnHidWifiWep *connHidWifiWep = new DlgConnHidWifiWep(1);
DlgHideWifiWep *connHidWifiWep = new DlgHideWifiWep(1);
connHidWifiWep->show();
} else if(ui->cbxSecurity->currentIndex()==4) {
QApplication::setQuitOnLastWindowClosed(false);
this->hide();
DlgConnHidWifiLeap *connHidWifiLeap = new DlgConnHidWifiLeap();
DlgHideWifiLeap *connHidWifiLeap = new DlgHideWifiLeap();
connHidWifiLeap->show();
} else if(ui->cbxSecurity->currentIndex()==5) {
if (WepOrWpa == 1) {
@ -192,49 +192,49 @@ void DlgConnHidWifiSecPwd::changeDialogSecu()
}
}
void DlgConnHidWifiSecPwd::changeDialogAuth()
void DlgHideWifiEapPwd::changeDialogAuth()
{
if(ui->cbxAuth->currentIndex()==0){
// QApplication::setQuitOnLastWindowClosed(false);
// this->hide();
// DlgConnHidWifiSecTls *connHidWifiSecTls = new DlgConnHidWifiSecTls(WepOrWpa);
// connHidWifiSecTls->show();
// DlgHideWifiEapTls *connHidWifiEapTls = new DlgHideWifiEapTls(WepOrWpa);
// connHidWifiEapTls->show();
} else if(ui->cbxAuth->currentIndex()==1) {
QApplication::setQuitOnLastWindowClosed(false);
this->hide();
DlgConnHidWifiSecLeap *connHidWifiSecLeap = new DlgConnHidWifiSecLeap(WepOrWpa);
connHidWifiSecLeap->show();
DlgHideWifiEapLeap *connHidWifiEapLeap = new DlgHideWifiEapLeap(WepOrWpa);
connHidWifiEapLeap->show();
} else if(ui->cbxAuth->currentIndex()==2) {
qDebug()<<"it's not need to change dialog";
} else if(ui->cbxAuth->currentIndex()==3) {
QApplication::setQuitOnLastWindowClosed(false);
this->hide();
DlgConnHidWifiSecFast *connHidWifiSecFast = new DlgConnHidWifiSecFast(WepOrWpa);
connHidWifiSecFast->show();
DlgHideWifiEapFast *connHidWifiEapFast = new DlgHideWifiEapFast(WepOrWpa);
connHidWifiEapFast->show();
} else if(ui->cbxAuth->currentIndex()==4) {
QApplication::setQuitOnLastWindowClosed(false);
this->hide();
DlgConnHidWifiSecTunnelTLS *connHidWifiSecTuTls = new DlgConnHidWifiSecTunnelTLS(WepOrWpa);
connHidWifiSecTuTls->show();
DlgHideWifiEapTTLS *connHidWifiEapTTls = new DlgHideWifiEapTTLS(WepOrWpa);
connHidWifiEapTTls->show();
} else {
// QApplication::setQuitOnLastWindowClosed(false);
// this->hide();
// DlgConnHidWifiSecPeap *connHidWifiSecPeap = new DlgConnHidWifiSecPeap(WepOrWpa);
// connHidWifiSecPeap->show();
// DlgHideWifiEapPeap *connHidWifiEapPeap = new DlgHideWifiEapPeap(WepOrWpa);
// connHidWifiEapPeap->show();
}
}
void DlgConnHidWifiSecPwd::on_btnCancel_clicked()
void DlgHideWifiEapPwd::on_btnCancel_clicked()
{
this->close();
}
void DlgConnHidWifiSecPwd::on_btnConnect_clicked()
void DlgHideWifiEapPwd::on_btnConnect_clicked()
{
this->close();
}
void DlgConnHidWifiSecPwd::on_checkBox_stateChanged(int arg1)
void DlgHideWifiEapPwd::on_checkBox_stateChanged(int arg1)
{
if (arg1 == 0) {
ui->lePassword ->setEchoMode(QLineEdit::Password);
@ -243,7 +243,7 @@ void DlgConnHidWifiSecPwd::on_checkBox_stateChanged(int arg1)
}
}
void DlgConnHidWifiSecPwd::on_leNetName_textEdited(const QString &arg1)
void DlgHideWifiEapPwd::on_leNetName_textEdited(const QString &arg1)
{
if (ui->leNetName->text() == ""){
ui->btnConnect->setEnabled(false);
@ -256,7 +256,7 @@ void DlgConnHidWifiSecPwd::on_leNetName_textEdited(const QString &arg1)
}
}
void DlgConnHidWifiSecPwd::on_leUserName_textEdited(const QString &arg1)
void DlgHideWifiEapPwd::on_leUserName_textEdited(const QString &arg1)
{
if (ui->leNetName->text() == ""){
ui->btnConnect->setEnabled(false);
@ -269,7 +269,7 @@ void DlgConnHidWifiSecPwd::on_leUserName_textEdited(const QString &arg1)
}
}
void DlgConnHidWifiSecPwd::on_lePassword_textEdited(const QString &arg1)
void DlgHideWifiEapPwd::on_lePassword_textEdited(const QString &arg1)
{
if (ui->leNetName->text() == ""){
ui->btnConnect->setEnabled(false);
@ -282,7 +282,7 @@ void DlgConnHidWifiSecPwd::on_lePassword_textEdited(const QString &arg1)
}
}
void DlgConnHidWifiSecPwd::paintEvent(QPaintEvent *event)
void DlgHideWifiEapPwd::paintEvent(QPaintEvent *event)
{
QStyleOption opt;
opt.init(this);

View File

@ -23,16 +23,16 @@
#include <QMouseEvent>
namespace Ui {
class DlgConnHidWifiSecPwd;
class DlgHideWifiEapPwd;
}
class DlgConnHidWifiSecPwd : public QDialog
class DlgHideWifiEapPwd : public QDialog
{
Q_OBJECT
public:
explicit DlgConnHidWifiSecPwd(int type, QWidget *parent = 0);
~DlgConnHidWifiSecPwd();
explicit DlgHideWifiEapPwd(int type, QWidget *parent = 0);
~DlgHideWifiEapPwd();
protected:
void paintEvent(QPaintEvent *event);
@ -55,7 +55,7 @@ private slots:
void on_lePassword_textEdited(const QString &arg1);
private:
Ui::DlgConnHidWifiSecPwd *ui;
Ui::DlgHideWifiEapPwd *ui;
int WepOrWpa = 0;//0 WEP;1WPA
void mousePressEvent(QMouseEvent *event);

View File

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>DlgConnHidWifiSecPwd</class>
<widget class="QDialog" name="DlgConnHidWifiSecPwd">
<class>DlgHideWifiEapPwd</class>
<widget class="QDialog" name="DlgHideWifiEapPwd">
<property name="geometry">
<rect>
<x>0</x>

View File

@ -17,7 +17,7 @@
*/
#include "ui_dlgconnhidwifisectls.h"
#include "ui_dlghidewifieaptls.h"
#include "kylinheadfile.h"
#include "src/mainwindow.h"
#include "src/kylin-dbus-interface.h"
@ -27,11 +27,11 @@
#include <QStandardItemModel>
#include <QDir>
DlgConnHidWifiSecTls::DlgConnHidWifiSecTls(int type, int beUsed, MainWindow *mainWindow, QWidget *parent) :
DlgHideWifiEapTls::DlgHideWifiEapTls(int type, int beUsed, MainWindow *mainWindow, QWidget *parent) :
WepOrWpa(type),
isUsed(beUsed),
QDialog(parent),
ui(new Ui::DlgConnHidWifiSecTls)
ui(new Ui::DlgHideWifiEapTls)
{
ui->setupUi(this);
@ -113,7 +113,7 @@ DlgConnHidWifiSecTls::DlgConnHidWifiSecTls(int type, int beUsed, MainWindow *mai
ui->cbxConn->addItem(tr("C_reate…")); //新建...
int status = system("nmcli connection show>/tmp/kylin-nm-connshow");
if (status != 0){ syslog(LOG_ERR, "execute 'nmcli connection show' in function 'DlgConnHidWifiSecTls' failed");}
if (status != 0){ syslog(LOG_ERR, "execute 'nmcli connection show' in function 'DlgHideWifiEapTls' failed");}
QFile file("/tmp/kylin-nm-connshow");
if(!file.open(QIODevice::ReadOnly | QIODevice::Text)){
qDebug()<<"Can't open the file!";
@ -186,12 +186,12 @@ DlgConnHidWifiSecTls::DlgConnHidWifiSecTls(int type, int beUsed, MainWindow *mai
KWindowEffects::enableBlurBehind(this->winId(), true, QRegion(path.toFillPolygon().toPolygon()));
}
DlgConnHidWifiSecTls::~DlgConnHidWifiSecTls()
DlgHideWifiEapTls::~DlgHideWifiEapTls()
{
delete ui;
}
void DlgConnHidWifiSecTls::mousePressEvent(QMouseEvent *event){
void DlgHideWifiEapTls::mousePressEvent(QMouseEvent *event){
if(event->button() == Qt::LeftButton){
this->isPress = true;
this->winPos = this->pos();
@ -199,10 +199,10 @@ void DlgConnHidWifiSecTls::mousePressEvent(QMouseEvent *event){
event->accept();
}
}
void DlgConnHidWifiSecTls::mouseReleaseEvent(QMouseEvent *event){
void DlgHideWifiEapTls::mouseReleaseEvent(QMouseEvent *event){
this->isPress = false;
}
void DlgConnHidWifiSecTls::mouseMoveEvent(QMouseEvent *event){
void DlgHideWifiEapTls::mouseMoveEvent(QMouseEvent *event){
if(this->isPress){
this->move(this->winPos - (this->dragPos - event->globalPos()));
event->accept();
@ -210,18 +210,18 @@ void DlgConnHidWifiSecTls::mouseMoveEvent(QMouseEvent *event){
}
//切换到其他Wi-Fi安全类型
void DlgConnHidWifiSecTls::changeDialogSecu()
void DlgHideWifiEapTls::changeDialogSecu()
{
if(ui->cbxSecurity->currentIndex()==0){
QApplication::setQuitOnLastWindowClosed(false);
this->hide();
DlgConnHidWifi *connHidWifi = new DlgConnHidWifi(0, mw);
DlgHideWifi *connHidWifi = new DlgHideWifi(0, mw);
connHidWifi->show();
connect(connHidWifi, SIGNAL(reSetWifiList() ), mw, SLOT(on_btnWifiList_clicked()) );
} else if(ui->cbxSecurity->currentIndex()==1) {
QApplication::setQuitOnLastWindowClosed(false);
this->hide();
DlgConnHidWifiWpa *connHidWifiWpa = new DlgConnHidWifiWpa(0);
DlgHideWifiWpa *connHidWifiWpa = new DlgHideWifiWpa(0);
connHidWifiWpa->show();
connect(connHidWifiWpa, SIGNAL(reSetWifiList() ), mw, SLOT(on_btnWifiList_clicked()) );
} else if(ui->cbxSecurity->currentIndex()==2) {
@ -233,17 +233,17 @@ void DlgConnHidWifiSecTls::changeDialogSecu()
} else if(ui->cbxSecurity->currentIndex()==3) {
QApplication::setQuitOnLastWindowClosed(false);
this->hide();
DlgConnHidWifiWep *connHidWifiWep = new DlgConnHidWifiWep(0);
DlgHideWifiWep *connHidWifiWep = new DlgHideWifiWep(0);
connHidWifiWep->show();
} else if(ui->cbxSecurity->currentIndex()==4) {
QApplication::setQuitOnLastWindowClosed(false);
this->hide();
DlgConnHidWifiWep *connHidWifiWep = new DlgConnHidWifiWep(1);
DlgHideWifiWep *connHidWifiWep = new DlgHideWifiWep(1);
connHidWifiWep->show();
} else if(ui->cbxSecurity->currentIndex()==5) {
QApplication::setQuitOnLastWindowClosed(false);
this->hide();
DlgConnHidWifiLeap *connHidWifiLeap = new DlgConnHidWifiLeap();
DlgHideWifiLeap *connHidWifiLeap = new DlgHideWifiLeap();
connHidWifiLeap->show();
} else {
if (WepOrWpa == 1) {
@ -254,44 +254,44 @@ void DlgConnHidWifiSecTls::changeDialogSecu()
}
//同一 Wi-Fi安全类型的Authentication变换
void DlgConnHidWifiSecTls::changeDialogAuth()
void DlgHideWifiEapTls::changeDialogAuth()
{
if(ui->cbxAuth->currentIndex()==0){
qDebug()<<"it's not need to change dialog";
} else if(ui->cbxAuth->currentIndex()==1) {
QApplication::setQuitOnLastWindowClosed(false);
this->hide();
DlgConnHidWifiSecLeap *connHidWifiSecLeap = new DlgConnHidWifiSecLeap(WepOrWpa);
connHidWifiSecLeap->show();
DlgHideWifiEapLeap *connHidWifiEapLeap = new DlgHideWifiEapLeap(WepOrWpa);
connHidWifiEapLeap->show();
} else if(ui->cbxAuth->currentIndex()==2) {
QApplication::setQuitOnLastWindowClosed(false);
this->hide();
DlgConnHidWifiSecPwd *connHidWifiSecPwd = new DlgConnHidWifiSecPwd(WepOrWpa);
connHidWifiSecPwd->show();
DlgHideWifiEapPwd *connHidWifiEapPwd = new DlgHideWifiEapPwd(WepOrWpa);
connHidWifiEapPwd->show();
} else if(ui->cbxAuth->currentIndex()==3) {
QApplication::setQuitOnLastWindowClosed(false);
this->hide();
DlgConnHidWifiSecFast *connHidWifiSecFast = new DlgConnHidWifiSecFast(WepOrWpa);
connHidWifiSecFast->show();
DlgHideWifiEapFast *connHidWifiEapFast = new DlgHideWifiEapFast(WepOrWpa);
connHidWifiEapFast->show();
} else if(ui->cbxAuth->currentIndex()==4) {
QApplication::setQuitOnLastWindowClosed(false);
this->hide();
DlgConnHidWifiSecTunnelTLS *connHidWifiSecTuTls = new DlgConnHidWifiSecTunnelTLS(WepOrWpa);
connHidWifiSecTuTls->show();
DlgHideWifiEapTTLS *connHidWifiEapTTls = new DlgHideWifiEapTTLS(WepOrWpa);
connHidWifiEapTTls->show();
} else {
QApplication::setQuitOnLastWindowClosed(false);
this->hide();
DlgConnHidWifiSecPeap *connHidWifiSecPeap = new DlgConnHidWifiSecPeap(WepOrWpa, 0, mw);
connHidWifiSecPeap->show();
DlgHideWifiEapPeap *connHidWifiEapPeap = new DlgHideWifiEapPeap(WepOrWpa, 0, mw);
connHidWifiEapPeap->show();
}
}
//同一 Wi-Fi安全类型的窗口变换
void DlgConnHidWifiSecTls::changeWindow(){
void DlgHideWifiEapTls::changeWindow(){
if (ui->cbxConn->currentIndex() == 0){
QApplication::setQuitOnLastWindowClosed(false);
this->hide();
DlgConnHidWifi *connHidWifi = new DlgConnHidWifi(0, mw);
DlgHideWifi *connHidWifi = new DlgHideWifi(0, mw);
connHidWifi->show();
connect(connHidWifi, SIGNAL(reSetWifiList() ), mw, SLOT(on_btnWifiList_clicked()) );
}else if (ui->cbxConn->currentIndex() >= 1){
@ -310,20 +310,20 @@ void DlgConnHidWifiSecTls::changeWindow(){
if (txt.indexOf("802-11-wireless-security.key-mgmt:") != -1){
QApplication::setQuitOnLastWindowClosed(false);
this->hide();
DlgConnHidWifiWpa *connHidWifiWpa = new DlgConnHidWifiWpa(ui->cbxConn->currentIndex(), mw);
DlgHideWifiWpa *connHidWifiWpa = new DlgHideWifiWpa(ui->cbxConn->currentIndex(), mw);
connHidWifiWpa->show();
connect(connHidWifiWpa, SIGNAL(reSetWifiList() ), mw, SLOT(on_btnWifiList_clicked()) );
} else {
QApplication::setQuitOnLastWindowClosed(false);
this->hide();
DlgConnHidWifi *connHidWifi = new DlgConnHidWifi(ui->cbxConn->currentIndex(), mw);
DlgHideWifi *connHidWifi = new DlgHideWifi(ui->cbxConn->currentIndex(), mw);
connHidWifi->show();
connect(connHidWifi, SIGNAL(reSetWifiList() ), mw, SLOT(on_btnWifiList_clicked()) );
}
}
}
void DlgConnHidWifiSecTls::on_cbxCA_currentIndexChanged(const QString &arg1)
void DlgHideWifiEapTls::on_cbxCA_currentIndexChanged(const QString &arg1)
{
if (ui->cbxCA->currentIndex() == 0){
ui->leCaPwd->setText("");
@ -336,7 +336,7 @@ void DlgConnHidWifiSecTls::on_cbxCA_currentIndexChanged(const QString &arg1)
}
}
void DlgConnHidWifiSecTls::on_cbxUserCertify_currentIndexChanged(const QString &arg1)
void DlgHideWifiEapTls::on_cbxUserCertify_currentIndexChanged(const QString &arg1)
{
if (ui->cbxUserCertify->currentIndex() == 0){
ui->leUserCertifyPwd->setText("");
@ -365,7 +365,7 @@ void DlgConnHidWifiSecTls::on_cbxUserCertify_currentIndexChanged(const QString &
}
}
void DlgConnHidWifiSecTls::on_cbxUserPriKey_currentIndexChanged(const QString &arg1)
void DlgHideWifiEapTls::on_cbxUserPriKey_currentIndexChanged(const QString &arg1)
{
if (ui->cbxUserPriKey->currentIndex() == 0){
ui->leUserKeyPwd->setText("");
@ -378,17 +378,17 @@ void DlgConnHidWifiSecTls::on_cbxUserPriKey_currentIndexChanged(const QString &a
}
}
void DlgConnHidWifiSecTls::on_btnCancel_clicked()
void DlgHideWifiEapTls::on_btnCancel_clicked()
{
this->close();
}
void DlgConnHidWifiSecTls::on_btnConnect_clicked()
void DlgHideWifiEapTls::on_btnConnect_clicked()
{
this->close();
}
void DlgConnHidWifiSecTls::on_checkBoxCA_stateChanged(int arg1)
void DlgHideWifiEapTls::on_checkBoxCA_stateChanged(int arg1)
{
if (arg1 == 0) {
ui->cbxCA->setCurrentIndex(0);
@ -401,7 +401,7 @@ void DlgConnHidWifiSecTls::on_checkBoxCA_stateChanged(int arg1)
}
}
void DlgConnHidWifiSecTls::on_checkBoxPwd_stateChanged(int arg1)
void DlgHideWifiEapTls::on_checkBoxPwd_stateChanged(int arg1)
{
if (arg1 == 0) {
ui->leCaPwd->setEchoMode(QLineEdit::Password);
@ -410,7 +410,7 @@ void DlgConnHidWifiSecTls::on_checkBoxPwd_stateChanged(int arg1)
}
}
void DlgConnHidWifiSecTls::on_checkBoxPwdSec_stateChanged(int arg1)
void DlgHideWifiEapTls::on_checkBoxPwdSec_stateChanged(int arg1)
{
if (arg1 == 0) {
ui->leUserCertifyPwd->setEchoMode(QLineEdit::Password);
@ -421,7 +421,7 @@ void DlgConnHidWifiSecTls::on_checkBoxPwdSec_stateChanged(int arg1)
}
}
void DlgConnHidWifiSecTls::on_leNetName_textEdited(const QString &arg1)
void DlgHideWifiEapTls::on_leNetName_textEdited(const QString &arg1)
{
if (ui->leNetName->text() == ""){
ui->btnConnect->setEnabled(false);
@ -470,7 +470,7 @@ void DlgConnHidWifiSecTls::on_leNetName_textEdited(const QString &arg1)
}
}
void DlgConnHidWifiSecTls::on_leIdentity_textEdited(const QString &arg1)
void DlgHideWifiEapTls::on_leIdentity_textEdited(const QString &arg1)
{
if (ui->leNetName->text() == ""){
ui->btnConnect->setEnabled(false);
@ -519,7 +519,7 @@ void DlgConnHidWifiSecTls::on_leIdentity_textEdited(const QString &arg1)
}
}
void DlgConnHidWifiSecTls::on_leDomain_textEdited(const QString &arg1)
void DlgHideWifiEapTls::on_leDomain_textEdited(const QString &arg1)
{
if (ui->leNetName->text() == ""){
ui->btnConnect->setEnabled(false);
@ -568,7 +568,7 @@ void DlgConnHidWifiSecTls::on_leDomain_textEdited(const QString &arg1)
}
}
void DlgConnHidWifiSecTls::on_leCaPwd_textEdited(const QString &arg1)
void DlgHideWifiEapTls::on_leCaPwd_textEdited(const QString &arg1)
{
if (ui->leNetName->text() == ""){
ui->btnConnect->setEnabled(false);
@ -597,7 +597,7 @@ void DlgConnHidWifiSecTls::on_leCaPwd_textEdited(const QString &arg1)
}
}
void DlgConnHidWifiSecTls::on_leUserCertifyPwd_textEdited(const QString &arg1)
void DlgHideWifiEapTls::on_leUserCertifyPwd_textEdited(const QString &arg1)
{
if (ui->leNetName->text() == ""){
ui->btnConnect->setEnabled(false);
@ -638,7 +638,7 @@ void DlgConnHidWifiSecTls::on_leUserCertifyPwd_textEdited(const QString &arg1)
}
}
void DlgConnHidWifiSecTls::on_leUserKeyPwd_textEdited(const QString &arg1)
void DlgHideWifiEapTls::on_leUserKeyPwd_textEdited(const QString &arg1)
{
if (ui->leNetName->text() == ""){
ui->btnConnect->setEnabled(false);
@ -671,7 +671,7 @@ void DlgConnHidWifiSecTls::on_leUserKeyPwd_textEdited(const QString &arg1)
}
}
void DlgConnHidWifiSecTls::paintEvent(QPaintEvent *event)
void DlgHideWifiEapTls::paintEvent(QPaintEvent *event)
{
KylinDBus mkylindbus;
double trans = mkylindbus.getTransparentData();

View File

@ -25,16 +25,16 @@
class MainWindow;
namespace Ui {
class DlgConnHidWifiSecTls;
class DlgHideWifiEapTls;
}
class DlgConnHidWifiSecTls : public QDialog
class DlgHideWifiEapTls : public QDialog
{
Q_OBJECT
public:
explicit DlgConnHidWifiSecTls(int type, int beUsed, MainWindow *mw = 0, QWidget *parent = 0);
~DlgConnHidWifiSecTls();
explicit DlgHideWifiEapTls(int type, int beUsed, MainWindow *mw = 0, QWidget *parent = 0);
~DlgHideWifiEapTls();
protected:
void paintEvent(QPaintEvent *event);
@ -74,7 +74,7 @@ private slots:
void on_cbxUserPriKey_currentIndexChanged(const QString &arg1);
private:
Ui::DlgConnHidWifiSecTls *ui;
Ui::DlgHideWifiEapTls *ui;
int WepOrWpa = 0;//0 WEP;1WPA
int isUsed;//=0 current wifi not used before; >=1 used
MainWindow *mw;

View File

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>DlgConnHidWifiSecTls</class>
<widget class="QDialog" name="DlgConnHidWifiSecTls">
<class>DlgHideWifiEapTls</class>
<widget class="QDialog" name="DlgHideWifiEapTls">
<property name="geometry">
<rect>
<x>0</x>

View File

@ -17,16 +17,16 @@
*/
#include "dlgconnhidwifisectunneltls.h"
#include "ui_dlgconnhidwifisectunneltls.h"
#include "dlghidewifieapttls.h"
#include "ui_dlghidewifieapttls.h"
#include "kylinheadfile.h"
#include <sys/syslog.h>
DlgConnHidWifiSecTunnelTLS::DlgConnHidWifiSecTunnelTLS(int type, QWidget *parent) :
DlgHideWifiEapTTLS::DlgHideWifiEapTTLS(int type, QWidget *parent) :
WepOrWpa(type),
QDialog(parent),
ui(new Ui::DlgConnHidWifiSecTunnelTLS)
ui(new Ui::DlgHideWifiEapTTLS)
{
ui->setupUi(this);
@ -104,7 +104,7 @@ DlgConnHidWifiSecTunnelTLS::DlgConnHidWifiSecTunnelTLS(int type, QWidget *parent
ui->cbxConn->addItem(tr("C_reate…")); //新建...
int status = system("nmcli connection show>/tmp/kylin-nm-connshow");
if (status != 0){ syslog(LOG_ERR, "execute 'nmcli connection show' in function 'DlgConnHidWifiSecTunnelTLS' failed");}
if (status != 0){ syslog(LOG_ERR, "execute 'nmcli connection show' in function 'DlgHideWifiEapTTLS' failed");}
QFile file("/tmp/kylin-nm-connshow");
if(!file.open(QIODevice::ReadOnly | QIODevice::Text)){
qDebug()<<"Can't open the file!";
@ -163,12 +163,12 @@ DlgConnHidWifiSecTunnelTLS::DlgConnHidWifiSecTunnelTLS(int type, QWidget *parent
KWindowEffects::enableBlurBehind(this->winId(), true, QRegion(path.toFillPolygon().toPolygon()));
}
DlgConnHidWifiSecTunnelTLS::~DlgConnHidWifiSecTunnelTLS()
DlgHideWifiEapTTLS::~DlgHideWifiEapTTLS()
{
delete ui;
}
void DlgConnHidWifiSecTunnelTLS::mousePressEvent(QMouseEvent *event){
void DlgHideWifiEapTTLS::mousePressEvent(QMouseEvent *event){
if(event->button() == Qt::LeftButton){
this->isPress = true;
this->winPos = this->pos();
@ -176,42 +176,42 @@ void DlgConnHidWifiSecTunnelTLS::mousePressEvent(QMouseEvent *event){
event->accept();
}
}
void DlgConnHidWifiSecTunnelTLS::mouseReleaseEvent(QMouseEvent *event){
void DlgHideWifiEapTTLS::mouseReleaseEvent(QMouseEvent *event){
this->isPress = false;
}
void DlgConnHidWifiSecTunnelTLS::mouseMoveEvent(QMouseEvent *event){
void DlgHideWifiEapTTLS::mouseMoveEvent(QMouseEvent *event){
if(this->isPress){
this->move(this->winPos - (this->dragPos - event->globalPos()));
event->accept();
}
}
void DlgConnHidWifiSecTunnelTLS::changeDialogSecu()
void DlgHideWifiEapTTLS::changeDialogSecu()
{
if(ui->cbxSecurity->currentIndex()==0){
QApplication::setQuitOnLastWindowClosed(false);
this->hide();
DlgConnHidWifi *connHidWifi = new DlgConnHidWifi(0);
DlgHideWifi *connHidWifi = new DlgHideWifi(0);
connHidWifi->show();
} else if(ui->cbxSecurity->currentIndex()==1) {
QApplication::setQuitOnLastWindowClosed(false);
this->hide();
DlgConnHidWifiWpa *connHidWifiWpa = new DlgConnHidWifiWpa(0);
DlgHideWifiWpa *connHidWifiWpa = new DlgHideWifiWpa(0);
connHidWifiWpa->show();
} else if(ui->cbxSecurity->currentIndex()==2) {
QApplication::setQuitOnLastWindowClosed(false);
this->hide();
DlgConnHidWifiWep *connHidWifiWep = new DlgConnHidWifiWep(0);
DlgHideWifiWep *connHidWifiWep = new DlgHideWifiWep(0);
connHidWifiWep->show();
} else if(ui->cbxSecurity->currentIndex()==3) {
QApplication::setQuitOnLastWindowClosed(false);
this->hide();
DlgConnHidWifiWep *connHidWifiWep = new DlgConnHidWifiWep(1);
DlgHideWifiWep *connHidWifiWep = new DlgHideWifiWep(1);
connHidWifiWep->show();
} else if(ui->cbxSecurity->currentIndex()==4) {
QApplication::setQuitOnLastWindowClosed(false);
this->hide();
DlgConnHidWifiLeap *connHidWifiLeap = new DlgConnHidWifiLeap();
DlgHideWifiLeap *connHidWifiLeap = new DlgHideWifiLeap();
connHidWifiLeap->show();
} else if(ui->cbxSecurity->currentIndex()==5) {
if (WepOrWpa == 1) {
@ -226,39 +226,39 @@ void DlgConnHidWifiSecTunnelTLS::changeDialogSecu()
}
}
void DlgConnHidWifiSecTunnelTLS::changeDialogAuth()
void DlgHideWifiEapTTLS::changeDialogAuth()
{
if(ui->cbxAuth->currentIndex()==0){
// QApplication::setQuitOnLastWindowClosed(false);
// this->hide();
// DlgConnHidWifiSecTls *connHidWifiSecTls = new DlgConnHidWifiSecTls(WepOrWpa);
// connHidWifiSecTls->show();
// DlgHideWifiEapTls *connHidWifiEapTls = new DlgHideWifiEapTls(WepOrWpa);
// connHidWifiEapTls->show();
} else if(ui->cbxAuth->currentIndex()==1) {
QApplication::setQuitOnLastWindowClosed(false);
this->hide();
DlgConnHidWifiSecLeap *connHidWifiSecLeap = new DlgConnHidWifiSecLeap(WepOrWpa);
connHidWifiSecLeap->show();
DlgHideWifiEapLeap *connHidWifiEapLeap = new DlgHideWifiEapLeap(WepOrWpa);
connHidWifiEapLeap->show();
} else if(ui->cbxAuth->currentIndex()==2) {
QApplication::setQuitOnLastWindowClosed(false);
this->hide();
DlgConnHidWifiSecPwd *connHidWifiSecPwd = new DlgConnHidWifiSecPwd(WepOrWpa);
connHidWifiSecPwd->show();
DlgHideWifiEapPwd *connHidWifiEapPwd = new DlgHideWifiEapPwd(WepOrWpa);
connHidWifiEapPwd->show();
} else if(ui->cbxAuth->currentIndex()==3) {
QApplication::setQuitOnLastWindowClosed(false);
this->hide();
DlgConnHidWifiSecFast *connHidWifiSecFast = new DlgConnHidWifiSecFast(WepOrWpa);
connHidWifiSecFast->show();
DlgHideWifiEapFast *connHidWifiEapFast = new DlgHideWifiEapFast(WepOrWpa);
connHidWifiEapFast->show();
} else if(ui->cbxAuth->currentIndex()==4) {
qDebug()<<"it's not need to change dialog";
} else {
// QApplication::setQuitOnLastWindowClosed(false);
// this->hide();
// DlgConnHidWifiSecPeap *connHidWifiSecPeap = new DlgConnHidWifiSecPeap(WepOrWpa);
// connHidWifiSecPeap->show();
// DlgHideWifiEapPeap *connHidWifiEapPeap = new DlgHideWifiEapPeap(WepOrWpa);
// connHidWifiEapPeap->show();
}
}
void DlgConnHidWifiSecTunnelTLS::on_cbxCA_currentIndexChanged(const QString &arg1)
void DlgHideWifiEapTTLS::on_cbxCA_currentIndexChanged(const QString &arg1)
{
if (ui->cbxCA->currentIndex() == 0){
ui->leCaPwd->setText("");
@ -271,17 +271,17 @@ void DlgConnHidWifiSecTunnelTLS::on_cbxCA_currentIndexChanged(const QString &arg
}
}
void DlgConnHidWifiSecTunnelTLS::on_btnCancel_clicked()
void DlgHideWifiEapTTLS::on_btnCancel_clicked()
{
this->close();
}
void DlgConnHidWifiSecTunnelTLS::on_btnConnect_clicked()
void DlgHideWifiEapTTLS::on_btnConnect_clicked()
{
this->close();
}
void DlgConnHidWifiSecTunnelTLS::on_checkBoxPwd_stateChanged(int arg1)
void DlgHideWifiEapTTLS::on_checkBoxPwd_stateChanged(int arg1)
{
if (arg1 == 0) {
ui->leCaPwd->setEchoMode(QLineEdit::Password);
@ -290,7 +290,7 @@ void DlgConnHidWifiSecTunnelTLS::on_checkBoxPwd_stateChanged(int arg1)
}
}
void DlgConnHidWifiSecTunnelTLS::on_checkBoxCA_stateChanged(int arg1)
void DlgHideWifiEapTTLS::on_checkBoxCA_stateChanged(int arg1)
{
if (arg1 == 0) {
ui->cbxCA->setCurrentIndex(0);
@ -305,7 +305,7 @@ void DlgConnHidWifiSecTunnelTLS::on_checkBoxCA_stateChanged(int arg1)
}
}
void DlgConnHidWifiSecTunnelTLS::on_checkBoxPwdSec_stateChanged(int arg1)
void DlgHideWifiEapTTLS::on_checkBoxPwdSec_stateChanged(int arg1)
{
if (arg1 == 0) {
ui->lePassword->setEchoMode(QLineEdit::Password);
@ -314,7 +314,7 @@ void DlgConnHidWifiSecTunnelTLS::on_checkBoxPwdSec_stateChanged(int arg1)
}
}
void DlgConnHidWifiSecTunnelTLS::on_leNetName_textEdited(const QString &arg1)
void DlgHideWifiEapTTLS::on_leNetName_textEdited(const QString &arg1)
{
if (ui->leNetName->text() == ""){
ui->btnConnect->setEnabled(false);
@ -337,7 +337,7 @@ void DlgConnHidWifiSecTunnelTLS::on_leNetName_textEdited(const QString &arg1)
}
}
void DlgConnHidWifiSecTunnelTLS::on_leAnonyId_textEdited(const QString &arg1)
void DlgHideWifiEapTTLS::on_leAnonyId_textEdited(const QString &arg1)
{
if (ui->leNetName->text() == ""){
ui->btnConnect->setEnabled(false);
@ -360,7 +360,7 @@ void DlgConnHidWifiSecTunnelTLS::on_leAnonyId_textEdited(const QString &arg1)
}
}
void DlgConnHidWifiSecTunnelTLS::on_leDomain_textEdited(const QString &arg1)
void DlgHideWifiEapTTLS::on_leDomain_textEdited(const QString &arg1)
{
if (ui->leNetName->text() == ""){
ui->btnConnect->setEnabled(false);
@ -383,7 +383,7 @@ void DlgConnHidWifiSecTunnelTLS::on_leDomain_textEdited(const QString &arg1)
}
}
void DlgConnHidWifiSecTunnelTLS::on_leCaPwd_textEdited(const QString &arg1)
void DlgHideWifiEapTTLS::on_leCaPwd_textEdited(const QString &arg1)
{
if (ui->leNetName->text() == ""){
ui->btnConnect->setEnabled(false);
@ -402,7 +402,7 @@ void DlgConnHidWifiSecTunnelTLS::on_leCaPwd_textEdited(const QString &arg1)
}
}
void DlgConnHidWifiSecTunnelTLS::on_leUserName_textEdited(const QString &arg1)
void DlgHideWifiEapTTLS::on_leUserName_textEdited(const QString &arg1)
{
if (ui->leNetName->text() == ""){
ui->btnConnect->setEnabled(false);
@ -425,7 +425,7 @@ void DlgConnHidWifiSecTunnelTLS::on_leUserName_textEdited(const QString &arg1)
}
}
void DlgConnHidWifiSecTunnelTLS::on_lePwd_textEdited(const QString &arg1)
void DlgHideWifiEapTTLS::on_lePwd_textEdited(const QString &arg1)
{
if (ui->leNetName->text() == ""){
ui->btnConnect->setEnabled(false);
@ -448,7 +448,7 @@ void DlgConnHidWifiSecTunnelTLS::on_lePwd_textEdited(const QString &arg1)
}
}
void DlgConnHidWifiSecTunnelTLS::paintEvent(QPaintEvent *event)
void DlgHideWifiEapTTLS::paintEvent(QPaintEvent *event)
{
QStyleOption opt;
opt.init(this);

View File

@ -23,16 +23,16 @@
#include <QMouseEvent>
namespace Ui {
class DlgConnHidWifiSecTunnelTLS;
class DlgHideWifiEapTTLS;
}
class DlgConnHidWifiSecTunnelTLS : public QDialog
class DlgHideWifiEapTTLS : public QDialog
{
Q_OBJECT
public:
explicit DlgConnHidWifiSecTunnelTLS(int type, QWidget *parent = 0);
~DlgConnHidWifiSecTunnelTLS();
explicit DlgHideWifiEapTTLS(int type, QWidget *parent = 0);
~DlgHideWifiEapTTLS();
protected:
void paintEvent(QPaintEvent *event);
@ -67,7 +67,7 @@ private slots:
void on_lePwd_textEdited(const QString &arg1);
private:
Ui::DlgConnHidWifiSecTunnelTLS *ui;
Ui::DlgHideWifiEapTTLS *ui;
int WepOrWpa = 0;//0 WEP;1WPA
void mousePressEvent(QMouseEvent *event);

View File

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>DlgConnHidWifiSecTunnelTLS</class>
<widget class="QDialog" name="DlgConnHidWifiSecTunnelTLS">
<class>DlgHideWifiEapTTLS</class>
<widget class="QDialog" name="DlgHideWifiEapTTLS">
<property name="geometry">
<rect>
<x>0</x>

View File

@ -17,14 +17,14 @@
*/
#include "ui_dlgconnhidwifileap.h"
#include "ui_dlghidewifileap.h"
#include "kylinheadfile.h"
#include <sys/syslog.h>
DlgConnHidWifiLeap::DlgConnHidWifiLeap(QWidget *parent) :
DlgHideWifiLeap::DlgHideWifiLeap(QWidget *parent) :
QDialog(parent),
ui(new Ui::DlgConnHidWifiLeap)
ui(new Ui::DlgHideWifiLeap)
{
ui->setupUi(this);
@ -76,7 +76,7 @@ DlgConnHidWifiLeap::DlgConnHidWifiLeap(QWidget *parent) :
ui->cbxConn->addItem(tr("C_reate…")); //新建...
int status = system("nmcli connection show>/tmp/kylin-nm-connshow");
if (status != 0){ syslog(LOG_ERR, "execute 'nmcli connection show' in function 'DlgConnHidWifiLeap' failed");}
if (status != 0){ syslog(LOG_ERR, "execute 'nmcli connection show' in function 'DlgHideWifiLeap' failed");}
QFile file("/tmp/kylin-nm-connshow");
if(!file.open(QIODevice::ReadOnly | QIODevice::Text)){
qDebug()<<"Can't open the file!";
@ -109,12 +109,12 @@ DlgConnHidWifiLeap::DlgConnHidWifiLeap(QWidget *parent) :
KWindowEffects::enableBlurBehind(this->winId(), true, QRegion(path.toFillPolygon().toPolygon()));
}
DlgConnHidWifiLeap::~DlgConnHidWifiLeap()
DlgHideWifiLeap::~DlgHideWifiLeap()
{
delete ui;
}
void DlgConnHidWifiLeap::mousePressEvent(QMouseEvent *event){
void DlgHideWifiLeap::mousePressEvent(QMouseEvent *event){
if(event->button() == Qt::LeftButton){
this->isPress = true;
this->winPos = this->pos();
@ -122,10 +122,10 @@ void DlgConnHidWifiLeap::mousePressEvent(QMouseEvent *event){
event->accept();
}
}
void DlgConnHidWifiLeap::mouseReleaseEvent(QMouseEvent *event){
void DlgHideWifiLeap::mouseReleaseEvent(QMouseEvent *event){
this->isPress = false;
}
void DlgConnHidWifiLeap::mouseMoveEvent(QMouseEvent *event){
void DlgHideWifiLeap::mouseMoveEvent(QMouseEvent *event){
if(this->isPress){
this->move(this->winPos - (this->dragPos - event->globalPos()));
event->accept();
@ -133,54 +133,54 @@ void DlgConnHidWifiLeap::mouseMoveEvent(QMouseEvent *event){
}
//切换到其他Wi-Fi安全类型
void DlgConnHidWifiLeap::changeDialog()
void DlgHideWifiLeap::changeDialog()
{
if(ui->cbxSecurity->currentIndex()==0){
QApplication::setQuitOnLastWindowClosed(false);
this->hide();
DlgConnHidWifi *connHidWifi = new DlgConnHidWifi(0);
DlgHideWifi *connHidWifi = new DlgHideWifi(0);
connHidWifi->show();
} else if(ui->cbxSecurity->currentIndex()==1) {
QApplication::setQuitOnLastWindowClosed(false);
this->hide();
DlgConnHidWifiWpa *connHidWifiWpa = new DlgConnHidWifiWpa(0);
DlgHideWifiWpa *connHidWifiWpa = new DlgHideWifiWpa(0);
connHidWifiWpa->show();
} else if(ui->cbxSecurity->currentIndex()==2) {
QApplication::setQuitOnLastWindowClosed(false);
this->hide();
DlgConnHidWifiWep *connHidWifiWep = new DlgConnHidWifiWep(0);
DlgHideWifiWep *connHidWifiWep = new DlgHideWifiWep(0);
connHidWifiWep->show();
} else if(ui->cbxSecurity->currentIndex()==3) {
QApplication::setQuitOnLastWindowClosed(false);
this->hide();
DlgConnHidWifiWep *connHidWifiWep = new DlgConnHidWifiWep(1);
DlgHideWifiWep *connHidWifiWep = new DlgHideWifiWep(1);
connHidWifiWep->show();
} else if(ui->cbxSecurity->currentIndex()==4) {
qDebug()<<"it's not need to change dialog";
} else if(ui->cbxSecurity->currentIndex()==5) {
// QApplication::setQuitOnLastWindowClosed(false);
// this->hide();
// DlgConnHidWifiSecTls *connHidWifiSecTls = new DlgConnHidWifiSecTls(0);
// connHidWifiSecTls->show();
// DlgHideWifiEapTls *connHidWifiEapTls = new DlgHideWifiEapTls(0);
// connHidWifiEapTls->show();
} else {
// QApplication::setQuitOnLastWindowClosed(false);
// this->hide();
// DlgConnHidWifiSecTls *connHidWifiSecTls = new DlgConnHidWifiSecTls(1);
// connHidWifiSecTls->show();
// DlgHideWifiEapTls *connHidWifiEapTls = new DlgHideWifiEapTls(1);
// connHidWifiEapTls->show();
}
}
void DlgConnHidWifiLeap::on_btnCancel_clicked()
void DlgHideWifiLeap::on_btnCancel_clicked()
{
this->close();
}
void DlgConnHidWifiLeap::on_btnConnect_clicked()
void DlgHideWifiLeap::on_btnConnect_clicked()
{
this->close();
}
void DlgConnHidWifiLeap::on_checkBoxPwd_stateChanged(int arg1)
void DlgHideWifiLeap::on_checkBoxPwd_stateChanged(int arg1)
{
if (arg1 == 0) {
ui->lePassword ->setEchoMode(QLineEdit::Password);
@ -189,7 +189,7 @@ void DlgConnHidWifiLeap::on_checkBoxPwd_stateChanged(int arg1)
}
}
void DlgConnHidWifiLeap::on_leNetName_textEdited(const QString &arg1)
void DlgHideWifiLeap::on_leNetName_textEdited(const QString &arg1)
{
if (ui->leNetName->text() == "" || ui->lePassword->text() == ""){
ui->btnConnect->setEnabled(false);
@ -202,7 +202,7 @@ void DlgConnHidWifiLeap::on_leNetName_textEdited(const QString &arg1)
}
}
void DlgConnHidWifiLeap::on_leUserName_textEdited(const QString &arg1)
void DlgHideWifiLeap::on_leUserName_textEdited(const QString &arg1)
{
if (ui->leNetName->text() == ""){
ui->btnConnect->setEnabled(false);
@ -215,7 +215,7 @@ void DlgConnHidWifiLeap::on_leUserName_textEdited(const QString &arg1)
}
}
void DlgConnHidWifiLeap::on_lePassword_textEdited(const QString &arg1)
void DlgHideWifiLeap::on_lePassword_textEdited(const QString &arg1)
{
if (ui->leNetName->text() == ""){
ui->btnConnect->setEnabled(false);
@ -228,7 +228,7 @@ void DlgConnHidWifiLeap::on_lePassword_textEdited(const QString &arg1)
}
}
void DlgConnHidWifiLeap::paintEvent(QPaintEvent *event)
void DlgHideWifiLeap::paintEvent(QPaintEvent *event)
{
QStyleOption opt;
opt.init(this);

View File

@ -23,16 +23,16 @@
#include <QMouseEvent>
namespace Ui {
class DlgConnHidWifiLeap;
class DlgHideWifiLeap;
}
class DlgConnHidWifiLeap : public QDialog
class DlgHideWifiLeap : public QDialog
{
Q_OBJECT
public:
explicit DlgConnHidWifiLeap(QWidget *parent = 0);
~DlgConnHidWifiLeap();
explicit DlgHideWifiLeap(QWidget *parent = 0);
~DlgHideWifiLeap();
protected:
void paintEvent(QPaintEvent *event);
@ -54,7 +54,7 @@ private slots:
void on_lePassword_textEdited(const QString &arg1);
private:
Ui::DlgConnHidWifiLeap *ui;
Ui::DlgHideWifiLeap *ui;
void mousePressEvent(QMouseEvent *event);
void mouseReleaseEvent(QMouseEvent *event);

View File

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>DlgConnHidWifiLeap</class>
<widget class="QDialog" name="DlgConnHidWifiLeap">
<class>DlgHideWifiLeap</class>
<widget class="QDialog" name="DlgHideWifiLeap">
<property name="geometry">
<rect>
<x>0</x>

View File

@ -17,15 +17,15 @@
*/
#include "ui_dlgconnhidwifiwep.h"
#include "ui_dlghidewifiwep.h"
#include "kylinheadfile.h"
#include <sys/syslog.h>
DlgConnHidWifiWep::DlgConnHidWifiWep(int type, QWidget *parent) :
DlgHideWifiWep::DlgHideWifiWep(int type, QWidget *parent) :
WepPwdOrCode(type),
QDialog(parent),
ui(new Ui::DlgConnHidWifiWep)
ui(new Ui::DlgHideWifiWep)
{
ui->setupUi(this);
@ -82,7 +82,7 @@ DlgConnHidWifiWep::DlgConnHidWifiWep(int type, QWidget *parent) :
ui->cbxConn->addItem(tr("C_reate…")); //新建...
int status = system("nmcli connection show>/tmp/kylin-nm-connshow");
if (status != 0){ syslog(LOG_ERR, "execute 'nmcli connection show' in function 'DlgConnHidWifiWep' failed");}
if (status != 0){ syslog(LOG_ERR, "execute 'nmcli connection show' in function 'DlgHideWifiWep' failed");}
QFile file("/tmp/kylin-nm-connshow");
if(!file.open(QIODevice::ReadOnly | QIODevice::Text)){
qDebug()<<"Can't open the file!";
@ -129,12 +129,12 @@ DlgConnHidWifiWep::DlgConnHidWifiWep(int type, QWidget *parent) :
KWindowEffects::enableBlurBehind(this->winId(), true, QRegion(path.toFillPolygon().toPolygon()));
}
DlgConnHidWifiWep::~DlgConnHidWifiWep()
DlgHideWifiWep::~DlgHideWifiWep()
{
delete ui;
}
void DlgConnHidWifiWep::mousePressEvent(QMouseEvent *event){
void DlgHideWifiWep::mousePressEvent(QMouseEvent *event){
if(event->button() == Qt::LeftButton){
this->isPress = true;
this->winPos = this->pos();
@ -142,10 +142,10 @@ void DlgConnHidWifiWep::mousePressEvent(QMouseEvent *event){
event->accept();
}
}
void DlgConnHidWifiWep::mouseReleaseEvent(QMouseEvent *event){
void DlgHideWifiWep::mouseReleaseEvent(QMouseEvent *event){
this->isPress = false;
}
void DlgConnHidWifiWep::mouseMoveEvent(QMouseEvent *event){
void DlgHideWifiWep::mouseMoveEvent(QMouseEvent *event){
if(this->isPress){
this->move(this->winPos - (this->dragPos - event->globalPos()));
event->accept();
@ -153,17 +153,17 @@ void DlgConnHidWifiWep::mouseMoveEvent(QMouseEvent *event){
}
//切换到其他Wi-Fi安全类型
void DlgConnHidWifiWep::changeDialog()
void DlgHideWifiWep::changeDialog()
{
if(ui->cbxSecurity->currentIndex()==0){
QApplication::setQuitOnLastWindowClosed(false);
this->hide();
DlgConnHidWifi *connHidWifi = new DlgConnHidWifi(0);
DlgHideWifi *connHidWifi = new DlgHideWifi(0);
connHidWifi->show();
} else if(ui->cbxSecurity->currentIndex()==1) {
QApplication::setQuitOnLastWindowClosed(false);
this->hide();
DlgConnHidWifiWpa *connHidWifiWpa = new DlgConnHidWifiWpa(0);
DlgHideWifiWpa *connHidWifiWpa = new DlgHideWifiWpa(0);
connHidWifiWpa->show();
} else if(ui->cbxSecurity->currentIndex()==2) {
if (WepPwdOrCode == 1) {
@ -178,32 +178,32 @@ void DlgConnHidWifiWep::changeDialog()
} else if(ui->cbxSecurity->currentIndex()==4) {
QApplication::setQuitOnLastWindowClosed(false);
this->hide();
DlgConnHidWifiLeap *connHidWifiLeap = new DlgConnHidWifiLeap();
DlgHideWifiLeap *connHidWifiLeap = new DlgHideWifiLeap();
connHidWifiLeap->show();
} else if(ui->cbxSecurity->currentIndex()==5) {
// QApplication::setQuitOnLastWindowClosed(false);
// this->hide();
// DlgConnHidWifiSecTls *connHidWifiSecTls = new DlgConnHidWifiSecTls(0);
// connHidWifiSecTls->show();
// DlgHideWifiEapTls *connHidWifiEapTls = new DlgHideWifiEapTls(0);
// connHidWifiEapTls->show();
} else {
// QApplication::setQuitOnLastWindowClosed(false);
// this->hide();
// DlgConnHidWifiSecTls *connHidWifiSecTls = new DlgConnHidWifiSecTls(1);
// connHidWifiSecTls->show();
// DlgHideWifiEapTls *connHidWifiEapTls = new DlgHideWifiEapTls(1);
// connHidWifiEapTls->show();
}
}
void DlgConnHidWifiWep::on_btnCancel_clicked()
void DlgHideWifiWep::on_btnCancel_clicked()
{
this->close();
}
void DlgConnHidWifiWep::on_btnConnect_clicked()
void DlgHideWifiWep::on_btnConnect_clicked()
{
this->close();
}
void DlgConnHidWifiWep::on_checkBoxPwd_stateChanged(int arg1)
void DlgHideWifiWep::on_checkBoxPwd_stateChanged(int arg1)
{
if (arg1 == 0) {
ui->leKey->setEchoMode(QLineEdit::Password);
@ -212,7 +212,7 @@ void DlgConnHidWifiWep::on_checkBoxPwd_stateChanged(int arg1)
}
}
void DlgConnHidWifiWep::on_leKey_textEdited(const QString &arg1)
void DlgHideWifiWep::on_leKey_textEdited(const QString &arg1)
{
if (ui->leNetName->text() == "" || ui->leKey->text() == ""){
ui->btnConnect->setEnabled(false);
@ -221,7 +221,7 @@ void DlgConnHidWifiWep::on_leKey_textEdited(const QString &arg1)
}
}
void DlgConnHidWifiWep::on_leNetName_textEdited(const QString &arg1)
void DlgHideWifiWep::on_leNetName_textEdited(const QString &arg1)
{
if (ui->leNetName->text() == "" || ui->leKey->text() == ""){
ui->btnConnect->setEnabled(false);
@ -230,7 +230,7 @@ void DlgConnHidWifiWep::on_leNetName_textEdited(const QString &arg1)
}
}
void DlgConnHidWifiWep::paintEvent(QPaintEvent *event)
void DlgHideWifiWep::paintEvent(QPaintEvent *event)
{
QStyleOption opt;
opt.init(this);

View File

@ -23,16 +23,16 @@
#include <QMouseEvent>
namespace Ui {
class DlgConnHidWifiWep;
class DlgHideWifiWep;
}
class DlgConnHidWifiWep : public QDialog
class DlgHideWifiWep : public QDialog
{
Q_OBJECT
public:
explicit DlgConnHidWifiWep(int type, QWidget *parent = 0);
~DlgConnHidWifiWep();
explicit DlgHideWifiWep(int type, QWidget *parent = 0);
~DlgHideWifiWep();
protected:
void paintEvent(QPaintEvent *event);
@ -52,7 +52,7 @@ private slots:
void on_leNetName_textEdited(const QString &arg1);
private:
Ui::DlgConnHidWifiWep *ui;
Ui::DlgHideWifiWep *ui;
int WepPwdOrCode = 0; //0 WEP password;1 WEP Code Sentence
void mousePressEvent(QMouseEvent *event);

View File

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>DlgConnHidWifiWep</class>
<widget class="QDialog" name="DlgConnHidWifiWep">
<class>DlgHideWifiWep</class>
<widget class="QDialog" name="DlgHideWifiWep">
<property name="geometry">
<rect>
<x>0</x>

View File

@ -17,8 +17,8 @@
*/
#include "dlgconnhidwifiwpa.h"
#include "ui_dlgconnhidwifiwpa.h"
#include "dlghidewifiwpa.h"
#include "ui_dlghidewifiwpa.h"
#include "kylinheadfile.h"
#include "src/backthread.h"
#include "src/mainwindow.h"
@ -28,10 +28,10 @@
#include <QDir>
DlgConnHidWifiWpa::DlgConnHidWifiWpa(int type, MainWindow *mainWindow, QWidget *parent) :
DlgHideWifiWpa::DlgHideWifiWpa(int type, MainWindow *mainWindow, QWidget *parent) :
isUsed(type),
QDialog(parent),
ui(new Ui::DlgConnHidWifiWpa)
ui(new Ui::DlgHideWifiWpa)
{
ui->setupUi(this);
@ -85,7 +85,7 @@ DlgConnHidWifiWpa::DlgConnHidWifiWpa(int type, MainWindow *mainWindow, QWidget *
QString cmd = "nmcli connection show > " + tmpPath;
int status = system(cmd.toUtf8().data());
if (status != 0) {
syslog(LOG_ERR, "execute 'nmcli connection show' in function 'DlgConnHidWifiWpa' failed");
syslog(LOG_ERR, "execute 'nmcli connection show' in function 'DlgHideWifiWpa' failed");
}
QFile file(tmpPath);
if(!file.open(QIODevice::ReadOnly | QIODevice::Text)){
@ -136,12 +136,12 @@ DlgConnHidWifiWpa::DlgConnHidWifiWpa(int type, MainWindow *mainWindow, QWidget *
KWindowEffects::enableBlurBehind(this->winId(), true, QRegion(path.toFillPolygon().toPolygon()));
}
DlgConnHidWifiWpa::~DlgConnHidWifiWpa()
DlgHideWifiWpa::~DlgHideWifiWpa()
{
delete ui;
}
void DlgConnHidWifiWpa::mousePressEvent(QMouseEvent *event){
void DlgHideWifiWpa::mousePressEvent(QMouseEvent *event){
if(event->button() == Qt::LeftButton){
this->isPress = true;
this->winPos = this->pos();
@ -149,10 +149,10 @@ void DlgConnHidWifiWpa::mousePressEvent(QMouseEvent *event){
event->accept();
}
}
void DlgConnHidWifiWpa::mouseReleaseEvent(QMouseEvent *event){
void DlgHideWifiWpa::mouseReleaseEvent(QMouseEvent *event){
this->isPress = false;
}
void DlgConnHidWifiWpa::mouseMoveEvent(QMouseEvent *event){
void DlgHideWifiWpa::mouseMoveEvent(QMouseEvent *event){
if(this->isPress){
this->move(this->winPos - (this->dragPos - event->globalPos()));
event->accept();
@ -160,12 +160,12 @@ void DlgConnHidWifiWpa::mouseMoveEvent(QMouseEvent *event){
}
//切换到其他Wi-Fi安全类型
void DlgConnHidWifiWpa::changeDialog()
void DlgHideWifiWpa::changeDialog()
{
if (ui->cbxSecurity->currentIndex()==0) {
QApplication::setQuitOnLastWindowClosed(false);
this->hide();
DlgConnHidWifi *connHidWifi = new DlgConnHidWifi(0);
DlgHideWifi *connHidWifi = new DlgHideWifi(0);
connHidWifi->show();
connect(connHidWifi, SIGNAL(reSetWifiList() ), mw, SLOT(on_btnWifiList_clicked()) );
} else if(ui->cbxSecurity->currentIndex()==1) {
@ -173,38 +173,38 @@ void DlgConnHidWifiWpa::changeDialog()
} else if(ui->cbxSecurity->currentIndex()==2) {
QApplication::setQuitOnLastWindowClosed(false);
this->hide();
DlgConnHidWifiSecPeap *connHidWifiSecPeap = new DlgConnHidWifiSecPeap(1, 0, mw);
connHidWifiSecPeap->show();
DlgHideWifiEapPeap *connHidWifiEapPeap = new DlgHideWifiEapPeap(1, 0, mw);
connHidWifiEapPeap->show();
} else if(ui->cbxSecurity->currentIndex()==3) {
QApplication::setQuitOnLastWindowClosed(false);
this->hide();
DlgConnHidWifiWep *connHidWifiWep = new DlgConnHidWifiWep(0);
DlgHideWifiWep *connHidWifiWep = new DlgHideWifiWep(0);
connHidWifiWep->show();
} else if(ui->cbxSecurity->currentIndex()==4) {
QApplication::setQuitOnLastWindowClosed(false);
this->hide();
DlgConnHidWifiWep *connHidWifiWep = new DlgConnHidWifiWep(1);
DlgHideWifiWep *connHidWifiWep = new DlgHideWifiWep(1);
connHidWifiWep->show();
} else if(ui->cbxSecurity->currentIndex()==5) {
QApplication::setQuitOnLastWindowClosed(false);
this->hide();
DlgConnHidWifiLeap *connHidWifiLeap = new DlgConnHidWifiLeap();
DlgHideWifiLeap *connHidWifiLeap = new DlgHideWifiLeap();
connHidWifiLeap->show();
} else {
QApplication::setQuitOnLastWindowClosed(false);
this->hide();
DlgConnHidWifiSecPeap *connHidWifiSecPeap = new DlgConnHidWifiSecPeap(0, 0, mw);
connHidWifiSecPeap->show();
DlgHideWifiEapPeap *connHidWifiEapPeap = new DlgHideWifiEapPeap(0, 0, mw);
connHidWifiEapPeap->show();
}
}
//同一 Wi-Fi安全类型的窗口变换
void DlgConnHidWifiWpa::changeWindow()
void DlgHideWifiWpa::changeWindow()
{
if (ui->cbxConn->currentIndex() == 0){
QApplication::setQuitOnLastWindowClosed(false);
this->hide();
DlgConnHidWifi *connHidWifi = new DlgConnHidWifi(0, mw);
DlgHideWifi *connHidWifi = new DlgHideWifi(0, mw);
connHidWifi->show();
connect(connHidWifi, SIGNAL(reSetWifiList() ), mw, SLOT(on_btnWifiList_clicked()) );
}else if (ui->cbxConn->currentIndex() >= 1){
@ -237,26 +237,26 @@ void DlgConnHidWifiWpa::changeWindow()
if (txt.indexOf("wpa-eap") != -1) {
QApplication::setQuitOnLastWindowClosed(false);
this->hide();
DlgConnHidWifiSecPeap *connHidWifiSecPeap = new DlgConnHidWifiSecPeap(1, ui->cbxConn->currentIndex(), mw);
connHidWifiSecPeap->show();
DlgHideWifiEapPeap *connHidWifiEapPeap = new DlgHideWifiEapPeap(1, ui->cbxConn->currentIndex(), mw);
connHidWifiEapPeap->show();
}
}else {
QApplication::setQuitOnLastWindowClosed(false);
this->hide();
DlgConnHidWifi *connHidWifi = new DlgConnHidWifi(ui->cbxConn->currentIndex(), mw);
DlgHideWifi *connHidWifi = new DlgHideWifi(ui->cbxConn->currentIndex(), mw);
connHidWifi->show();
connect(connHidWifi, SIGNAL(reSetWifiList() ), mw, SLOT(on_btnWifiList_clicked()) );
}
}
}
void DlgConnHidWifiWpa::on_btnCancel_clicked()
void DlgHideWifiWpa::on_btnCancel_clicked()
{
//this->close();
this->hide();
}
void DlgConnHidWifiWpa::on_btnConnect_clicked()
void DlgHideWifiWpa::on_btnConnect_clicked()
{
QThread *t = new QThread();
connect(t, SIGNAL(finished()), t, SLOT(deleteLater()));
@ -301,7 +301,7 @@ void DlgConnHidWifiWpa::on_btnConnect_clicked()
this->hide();
}
void DlgConnHidWifiWpa::on_checkBoxPwd_stateChanged(int arg1)
void DlgHideWifiWpa::on_checkBoxPwd_stateChanged(int arg1)
{
if (arg1 == 0) {
ui->lePassword ->setEchoMode(QLineEdit::Password);
@ -310,7 +310,7 @@ void DlgConnHidWifiWpa::on_checkBoxPwd_stateChanged(int arg1)
}
}
void DlgConnHidWifiWpa::on_leNetName_textEdited(const QString &arg1)
void DlgHideWifiWpa::on_leNetName_textEdited(const QString &arg1)
{
if (ui->leNetName->text() == "" || ui->lePassword->text() == ""){
ui->btnConnect->setEnabled(false);
@ -319,7 +319,7 @@ void DlgConnHidWifiWpa::on_leNetName_textEdited(const QString &arg1)
}
}
void DlgConnHidWifiWpa::on_lePassword_textEdited(const QString &arg1)
void DlgHideWifiWpa::on_lePassword_textEdited(const QString &arg1)
{
if (ui->leNetName->text() == "" || ui->lePassword->text() == ""){
ui->btnConnect->setEnabled(false);
@ -328,12 +328,12 @@ void DlgConnHidWifiWpa::on_lePassword_textEdited(const QString &arg1)
}
}
void DlgConnHidWifiWpa::slotStartLoading()
void DlgHideWifiWpa::slotStartLoading()
{
mw->startLoading();
}
void DlgConnHidWifiWpa::on_execSecConn()
void DlgHideWifiWpa::on_execSecConn()
{
QString str = "nmcli device wifi connect " + strWifiname + " password " + strWifiPassword;
int status = system(str.toUtf8().data());
@ -342,14 +342,14 @@ void DlgConnHidWifiWpa::on_execSecConn()
QTimer::singleShot(3*1000, this, SLOT(emitSignal() ));
}
void DlgConnHidWifiWpa::emitSignal()
void DlgHideWifiWpa::emitSignal()
{
emit reSetWifiList();
mw->stopLoading();
emit this->stopSignal();
}
void DlgConnHidWifiWpa::paintEvent(QPaintEvent *event)
void DlgHideWifiWpa::paintEvent(QPaintEvent *event)
{
KylinDBus mkylindbus;
double trans = mkylindbus.getTransparentData();

View File

@ -26,16 +26,16 @@
class MainWindow;
namespace Ui {
class DlgConnHidWifiWpa;
class DlgHideWifiWpa;
}
class DlgConnHidWifiWpa : public QDialog
class DlgHideWifiWpa : public QDialog
{
Q_OBJECT
public:
explicit DlgConnHidWifiWpa(int type, MainWindow *mw = 0, QWidget *parent = 0);
~DlgConnHidWifiWpa();
explicit DlgHideWifiWpa(int type, MainWindow *mw = 0, QWidget *parent = 0);
~DlgHideWifiWpa();
protected:
void paintEvent(QPaintEvent *event);
@ -65,7 +65,7 @@ signals:
void stopSignal();
private:
Ui::DlgConnHidWifiWpa *ui;
Ui::DlgHideWifiWpa *ui;
int isUsed;//=0 current wifi not used before; >=1 used
MainWindow *mw;
QString strWifiname;

View File

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>DlgConnHidWifiWpa</class>
<widget class="QDialog" name="DlgConnHidWifiWpa">
<class>DlgHideWifiWpa</class>
<widget class="QDialog" name="DlgHideWifiWpa">
<property name="geometry">
<rect>
<x>0</x>

View File

@ -19,16 +19,16 @@
#ifndef KYLINHEADFILE_H
#define KYLINHEADFILE_H
#include "dlgconnhidwifi.h"
#include "dlgconnhidwifileap.h"
#include "dlgconnhidwifisecfast.h"
#include "dlgconnhidwifisecleap.h"
#include "dlgconnhidwifisecpeap.h"
#include "dlgconnhidwifisecpwd.h"
#include "dlgconnhidwifisectls.h"
#include "dlgconnhidwifisectunneltls.h"
#include "dlgconnhidwifiwep.h"
#include "dlgconnhidwifiwpa.h"
#include "dlghidewifi.h"
#include "dlghidewifileap.h"
#include "dlghidewifieapfast.h"
#include "dlghidewifieapleap.h"
#include "dlghidewifieappeap.h"
#include "dlghidewifieappwd.h"
#include "dlghidewifieaptls.h"
#include "dlghidewifieapttls.h"
#include "dlghidewifiwep.h"
#include "dlghidewifiwpa.h"
#include <QDebug>
#include <QFile>