解决连接企业wifi不能弹框认证的问题
This commit is contained in:
parent
f1308ff2fe
commit
f97ae5038b
|
@ -24,6 +24,10 @@ Vcs-Browser: https://github.com/ukui/kylin-nm
|
||||||
Package: kylin-nm
|
Package: kylin-nm
|
||||||
Architecture: any
|
Architecture: any
|
||||||
Depends: network-manager (>=1.2.6),
|
Depends: network-manager (>=1.2.6),
|
||||||
|
network-manager-config-connectivity-ubuntu,
|
||||||
|
gir1.2-javascriptcoregtk-4.0,
|
||||||
|
gir1.2-webkit2-4.0,
|
||||||
|
gnome-shell,
|
||||||
${shlibs:Depends},
|
${shlibs:Depends},
|
||||||
${misc:Depends}
|
${misc:Depends}
|
||||||
Description: Gui Applet tool for display and edit network simply
|
Description: Gui Applet tool for display and edit network simply
|
||||||
|
|
|
@ -61,6 +61,7 @@ QMAKE_LFLAGS *= $(shell dpkg-buildflags --get LDFLAGS)
|
||||||
|
|
||||||
SOURCES += \
|
SOURCES += \
|
||||||
src/backthread.cpp \
|
src/backthread.cpp \
|
||||||
|
src/wifi-auth-thread.cpp \
|
||||||
src/confform.cpp \
|
src/confform.cpp \
|
||||||
src/dbusadaptor.cpp \
|
src/dbusadaptor.cpp \
|
||||||
src/ksimplenm.cpp \
|
src/ksimplenm.cpp \
|
||||||
|
@ -92,6 +93,7 @@ SOURCES += \
|
||||||
|
|
||||||
HEADERS += \
|
HEADERS += \
|
||||||
src/backthread.h \
|
src/backthread.h \
|
||||||
|
src/wifi-auth-thread.h \
|
||||||
src/confform.h \
|
src/confform.h \
|
||||||
src/dbusadaptor.h \
|
src/dbusadaptor.h \
|
||||||
src/ksimplenm.h \
|
src/ksimplenm.h \
|
||||||
|
|
|
@ -20,6 +20,7 @@
|
||||||
#include "ui_mainwindow.h"
|
#include "ui_mainwindow.h"
|
||||||
#include "oneconnform.h"
|
#include "oneconnform.h"
|
||||||
#include "onelancform.h"
|
#include "onelancform.h"
|
||||||
|
#include "wifi-auth-thread.h"
|
||||||
#include "hot-spot/dlghotspotcreate.h"
|
#include "hot-spot/dlghotspotcreate.h"
|
||||||
#include "wireless-security/dlghidewifi.h"
|
#include "wireless-security/dlghidewifi.h"
|
||||||
#include "sysdbusregister.h"
|
#include "sysdbusregister.h"
|
||||||
|
@ -3188,6 +3189,8 @@ void MainWindow::connWifiDone(int connFlag)
|
||||||
{
|
{
|
||||||
// Wifi连接结果,0点击连接成功 1失败 2没有配置文件 3开机启动网络工具时已经连接
|
// Wifi连接结果,0点击连接成功 1失败 2没有配置文件 3开机启动网络工具时已经连接
|
||||||
if (connFlag == 0) {
|
if (connFlag == 0) {
|
||||||
|
WifiAuthThread *wifi_auth_thread=new WifiAuthThread();
|
||||||
|
wifi_auth_thread->start();
|
||||||
syslog(LOG_DEBUG, "Wi-Fi already connected by clicking button");
|
syslog(LOG_DEBUG, "Wi-Fi already connected by clicking button");
|
||||||
this->ksnm->execGetWifiList();
|
this->ksnm->execGetWifiList();
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,15 @@
|
||||||
|
#include "wifi-auth-thread.h"
|
||||||
|
void WifiAuthThread::run()
|
||||||
|
{
|
||||||
|
QDBusInterface interface( "org.freedesktop.NetworkManager",
|
||||||
|
"/org/freedesktop/NetworkManager",
|
||||||
|
"org.freedesktop.NetworkManager",
|
||||||
|
QDBusConnection::systemBus() );
|
||||||
|
QDBusReply<uint> reply= interface.call("CheckConnectivity");
|
||||||
|
if (reply.isValid()) {
|
||||||
|
if (reply.value() == 2)
|
||||||
|
system("gdbus call --session --dest org.gnome.Shell.PortalHelper --object-path /org/gnome/Shell/PortalHelper --method org.gtk.Application.Activate []");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,13 @@
|
||||||
|
#ifndef WIFI_AUTH_THREAD_H
|
||||||
|
#define WIFI_AUTH_THREAD_H
|
||||||
|
#include <QThread>
|
||||||
|
#include <QDBusInterface>
|
||||||
|
#include <QDBusReply>
|
||||||
|
|
||||||
|
class WifiAuthThread:public QThread
|
||||||
|
{
|
||||||
|
protected:
|
||||||
|
virtual void run();
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif //WIFI_AUTH_THREAD_H
|
Loading…
Reference in New Issue