Remove redundent comments

This commit is contained in:
chenlelin 2020-12-08 14:45:58 +08:00
parent d0919b9ec2
commit 5483d1446d
21 changed files with 61 additions and 512 deletions

View File

@ -99,8 +99,6 @@ void DlgHotspotCreate::on_btnOk_clicked()
str = "nmcli device wifi hotspot ifname " + wirelessCardName + " con-name " + ui->leNetName->text() + " ssid " + ui->leNetName->text() + " password " + ui->lePassword->text();
}
Utils::m_system(str.toUtf8().data());
// int status = system(str.toUtf8().data());
// if (status != 0){ syslog(LOG_ERR, "execute 'nmcli device wifi hotspot' in function 'on_btnOk_clicked' failed");}
this->close();
emit updateHotspotList();

View File

@ -52,9 +52,6 @@ IFace* BackThread::execGetIface()
QString cmd = "export LANG='en_US.UTF-8';export LANGUAGE='en_US';nmcli -f TYPE,DEVICE,STATE device > " + tmpPath;
Utils::m_system(cmd.toUtf8().data());
// int status = system(cmd.toUtf8().data());
// if (status != 0){ syslog(LOG_ERR, "execute 'nmcli device' in function 'execGetIface' failed");}
QFile file(tmpPath);
if (!file.open(QIODevice::ReadOnly | QIODevice::Text)) {
// print information if can not open file ~/.config/kylin-nm-iface
@ -118,8 +115,6 @@ void BackThread::execEnNet()
char *chr = "nmcli networking on";
Utils::m_system(chr);
// int status = system("nmcli networking on");
// if (status != 0){ syslog(LOG_ERR, "execute 'nmcli networking on' in function 'execEnNet' failed");}
while (1) {
if (execGetIface()->lstate != 2) {
sleep(3);
@ -138,8 +133,6 @@ void BackThread::execDisNet()
char *chr = "nmcli radio wifi off";
Utils::m_system(chr);
// int status = system("nmcli radio wifi off");
// if (status != 0){ syslog(LOG_ERR, "execute 'nmcli radio wifi off' in function 'execDisNet' failed");}
while (1) {
if (execGetIface()->wstate == 2) {
emit disWifiDone();
@ -152,8 +145,7 @@ void BackThread::execDisNet()
char *chr1 = "nmcli networking off";
Utils::m_system(chr1);
// int status1 = system("nmcli networking off");
// if (status1 != 0){ syslog(LOG_ERR, "execute 'nmcli networking off' in function 'execDisNet' failed");}
while (1) {
if (execGetIface()->lstate == 2) {
emit disNetDone();
@ -167,24 +159,8 @@ void BackThread::execDisNet()
//turn on the switch of wireless network
void BackThread::execEnWifi()
{
//if (execGetIface()->lstate == 2){
// char *chr = "nmcli networking on";
// Utils::m_system(chr);
// //int status = system("nmcli networking on");
// //if (status != 0){ syslog(LOG_ERR, "execute 'nmcli networking on' in function 'execEnWifi' failed");}
// while(1){
// if (execGetIface()->lstate != 2){
// emit launchLanDone();
// break;
// }
// sleep(1);
// }
//}
char *chr1 = "nmcli radio wifi on";
Utils::m_system(chr1);
//int status1 = system("nmcli radio wifi on");
//if (status1 != 0){ syslog(LOG_ERR, "execute 'nmcli radio wifi on' in function 'execEnWifi' failed");}
while (1) {
if (execGetIface()->wstate != 2) {
KylinDBus objKyDbus;
@ -208,8 +184,6 @@ void BackThread::execDisWifi()
{
char *chr = "nmcli radio wifi off";
Utils::m_system(chr);
// int status = system("nmcli radio wifi off");
// if (status != 0){ syslog(LOG_ERR, "execute 'nmcli radio wifi off' in function 'execDisWifi' failed");}
while (1) {
if (execGetIface()->wstate == 2) {
emit disWifiDone();
@ -230,8 +204,6 @@ void BackThread::execConnLan(QString connName)
// only if wired cable is plug in, can connect wired network
QString cmd = "export LANG='en_US.UTF-8';export LANGUAGE='en_US';nmcli connection up '" + connName + "'";
Utils::m_system(cmd.toUtf8().data());
// int status = system(cmd.toUtf8().data());
// if (status != 0){ syslog(LOG_ERR, "execute 'nmcli connection up' in function 'execConnLan' failed");}
qDebug()<<"debug: in function execConnLan, wired net state is: "<<QString::number(execGetIface()->lstate);
syslog(LOG_DEBUG, "In function execConnLan, wired net state is: %d", execGetIface()->lstate);
emit connDone(0);
@ -257,8 +229,6 @@ void BackThread::execConnWifiPWD(QString connName, QString password, QString con
QString tmpPath = "/tmp/kylin-nm-btoutput-" + QDir::home().dirName();
QString cmdStr = "export LANG='en_US.UTF-8';export LANGUAGE='en_US';nmcli device wifi connect '" + connName + "' password '" + password + "' > " + tmpPath;
Utils::m_system(cmdStr.toUtf8().data());
// int status = system(cmdStr.toUtf8().data());
// if (status != 0){ syslog(LOG_ERR, "execute 'nmcli device wifi connect' in function 'execConnWifiPWD' failed");}
QFile file(tmpPath);
if (!file.open(QIODevice::ReadOnly | QIODevice::Text)) {
@ -334,8 +304,6 @@ QString BackThread::getConnProp(QString connName)
QString tmpPath = "/tmp/kylin-nm-connprop-" + QDir::home().dirName();
QString cmd = "nmcli connection show '" + connName + "' > " + tmpPath;
Utils::m_system(cmd.toUtf8().data());
// int status = system(cmd.toUtf8().data());
// if (status != 0){ syslog(LOG_ERR, "execute 'nmcli connection show' in function 'getConnProp' failed");}
QFile file(tmpPath);
if (!file.open(QIODevice::ReadOnly | QIODevice::Text)) {
@ -394,8 +362,6 @@ QString BackThread::execChkLanWidth(QString ethName)
QString tmpPath = "/tmp/kylin-nm-bandwidth-" + QDir::home().dirName();
QString cmd = "export LANG='en_US.UTF-8';export LANGUAGE='en_US';ethtool '" + ethName + "' | grep Speed > " + tmpPath;
Utils::m_system(cmd.toUtf8().data());
// int status = system(cmd.toUtf8().data());
// if (status != 0){ syslog(LOG_ERR, "execute 'ethtool' in function 'execChkLanWidth' failed");}
QFile file(tmpPath);
if (!file.open(QIODevice::ReadOnly | QIODevice::Text)) {

View File

@ -69,7 +69,6 @@ signals:
void enNetDone();
void disNetDone();
void enWifiDone();
void launchLanDone();
void disWifiDone();
void connDone(int connFlag);

View File

@ -65,33 +65,10 @@ ConfForm::ConfForm(QWidget *parent) :
"QPushButton:Pressed{border-radius:4px;background-color:rgba(50,87,202,1);}";
lineQss = "background:rgba(156,156,156,0.1);";
// ui->centralWidget->setStyleSheet("#centralWidget{border:1px solid #297a97;background-color:#ffffff;}");
ui->wdHead->setStyleSheet("#wdHead{border:none}");
ui->wgManual->setStyleSheet("#wgManual{border:none}");
ui->wdBottom->setStyleSheet("#wdBottom{border:none}");
ui->lbLeftupTitle->setStyleSheet("QLabel{font-size:20px;}");
// ui->lbName->setStyleSheet(labelQss);
// ui->lbTxt1->setStyleSheet(labelQss);
// ui->lbTxt2->setStyleSheet(labelQss);
// ui->lbTxt3->setStyleSheet(labelQss);
// ui->lbTxt4->setStyleSheet(labelQss);
// ui->lbTxt5->setStyleSheet(labelQss);
// ui->lbTxt6->setStyleSheet(labelQss);
// ui->cbType->setStyleSheet(cbxQss);
// ui->cbType->setView(new QListView());
// ui->cbMask->setStyleSheet(cbxQss);
// ui->cbMask->setView(new QListView());
// ui->leName->setStyleSheet(leQss);
// ui->leAddr->setStyleSheet(leQss);
// ui->leGateway->setStyleSheet(leQss);
// ui->leDns->setStyleSheet(leQss);
// ui->leDns2->setStyleSheet(leQss);
// ui->btnCancel->setStyleSheet(btnOffQss);
// ui->btnOk->setStyleSheet(btnOnQss);
// ui->btnCreate->setStyleSheet(btnOnQss);
ui->leAddr->setContextMenuPolicy(Qt::NoContextMenu);
ui->leName->setContextMenuPolicy(Qt::NoContextMenu);
ui->leDns->setContextMenuPolicy(Qt::NoContextMenu);
@ -242,8 +219,6 @@ void ConfForm::on_btnCreate_clicked()
QString cmdStr = "nmcli connection add con-name '" + ui->leName->text() + "' ifname '" + mIfname + "' type ethernet";
Utils::m_system(cmdStr.toUtf8().data());
//int status = system(cmdStr.toUtf8().data());
//if (status != 0){ syslog(LOG_ERR, "execute 'nmcli connection add con-name' in function 'on_btnCreate_clicked' failed");}
if (ui->cbType->currentIndex() == 1) {
//config the ipv4 and netmask and gateway if select Manual
@ -254,7 +229,6 @@ void ConfForm::on_btnCreate_clicked()
kylindbus.showDesktopNotify(txt);
}
//this->close();
this->hide();
}
@ -294,30 +268,11 @@ void ConfForm::on_btnSave_clicked()
}
this->saveNetworkConfiguration();
//this->close();
this->hide();
QString txt(tr("New network settings already finished"));
kylindbus.showDesktopNotify(txt);
// if (!this->isCreateNewNet) {
// if (this->isActConf == true) {
// // 如果是修改当前连接的网络,则修改设置后简略重连网络
// //QString cmd = "/usr/share/kylin-nm/shell/connup.sh '" + ui->leName->text() + "'";
// //QString connCmd = "nmcli connection up '" + ui->leName->text() + "'";
// //system(connCmd.toUtf8().data());
// kylindbus.connectWiredNet(ui->leName->text()); //reconnect this wired network
// QString m_txt(tr("New settings already effective"));
// kylindbus.showDesktopNotify(m_txt); //show desktop notify
// }
// //需要更新一下有线网界面
// qDebug()<<"debug: request refresh Lan list";
// emit requestRefreshLanList(0);
// }
this->isCreateNewNet = false;
}
@ -437,10 +392,7 @@ void ConfForm::cbTypeChanged(int index)
this->resize(432, 510);
}
if (index == 3) {
// ui->btnOk->setStyleSheet(btnOffQss);
ui->btnSave->setEnabled(false);
// ui->btnCreate->setStyleSheet(btnOffQss);
ui->btnCreate->setEnabled(false);
if (!isActWifi) {
@ -515,10 +467,7 @@ void ConfForm::setEnableOfBtn()
}
}
// ui->btnOk->setStyleSheet(btnOnQss);
ui->btnSave->setEnabled(true);
// ui->btnCreate->setStyleSheet(btnOnQss);
ui->btnCreate->setEnabled(true);
}
@ -529,7 +478,6 @@ bool ConfForm::getTextEditState(QString text)
bool match = false;
match = rx.exactMatch(text);
// qDebug()<<"the match result is: " << match;
return match;
}
@ -537,10 +485,7 @@ bool ConfForm::getTextEditState(QString text)
//设置创建或保存按钮不可点击
void ConfForm::setBtnEnableFalse()
{
// ui->btnOk->setStyleSheet(btnOffQss);
ui->btnSave->setEnabled(false);
// ui->btnCreate->setStyleSheet(btnOffQss);
ui->btnCreate->setEnabled(false);
}

View File

@ -86,21 +86,14 @@ KylinDBus::KylinDBus(MainWindow *mainWindow, QObject *parent) :QObject(parent)
QString("org.freedesktop.NetworkManager.Device.Wired"),
QString("PropertiesChanged"), this, SLOT(onLanPropertyChanged(QVariantMap) ) );
} else {
syslog(LOG_DEBUG, "Can not find wired device object path when using dbus.");
qDebug()<<"Can not find wired device object path when using dbus.";
}
if (wirelessPath.path() != "") {
QDBusConnection::systemBus().connect(QString("org.freedesktop.NetworkManager"),
QString(wirelessPath.path()),
QString("org.freedesktop.NetworkManager.Device.Wireless"),
QString("PropertiesChanged"), this, SLOT(onWifiPropertyChanged(QVariantMap) ) );
QDBusConnection::systemBus().connect(QString("org.freedesktop.NetworkManager"),
QString(wirelessPath.path()),
QString("org.freedesktop.NetworkManager.Device.Wireless"),
QString("AccessPointAdded"), this, SLOT(onAccessPointAdded(QDBusObjectPath) ) );
getWirelessCardName();//获取无线网卡名称
} else {
syslog(LOG_DEBUG, "Can not find wireless device object path when using dbus.");
qDebug()<<"Can not find wireless device object path when using dbus.";
}
@ -144,6 +137,7 @@ void KylinDBus::getObjectPath()
//先获取所有的网络设备的设备路径
QDBusReply<QList<QDBusObjectPath>> obj_reply = m_interface.call("GetAllDevices");
if (!obj_reply.isValid()) {
syslog(LOG_DEBUG, "execute dbus method 'GetAllDevices' is invalid in func getObjectPath()");
qDebug()<<"execute dbus method 'GetAllDevices' is invalid in func getObjectPath()";
}
@ -158,6 +152,7 @@ void KylinDBus::getObjectPath()
QDBusReply<QString> reply = interface.call("Introspect");
if (!reply.isValid()) {
syslog(LOG_DEBUG, "execute dbus method 'Introspect' is invalid in func getObjectPath()");
qDebug()<<"execute dbus method 'Introspect' is invalid in func getObjectPath()";
}
@ -191,13 +186,9 @@ void KylinDBus::getPhysicalCarrierState(int n)
try {
if (reply.value().toString() == "true") {
//isWiredCableOn = true;
multiWiredCableState.append("true");
//if (n == 1){ this->mw->onPhysicalCarrierChanged(isWiredCableOn);}
} else if (reply.value().toString() == "false") {
//isWiredCableOn = false;
multiWiredCableState.append("false");
//if (n == 1){ this->mw->onPhysicalCarrierChanged(isWiredCableOn);}
} else {
throw -1; //出现异常
}
@ -227,6 +218,7 @@ void KylinDBus::getLanHwAddressState()
QDBusReply<QVariant> lanReply = lanInterface.call("Get", "org.freedesktop.NetworkManager.Device.Wired", "HwAddress");
if (!lanReply.isValid()) {
syslog(LOG_DEBUG, "can not get the attribute 'HwAddress' in func getLanHwAddressState()");
qDebug()<<"can not get the attribute 'HwAddress' in func getLanHwAddressState()";
} else {
dbusLanMac = lanReply.value().toString();
@ -246,6 +238,7 @@ void KylinDBus::getWiredCardName()
QDBusReply<QVariant> lanReply = lanInterface.call("Get", "org.freedesktop.NetworkManager.Device", "Interface");
if (!lanReply.isValid()) {
syslog(LOG_DEBUG, "can not get the attribute 'Interface' in func getWiredCardName()");
qDebug()<<"can not get the attribute 'Interface' in func getWiredCardName()";
dbusLanCardName = "";
} else {
@ -264,6 +257,7 @@ void KylinDBus::getWirelessCardName()
QDBusReply<QVariant> lanReply = lanInterface.call("Get", "org.freedesktop.NetworkManager.Device", "Interface");
if (!lanReply.isValid()) {
syslog(LOG_DEBUG, "can not get the attribute 'Interface' in func getWirelessCardName()");
qDebug()<<"can not get the attribute 'Interface' in func getWirelessCardName()";
} else {
dbusWiFiCardName = lanReply.value().toString();
@ -288,7 +282,6 @@ void KylinDBus::getLanIp(QString netName, bool isActNet)
QDBusMessage result = m_interface.call("GetSettings"); //get information of this network
const QDBusArgument &dbusArg1st = result.arguments().at( 0 ).value<QDBusArgument>();
//DBus type : a{sa{sv}}, a map with a key of QString, which maps to another map of QString,QVariant
QMap<QString,QMap<QString,QVariant>> map;
dbusArg1st >> map;
@ -297,13 +290,10 @@ void KylinDBus::getLanIp(QString netName, bool isActNet)
if (outside_key == "connection") {
for (QString search_key : outsideMap.keys()) {
if (search_key == "id") {
//const QDBusArgument &dbusArg2nd = innerMap.value(inner_key).value<QDBusArgument>();
if (netName == outsideMap.value(search_key).toString()) {
// qDebug()<<"aaaaaa"<<outsideMap.value(search_key).toString();
for (QString key : map.keys() ) {
QMap<QString,QVariant> innerMap = map.value(key);
//qDebug() << "Key: " << key;
if (key == "ipv4") {
for (QString inner_key : innerMap.keys()) {
//获取ipv4
@ -317,7 +307,6 @@ void KylinDBus::getLanIp(QString netName, bool isActNet)
}
dbusArg2nd.endArray();
//qDebug()<<" " << m_map.value("address").toString();
dbusLanIpv4 = m_map.value("address").toString();
}
@ -346,7 +335,6 @@ void KylinDBus::getLanIp(QString netName, bool isActNet)
}
dbusArg2nd.endArray();
//qDebug()<<" " << m_map.value("address").toString();
dbusLanIpv6 = m_map.value("address").toString();
}
}
@ -645,12 +633,10 @@ void KylinDBus::initConnectionInfo()
QDBusArgument dbusArgs = vFirst.value<QDBusArgument>();
QDBusObjectPath objPath;
// qDebug()<<" ";
dbusArgs.beginArray();
while (!dbusArgs.atEnd()) {
dbusArgs >> objPath;
oldPaths.append(objPath);
// qDebug() <<"debug: *****path is: "<< objPath.path();
QDBusInterface interface( "org.freedesktop.NetworkManager",
objPath.path(),
@ -658,12 +644,9 @@ void KylinDBus::initConnectionInfo()
QDBusConnection::systemBus() );
QDBusReply<QVariant> reply = interface.call("Get", "org.freedesktop.NetworkManager.Connection.Active", "Type");
// qDebug()<<"debug: *****connection type is: "<<reply.value().toString();
oldPathInfo.append(reply.value().toString());
}
dbusArgs.endArray();
// qDebug()<<" ";
//获取当前wifi的开关状态
QDBusReply<QVariant> m_result = interface.call("Get", "org.freedesktop.NetworkManager", "WirelessEnabled");
@ -684,15 +667,12 @@ void KylinDBus::onPropertiesChanged(QVariantMap qvm)
QStringList newPathInfo;
qDebug()<<" ";
foreach (QDBusObjectPath objPath, newPaths) {
qDebug()<<"dbug: bbbbb "<<objPath.path();
QDBusInterface interface( "org.freedesktop.NetworkManager",
objPath.path(),
"org.freedesktop.DBus.Properties",
QDBusConnection::systemBus() );
QDBusReply<QVariant> reply = interface.call("Get", "org.freedesktop.NetworkManager.Connection.Active", "Type");
qDebug()<<"dbug: ccccc "<<reply.value().toString();
newPathInfo.append(reply.value().toString());
}
qDebug()<<" ";
@ -793,28 +773,12 @@ void KylinDBus::slot_timeout()
time->stop();
}
//无线网属性变化时,执行该函数
void KylinDBus::onWifiPropertyChanged(QVariantMap qvm)
{
//qDebug()<<"debug: *************"<<qvm.values();
//uint ii = qvm.value("Bitrate").toUInt();
//QString ss = QString::number(ii);
//qDebug()<<"debug: ============="<<ss;
}
//有线网的Ip属性变化时的响应函数
void KylinDBus::onIpPropertiesChanged()
{
qDebug () <<"哈哈哈哈或哈哈哈哈或或或或或";
emit this->updateWiredList(0);
}
//增加了新的accesspoint时执行该函数即检测到一个新的wifi
void KylinDBus::onAccessPointAdded(QDBusObjectPath objPath)
{
//qDebug()<<"debug: &&&&&&&&&&&&&"<<objPath.path();
}
//利用dbus的方法连接有线网
void KylinDBus::connectWiredNet(QString netName)
{
@ -1084,12 +1048,3 @@ double KylinDBus::getTransparentData()
return 0.7;
}
}
//使用GSetting获取当前系统主题样式
void KylinDBus::getUkuiStyleState()
{
// if(QGSettings::isSchemaInstalled(QString("org.ukui.style").toLocal8Bit())) {
// QGSettings* gsetting=new QGSettings(QString("org.ukui.style").toLocal8Bit());
// connect(gsetting,&QGSettings::changed,this,&SideBarWidget::themeModeChangeSlot);
// }
}

View File

@ -60,7 +60,6 @@ public:
void initTaskbarGsetting();
int getTaskbarHeight();
int getTaskbarPos();
void getUkuiStyleState();
void getWifiSwitchState();
bool getSwitchStatus(QString key);
@ -95,9 +94,7 @@ public slots:
void toCreateNewLan();
void onPropertiesChanged(QVariantMap qvm);
void onLanPropertyChanged(QVariantMap qvm);
void onWifiPropertyChanged(QVariantMap qvm);
void onIpPropertiesChanged();
void onAccessPointAdded(QDBusObjectPath objPath);
void getPhysicalCarrierState(int n);
void getLanHwAddressState();
void getWiredCardName();

View File

@ -42,11 +42,6 @@ LoadingDiv::LoadingDiv(QWidget *parent) : QWidget(parent)
//加载动画控件'loadingGif'
void LoadingDiv::switchAnimStep()
{
// QString qpmQss = "QLabel{background-image:url(':/res/s/conning-b/";
// qpmQss.append(QString::number(this->currentPage));
// qpmQss.append(".png');}");
// loadingGif->setStyleSheet(qpmQss);
//另外一种加载方法
QString qpmQss = ":/res/s/conning-b/";
qpmQss.append(QString::number(this->currentPage));

View File

@ -55,10 +55,6 @@ MainWindow::MainWindow(QWidget *parent) :
path.addRoundedRect(rect, 6, 6);
setProperty("blurRegion", QRegion(path.toFillPolygon().toPolygon()));
//this->setStyleSheet("QWidget{border:none;border-radius:6px;}");
//ui->centralWidget->setStyleSheet("#centralWidget{border:none;border-radius:6px;background:rgba(19,19,20,0.5);}");
editQssString(); //编辑部分控件QSS
createTopLanUI(); //创建顶部有线网item
createTopWifiUI(); //创建顶部无线网item
@ -105,9 +101,6 @@ MainWindow::MainWindow(QWidget *parent) :
connect(ui->btnNetList, &QPushButton::clicked, this, &MainWindow::onBtnNetListClicked);
connect(btnWireless, &SwitchButton::clicked,this, &MainWindow::onBtnWifiClicked);
//auto app = static_cast<QApplication*>(QCoreApplication::instance());
//app->setStyle(new CustomStyle()); //设置自定义主题
ui->btnNetList->setAttribute(Qt::WA_Hover,true);
ui->btnNetList->installEventFilter(this);
ui->btnWifiList->setAttribute(Qt::WA_Hover,true);
@ -290,7 +283,6 @@ void MainWindow::createOtherUI()
lbNoItemTip = new QLabel(ui->centralWidget);
lbNoItemTip->resize(W_NO_ITEM_TIP, H_NO_ITEM_TIP);
lbNoItemTip->move(this->width()/2 - W_NO_ITEM_TIP/2 + W_LEFT_AREA/2, this->height()/2);
// lbNoItemTip->setStyleSheet("QLabel{border:none;background:transparent;font-size:14px;color:rgba(255,255,255,0.91);}");
lbNoItemTip->setStyleSheet("QLabel{border:none;background:transparent;}");
lbNoItemTip->setText(tr("No usable network in the list"));//列表暂无可连接网络
lbNoItemTip->setAlignment(Qt::AlignCenter);
@ -348,8 +340,6 @@ void MainWindow::createLeftAreaUI()
QString txtEthernet(tr("Ethernet"));
ui->btnNetList->setToolTip(txtEthernet);
ui->lbNetListBG->setStyleSheet(btnOffQss);
//ui->lbNetListImg->setStyleSheet("QLabel{background-image:url(:/res/x/net-list-bg.svg);}");
//ui->btnNetListImg->setStyleSheet("QPushButton{background:transparent;}");
//设置PushButton背景透明
QPalette paletteLan = ui->btnNetListImg->palette();
paletteLan.setColor(QPalette::Highlight, Qt::transparent);
@ -364,7 +354,6 @@ void MainWindow::createLeftAreaUI()
QString txtWifi(tr("Wifi"));
ui->btnWifiList->setToolTip(txtWifi);
ui->lbWifiListBG->setStyleSheet(btnOffQss);
//ui->lbWifiListImg->setStyleSheet("QLabel{background-image:url(:/res/x/wifi-list-bg.svg);}");
//设置PushButton背景透明
QPalette paletteWifi = ui->btnWifiListImg->palette();
paletteWifi.setColor(QPalette::Highlight, Qt::transparent);
@ -403,7 +392,6 @@ void MainWindow::createLeftAreaUI()
ui->btnAdvConf->setFocusPolicy(Qt::NoFocus);
QString txtAdvanced(tr("Advanced"));
ui->btnAdvConf->setToolTip(txtAdvanced);
//ui->lbBtnConfImg->setStyleSheet("QLabel{background-image:url(:/res/x/control.svg);}");
//设置PushButton背景透明
QPalette paletteConf = ui->btnConfImg->palette();
paletteConf.setColor(QPalette::Highlight, Qt::transparent);
@ -463,15 +451,10 @@ void MainWindow::initNetwork()
syslog(LOG_DEBUG, "current network state: wired state =%d, wifi state =%d", iface->lstate, iface->wstate);
qDebug()<<"===";
//ui->lbBtnNetBG->setStyleSheet(btnOnQss);////
if (iface->wstate == 0 || iface->wstate == 1) {
// ui->lbBtnWifiBG->setStyleSheet(btnBgOnQss);////
//ui->lbBtnWifiBall->move(X_RIGHT_WIFI_BALL, Y_WIFI_BALL);////
btnWireless->setSwitchStatus(true);
} else {
btnWireless->setSwitchStatus(false);
//ui->lbBtnWifiBG->setStyleSheet(btnBgOffQss);////
//ui->lbBtnWifiBall->move(X_LEFT_WIFI_BALL, Y_WIFI_BALL);////
}
// 初始化网络列表
@ -512,15 +495,11 @@ void MainWindow::initNetwork()
char *chr = "nmcli networking on";
Utils::m_system(chr);
//int status = system("nmcli networking on");
//if (status != 0){ syslog(LOG_ERR, "execute 'nmcli networking on' in function 'initNetwork' failed");}
onBtnNetListClicked();
ui->btnNetList->setStyleSheet("QPushButton{border:0px solid rgba(255,255,255,0);background-color:rgba(255,255,255,0);}");
ui->btnWifiList->setStyleSheet("QPushButton{border:none;}");
//disNetDone();
}
}
}
@ -592,10 +571,7 @@ void MainWindow::createTrayIcon()
mAdvConf->setIcon(QIcon::fromTheme("document-page-setup", QIcon(":/res/x/setup.png")) );
trayIconMenu->addAction(mShowWindow);
//trayIconMenu->addSeparator();
trayIconMenu->addAction(mAdvConf);
//trayIconMenu->setAttribute(Qt::WA_TranslucentBackground);//设置窗口背景透明
//trayIconMenu->setWindowOpacity(0.8);
trayIcon->setContextMenu(trayIconMenu);
// 初始化托盘所有Icon
@ -658,12 +634,6 @@ void MainWindow::iconActivated(QSystemTrayIcon::ActivationReason reason)
handleIconClicked();
if (this->isHidden()) {
//double trans = objKyDBus->getTransparentData();
//QString strTrans;
//strTrans = QString::number(trans, 10, 2);
//QString sty = "#centralWidget{background:rgba(19,19,20," + strTrans + ");}";
//ui->centralWidget->setStyleSheet(sty);
this->showNormal();
if (is_btnNetList_clicked == 1) {
onBtnNetListClicked(0);
@ -760,9 +730,7 @@ void MainWindow::showTrayIconMenu()
QRect screenGeometry = qApp->primaryScreen()->geometry();
QDesktopWidget* desktopWidget = QApplication::desktop();
// QRect deskMainRect = desktopWidget->availableGeometry(0);//获取可用桌面大小
QRect screenMainRect = desktopWidget->screenGeometry(0);//获取设备屏幕大小
// QRect deskDupRect = desktopWidget->availableGeometry(1);//获取可用桌面大小
QRect screenDupRect = desktopWidget->screenGeometry(1);//获取设备屏幕大小
QPoint cursorPoint = QCursor::pos();//返回相对显示器的全局坐标
@ -781,18 +749,8 @@ void MainWindow::showTrayIconMenu()
trayIconMenu->move(availableGeometry.x() + cursor_x - trayIconMenu->width()/2, screenMainRect.y() + screenGeometry.height() - availableGeometry.height() + m + d);
} else if (n == 2) { //任务栏在左侧
trayIconMenu->move(m + d, cursor_y - trayIconMenu->height()/2);
//if (screenGeometry.x() == 0){//主屏在左侧
// trayIconMenu->move(screenGeometry.width() - availableGeometry.width() + m + d, screenMainRect.y() + screenMainRect.height() - trayIconMenu->height() - s);
//}else{//主屏在右侧
// trayIconMenu->move(screenGeometry.width() - availableGeometry.width() + m + d,screenDupRect.y() + screenDupRect.height() - trayIconMenu->height() - s);
//}
} else if (n == 3) { //任务栏在右侧
trayIconMenu->move(screenMainRect.width() - trayIconMenu->width() - m - d, cursor_y - trayIconMenu->height()/2);
//if (screenGeometry.x() == 0){//主屏在左侧
// trayIconMenu->move(screenMainRect.width() + screenDupRect.width() - trayIconMenu->width() - m - d, screenDupRect.y() + screenDupRect.height() - trayIconMenu->height() - s);
//}else{//主屏在右侧
// trayIconMenu->move(availableGeometry.x() + availableGeometry.width() - trayIconMenu->width() - m - d, screenMainRect.y() + screenMainRect.height() - trayIconMenu->height() - s);
//}
}
} else if(screenGeometry.width() == availableGeometry.width() ) {
if (trayIcon->geometry().y() > availableGeometry.height()/2) { //任务栏在下侧
@ -861,16 +819,6 @@ void MainWindow::getActiveInfo()
index ++;
}
//ukui2.0中获取currentActWifiSignalLv的值
//QList<OneConnForm *> wifiList = wifiListWidget->findChildren<OneConnForm *>();
//for(int i = 0; i < wifiList.size(); i ++){
// OneConnForm *ocf = wifiList.at(i);
// if(ocf->isActive == true){
// currentActWifiSignalLv = ocf->signalLv;
// break;
// }
//}
//ukui3.0中获取currentActWifiSignalLv的值
if (activeWifiSignalLv > 75) {
currentActWifiSignalLv = 1;
@ -939,13 +887,6 @@ void MainWindow::onPhysicalCarrierChanged(bool flag)
void MainWindow::onCarrierUpHandle()
{
wiredCableUpTimer->stop();
//BackThread *up_bt = new BackThread();
//up_bt->disConnLanOrWifi("ethernet");
//sleep(1);
//up_bt->disConnLanOrWifi("ethernet");
//sleep(1);
//up_bt->disConnLanOrWifi("ethernet");
//up_bt->deleteLater();
//检查有线网络的个数是否为0,如果是0则新建一个有线网络
checkIfWiredNetExist();
@ -1141,8 +1082,6 @@ void MainWindow::onBtnWifiClicked(int flag)
is_stop_check_net_state = 1;
objKyDBus->setWifiCardState(true);
objKyDBus->setWifiSwitchState(true);
//lbTopWifiList->show();
//btnAddNet->show();
QThread *t = new QThread();
BackThread *bt = new BackThread();
@ -1151,7 +1090,6 @@ void MainWindow::onBtnWifiClicked(int flag)
connect(t, SIGNAL(finished()), t, SLOT(deleteLater()));
connect(t, SIGNAL(started()), bt, SLOT(execEnWifi()));
connect(bt, SIGNAL(enWifiDone()), this, SLOT(enWifiDone()));
connect(bt, SIGNAL(launchLanDone()), this, SLOT(launchLanDone()));
connect(bt, SIGNAL(btFinish()), t, SLOT(quit()));
t->start();
this->startLoading();
@ -1171,7 +1109,6 @@ void MainWindow::onBtnWifiClicked(int flag)
connect(t, SIGNAL(finished()), t, SLOT(deleteLater()));
connect(t, SIGNAL(started()), bt, SLOT(execEnWifi()));
connect(bt, SIGNAL(enWifiDone()), this, SLOT(enWifiDone()));
connect(bt, SIGNAL(launchLanDone()), this, SLOT(launchLanDone()));
connect(bt, SIGNAL(btFinish()), t, SLOT(quit()));
t->start();
this->startLoading();
@ -1209,9 +1146,6 @@ void MainWindow::onBtnWifiClicked(int flag)
objKyDBus->showDesktopNotify(txt);
qDebug()<<"No wireless card detected";
syslog(LOG_DEBUG, "No wireless card detected");
//QString cmd = "export LANG='en_US.UTF-8';export LANGUAGE='en_US';notify-send '" + txt + "' -t 3800";
//int status = system(cmd.toUtf8().data());
//if (status != 0){ syslog(LOG_ERR, "execute 'notify-send' in function 'onBtnWifiClicked' failed");}
disWifiStateKeep();
}
@ -1244,8 +1178,6 @@ void MainWindow::onBtnNetListClicked(int flag)
ui->lbNetwork->setText(tr("Ethernet"));
btnWireless->hide();
//ui->lbBtnWifiBG->hide();
//ui->lbBtnWifiBall->hide();
// 强行设置为打开
if (flag == 1) {
@ -1255,7 +1187,6 @@ void MainWindow::onBtnNetListClicked(int flag)
this->topLanListWidget->show();
this->scrollAreaw->hide();
this->topWifiListWidget->hide();
on_btnNetList_pressed();
return;
}
@ -1271,7 +1202,6 @@ void MainWindow::onBtnNetListClicked(int flag)
this->topLanListWidget->show();
this->scrollAreaw->hide();
this->topWifiListWidget->hide();
on_btnNetList_pressed();
delete iface;
bt->deleteLater();
@ -1303,21 +1233,13 @@ void MainWindow::on_btnWifiList_clicked()
ui->lbNetwork->setText(tr("Wifi"));
btnWireless->show();
//ui->lbBtnWifiBG->show();
//ui->lbBtnWifiBall->show();
if (iface->wstate == 0 || iface->wstate == 1) {
//ui->lbBtnWifiBG->setStyleSheet(btnBgOnQss);////
//ui->lbBtnWifiBall->move(X_RIGHT_WIFI_BALL, Y_WIFI_BALL);////
btnWireless->setSwitchStatus(true);
} else {
//ui->lbBtnWifiBG->setStyleSheet(btnBgOffQss);////
//ui->lbBtnWifiBall->move(X_LEFT_WIFI_BALL, Y_WIFI_BALL);////
btnWireless->setSwitchStatus(false);
}
if (iface->wstate != 2) {
//ui->lbBtnWifiBG->setStyleSheet(btnBgOnQss);////
//ui->lbBtnWifiBall->move(X_RIGHT_WIFI_BALL, Y_WIFI_BALL);////
btnWireless->setSwitchStatus(true);
lbTopWifiList->show();
btnAddNet->show();
@ -1325,8 +1247,6 @@ void MainWindow::on_btnWifiList_clicked()
this->startLoading();
this->ksnm->execGetWifiList();
} else {
//ui->lbBtnWifiBG->setStyleSheet(btnBgOffQss);////
//ui->lbBtnWifiBall->move(X_LEFT_WIFI_BALL, Y_WIFI_BALL);////
btnWireless->setSwitchStatus(false);
delete topWifiListWidget; //清空top列表
createTopWifiUI(); //创建顶部无线网item
@ -1362,26 +1282,11 @@ void MainWindow::on_btnWifiList_clicked()
this->topLanListWidget->hide();
this->scrollAreaw->show();
this->topWifiListWidget->show();
on_btnWifiList_pressed();
delete iface;
bt->deleteLater();
}
void MainWindow::on_btnNetList_pressed()
{
//ui->btnNetList->setStyleSheet("#btnNetList{font-size:12px;color:white;border:1px solid rgba(255,255,255,0.1);border:1px solid rgba(255,255,255,0.5);background:transparent;background-color:rgba(255,255,255,0.1);}");
//ui->btnWifiList->setStyleSheet("#btnWifiList{font-size:12px;color:white;border:1px solid rgba(255,255,255,0.1);background:transparent;background-color:rgba(0,0,0,0.2);}"
// "#btnWifiList:Pressed{border:1px solid rgba(255,255,255,0.5);background:transparent;background-color:rgba(255,255,255,0.1);}");
}
void MainWindow::on_btnWifiList_pressed()
{
//ui->btnWifiList->setStyleSheet("#btnWifiList{font-size:12px;color:white;border:1px solid rgba(255,255,255,0.1);border:1px solid rgba(255,255,255,0.5);background:transparent;background-color:rgba(255,255,255,0.1);}");
//ui->btnNetList->setStyleSheet("#btnNetList{font-size:12px;color:white;border:1px solid rgba(255,255,255,0.1);background:transparent;background-color:rgba(0,0,0,0.2);}"
// "#btnNetList:Pressed{border:1px solid rgba(255,255,255,0.5);background:transparent;background-color:rgba(255,255,255,0.1);}");
}
///////////////////////////////////////////////////////////////////////////////
//网络列表加载与更新
@ -1460,8 +1365,7 @@ void MainWindow::getLanListDone(QStringList slist)
objKyDBus->getLanIp(nname, true);
actLanName = "--";
if (mwBandWidth == "Unknown!") { getLanBandWidth(); }
//QString strLanName = TranslateLanName(nname);
//QString strLanName = TranslateLanName(nname); //进行中英文系统环境下有线网络名称的汉化
connect(ccf, SIGNAL(selectedOneLanForm(QString, QString)), this, SLOT(oneTopLanFormSelected(QString, QString)));
connect(ccf, SIGNAL(disconnActiveLan()), this, SLOT(activeLanDisconn()));
@ -1497,7 +1401,6 @@ void MainWindow::getLanListDone(QStringList slist)
} else {
objKyDBus->getLanIp(nname, false);
lanListWidget->resize(W_LIST_WIDGET, lanListWidget->height() + H_NORMAL_ITEM);
//QString strLanName = TranslateLanName(nname);
OneLancForm *ocf = new OneLancForm(lanListWidget, this, confForm, ksnm);
@ -1611,8 +1514,6 @@ void MainWindow::loadWifiListDone(QStringList slist)
indexSecu = headLine.indexOf("安全性");
indexName = headLine.indexOf("SSID") + 4;
} else {
//int indexRate = headLine.indexOf("RATE");
//indexSignal = headLine.indexOf("SIGNAL");
indexSecu = headLine.indexOf("SECURITY");
indexName = headLine.indexOf("SSID");
}
@ -1621,8 +1522,6 @@ void MainWindow::loadWifiListDone(QStringList slist)
int count = 0;
for (int i = 1, j = 0; i < slist.size(); i ++) {
QString line = slist.at(i);
//QString wsignal = line.mid(0, indexRate).trimmed();
//QString wrate = line.mid(indexRate, indexSecu - indexRate).trimmed();
QString wsignal = line.mid(0, indexSecu).trimmed();
QString wsecu = line.mid(indexSecu, indexName - indexSecu).trimmed();
QString wname = line.mid(indexName).trimmed();
@ -1713,7 +1612,6 @@ void MainWindow::updateWifiListDone(QStringList slist)
//获取表头信息
QString lastHeadLine = oldWifiSlist.at(0);
//int lastIndexName = lastHeadLine.indexOf("SSID");
int lastIndexName;
lastHeadLine = lastHeadLine.trimmed();
bool isChineseInIt = lastHeadLine.contains(QRegExp("[\\x4e00-\\x9fa5]+"));
@ -1745,8 +1643,6 @@ void MainWindow::updateWifiListDone(QStringList slist)
if (lastWname == wname){break;} //在slist最后之前找到了lastWname则停止
if (j == slist.size()-1) {
//syslog(LOG_DEBUG, "Will remove a Wi-Fi, it's name is: %s", lastWname.toUtf8().data());
//qDebug()<<"Will remove a Wi-Fi, it's name is: "<<lastWname;
QList<OneConnForm *> wifiList = wifiListWidget->findChildren<OneConnForm *>();
for (int pos = 0; pos < wifiList.size(); pos ++) {
OneConnForm *ocf = wifiList.at(pos);
@ -1795,8 +1691,6 @@ void MainWindow::updateWifiListDone(QStringList slist)
if (lastWname == wname){break;} //上一次的wifi列表已经有名为wname的wifi则停止
if (j == oldWifiSlist.size()-1) { //到lastSlist最后一个都没找到执行下面流程
//syslog(LOG_DEBUG, "Will add a Wi-Fi, it's name is: %s", wname.toUtf8().data());
//qDebug()<<"Will add a Wi-Fi, it's name is: "<<wname;
QList<OneConnForm *> wifiList = wifiListWidget->findChildren<OneConnForm *>();
int n = wifiList.size();
int posY = 0;
@ -1886,32 +1780,16 @@ void MainWindow::on_btnAdvConf_clicked()
{
QProcess *qprocess = new QProcess(this);
qprocess->start("nm-connection-editor &");
// int status = system("nm-connection-editor &");
// if (status != 0){ syslog(LOG_ERR, "execute 'nm-connection-editor &' in function 'on_btnAdvConf_clicked' failed");}
}
void MainWindow::on_btnAdvConf_pressed()
{
//ui->lbBtnConfBG->setStyleSheet(btnOnQss);
}
void MainWindow::on_btnAdvConf_released()
{
//ui->lbBtnConfBG->setStyleSheet(btnOffQss);
}
void MainWindow::on_btnFlyMode_clicked()
{
if (is_fly_mode_on == 0) {
// ui->lbFlyImg->setStyleSheet("QLabel{background-image:url(:/res/x/fly-mode-on.svg);}");
// ui->lbFlyBG->setStyleSheet(btnOnQss);
is_fly_mode_on = 1;
onBtnWifiClicked(0);
on_btnWifiList_clicked();
} else {
// ui->lbFlyImg->setStyleSheet("QLabel{background-image:url(:/res/x/fly-mode-off.svg);}");
// ui->lbFlyBG->setStyleSheet(btnOffQss);
is_fly_mode_on = 0;
}
}
@ -1965,7 +1843,6 @@ void MainWindow::onBtnCreateNetClicked()
QApplication::setQuitOnLastWindowClosed(false);
ConfForm *m_cf = new ConfForm();
//m_cf->setAttribute(Qt::WA_DeleteOnClose);
m_cf->cbTypeChanged(3);
m_cf->move(primaryGeometry.width() / 2 - m_cf->width() / 2, primaryGeometry.height() / 2 - m_cf->height() / 2);
m_cf->exec();
@ -2238,14 +2115,10 @@ void MainWindow::activeLanDisconn()
QString txt(tr("Wired net is disconnected"));
objKyDBus->showDesktopNotify(txt);
//QString cmd = "export LANG='en_US.UTF-8';export LANGUAGE='en_US';notify-send '" + txt + "...' -t 3800";
//int status1 = system(cmd.toUtf8().data());
//if (status1 != 0){ syslog(LOG_ERR, "execute 'notify-send' in function 'execConnWifiPWD' failed");}
currSelNetName = "";
oldActLanName = "";
oldDbusActLanDNS = 0;
//this->startLoading();
emit this->waitLanStop();
this->ksnm->execGetLanList();
}
@ -2268,12 +2141,8 @@ void MainWindow::activeStartLoading()
QString txt(tr("Wi-Fi is disconnected"));
objKyDBus->showDesktopNotify(txt);
//QString cmd = "export LANG='en_US.UTF-8';export LANGUAGE='en_US';notify-send '" + txt + "...' -t 3800";
//int status1 = system(cmd.toUtf8().data());
//if (status1 != 0){ syslog(LOG_ERR, "execute 'notify-send' in function 'execConnWifiPWD' failed");}
currSelNetName = "";
//this->startLoading();
emit this->disConnSparedNet("wifi");
}
void MainWindow::activeGetWifiList()
@ -2288,13 +2157,9 @@ void MainWindow::enNetDone()
BackThread *bt = new BackThread();
mwBandWidth = bt->execChkLanWidth(lname);
// ui->lbBtnNetBG->setStyleSheet(btnOnQss);
// 打开网络开关时如果Wifi开关是打开的设置其样式
if (checkWlOn()) {
btnWireless->setSwitchStatus(true);
//ui->lbBtnWifiBG->setStyleSheet(btnBgOnQss);////
//ui->lbBtnWifiBall->move(X_RIGHT_WIFI_BALL, Y_WIFI_BALL);////
}
onBtnNetListClicked(1);
@ -2313,8 +2178,6 @@ void MainWindow::disNetDone()
ui->lbNetwork->setText(tr("Ethernet"));
btnWireless->hide();
//ui->lbBtnWifiBG->hide();
//ui->lbBtnWifiBall->hide();
delete topLanListWidget; // 清空top列表
createTopLanUI(); //创建顶部有线网item
@ -2336,8 +2199,6 @@ void MainWindow::disNetDone()
ccf->move(L_VERTICAL_LINE_TO_ITEM, 0);
ccf->show();
// ui->lbBtnNetBG->setStyleSheet(btnOffQss);
btnWireless->setSwitchStatus(false);
this->lanListWidget->show();
@ -2347,23 +2208,14 @@ void MainWindow::disNetDone()
this->scrollAreaw->hide();
this->topWifiListWidget->hide();
on_btnNetList_pressed();
qDebug()<<"debug: already turn off the switch of lan network";
syslog(LOG_DEBUG, "Already turn off the switch of lan network");
this->stopLoading();
}
void MainWindow::launchLanDone()
{
// ui->lbBtnNetBG->setStyleSheet(btnOnQss);
}
void MainWindow::enWifiDone()
{
//ui->lbBtnWifiBG->setStyleSheet(btnBgOnQss);////
//ui->lbBtnWifiBall->move(X_RIGHT_WIFI_BALL, Y_WIFI_BALL);////
is_update_wifi_list = 0;
if (is_btnWifiList_clicked) {
this->ksnm->execGetWifiList();
@ -2379,8 +2231,6 @@ void MainWindow::disWifiDone()
{
disWifiDoneChangeUI();
on_btnWifiList_pressed();
qDebug()<<"debug: already turn off the switch of wifi network";
syslog(LOG_DEBUG, "Already turn off the switch of wifi network");
@ -2391,13 +2241,9 @@ void MainWindow::disWifiStateKeep()
{
if (this->is_btnNetList_clicked == 1) {
btnWireless->setSwitchStatus(false);
//ui->lbBtnWifiBG->setStyleSheet(btnBgOffQss);////
//ui->lbBtnWifiBall->move(X_LEFT_WIFI_BALL, Y_WIFI_BALL);////
}
if (this->is_btnWifiList_clicked== 1) {
disWifiDoneChangeUI();
// this->stopLoading();
getActiveInfo();
}
}
@ -2433,8 +2279,6 @@ void MainWindow::disWifiDoneChangeUI()
}
btnWireless->setSwitchStatus(false);
//ui->lbBtnWifiBG->setStyleSheet(btnBgOffQss);////
//ui->lbBtnWifiBall->move(X_LEFT_WIFI_BALL, Y_WIFI_BALL);////
this->lanListWidget->hide();
this->topLanListWidget->hide();
@ -2604,9 +2448,6 @@ void MainWindow::connLanDone(int connFlag)
QString txt(tr("Conn Ethernet Success"));
objKyDBus->showDesktopNotify(txt);
//QString cmd = "export LANG='en_US.UTF-8';export LANGUAGE='en_US';notify-send '" + txt + "' -t 3800";
//int status = system(cmd.toUtf8().data());
//if (status != 0){ syslog(LOG_ERR, "execute 'notify-send' in function 'connLanDone' failed");}
}
if (connFlag == 1) {
@ -2616,9 +2457,6 @@ void MainWindow::connLanDone(int connFlag)
QString txt(tr("Conn Ethernet Fail"));
objKyDBus->showDesktopNotify(txt);
//QString cmd = "export LANG='en_US.UTF-8';export LANGUAGE='en_US';notify-send '" + txt + "' -t 3800";
//int status = system(cmd.toUtf8().data());
//if (status != 0){ syslog(LOG_ERR, "execute 'notify-send' in function 'connLanDone' failed");}
}
if (connFlag == 3) {
@ -2639,18 +2477,12 @@ void MainWindow::connWifiDone(int connFlag)
QString txt(tr("Conn Wifi Success"));
objKyDBus->showDesktopNotify(txt);
//QString cmd = "export LANG='en_US.UTF-8';export LANGUAGE='en_US';notify-send '" + txt + "' -t 3800";
//int status = system(cmd.toUtf8().data());
//if (status != 0){ syslog(LOG_ERR, "execute 'notify-send' in function 'connWifiDone' failed");}
} else if (connFlag == 1) {
is_stop_check_net_state = 0;
is_connect_wifi_failed = 1;
QString txt(tr("Confirm your Wi-Fi password or usable of wireless card"));
objKyDBus->showDesktopNotify(txt);
//QString cmd = "export LANG='en_US.UTF-8';export LANGUAGE='en_US';notify-send '" + txt + "...' -t 3800";
//int status1 = system(cmd.toUtf8().data());
//if (status1 != 0){ syslog(LOG_ERR, "execute 'notify-send' in function 'execConnWifiPWD' failed");}
} else if (connFlag == 3) {
syslog(LOG_DEBUG, "Launch kylin-nm, Wi-Fi already connected");
}
@ -2675,21 +2507,6 @@ void MainWindow::paintEvent(QPaintEvent *event)
///////////////////////////////////////////////////////////////////////////////
//控件随主题
void MainWindow::setUkuiStyle(QString style)
{
qDebug() << "zzzzz" << style;
// const auto ratio=devicePixelRatioF();
// QPixmap pixmap=loadSvg(iconStr,19*ratio);
// if (style == "ukui-light") {
// pixmap=drawSymbolicBlackColoredPixmap(pixmap);
// } else {
// pixmap=drawSymbolicColoredPixmap(pixmap);//反白
// }
// pixmap.setDevicePixelRatio(qApp->devicePixelRatio());
// label->setPixmap(pixmap);
}
QPixmap MainWindow::drawSymbolicColoredPixmap(const QPixmap &source)
{
QColor gray(128,128,128);

View File

@ -169,7 +169,6 @@ public slots:
void onNetworkDeviceAdded(QDBusObjectPath objPath);
void onNetworkDeviceRemoved(QDBusObjectPath objPath);
void getLanBandWidth();
void setUkuiStyle(QString style);
void checkIfWiredNetExist();
void onExternalConnectionChange(QString type);
@ -292,15 +291,11 @@ private slots:
void on_showWindowAction();
void on_btnAdvConf_clicked();
void on_btnNetList_pressed();
void on_btnWifiList_pressed();
void activeLanDisconn();
void activeWifiDisconn();
void activeStartLoading();
void activeGetWifiList();
void on_btnAdvConf_pressed();
void on_btnAdvConf_released();
void on_checkWifiListChanged();
void on_setNetSpeed();
void on_checkOverTime();
@ -309,7 +304,6 @@ private slots:
void enNetDone();
void disNetDone();
void enWifiDone();
void launchLanDone();
void disWifiDone();
void disWifiStateKeep();
void disWifiDoneChangeUI();

View File

@ -44,7 +44,6 @@ OneConnForm::OneConnForm(QWidget *parent, MainWindow *mainWindow, ConfForm *conf
ui->btnConnPWD->setText(tr("Connect"));//"连接"
ui->btnDisConn->setText(tr("Disconnect"));//"断开连接"
ui->btnHideConn->setText(tr("Connect"));//"连接"
//ui->lePassword->setText(tr("Input Password..."));//"输入密码..."
ui->lbConned->setAlignment(Qt::AlignLeft);
ui->lePassword->setEchoMode(QLineEdit::Normal);
@ -78,9 +77,6 @@ OneConnForm::OneConnForm(QWidget *parent, MainWindow *mainWindow, ConfForm *conf
ui->btnConnPWD->setStyleSheet("QPushButton{border:0px;border-radius:4px;background-color:rgba(255,255,255,0.12);color:white;font-size:14px;}"
"QPushButton:Hover{border:0px solid rgba(255,255,255,0.2);border-radius:4px;background-color:rgba(255,255,255,0.2);}"
"QPushButton:Pressed{border-radius:4px;background-color:rgba(255,255,255,0.08);}");
//ui->btnDisConn->setStyleSheet("QPushButton{border:0px;border-radius:4px;background-color:rgba(255,255,255,0.12);color:white;font-size:14px;}"
// "QPushButton:Hover{border:0px solid rgba(255,255,255,0.2);border-radius:4px;background-color:rgba(255,255,255,0.2);}"
// "QPushButton:Pressed{border-radius:4px;background-color:rgba(255,255,255,0.08);}");
ui->btnHideConn->setStyleSheet("QPushButton{border:0px;border-radius:4px;background-color:rgba(61,107,229,1);color:white;font-size:14px;}"
"QPushButton:Hover{border:0px solid rgba(255,255,255,0.2);border-radius:4px;background-color:rgba(107,142,235,1);}"
"QPushButton:Pressed{border-radius:4px;background-color:rgba(50,87,202,1);}");
@ -130,8 +126,6 @@ OneConnForm::OneConnForm(QWidget *parent, MainWindow *mainWindow, ConfForm *conf
ui->btnInfo->setAttribute(Qt::WA_Hover,true);
ui->btnInfo->installEventFilter(this);
//m_notify = new NotifySend();
connect(ui->lePassword, SIGNAL(returnPressed()), this, SLOT(on_btnConnPWD_clicked()));
ui->btnConn->setShortcut(Qt::Key_Return);//将字母区回车键与登录按钮绑定在一起
@ -201,10 +195,8 @@ bool OneConnForm::eventFilter(QObject *obj, QEvent *event)
void OneConnForm::setAct(bool isAct)
{
if (isAct) {
//ui->lbName->setStyleSheet("QLabel{font-size:14px;color:#ffffff;}");
ui->lbConned->show();
} else {
//ui->lbName->setStyleSheet("QLabel{font-size:14px;color:#ffffff;}");
ui->lbConned->hide();
}
isActive = isAct;
@ -283,7 +275,6 @@ void OneConnForm::setSelected(bool isSelected, bool isCurrName)
this->isSelected = true;
} else {
resize(W_ITEM, H_ITEM);
//ui->lePassword->setText(tr("Input Password..."));//"输入密码..."
ui->lePassword->setText("");
ui->lePassword->setStyleSheet("QLineEdit{border:1px solid rgba(61,107,229,1);border-radius:4px;background:rgba(0,0,0,0.2);}");
ui->lePassword->setEchoMode(QLineEdit::Normal);
@ -446,13 +437,11 @@ void OneConnForm::setWifiInfo(QString str1, QString str2, QString str3)
void OneConnForm::slotConnWifi()
{
//mw->startLoading();
this->startWaiting(true);
emit sigConnWifi(ui->lbName->text());
}
void OneConnForm::slotConnWifiPWD()
{
//mw->startLoading();
this->startWaiting(true);
emit sigConnWifiPWD(ui->lbName->text(), ui->lePassword->text(), connType);
}
@ -728,9 +717,6 @@ void OneConnForm::slotConnWifiResult(int connFlag)
currentActWifiSignalLv = signalLv;
this->stopWaiting();
//if (connFlag != 0){
// mw->stopLoading();
//}
}
void OneConnForm::waitAnimStep()

View File

@ -52,9 +52,6 @@ OneLancForm::OneLancForm(QWidget *parent, MainWindow *mainWindow, ConfForm *conf
ui->btnConn->setStyleSheet("QPushButton{border:0px;border-radius:4px;background-color:rgba(61,107,229,1);color:white;font-size:14px;}"
"QPushButton:Hover{border:0px solid rgba(255,255,255,0.2);border-radius:4px;background-color:rgba(107,142,235,1);}"
"QPushButton:Pressed{border-radius:4px;background-color:rgba(50,87,202,1);}");
//ui->btnDisConn->setStyleSheet("QPushButton{border:0px;border-radius:4px;background-color:rgba(255,255,255,0.12);color:white;font-size:14px;}"
// "QPushButton:Hover{border:0px solid rgba(255,255,255,0.2);border-radius:4px;background-color:rgba(255,255,255,0.2);}"
// "QPushButton:Pressed{border-radius:4px;background-color:rgba(255,255,255,0.08);}");
ui->lbWaiting->setStyleSheet("QLabel{border:0px;border-radius:4px;background-color:rgba(61,107,229,1);}");
ui->lbWaitingIcon->setStyleSheet("QLabel{border:0px;background-color:transparent;}");
@ -101,7 +98,6 @@ OneLancForm::~OneLancForm()
void OneLancForm::mousePressEvent(QMouseEvent *)
{
//emit selectedOneLanForm(lanName);
emit selectedOneLanForm(lanName, uniqueName);//避免重名情况
}
@ -147,11 +143,9 @@ bool OneLancForm::eventFilter(QObject *obj, QEvent *event)
void OneLancForm::setAct(bool isAct)
{
if (isAct) {
//ui->lbName->setStyleSheet("QLabel{font-size:14px;color:#ffffff;}");
ui->lbConned->show();
ui->btnConnSub->hide();
} else {
//ui->lbName->setStyleSheet("QLabel{font-size:14px;color:#ffffff;}");
ui->lbConned->hide();
ui->btnConnSub->hide();
}

View File

@ -52,18 +52,7 @@ DlgHideWifi::DlgHideWifi(int type, MainWindow *mainWindow, QWidget *parent) :
ui->lbBoder->setStyleSheet("QLabel{border-radius:6px;background-color:rgba(19,19,20,0.95);border:1px solid rgba(255, 255, 255, 0.05);}");
ui->lbBoder->hide();
ui->lbLeftupTitle->setStyleSheet("QLabel{font-size:20px;}");
// ui->lbConn->setStyleSheet(objQss.labelQss);
// ui->lbNetName->setStyleSheet(objQss.labelQss);
// ui->lbSecurity->setStyleSheet(objQss.labelQss);
// ui->cbxConn->setStyleSheet(objQss.cbxQss);
// ui->cbxConn->setView(new QListView());
// ui->leNetName->setStyleSheet(objQss.leQss);
// ui->cbxSecurity->setStyleSheet(objQss.cbxQss);
// ui->cbxSecurity->setView(new QListView());
// ui->btnConnect->setStyleSheet(objQss.btnConnQss);
// ui->btnCancel->setStyleSheet(objQss.btnCancelQss);
ui->lineUp->setStyleSheet(objQss.lineQss);
ui->lineDown->setStyleSheet(objQss.lineQss);

View File

@ -224,10 +224,10 @@ void DlgHideWifiEapFast::changeDialogSecu()
void DlgHideWifiEapFast::changeDialogAuth()
{
if(ui->cbxAuth->currentIndex()==0){
// QApplication::setQuitOnLastWindowClosed(false);
// this->hide();
// DlgHideWifiEapTls *connHidWifiEapTls = new DlgHideWifiEapTls(WepOrWpa);
// connHidWifiEapTls->show();
//QApplication::setQuitOnLastWindowClosed(false);
//this->hide();
//DlgHideWifiEapTls *connHidWifiEapTls = new DlgHideWifiEapTls(WepOrWpa);
//connHidWifiEapTls->show();
} else if(ui->cbxAuth->currentIndex()==1) {
QApplication::setQuitOnLastWindowClosed(false);
this->hide();
@ -241,15 +241,15 @@ void DlgHideWifiEapFast::changeDialogAuth()
} 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();
// DlgHideWifiEapTTLS *connHidWifiEapTTls = new DlgHideWifiEapTTLS(WepOrWpa);
// connHidWifiEapTTls->show();
//QApplication::setQuitOnLastWindowClosed(false);
//this->hide();
//DlgHideWifiEapTTLS *connHidWifiEapTTls = new DlgHideWifiEapTTLS(WepOrWpa);
//connHidWifiEapTTls->show();
} else {
// QApplication::setQuitOnLastWindowClosed(false);
// this->hide();
// DlgHideWifiEapPeap *connHidWifiEapPeap = new DlgHideWifiEapPeap(WepOrWpa);
// connHidWifiEapPeap->show();
//QApplication::setQuitOnLastWindowClosed(false);
//this->hide();
//DlgHideWifiEapPeap *connHidWifiEapPeap = new DlgHideWifiEapPeap(WepOrWpa);
//connHidWifiEapPeap->show();
}
}

View File

@ -194,10 +194,10 @@ void DlgHideWifiEapLeap::changeDialogSecu()
void DlgHideWifiEapLeap::changeDialogAuth()
{
if(ui->cbxAuth->currentIndex()==0){
// QApplication::setQuitOnLastWindowClosed(false);
// this->hide();
// DlgHideWifiEapTls *connHidWifiEapTls = new DlgHideWifiEapTls(WepOrWpa);
// connHidWifiEapTls->show();
//QApplication::setQuitOnLastWindowClosed(false);
//this->hide();
//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) {
@ -216,10 +216,10 @@ void DlgHideWifiEapLeap::changeDialogAuth()
DlgHideWifiEapTTLS *connHidWifiEapTTls = new DlgHideWifiEapTTLS(WepOrWpa);
connHidWifiEapTTls->show();
} else {
// QApplication::setQuitOnLastWindowClosed(false);
// this->hide();
// DlgHideWifiEapPeap *connHidWifiEapPeap = new DlgHideWifiEapPeap(WepOrWpa);
// connHidWifiEapPeap->show();
//QApplication::setQuitOnLastWindowClosed(false);
//this->hide();
//DlgHideWifiEapPeap *connHidWifiEapPeap = new DlgHideWifiEapPeap(WepOrWpa);
//connHidWifiEapPeap->show();
}
}

View File

@ -47,54 +47,17 @@ DlgHideWifiEapPeap::DlgHideWifiEapPeap(int type, int beUsed, MainWindow *mainWin
path.addRoundedRect(rect, 6, 6);
setProperty("blurRegion", QRegion(path.toFillPolygon().toPolygon()));
//this->setStyleSheet("QWidget{border-radius:6px;background-color:rgba(19,19,20,0.7);border:1px solid rgba(255, 255, 255, 0.05);}");
MyQss objQss;
ui->lbBoder->setStyleSheet("QLabel{border-radius:6px;background-color:rgba(19,19,20,0.95);border:1px solid rgba(255, 255, 255, 0.05);}");
ui->lbBoder->hide();
ui->lbLeftupTitle->setStyleSheet("QLabel{font-size:20px;}");
// ui->lbConn->setStyleSheet(objQss.labelQss);
// ui->lbNetName->setStyleSheet(objQss.labelQss);
// ui->lbSecurity->setStyleSheet(objQss.labelQss);
// ui->lbAuth->setStyleSheet(objQss.labelQss);
// ui->lbAnonyId->setStyleSheet(objQss.labelQss);
// ui->lbDomain->setStyleSheet(objQss.labelQss);
// ui->lbCA->setStyleSheet(objQss.labelQss);
// ui->lbCaPwd->setStyleSheet(objQss.labelQss);
// ui->lbPEAPver->setStyleSheet(objQss.labelQss);
// ui->lbInnerAuth->setStyleSheet(objQss.labelQss);
// ui->lbUserName->setStyleSheet(objQss.labelQss);
// ui->lbPassword->setStyleSheet(objQss.labelQss);
// ui->cbxConn->setStyleSheet(objQss.cbxQss);
// ui->cbxConn->setView(new QListView());
// ui->leNetName->setStyleSheet(objQss.leQss);
// ui->cbxSecurity->setStyleSheet(objQss.cbxQss);
// ui->cbxSecurity->setView(new QListView());
// ui->cbxAuth->setStyleSheet(objQss.cbxQss);
// ui->cbxAuth->setView(new QListView());
// ui->leAnonyId->setStyleSheet(objQss.leQss);
// ui->leDomain->setStyleSheet(objQss.leQss);
// ui->cbxCA->setStyleSheet(objQss.cbxQss);
// ui->cbxCA->setView(new QListView());
// ui->leCaPwd->setStyleSheet(objQss.leQss);
ui->checkBoxPwd->setStyleSheet(objQss.checkBoxQss);
// ui->checkBoxCA->setStyleSheet(objQss.checkBoxCAQss);
// ui->cbxPEAPver->setStyleSheet(objQss.cbxQss);
// ui->cbxPEAPver->setView(new QListView());
// ui->cbxInnerAuth->setStyleSheet(objQss.cbxQss);
// ui->cbxInnerAuth->setView(new QListView());
// ui->leUserName->setStyleSheet(objQss.leQss);
// ui->lePassword->setStyleSheet(objQss.leQss);
ui->checkBoxPwdSec->setStyleSheet(objQss.checkBoxQss);
// ui->btnCancel->setStyleSheet(objQss.btnCancelQss);
// ui->btnConnect->setStyleSheet(objQss.btnConnQss);
ui->lineUp->setStyleSheet(objQss.lineQss);
ui->lineDown->setStyleSheet(objQss.lineQss);
ui->lbLeftupTitle->setText(tr("Add hidden Wi-Fi")); //加入隐藏Wi-Fi
ui->lbConn->setText(tr("Connection")); //连接设置:
ui->lbNetName->setText(tr("Network name")); //网络名称:

View File

@ -195,10 +195,10 @@ void DlgHideWifiEapPwd::changeDialogSecu()
void DlgHideWifiEapPwd::changeDialogAuth()
{
if(ui->cbxAuth->currentIndex()==0){
// QApplication::setQuitOnLastWindowClosed(false);
// this->hide();
// DlgHideWifiEapTls *connHidWifiEapTls = new DlgHideWifiEapTls(WepOrWpa);
// connHidWifiEapTls->show();
//QApplication::setQuitOnLastWindowClosed(false);
//this->hide();
//DlgHideWifiEapTls *connHidWifiEapTls = new DlgHideWifiEapTls(WepOrWpa);
//connHidWifiEapTls->show();
} else if(ui->cbxAuth->currentIndex()==1) {
QApplication::setQuitOnLastWindowClosed(false);
this->hide();
@ -217,10 +217,10 @@ void DlgHideWifiEapPwd::changeDialogAuth()
DlgHideWifiEapTTLS *connHidWifiEapTTls = new DlgHideWifiEapTTLS(WepOrWpa);
connHidWifiEapTTls->show();
} else {
// QApplication::setQuitOnLastWindowClosed(false);
// this->hide();
// DlgHideWifiEapPeap *connHidWifiEapPeap = new DlgHideWifiEapPeap(WepOrWpa);
// connHidWifiEapPeap->show();
//QApplication::setQuitOnLastWindowClosed(false);
//this->hide();
//DlgHideWifiEapPeap *connHidWifiEapPeap = new DlgHideWifiEapPeap(WepOrWpa);
//connHidWifiEapPeap->show();
}
}

View File

@ -46,53 +46,16 @@ DlgHideWifiEapTls::DlgHideWifiEapTls(int type, int beUsed, MainWindow *mainWindo
path.addRoundedRect(rect, 6, 6);
setProperty("blurRegion", QRegion(path.toFillPolygon().toPolygon()));
//this->setStyleSheet("QWidget{border-radius:6px;background-color:rgba(19,19,20,0.7);border:1px solid rgba(255, 255, 255, 0.05);}");
MyQss objQss;
ui->lbBoder->setStyleSheet("QLabel{border-radius:6px;background-color:rgba(19,19,20,0.95);border:1px solid rgba(255, 255, 255, 0.05);}");
ui->lbBoder->hide();
ui->lbLeftupTitle->setStyleSheet("QLabel{font-size:20px;}");
// ui->lbConn->setStyleSheet(objQss.labelQss);
// ui->lbNetName->setStyleSheet(objQss.labelQss);
// ui->lbSecurity->setStyleSheet(objQss.labelQss);
// ui->lbAuth->setStyleSheet(objQss.labelQss);
// ui->lbIdentity->setStyleSheet(objQss.labelQss);
// ui->lbDomain->setStyleSheet(objQss.labelQss);
// ui->lbCA->setStyleSheet(objQss.labelQss);
// ui->lbCaPwd->setStyleSheet(objQss.labelQss);
// ui->lbUserCertify->setStyleSheet(objQss.labelQss);
// ui->lbUserCertifyPwd->setStyleSheet(objQss.labelQss);
// ui->lbUserPriKey->setStyleSheet(objQss.labelQss);
// ui->lbUserKeyPwd->setStyleSheet(objQss.labelQss);
// ui->cbxConn->setStyleSheet(objQss.cbxQss);
// ui->cbxConn->setView(new QListView());
// ui->leNetName->setStyleSheet(objQss.leQss);
// ui->cbxSecurity->setStyleSheet(objQss.cbxQss);
// ui->cbxSecurity->setView(new QListView());
// ui->cbxAuth->setStyleSheet(objQss.cbxQss);
// ui->cbxAuth->setView(new QListView());
// ui->leIdentity->setStyleSheet(objQss.leQss);
// ui->leDomain->setStyleSheet(objQss.leQss);
// ui->cbxCA->setStyleSheet(objQss.cbxQss);
// ui->cbxCA->setView(new QListView());
// ui->leCaPwd->setStyleSheet(objQss.leQss);
ui->checkBoxPwd->setStyleSheet(objQss.checkBoxQss);
// ui->checkBoxCA->setStyleSheet(objQss.checkBoxCAQss);
// ui->cbxUserCertify->setStyleSheet(objQss.cbxQss);
// ui->cbxUserCertify->setView(new QListView());
// ui->leUserCertifyPwd->setStyleSheet(objQss.leQss);
// ui->cbxUserPriKey->setStyleSheet(objQss.cbxQss);
// ui->cbxUserPriKey->setView(new QListView());
// ui->leUserKeyPwd->setStyleSheet(objQss.leQss);
ui->checkBoxPwdSec->setStyleSheet(objQss.checkBoxQss);
//ui->btnCancel->setStyleSheet(objQss.btnCancelQss);
//ui->btnConnect->setStyleSheet(objQss.btnCancelQss);
ui->lineUp->setStyleSheet(objQss.lineQss);
ui->lineDown->setStyleSheet(objQss.lineQss);
//ui->checkBoxCA->setFocusPolicy(Qt::NoFocus);
ui->lbLeftupTitle->setText(tr("Add hidden Wi-Fi")); //加入隐藏Wi-Fi
ui->lbConn->setText(tr("Connection")); //连接设置:

View File

@ -229,10 +229,10 @@ void DlgHideWifiEapTTLS::changeDialogSecu()
void DlgHideWifiEapTTLS::changeDialogAuth()
{
if(ui->cbxAuth->currentIndex()==0){
// QApplication::setQuitOnLastWindowClosed(false);
// this->hide();
// DlgHideWifiEapTls *connHidWifiEapTls = new DlgHideWifiEapTls(WepOrWpa);
// connHidWifiEapTls->show();
//QApplication::setQuitOnLastWindowClosed(false);
//this->hide();
//DlgHideWifiEapTls *connHidWifiEapTls = new DlgHideWifiEapTls(WepOrWpa);
//connHidWifiEapTls->show();
} else if(ui->cbxAuth->currentIndex()==1) {
QApplication::setQuitOnLastWindowClosed(false);
this->hide();
@ -251,10 +251,10 @@ void DlgHideWifiEapTTLS::changeDialogAuth()
} else if(ui->cbxAuth->currentIndex()==4) {
qDebug()<<"it's not need to change dialog";
} else {
// QApplication::setQuitOnLastWindowClosed(false);
// this->hide();
// DlgHideWifiEapPeap *connHidWifiEapPeap = new DlgHideWifiEapPeap(WepOrWpa);
// connHidWifiEapPeap->show();
//QApplication::setQuitOnLastWindowClosed(false);
//this->hide();
//DlgHideWifiEapPeap *connHidWifiEapPeap = new DlgHideWifiEapPeap(WepOrWpa);
//connHidWifiEapPeap->show();
}
}

View File

@ -158,15 +158,15 @@ void DlgHideWifiLeap::changeDialog()
} 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();
// DlgHideWifiEapTls *connHidWifiEapTls = new DlgHideWifiEapTls(0);
// connHidWifiEapTls->show();
//QApplication::setQuitOnLastWindowClosed(false);
//this->hide();
//DlgHideWifiEapTls *connHidWifiEapTls = new DlgHideWifiEapTls(0);
//connHidWifiEapTls->show();
} else {
// QApplication::setQuitOnLastWindowClosed(false);
// this->hide();
// DlgHideWifiEapTls *connHidWifiEapTls = new DlgHideWifiEapTls(1);
// connHidWifiEapTls->show();
//QApplication::setQuitOnLastWindowClosed(false);
//this->hide();
//DlgHideWifiEapTls *connHidWifiEapTls = new DlgHideWifiEapTls(1);
//connHidWifiEapTls->show();
}
}

View File

@ -181,15 +181,15 @@ void DlgHideWifiWep::changeDialog()
DlgHideWifiLeap *connHidWifiLeap = new DlgHideWifiLeap();
connHidWifiLeap->show();
} else if(ui->cbxSecurity->currentIndex()==5) {
// QApplication::setQuitOnLastWindowClosed(false);
// this->hide();
// DlgHideWifiEapTls *connHidWifiEapTls = new DlgHideWifiEapTls(0);
// connHidWifiEapTls->show();
//QApplication::setQuitOnLastWindowClosed(false);
//this->hide();
//DlgHideWifiEapTls *connHidWifiEapTls = new DlgHideWifiEapTls(0);
//connHidWifiEapTls->show();
} else {
// QApplication::setQuitOnLastWindowClosed(false);
// this->hide();
// DlgHideWifiEapTls *connHidWifiEapTls = new DlgHideWifiEapTls(1);
// connHidWifiEapTls->show();
//QApplication::setQuitOnLastWindowClosed(false);
//this->hide();
//DlgHideWifiEapTls *connHidWifiEapTls = new DlgHideWifiEapTls(1);
//connHidWifiEapTls->show();
}
}

View File

@ -51,21 +51,9 @@ DlgHideWifiWpa::DlgHideWifiWpa(int type, MainWindow *mainWindow, QWidget *parent
ui->lbBoder->setStyleSheet("QLabel{border-radius:6px;background-color:rgba(19,19,20,0.95);border:1px solid rgba(255, 255, 255, 0.05);}");
ui->lbBoder->hide();
ui->lbLeftupTitle->setStyleSheet("QLabel{font-size:20px;}");
// ui->lbConn->setStyleSheet(objQss.labelQss);
// ui->lbNetName->setStyleSheet(objQss.labelQss);
// ui->lbSecurity->setStyleSheet(objQss.labelQss);
// ui->lbPassword->setStyleSheet(objQss.labelQss);
// ui->cbxConn->setStyleSheet(objQss.cbxQss);
// ui->cbxConn->setView(new QListView());
// ui->leNetName->setStyleSheet(objQss.leQss);
// ui->lePassword->setStyleSheet(objQss.leQss);
// ui->cbxSecurity->setStyleSheet(objQss.cbxQss);
// ui->cbxSecurity->setView(new QListView());
ui->checkBoxPwd->setStyleSheet(objQss.checkBoxQss);
// ui->btnCancel->setStyleSheet(objQss.btnCancelQss);
// ui->btnConnect->setStyleSheet(objQss.btnConnQss);
ui->lineUp->setStyleSheet(objQss.lineQss);
ui->lineDown->setStyleSheet(objQss.lineQss);
ui->btnCancel->setFocusPolicy(Qt::NoFocus);