Merge branch '0809-main' into 'dbus-interface'

Adjust documents' struct.

See merge request kylin-desktop/kylin-nm!151
This commit is contained in:
ren peijia 2021-08-09 10:21:32 +00:00
commit a5482a2af5
88 changed files with 241 additions and 232 deletions

View File

@ -1,190 +1,11 @@
#-------------------------------------------------
#
# Project created by QtCreator 2018-10-19T15:29:47
#
#-------------------------------------------------
TEMPLATE = subdirs
QT += core gui x11extras dbus KWindowSystem svg concurrent network
CONFIG += ordered
greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
SUBDIRS = \
src \
TARGET = kylin-nm
TEMPLATE = app
LANGUAGE = C++
CONFIG += c++14
CONFIG += qt warn_on
#CONFIG += release
CONFIG += link_pkgconfig
PKGCONFIG +=gio-2.0 glib-2.0 gio-unix-2.0 libnm
INCLUDEPATH += /usr/include/KF5/NetworkManagerQt
LIBS += -L/usr/lib/ -lgsettings-qt -lX11 -lKF5NetworkManagerQt
#LIBS += -lkysec
target.path = /usr/bin
target.source += $$TARGET
desktop.path = /etc/xdg/autostart/
desktop.files = kylin-nm.desktop
inst1.files += src/conf/com.kylin.NetworkManager.qt.systemdbus.service
inst1.path = /usr/share/dbus-1/system-services/
inst2.files += src/conf/com.kylin.NetworkManager.qt.systemdbus.conf
inst2.path = /etc/dbus-1/system.d/
INSTALLS += target \
desktop \
inst1 \
inst2 \
TRANSLATIONS += ./translations/kylin-nm_zh_CN.ts \
./translations/kylin-nm_tr.ts \
./translations/kylin-nm_bo.ts
# The following define makes your compiler emit warnings if you use
# any feature of Qt which has been marked as deprecated (the exact warnings
# depend on your compiler). Please consult the documentation of the
# deprecated API in order to know how to port your code away from it.
DEFINES += QT_DEPRECATED_WARNINGS
# You can also make your code fail to compile if you use deprecated APIs.
# In order to do so, uncomment the following line.
# You can also select to disable deprecated APIs only up to a certain version of Qt.
#DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000 # disables all the APIs deprecated before Qt 6.0.0
# QMAKE_CXXFLAGS += -Wno-unused-parameter
QMAKE_CPPFLAGS *= $(shell dpkg-buildflags --get CPPFLAGS)
QMAKE_CFLAGS *= $(shell dpkg-buildflags --get CFLAGS)
QMAKE_CXXFLAGS *= $(shell dpkg-buildflags --get CXXFLAGS)
QMAKE_LFLAGS *= $(shell dpkg-buildflags --get LDFLAGS)
include(src/singleapplication/qt-single-application.pri)
SOURCES += \
src/backend/dbus-interface/kylinconnectitem.cpp \
src/backend/dbus-interface/kylinconnectoperation.cpp \
src/backend/dbus-interface/kylinconnectresource.cpp \
src/backend/dbus-interface/kylinconnectsetting.cpp \
src/backend/dbus-interface/kylinnetworkdeviceresource.cpp \
src/backend/dbus-interface/kylinnetworkresourcemanager.cpp \
src/backend/dbus-interface/kylinvpnconnectitem.cpp \
src/backend/dbus-interface/kylinwiredconnectoperation.cpp \
src/backend/dbus-interface/kywirelessconnectoperation.cpp \
src/backend/dbus-interface/kywirelessnetitem.cpp \
src/backend/dbus-interface/kywirelessnetresource.cpp \
src/backend/dbus-interface/kyenterpricesettinginfo.cpp \
src/backend/dbus-interface/kylinactiveconnectresource.cpp \
src/backend/dbus-interface/kylinbluetoothconnectitem.cpp \
src/backthread.cpp \
src/nmdemo.cpp \
src/kylinwiredwidget.cpp \
src/wifi-auth-thread.cpp \
src/confform.cpp \
src/dbusadaptor.cpp \
src/ksimplenm.cpp \
src/kylin-dbus-interface.cpp \
src/kylin-network-interface.c \
src/loadingdiv.cpp \
src/main.cpp \
src/mainwindow.cpp \
src/oneconnform.cpp \
src/onelancform.cpp \
src/switchbutton.cpp \
src/sysdbusregister.cpp \
src/utils.cpp \
src/wpawifidialog.cpp \
src/wificonfigdialog.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
HEADERS += \
src/backend/dbus-interface/kyenterpricesettinginfo.h \
src/backend/dbus-interface/kylinactiveconnectresource.h \
src/backend/dbus-interface/kylinbluetoothconnectitem.h \
src/backend/dbus-interface/kylinconnectitem.h \
src/backend/dbus-interface/kylinconnectoperation.h \
src/backend/dbus-interface/kylinconnectresource.h \
src/backend/dbus-interface/kylinconnectsetting.h \
src/backend/dbus-interface/kylinnetworkdeviceresource.h \
src/backend/dbus-interface/kylinnetworkresourcemanager.h \
src/backend/dbus-interface/kylinvpnconnectitem.h \
src/backend/dbus-interface/kylinwiredconnectoperation.h \
src/backend/dbus-interface/kywirelessconnectoperation.h \
src/backend/dbus-interface/kywirelessnetitem.h \
src/backend/dbus-interface/kywirelessnetresource.h \
src/backthread.h \
src/nmdemo.h \
src/kylinwiredwidget.h \
src/wifi-auth-thread.h \
src/confform.h \
src/dbusadaptor.h \
src/ksimplenm.h \
src/kylin-dbus-interface.h \
src/kylin-network-interface.h \
src/loadingdiv.h \
src/mainwindow.h \
src/oneconnform.h \
src/onelancform.h \
src/switchbutton.h \
src/sysdbusregister.h \
src/utils.h \
src/wpawifidialog.h \
src/wificonfigdialog.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
FORMS += \
src/confform.ui \
src/mainwindow.ui \
src/oneconnform.ui \
src/onelancform.ui \
hot-spot/dlghotspotcreate.ui \
src/wpawifidialog.ui \
src/wificonfigdialog.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
unix {
UI_DIR = .ui
MOC_DIR = .moc
OBJECTS_DIR = .obj
}
DISTFILES += \
src/conf/com.kylin.NetworkManager.qt.systemdbus.conf \
src/conf/com.kylin.NetworkManager.qt.systemdbus.service
TRANSLATIONS += \
translations/kylin-nm_zh_CN.ts \
translations/kylin-nm_tr.ts \
translations/kylin-nm_bo.ts

23
src/backend/backend.pri Normal file
View File

@ -0,0 +1,23 @@
INCLUDEPATH += $$PWD
include(hotspot/hotspot.pri)
include(dbus-interface/dbus-interface.pri)
HEADERS += \
$$PWD/backthread.h \
$$PWD/dbusadaptor.h \
$$PWD/ksimplenm.h \
$$PWD/kylin-dbus-interface.h \
$$PWD/kylin-network-interface.h \
$$PWD/sysdbusregister.h \
$$PWD/utils.h \
$$PWD/wifi-auth-thread.h
SOURCES += \
$$PWD/backthread.cpp \
$$PWD/dbusadaptor.cpp \
$$PWD/ksimplenm.cpp \
$$PWD/kylin-dbus-interface.cpp \
$$PWD/kylin-network-interface.c \
$$PWD/sysdbusregister.cpp \
$$PWD/utils.cpp \
$$PWD/wifi-auth-thread.cpp

View File

@ -0,0 +1,34 @@
INCLUDEPATH += $$PWD
HEADERS += \
$$PWD/kyenterpricesettinginfo.h \
$$PWD/kylinactiveconnectresource.h \
$$PWD/kylinbluetoothconnectitem.h \
$$PWD/kylinconnectitem.h \
$$PWD/kylinconnectoperation.h \
$$PWD/kylinconnectresource.h \
$$PWD/kylinconnectsetting.h \
$$PWD/kylinnetworkdeviceresource.h \
$$PWD/kylinnetworkresourcemanager.h \
$$PWD/kylinvpnconnectitem.h \
$$PWD/kylinwiredconnectoperation.h \
$$PWD/kywirelessconnectoperation.h \
$$PWD/kywirelessnetitem.h \
$$PWD/kywirelessnetresource.h
SOURCES += \
$$PWD/kyenterpricesettinginfo.cpp \
$$PWD/kylinactiveconnectresource.cpp \
$$PWD/kylinbluetoothconnectitem.cpp \
$$PWD/kylinconnectitem.cpp \
$$PWD/kylinconnectoperation.cpp \
$$PWD/kylinconnectresource.cpp \
$$PWD/kylinconnectsetting.cpp \
$$PWD/kylinnetworkdeviceresource.cpp \
$$PWD/kylinnetworkresourcemanager.cpp \
$$PWD/kylinvpnconnectitem.cpp \
$$PWD/kylinwiredconnectoperation.cpp \
$$PWD/kywirelessconnectoperation.cpp \
$$PWD/kywirelessnetitem.cpp \
$$PWD/kywirelessnetresource.cpp

View File

@ -18,7 +18,7 @@
#include "dlghotspotcreate.h"
#include "ui_dlghotspotcreate.h"
#include "src/utils.h"
#include "utils.h"
DlgHotspotCreate::DlgHotspotCreate(QString wiFiCardName, QWidget *parent) :
wirelessCardName(wiFiCardName),

View File

@ -0,0 +1,11 @@
INCLUDEPATH += $$PWD
FORMS += \
$$PWD/dlghotspotcreate.ui
HEADERS += \
$$PWD/dlghotspotcreate.h
SOURCES += \
$$PWD/dlghotspotcreate.cpp

View File

@ -1,22 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?> <!-- -*- XML -*- -->
<!DOCTYPE busconfig PUBLIC
"-//freedesktop//DTD D-BUS Bus Configuration 1.0//EN"
"http://www.freedesktop.org/standards/dbus/1.0/busconfig.dtd">
<busconfig>
<!-- Only root can own the service -->
<policy user="root">
<allow own="com.kylin.NetworkManager.qt.systemdbus"/>
<allow send_interface="com.kylin.NetworkManager.interface"/>
</policy>
<!-- Allow anyone to invoke methods on the interfaces -->
<policy context="default">
<allow send_destination="com.kylin.NetworkManager.qt.systemdbus"
send_interface="com.kylin.NetworkManager.interface"/>
<allow send_destination="com.kylin.NetworkManager.qt.systemdbus"
send_interface="org.freedesktop.DBus.Introspectable"/>
<allow send_destination="com.kylin.NetworkManager.qt.systemdbus"
send_interface="org.freedesktop.DBus.Properties"/>
</policy>
</busconfig>

View File

@ -1,4 +0,0 @@
[D-BUS Service]
Name=com.kylin.NetworkManager.qt.systemdbus
Exec=/usr/bin/kylin-nm
User=root

31
src/frontend/frontend.pri Normal file
View File

@ -0,0 +1,31 @@
INCLUDEPATH += $$PWD
include(tools/tools.pri)
include(wireless-security/wireless-security.pri)
FORMS += \
$$PWD/confform.ui \
$$PWD/mainwindow.ui \
$$PWD/oneconnform.ui \
$$PWD/onelancform.ui \
$$PWD/wificonfigdialog.ui \
$$PWD/wpawifidialog.ui
HEADERS += \
$$PWD/confform.h \
$$PWD/kylinwiredwidget.h \
$$PWD/mainwindow.h \
$$PWD/nmdemo.h \
$$PWD/oneconnform.h \
$$PWD/onelancform.h \
$$PWD/wificonfigdialog.h \
$$PWD/wpawifidialog.h
SOURCES += \
$$PWD/confform.cpp \
$$PWD/kylinwiredwidget.cpp \
$$PWD/mainwindow.cpp \
$$PWD/nmdemo.cpp \
$$PWD/oneconnform.cpp \
$$PWD/onelancform.cpp \
$$PWD/wificonfigdialog.cpp \
$$PWD/wpawifidialog.cpp

View File

@ -21,7 +21,7 @@
#include "oneconnform.h"
#include "onelancform.h"
#include "wifi-auth-thread.h"
#include "hot-spot/dlghotspotcreate.h"
#include "hotspot/dlghotspotcreate.h"
#include "wireless-security/dlghidewifi.h"
#include "sysdbusregister.h"
#include "kylinwiredwidget.h"

View File

@ -0,0 +1,10 @@
INCLUDEPATH += $$PWD
HEADERS += \
$$PWD/loadingdiv.h \
$$PWD/switchbutton.h
SOURCES += \
$$PWD/loadingdiv.cpp \
$$PWD/switchbutton.cpp

View File

@ -20,10 +20,10 @@
#include "dlghidewifi.h"
#include "kylinheadfile.h"
#include "ui_dlghidewifi.h"
#include "src/backthread.h"
#include "src/mainwindow.h"
#include "src/kylin-dbus-interface.h"
#include "src/wpawifidialog.h"
#include "backthread.h"
#include "mainwindow.h"
#include "kylin-dbus-interface.h"
#include "wpawifidialog.h"
#include <unistd.h>
#include <QPoint>

View File

@ -20,7 +20,7 @@
#include "dlghidewifieapfast.h"
#include "ui_dlghidewifieapfast.h"
#include "kylinheadfile.h"
#include "src/kylin-dbus-interface.h"
#include "kylin-dbus-interface.h"
DlgHideWifiEapFast::DlgHideWifiEapFast(int type, QWidget *parent) :
WepOrWpa(type),

View File

@ -20,7 +20,7 @@
#include "dlghidewifieapleap.h"
#include "ui_dlghidewifieapleap.h"
#include "kylinheadfile.h"
#include "src/kylin-dbus-interface.h"
#include "kylin-dbus-interface.h"
DlgHideWifiEapLeap::DlgHideWifiEapLeap(int type, QWidget *parent) :
WepOrWpa(type),

View File

@ -20,8 +20,8 @@
#include "dlghidewifieappeap.h"
#include "ui_dlghidewifieappeap.h"
#include "kylinheadfile.h"
#include "src/mainwindow.h"
#include "src/kylin-dbus-interface.h"
#include "mainwindow.h"
#include "kylin-dbus-interface.h"
#include <QStandardItemModel>
#include <QDir>

View File

@ -20,7 +20,7 @@
#include "dlghidewifieappwd.h"
#include "ui_dlghidewifieappwd.h"
#include "kylinheadfile.h"
#include "src/kylin-dbus-interface.h"
#include "kylin-dbus-interface.h"
DlgHideWifiEapPwd::DlgHideWifiEapPwd(int type, QWidget *parent) :
WepOrWpa(type),

View File

@ -19,8 +19,8 @@
#include "ui_dlghidewifieaptls.h"
#include "kylinheadfile.h"
#include "src/mainwindow.h"
#include "src/kylin-dbus-interface.h"
#include "mainwindow.h"
#include "kylin-dbus-interface.h"
#include <QStandardItemModel>
#include <QDir>

View File

@ -20,7 +20,7 @@
#include "dlghidewifieapttls.h"
#include "ui_dlghidewifieapttls.h"
#include "kylinheadfile.h"
#include "src/kylin-dbus-interface.h"
#include "kylin-dbus-interface.h"
DlgHideWifiEapTTLS::DlgHideWifiEapTTLS(int type, QWidget *parent) :
WepOrWpa(type),

View File

@ -19,7 +19,7 @@
#include "ui_dlghidewifileap.h"
#include "kylinheadfile.h"
#include "src/kylin-dbus-interface.h"
#include "kylin-dbus-interface.h"
DlgHideWifiLeap::DlgHideWifiLeap(QWidget *parent) :
QDialog(parent),

View File

@ -19,7 +19,7 @@
#include "ui_dlghidewifiwep.h"
#include "kylinheadfile.h"
#include "src/kylin-dbus-interface.h"
#include "kylin-dbus-interface.h"
DlgHideWifiWep::DlgHideWifiWep(int type, QWidget *parent) :
WepPwdOrCode(type),

View File

@ -20,9 +20,9 @@
#include "dlghidewifiwpa.h"
#include "ui_dlghidewifiwpa.h"
#include "kylinheadfile.h"
#include "src/backthread.h"
#include "src/mainwindow.h"
#include "src/wpawifidialog.h"
#include "backthread.h"
#include "mainwindow.h"
#include "wpawifidialog.h"
#include <unistd.h>
#include <stdlib.h>

View File

@ -0,0 +1,40 @@
INCLUDEPATH += $$PWD
FORMS += \
$$PWD/dlghidewifi.ui \
$$PWD/dlghidewifieapfast.ui \
$$PWD/dlghidewifieapleap.ui \
$$PWD/dlghidewifieappeap.ui \
$$PWD/dlghidewifieappwd.ui \
$$PWD/dlghidewifieaptls.ui \
$$PWD/dlghidewifieapttls.ui \
$$PWD/dlghidewifileap.ui \
$$PWD/dlghidewifiwep.ui \
$$PWD/dlghidewifiwpa.ui
HEADERS += \
$$PWD/dlghidewifi.h \
$$PWD/dlghidewifieapfast.h \
$$PWD/dlghidewifieapleap.h \
$$PWD/dlghidewifieappeap.h \
$$PWD/dlghidewifieappwd.h \
$$PWD/dlghidewifieaptls.h \
$$PWD/dlghidewifieapttls.h \
$$PWD/dlghidewifileap.h \
$$PWD/dlghidewifiwep.h \
$$PWD/dlghidewifiwpa.h \
$$PWD/kylinheadfile.h
SOURCES += \
$$PWD/dlghidewifi.cpp \
$$PWD/dlghidewifieapfast.cpp \
$$PWD/dlghidewifieapleap.cpp \
$$PWD/dlghidewifieappeap.cpp \
$$PWD/dlghidewifieappwd.cpp \
$$PWD/dlghidewifieaptls.cpp \
$$PWD/dlghidewifieapttls.cpp \
$$PWD/dlghidewifileap.cpp \
$$PWD/dlghidewifiwep.cpp \
$$PWD/dlghidewifiwpa.cpp \
$$PWD/kylinheadfile.cpp

65
src/src.pro Normal file
View File

@ -0,0 +1,65 @@
#-------------------------------------------------
#
# Project created by QtCreator 2018-10-19T15:29:47
#
#-------------------------------------------------
QT += core gui x11extras dbus KWindowSystem svg concurrent network
greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
TARGET = kylin-nm
TEMPLATE = app
LANGUAGE = C++
CONFIG += c++14
CONFIG += qt warn_on
#CONFIG += release
CONFIG += link_pkgconfig
PKGCONFIG +=gio-2.0 glib-2.0 gio-unix-2.0 libnm
INCLUDEPATH += /usr/include/KF5/NetworkManagerQt
LIBS += -L/usr/lib/ -lgsettings-qt -lX11 -lKF5NetworkManagerQt
#LIBS += -lkysec
target.path = /usr/bin
target.source += $$TARGET
desktop.path = /etc/xdg/autostart/
desktop.files = kylin-nm.desktop
INSTALLS += target \
desktop \
# The following define makes your compiler emit warnings if you use
# any feature of Qt which has been marked as deprecated (the exact warnings
# depend on your compiler). Please consult the documentation of the
# deprecated API in order to know how to port your code away from it.
DEFINES += QT_DEPRECATED_WARNINGS
# You can also make your code fail to compile if you use deprecated APIs.
# In order to do so, uncomment the following line.
# You can also select to disable deprecated APIs only up to a certain version of Qt.
#DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000 # disables all the APIs deprecated before Qt 6.0.0
# QMAKE_CXXFLAGS += -Wno-unused-parameter
QMAKE_CPPFLAGS *= $(shell dpkg-buildflags --get CPPFLAGS)
QMAKE_CFLAGS *= $(shell dpkg-buildflags --get CFLAGS)
QMAKE_CXXFLAGS *= $(shell dpkg-buildflags --get CXXFLAGS)
QMAKE_LFLAGS *= $(shell dpkg-buildflags --get LDFLAGS)
include(singleapplication/qt-single-application.pri)
include(backend/backend.pri)
include(frontend/frontend.pri)
RESOURCES += \
../nmqrc.qrc
SOURCES += \
main.cpp
unix {
UI_DIR = .ui
MOC_DIR = .moc
OBJECTS_DIR = .obj
}