From f25569f10e88930ce97993eae2c078a31949e566 Mon Sep 17 00:00:00 2001 From: zhangjiaping Date: Mon, 9 Aug 2021 17:13:04 +0800 Subject: [PATCH] Adjust documents' struct. --- kylin-nm.pro | 195 +----- src/backend/backend.pri | 23 + src/{ => backend}/backthread.cpp | 0 src/{ => backend}/backthread.h | 0 src/backend/dbus-interface/dbus-interface.pri | 38 ++ .../dbus-interface/kylinnetworkconnect.cpp | 612 ++++++++++++++++++ .../dbus-interface/kylinnetworkconnect.h | 82 +++ .../dbus-interface/kylinwiredconnectitem.cpp | 43 ++ .../dbus-interface/kylinwiredconnectitem.h | 34 + src/{ => backend}/dbusadaptor.cpp | 0 src/{ => backend}/dbusadaptor.h | 0 .../backend/hotspot}/dlghotspotcreate.cpp | 2 +- .../backend/hotspot}/dlghotspotcreate.h | 0 .../backend/hotspot}/dlghotspotcreate.ui | 0 src/backend/hotspot/hotspot.pri | 11 + src/{ => backend}/ksimplenm.cpp | 0 src/{ => backend}/ksimplenm.h | 0 src/{ => backend}/kylin-dbus-interface.cpp | 0 src/{ => backend}/kylin-dbus-interface.h | 0 src/{ => backend}/kylin-network-interface.c | 0 src/{ => backend}/kylin-network-interface.h | 0 src/{ => backend}/sysdbusregister.cpp | 0 src/{ => backend}/sysdbusregister.h | 0 src/{ => backend}/utils.cpp | 0 src/{ => backend}/utils.h | 0 src/{ => backend}/wifi-auth-thread.cpp | 0 src/{ => backend}/wifi-auth-thread.h | 0 ...om.kylin.NetworkManager.qt.systemdbus.conf | 22 - ...kylin.NetworkManager.qt.systemdbus.service | 4 - src/{ => frontend}/confform.cpp | 0 src/{ => frontend}/confform.h | 0 src/{ => frontend}/confform.ui | 0 src/frontend/frontend.pri | 31 + src/{ => frontend}/kylinwiredwidget.cpp | 0 src/{ => frontend}/kylinwiredwidget.h | 0 src/{ => frontend}/mainwindow.cpp | 2 +- src/{ => frontend}/mainwindow.h | 0 src/{ => frontend}/mainwindow.ui | 0 src/{ => frontend}/nmdemo.cpp | 0 src/{ => frontend}/nmdemo.h | 0 src/{ => frontend}/oneconnform.cpp | 0 src/{ => frontend}/oneconnform.h | 0 src/{ => frontend}/oneconnform.ui | 0 src/{ => frontend}/onelancform.cpp | 0 src/{ => frontend}/onelancform.h | 0 src/{ => frontend}/onelancform.ui | 0 src/{ => frontend/tools}/loadingdiv.cpp | 0 src/{ => frontend/tools}/loadingdiv.h | 0 src/{ => frontend/tools}/switchbutton.cpp | 0 src/{ => frontend/tools}/switchbutton.h | 0 src/frontend/tools/tools.pri | 10 + src/{ => frontend}/wificonfigdialog.cpp | 0 src/{ => frontend}/wificonfigdialog.h | 0 src/{ => frontend}/wificonfigdialog.ui | 0 .../wireless-security}/dlghidewifi.cpp | 8 +- .../frontend/wireless-security}/dlghidewifi.h | 0 .../wireless-security}/dlghidewifi.ui | 0 .../wireless-security}/dlghidewifieapfast.cpp | 2 +- .../wireless-security}/dlghidewifieapfast.h | 0 .../wireless-security}/dlghidewifieapfast.ui | 0 .../wireless-security}/dlghidewifieapleap.cpp | 2 +- .../wireless-security}/dlghidewifieapleap.h | 0 .../wireless-security}/dlghidewifieapleap.ui | 0 .../wireless-security}/dlghidewifieappeap.cpp | 4 +- .../wireless-security}/dlghidewifieappeap.h | 0 .../wireless-security}/dlghidewifieappeap.ui | 0 .../wireless-security}/dlghidewifieappwd.cpp | 2 +- .../wireless-security}/dlghidewifieappwd.h | 0 .../wireless-security}/dlghidewifieappwd.ui | 0 .../wireless-security}/dlghidewifieaptls.cpp | 4 +- .../wireless-security}/dlghidewifieaptls.h | 0 .../wireless-security}/dlghidewifieaptls.ui | 0 .../wireless-security}/dlghidewifieapttls.cpp | 2 +- .../wireless-security}/dlghidewifieapttls.h | 0 .../wireless-security}/dlghidewifieapttls.ui | 0 .../wireless-security}/dlghidewifileap.cpp | 2 +- .../wireless-security}/dlghidewifileap.h | 0 .../wireless-security}/dlghidewifileap.ui | 0 .../wireless-security}/dlghidewifiwep.cpp | 2 +- .../wireless-security}/dlghidewifiwep.h | 0 .../wireless-security}/dlghidewifiwep.ui | 0 .../wireless-security}/dlghidewifiwpa.cpp | 6 +- .../wireless-security}/dlghidewifiwpa.h | 0 .../wireless-security}/dlghidewifiwpa.ui | 0 .../wireless-security}/kylinheadfile.cpp | 0 .../wireless-security}/kylinheadfile.h | 0 .../wireless-security/wireless-security.pri | 40 ++ src/{ => frontend}/wpawifidialog.cpp | 0 src/{ => frontend}/wpawifidialog.h | 0 src/{ => frontend}/wpawifidialog.ui | 0 kylin-nm.desktop => src/kylin-nm.desktop | 0 src/src.pro | 65 ++ 92 files changed, 1016 insertions(+), 232 deletions(-) create mode 100644 src/backend/backend.pri rename src/{ => backend}/backthread.cpp (100%) rename src/{ => backend}/backthread.h (100%) create mode 100644 src/backend/dbus-interface/dbus-interface.pri create mode 100644 src/backend/dbus-interface/kylinnetworkconnect.cpp create mode 100644 src/backend/dbus-interface/kylinnetworkconnect.h create mode 100644 src/backend/dbus-interface/kylinwiredconnectitem.cpp create mode 100644 src/backend/dbus-interface/kylinwiredconnectitem.h rename src/{ => backend}/dbusadaptor.cpp (100%) rename src/{ => backend}/dbusadaptor.h (100%) rename {hot-spot => src/backend/hotspot}/dlghotspotcreate.cpp (99%) rename {hot-spot => src/backend/hotspot}/dlghotspotcreate.h (100%) rename {hot-spot => src/backend/hotspot}/dlghotspotcreate.ui (100%) create mode 100644 src/backend/hotspot/hotspot.pri rename src/{ => backend}/ksimplenm.cpp (100%) rename src/{ => backend}/ksimplenm.h (100%) rename src/{ => backend}/kylin-dbus-interface.cpp (100%) rename src/{ => backend}/kylin-dbus-interface.h (100%) rename src/{ => backend}/kylin-network-interface.c (100%) rename src/{ => backend}/kylin-network-interface.h (100%) rename src/{ => backend}/sysdbusregister.cpp (100%) rename src/{ => backend}/sysdbusregister.h (100%) rename src/{ => backend}/utils.cpp (100%) rename src/{ => backend}/utils.h (100%) rename src/{ => backend}/wifi-auth-thread.cpp (100%) rename src/{ => backend}/wifi-auth-thread.h (100%) delete mode 100644 src/conf/com.kylin.NetworkManager.qt.systemdbus.conf delete mode 100644 src/conf/com.kylin.NetworkManager.qt.systemdbus.service rename src/{ => frontend}/confform.cpp (100%) rename src/{ => frontend}/confform.h (100%) rename src/{ => frontend}/confform.ui (100%) create mode 100644 src/frontend/frontend.pri rename src/{ => frontend}/kylinwiredwidget.cpp (100%) rename src/{ => frontend}/kylinwiredwidget.h (100%) rename src/{ => frontend}/mainwindow.cpp (99%) rename src/{ => frontend}/mainwindow.h (100%) rename src/{ => frontend}/mainwindow.ui (100%) rename src/{ => frontend}/nmdemo.cpp (100%) rename src/{ => frontend}/nmdemo.h (100%) rename src/{ => frontend}/oneconnform.cpp (100%) rename src/{ => frontend}/oneconnform.h (100%) rename src/{ => frontend}/oneconnform.ui (100%) rename src/{ => frontend}/onelancform.cpp (100%) rename src/{ => frontend}/onelancform.h (100%) rename src/{ => frontend}/onelancform.ui (100%) rename src/{ => frontend/tools}/loadingdiv.cpp (100%) rename src/{ => frontend/tools}/loadingdiv.h (100%) rename src/{ => frontend/tools}/switchbutton.cpp (100%) rename src/{ => frontend/tools}/switchbutton.h (100%) create mode 100644 src/frontend/tools/tools.pri rename src/{ => frontend}/wificonfigdialog.cpp (100%) rename src/{ => frontend}/wificonfigdialog.h (100%) rename src/{ => frontend}/wificonfigdialog.ui (100%) rename {wireless-security => src/frontend/wireless-security}/dlghidewifi.cpp (99%) rename {wireless-security => src/frontend/wireless-security}/dlghidewifi.h (100%) rename {wireless-security => src/frontend/wireless-security}/dlghidewifi.ui (100%) rename {wireless-security => src/frontend/wireless-security}/dlghidewifieapfast.cpp (99%) rename {wireless-security => src/frontend/wireless-security}/dlghidewifieapfast.h (100%) rename {wireless-security => src/frontend/wireless-security}/dlghidewifieapfast.ui (100%) rename {wireless-security => src/frontend/wireless-security}/dlghidewifieapleap.cpp (99%) rename {wireless-security => src/frontend/wireless-security}/dlghidewifieapleap.h (100%) rename {wireless-security => src/frontend/wireless-security}/dlghidewifieapleap.ui (100%) rename {wireless-security => src/frontend/wireless-security}/dlghidewifieappeap.cpp (99%) rename {wireless-security => src/frontend/wireless-security}/dlghidewifieappeap.h (100%) rename {wireless-security => src/frontend/wireless-security}/dlghidewifieappeap.ui (100%) rename {wireless-security => src/frontend/wireless-security}/dlghidewifieappwd.cpp (99%) rename {wireless-security => src/frontend/wireless-security}/dlghidewifieappwd.h (100%) rename {wireless-security => src/frontend/wireless-security}/dlghidewifieappwd.ui (100%) rename {wireless-security => src/frontend/wireless-security}/dlghidewifieaptls.cpp (99%) rename {wireless-security => src/frontend/wireless-security}/dlghidewifieaptls.h (100%) rename {wireless-security => src/frontend/wireless-security}/dlghidewifieaptls.ui (100%) rename {wireless-security => src/frontend/wireless-security}/dlghidewifieapttls.cpp (99%) rename {wireless-security => src/frontend/wireless-security}/dlghidewifieapttls.h (100%) rename {wireless-security => src/frontend/wireless-security}/dlghidewifieapttls.ui (100%) rename {wireless-security => src/frontend/wireless-security}/dlghidewifileap.cpp (99%) rename {wireless-security => src/frontend/wireless-security}/dlghidewifileap.h (100%) rename {wireless-security => src/frontend/wireless-security}/dlghidewifileap.ui (100%) rename {wireless-security => src/frontend/wireless-security}/dlghidewifiwep.cpp (99%) rename {wireless-security => src/frontend/wireless-security}/dlghidewifiwep.h (100%) rename {wireless-security => src/frontend/wireless-security}/dlghidewifiwep.ui (100%) rename {wireless-security => src/frontend/wireless-security}/dlghidewifiwpa.cpp (99%) rename {wireless-security => src/frontend/wireless-security}/dlghidewifiwpa.h (100%) rename {wireless-security => src/frontend/wireless-security}/dlghidewifiwpa.ui (100%) rename {wireless-security => src/frontend/wireless-security}/kylinheadfile.cpp (100%) rename {wireless-security => src/frontend/wireless-security}/kylinheadfile.h (100%) create mode 100644 src/frontend/wireless-security/wireless-security.pri rename src/{ => frontend}/wpawifidialog.cpp (100%) rename src/{ => frontend}/wpawifidialog.h (100%) rename src/{ => frontend}/wpawifidialog.ui (100%) rename kylin-nm.desktop => src/kylin-nm.desktop (100%) create mode 100644 src/src.pro diff --git a/kylin-nm.pro b/kylin-nm.pro index 20ee8879..f4afe7bc 100644 --- a/kylin-nm.pro +++ b/kylin-nm.pro @@ -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 diff --git a/src/backend/backend.pri b/src/backend/backend.pri new file mode 100644 index 00000000..5cc3a775 --- /dev/null +++ b/src/backend/backend.pri @@ -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 diff --git a/src/backthread.cpp b/src/backend/backthread.cpp similarity index 100% rename from src/backthread.cpp rename to src/backend/backthread.cpp diff --git a/src/backthread.h b/src/backend/backthread.h similarity index 100% rename from src/backthread.h rename to src/backend/backthread.h diff --git a/src/backend/dbus-interface/dbus-interface.pri b/src/backend/dbus-interface/dbus-interface.pri new file mode 100644 index 00000000..a578e1db --- /dev/null +++ b/src/backend/dbus-interface/dbus-interface.pri @@ -0,0 +1,38 @@ +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/kylinnetworkconnect.h \ + $$PWD/kylinnetworkdeviceresource.h \ + $$PWD/kylinnetworkresourcemanager.h \ + $$PWD/kylinvpnconnectitem.h \ + $$PWD/kylinwiredconnectitem.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/kylinnetworkconnect.cpp \ + $$PWD/kylinnetworkdeviceresource.cpp \ + $$PWD/kylinnetworkresourcemanager.cpp \ + $$PWD/kylinvpnconnectitem.cpp \ + $$PWD/kylinwiredconnectitem.cpp \ + $$PWD/kylinwiredconnectoperation.cpp \ + $$PWD/kywirelessconnectoperation.cpp \ + $$PWD/kywirelessnetitem.cpp \ + $$PWD/kywirelessnetresource.cpp + diff --git a/src/backend/dbus-interface/kylinnetworkconnect.cpp b/src/backend/dbus-interface/kylinnetworkconnect.cpp new file mode 100644 index 00000000..ddb655ed --- /dev/null +++ b/src/backend/dbus-interface/kylinnetworkconnect.cpp @@ -0,0 +1,612 @@ +/* + * Copyright (C) 2020 Tianjin KYLIN Information Technology Co., Ltd. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3, or (at your option) + * any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, see setId(accessPoint->ssid()); + settings->setUuid(NetworkManager::ConnectionSettings::createNewUuid()); + settings->setAutoconnect(true); + //Note: workaround for wrongly (randomly) initialized gateway-ping-timeout + settings->setGatewayPingTimeout(0); + + NetworkManager::WirelessSetting::Ptr wifi_sett + = settings->setting(NetworkManager::Setting::Wireless).dynamicCast(); + wifi_sett->setInitialized(true); + wifi_sett->setSsid(accessPoint->ssid().toUtf8()); + wifi_sett->setSecurity("802-11-wireless-security"); + + NetworkManager::WirelessSecuritySetting::Ptr security_sett + = settings->setting(NetworkManager::Setting::WirelessSecurity).dynamicCast(); + security_sett->setInitialized(true); + if (NetworkManager::AccessPoint::Adhoc == accessPoint->mode()) + { + wifi_sett->setMode(NetworkManager::WirelessSetting::Adhoc); + security_sett->setKeyMgmt(NetworkManager::WirelessSecuritySetting::WpaNone); + } else + { + security_sett->setKeyMgmt(NetworkManager::WirelessSecuritySetting::WpaPsk); + } + security_sett->setPsk(psk); + return settings; +} + + +#include +#include +#include +#include +#include + +KyNetworkConnect::KyNetworkConnect() +{ + qDebug()<<"construct network connect"; + m_networkResourceInstance = KyNetworkResourceManager::getInstance(); + + connect(this, &KyNetworkConnect::checkActiveonnection, this, &KyNetworkConnect::onCheckActiveonnection); +} + +KyNetworkConnect::~KyNetworkConnect() +{ + m_networkResourceInstance = nullptr; +} + +void KyNetworkConnect::ipv4SettingInit( + NetworkManager::Ipv4Setting::Ptr &ipv4Setting, + const KyConnectSetting &connectInfo) +{ + ipv4Setting->setInitialized(true); + + if (CONFIG_IP_DHCP == connectInfo.m_ipv4ConfigIpType) { + ipv4Setting->setMethod(NetworkManager::Ipv4Setting::Automatic); + return; + } else { + ipv4Setting->setMethod(NetworkManager::Ipv4Setting::Manual); + } + + if (!connectInfo.m_ipv4Dns.empty()) { + ipv4Setting->setDns(connectInfo.m_ipv4Dns); + } + + if (!connectInfo.m_ipv4Address.empty()) { + ipv4Setting->setAddresses(connectInfo.m_ipv4Address); + } + + return; +} +void KyNetworkConnect::ipv6SettingInit( + NetworkManager::Ipv6Setting::Ptr &ipv6Setting, + const KyConnectSetting &connectInfo) +{ + ipv6Setting->setInitialized(true); + + if (CONFIG_IP_DHCP == connectInfo.m_ipv6ConfigIpType) { + ipv6Setting->setMethod(NetworkManager::Ipv6Setting::Automatic); + return; + } + + ipv6Setting->setMethod(NetworkManager::Ipv6Setting::Manual); + if (!connectInfo.m_ipv6Dns.empty()) { + ipv6Setting->setDns(connectInfo.m_ipv6Dns); + } + + if (!connectInfo.m_ipv6Address.empty()) { + ipv6Setting->setAddresses(connectInfo.m_ipv6Address); + } + + return ; +} + +void KyNetworkConnect::connectSettingInit( + NetworkManager::ConnectionSettings::Ptr connectionSettings, + const KyConnectSetting &connectInfo) +{ + connectionSettings->setId(connectInfo.m_connectName); + connectionSettings->setUuid(NetworkManager::ConnectionSettings::createNewUuid()); + connectionSettings->setAutoconnect(true); + connectionSettings->setAutoconnectPriority(0); + connectionSettings->setInterfaceName(connectInfo.m_ifaceName); + return; +} + +void KyNetworkConnect::createWiredConnect(const KyConnectSetting &connectInfo) +{ + NetworkManager::ConnectionSettings::Ptr connectionSettings = NetworkManager::ConnectionSettings::Ptr(new NetworkManager::ConnectionSettings(NetworkManager::ConnectionSettings::Wired)); + connectSettingInit(connectionSettings, connectInfo); + + NetworkManager::Ipv4Setting::Ptr ipv4Setting = connectionSettings->setting(NetworkManager::Setting::Ipv4).dynamicCast(); + ipv4SettingInit(ipv4Setting, connectInfo); + + NetworkManager::Ipv6Setting::Ptr ipv6Setting = connectionSettings->setting(NetworkManager::Setting::Ipv6).dynamicCast(); + ipv6SettingInit(ipv6Setting, connectInfo); + + NetworkManager::WiredSetting::Ptr wiredSetting = connectionSettings->setting(NetworkManager::Setting::Wired).dynamicCast(); + wiredSetting->setInitialized(true); + + qDebug()<<"add wired connect"<toMap()), this}; + connect(watcher, &QDBusPendingCallWatcher::finished, [](QDBusPendingCallWatcher * watcher) { + if (watcher->isError() || !watcher->isValid()) { + //TODO: in what form should we output the warning messages + qWarning() << "create connection failed: " << watcher->error().message(); + } else { + qWarning()<<"success"<reply().errorName() <<"error msg"<reply().errorMessage(); + qWarning()<<"error type"<error().type(); + } + watcher->deleteLater(); + }); + + return; +} + +void KyNetworkConnect::createConnect(KyConnectType connectType, const KyConnectSetting &connectInfo) +{ + switch (connectType) { + case WIRED_CONNECT: + qDebug()<<"create wired connect"; + createWiredConnect(connectInfo); + break; + default: + qWarning()<<"the connect type undefined"<settings(); + connectSettingInit(connectionSettings, connectInfo); + + NetworkManager::Ipv4Setting::Ptr ipv4Setting = connectionSettings->setting(NetworkManager::Setting::Ipv4).dynamicCast(); + ipv4SettingInit(ipv4Setting, connectInfo); + + NetworkManager::Ipv6Setting::Ptr ipv6Setting = connectionSettings->setting(NetworkManager::Setting::Ipv6).dynamicCast(); + ipv6SettingInit(ipv6Setting, connectInfo); + + NetworkManager::WiredSetting::Ptr wiredSetting = connectionSettings->setting(NetworkManager::Setting::Wired).dynamicCast(); + wiredSetting->setInitialized(true); + + connectPtr->update(connectionSettings->toMap()); + + return ; +} + +void KyNetworkConnect::deleteConnect(const QString &connectUuid) +{ + + qWarning()<<"TODO:delete connect "; + + NetworkManager::Connection::Ptr connectPtr = + NetworkManager::findConnectionByUuid(connectUuid); + + connectPtr->remove(); + + return ; +} + +int KyNetworkConnect::activateConnection(const QString connectUuid) +{ + QString conn_uni; + QString dev_uni; + QString conn_name; + QString dev_name; + QString spec_object; + + qDebug()<<"it will activate connect"<getConnect(connectUuid); + conn_uni = connectPtr->path(); + conn_name = connectPtr->name(); + if (NetworkManager::ConnectionSettings::Vpn == connectPtr->settings()->connectionType()) { + spec_object = dev_uni = QStringLiteral("/"); + /* + // find first non-vpn active connection + const auto act_i = std::find_if(d->mActiveConns.cbegin(), d->mActiveConns.cend(), [] (NetworkManager::ActiveConnection::Ptr const & conn) -> bool + { + return nullptr != dynamic_cast(conn.data()); + }); + if (act_i != d->mActiveConns.cend() && !(*act_i)->devices().empty()) + { + dev_uni = (*act_i)->devices().front(); + spec_object = (*act_i)->path(); + } + */ + + } else { + dev_name = connectPtr->settings()->interfaceName(); + for (auto const & dev : m_networkResourceInstance->m_devices) { + for (auto const & dev_conn : dev->availableConnections()) { + if (dev_conn == connectPtr) { + dev_uni = dev->uni(); + dev_name = dev->interfaceName(); + break; + } + } + } + + if (dev_uni.isEmpty() && !dev_name.isEmpty()) { + auto dev = m_networkResourceInstance->findDeviceInterface(dev_name); + if (!dev.isNull()) + dev_uni = dev->uni(); + } + } + + if (dev_uni.isEmpty()) { + //TODO: in what form should we output the warning messages + qWarning() << QStringLiteral("can't find device '%1' to activate connection '%2' on").arg(dev_name).arg(connectPtr->name()); + return -EINVAL; + } + + qDebug() << __FUNCTION__ << conn_uni << dev_uni << conn_name << dev_name << spec_object; + + //TODO: check vpn type etc.. + QDBusPendingCallWatcher * watcher; + watcher = new QDBusPendingCallWatcher{NetworkManager::activateConnection(conn_uni, dev_uni, spec_object), this}; + connect(watcher, &QDBusPendingCallWatcher::finished, [conn_name, dev_name] (QDBusPendingCallWatcher * watcher) { + if (watcher->isError() || !watcher->isValid()) { + //TODO: in what form should we output the warning messages + qWarning() << "activate connection failed: " << watcher->error().message(); + } else { + qWarning()<<"success"<reply().errorName() <<"error msg"<reply().errorMessage(); + qWarning()<<"error type"<error().type(); + } + + watcher->deleteLater(); + }); + + return 0; +} + +int KyNetworkConnect::deactivateConnection(const QString connectName, const QString &uuid) +{ + int index = 0; + NetworkManager::ActiveConnection::Ptr activateConnectPtr = nullptr; + + qDebug()<<"deactivetate connect name"<m_activeConns.size(); ++index) { + activateConnectPtr = m_networkResourceInstance->m_activeConns.at(index); + if (activateConnectPtr->uuid() == uuid) { + break; + } + } + + if (index >= m_networkResourceInstance->m_activeConns.size()) { + qWarning()<<"it can not find the activate connect"<path(); + + QDBusPendingReply<> reply = NetworkManager::deactivateConnection(activateConnectPtr->path()); + QDBusPendingCallWatcher *watcher = new QDBusPendingCallWatcher(reply, this); + connect(watcher, &QDBusPendingCallWatcher::finished, [activateConnectPtr] (QDBusPendingCallWatcher * watcher) { + qDebug() << "finshed"; + //TODO::it may should send signal deactivateConnectionFinished + if (watcher->isError() || !watcher->isValid()) { + //TODO: in what form should we output the warning messages + qWarning() << QStringLiteral("deactivation of connection '%1' failed: %3").arg(activateConnectPtr->connection()->name()) + .arg(watcher->error().message()); + } else { + qWarning()<<"deactive connect finished"<connection()->name(); + } + watcher->deleteLater(); + }); + + return 0; +} + +void KyNetworkConnect::requestScan(const QString ifaceName) +{ + auto const & dev = m_networkResourceInstance->getNetworkDevice(ifaceName); + auto spec_dev = dev->as(); + if (nullptr == spec_dev) { + //TODO: in what form should we output the warning messages + qWarning() << "dropping request for scan on non wireles device " << dev->interfaceName(); + return; + } + + m_networkResourceInstance->requestScan(spec_dev); +} + +void KyNetworkConnect::requestAllWifiScan() +{ + return; +} + + +void KyNetworkConnect::activateWirelessConnection(NetworkManager::WirelessNetwork::Ptr wirelessNet) +{ +qDebug() << "activateWirelessConnections" ; + emit starWaiting(); + QString conn_uni; + QString dev_uni; + QString conn_name; + QString dev_name; + QString spec_object; + + auto access_point = wirelessNet->referenceAccessPoint(); + Q_ASSERT(!access_point.isNull()); + dev_uni = wirelessNet->device(); + syslog(LOG_DEBUG,"dev_uni %s",dev_uni.toUtf8().data()); + auto dev = m_networkResourceInstance->findDeviceUni(dev_uni); + Q_ASSERT(!dev.isNull()); + auto spec_dev = dev->as(); + Q_ASSERT(nullptr != spec_dev); + conn_uni = access_point->uni(); + syslog(LOG_DEBUG,"conn_uni %s",conn_uni.toUtf8().data()); + conn_name = access_point->ssid(); + syslog(LOG_DEBUG,"conn_name %s",conn_name.toUtf8().data()); + //find the device name + NetworkManager::Connection::Ptr conn; + dev_name = dev->interfaceName(); + syslog(LOG_DEBUG,"dev_name %s",dev_name.toUtf8().data()); + for (auto const & dev_conn : dev->availableConnections()) + { + syslog(LOG_DEBUG,"dev_conn->settings()->id() %s",dev_conn->settings()->id().toUtf8().data()); + if (dev_conn->settings()->id() == conn_name) + { + conn = dev_conn; + } + } + conn_uni = conn->path(); + qDebug()<isError() || !watcher->isValid()) + { + //TODO: in what form should we output the warning messages + qWarning() << QStringLiteral("activation of connection failed: %1").arg(watcher->error().message()); + } else { + emit checkActiveonnection((qdbus_cast(watcher->reply().arguments().at(0))).path()); + } + qDebug() <<" " << (qdbus_cast(watcher->reply().arguments().at(0))).path(); + + watcher->deleteLater(); + }); +} + +void KyNetworkConnect::addAndActivateWirelessConnection(NetworkManager::WirelessNetwork::Ptr wirelessNet, const QString &psk) +{ + qDebug() << "addAndActivateWirelessConnection" ; + emit starWaiting(); + QString conn_uni; + QString dev_uni; + QString conn_name; + QString dev_name; + QString spec_object; + NMVariantMapMap map_settings; + + auto access_point = wirelessNet->referenceAccessPoint(); + Q_ASSERT(!access_point.isNull()); + dev_uni = wirelessNet->device(); + syslog(LOG_DEBUG,"dev_uni %s",dev_uni.toUtf8().data()); + auto dev = m_networkResourceInstance->findDeviceUni(dev_uni); + Q_ASSERT(!dev.isNull()); + auto spec_dev = dev->as(); + Q_ASSERT(nullptr != spec_dev); + conn_uni = access_point->uni(); + syslog(LOG_DEBUG,"conn_uni %s",conn_uni.toUtf8().data()); + conn_name = access_point->ssid(); + syslog(LOG_DEBUG,"conn_name %s",conn_name.toUtf8().data()); + //find the device name + NetworkManager::Connection::Ptr conn; + dev_name = dev->interfaceName(); + syslog(LOG_DEBUG,"dev_name %s",dev_name.toUtf8().data()); + + //TODO: in what form should we output the warning messages + qWarning() << QStringLiteral("can't find connection for '%1' on device '%2', will create new...").arg(conn_name).arg(dev_name); + spec_object = conn_uni; + NetworkManager::WirelessSecurityType sec_type = NetworkManager::findBestWirelessSecurity(spec_dev->wirelessCapabilities() + , true, (spec_dev->mode() == NetworkManager::WirelessDevice::Adhoc) + , access_point->capabilities(), access_point->wpaFlags(), access_point->rsnFlags()); + + qDebug() << "findBestWirelessSecurity type "<< sec_type; + switch (sec_type) + { + case NetworkManager::UnknownSecurity: + qWarning() << QStringLiteral("unknown security to use for '%1'").arg(conn_name); + case NetworkManager::NoneSecurity: + //nothing to do + break; + case NetworkManager::WpaPsk: + case NetworkManager::Wpa2Psk: + if (NetworkManager::ConnectionSettings::Ptr settings = assembleWpaXPskSettings(access_point,psk)) + { + map_settings = settings->toMap(); + } else + { + qWarning() << QStringLiteral("connection settings assembly for '%1' failed, abandoning activation...").arg(conn_name); + return; + } + break; + //TODO: other types... + } + + QDBusPendingCallWatcher * watcher; + watcher = new QDBusPendingCallWatcher{NetworkManager::addAndActivateConnection(map_settings, dev_uni, spec_object), this}; + connect(watcher, &QDBusPendingCallWatcher::finished, [&] (QDBusPendingCallWatcher * watcher) { + if (watcher->isError() || !watcher->isValid()) + { + //TODO: in what form should we output the warning messages + qDebug() << "activation of connection failed " << watcher->error().message(); + } + else{ + emit checkActiveonnection((qdbus_cast(watcher->reply().arguments().at(1))).path()); + } + watcher->deleteLater(); + }); +} + +void KyNetworkConnect::onActivateWirelessConnection(const QString &connectSsid, const QString &connectUuid) +{ + qDebug() << "onActivateWirelessConnection" << connectSsid; + NetworkManager::WirelessNetwork::Ptr wirelessNet = nullptr; + for (auto const & net : m_networkResourceInstance->m_wifiNets) + { + qDebug() << net->ssid() << " " << connectSsid; + if (net->ssid() == connectSsid) + { + wirelessNet = net; + break; + } + } + + if (wirelessNet.isNull()) + { + //TODO:隐藏wifi不会存在与AP中,需要新建connection去连接 + qDebug() << "hidewifi";emit noConnection(); + return; + } + + qDebug() << "非隐藏wifi"; + NetworkManager::Connection::Ptr connectPtr = m_networkResourceInstance->getConnect(connectUuid); + if (connectPtr.isNull()) + { + //无配置文件,前段输入完密码直接调用addAndActivateWirelessConnection + qDebug() << "emit noConnection"; + emit noConnection(); + return; + } + +// //获取安全类型 +// NetworkManager::ConnectionSettings::Ptr settings = connectPtr->settings(); +// NetworkManager::WirelessSecuritySetting::Ptr wifiSecurity = +// settings->setting(NetworkManager::Setting::WirelessSecurity).dynamicCast(); +// int key_mgmt = wifiSecurity->keyMgmt(); + + //获取密码存储策略 0:所有用户存储 1:当前用户存储 2:每次连接询问 + NetworkManager::ConnectionSettings::Ptr settings = connectPtr->settings(); + NetworkManager::WirelessSecuritySetting::Ptr wifiSecurity = + settings->setting(NetworkManager::Setting::WirelessSecurity).dynamicCast(); + int psk_flag = wifiSecurity->pskFlags(); + + qDebug() << "psk_flag=" <getConnect(connectUuid); + if (connectPtr.isNull()) + { + return; + } + + NetworkManager::ConnectionSettings::Ptr settings = connectPtr->settings(); + NetworkManager::WirelessSecuritySetting::Ptr security_sett + = settings->setting(NetworkManager::Setting::WirelessSecurity).dynamicCast(); + qDebug() << connectPtr->path(); + security_sett->setPsk(psk); + + // + NetworkManager::WirelessNetwork::Ptr wirelessNet = nullptr; + for (auto const & net : m_networkResourceInstance->m_wifiNets) + { + if (net->ssid() == connectSsid) + { + wirelessNet = net; + break; + } + } + + activateWirelessConnection(wirelessNet); + return; + } + + NetworkManager::WirelessNetwork::Ptr wirelessNet = nullptr; + for (auto const & net : m_networkResourceInstance->m_wifiNets) + { + if (net->ssid() == connectSsid) + { + wirelessNet = net; + break; + } + } + + if (wirelessNet.isNull()) + { + //TODO:隐藏wifi不会存在与AP中,需要新建connection去连接 + qDebug() << "hidewifi"; + return; + } + + addAndActivateWirelessConnection(wirelessNet,psk); +} + + +void KyNetworkConnect::onCheckActiveonnection(const QString &activeConnPath) +{ + if (m_networkResourceInstance->m_activeConns.size() == 0) + { + qDebug() << "不存在activeConnPath"; + emit connResult(1); + return; + } + + for (auto const & activeConn : m_networkResourceInstance->m_activeConns) + { + if (activeConn->path() == activeConnPath) + { + qDebug() << "存在activeConnPath,且匹配"<state(); + connect(activeConn.data(), &NetworkManager::ActiveConnection::stateChangedReason, this, &KyNetworkConnect::onStateChangedReason); + return; + } + } + qDebug() << "存在activeConnPath,但不匹配"< +#include "kylinnetworkresourcemanager.h" + +class KyWiredConnectItem : public QObject +{ + Q_OBJECT +public: + explicit KyWiredConnectItem(QObject *parent = nullptr); + ~KyWiredConnectItem(); + +public: + void dumpInfo(); + +public: + QString m_connectName; + QString m_connectUuid; + QString m_ifaceName; + + QString m_ipv4; + QString m_ipv6; + QString m_hardAddress; + + QString m_bandWith; + qulonglong m_upSpeed; + qulonglong m_downSpeed; + + NetworkManager::ActiveConnection::State m_state; //deactive、activing and actived + QString m_itemType; //activeconnect or connect +}; + +#endif // KYLINWIREDCONNECTITEM_H diff --git a/src/dbusadaptor.cpp b/src/backend/dbusadaptor.cpp similarity index 100% rename from src/dbusadaptor.cpp rename to src/backend/dbusadaptor.cpp diff --git a/src/dbusadaptor.h b/src/backend/dbusadaptor.h similarity index 100% rename from src/dbusadaptor.h rename to src/backend/dbusadaptor.h diff --git a/hot-spot/dlghotspotcreate.cpp b/src/backend/hotspot/dlghotspotcreate.cpp similarity index 99% rename from hot-spot/dlghotspotcreate.cpp rename to src/backend/hotspot/dlghotspotcreate.cpp index 11b975f8..afeb5b9d 100644 --- a/hot-spot/dlghotspotcreate.cpp +++ b/src/backend/hotspot/dlghotspotcreate.cpp @@ -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), diff --git a/hot-spot/dlghotspotcreate.h b/src/backend/hotspot/dlghotspotcreate.h similarity index 100% rename from hot-spot/dlghotspotcreate.h rename to src/backend/hotspot/dlghotspotcreate.h diff --git a/hot-spot/dlghotspotcreate.ui b/src/backend/hotspot/dlghotspotcreate.ui similarity index 100% rename from hot-spot/dlghotspotcreate.ui rename to src/backend/hotspot/dlghotspotcreate.ui diff --git a/src/backend/hotspot/hotspot.pri b/src/backend/hotspot/hotspot.pri new file mode 100644 index 00000000..76750347 --- /dev/null +++ b/src/backend/hotspot/hotspot.pri @@ -0,0 +1,11 @@ +INCLUDEPATH += $$PWD + +FORMS += \ + $$PWD/dlghotspotcreate.ui + +HEADERS += \ + $$PWD/dlghotspotcreate.h + +SOURCES += \ + $$PWD/dlghotspotcreate.cpp + diff --git a/src/ksimplenm.cpp b/src/backend/ksimplenm.cpp similarity index 100% rename from src/ksimplenm.cpp rename to src/backend/ksimplenm.cpp diff --git a/src/ksimplenm.h b/src/backend/ksimplenm.h similarity index 100% rename from src/ksimplenm.h rename to src/backend/ksimplenm.h diff --git a/src/kylin-dbus-interface.cpp b/src/backend/kylin-dbus-interface.cpp similarity index 100% rename from src/kylin-dbus-interface.cpp rename to src/backend/kylin-dbus-interface.cpp diff --git a/src/kylin-dbus-interface.h b/src/backend/kylin-dbus-interface.h similarity index 100% rename from src/kylin-dbus-interface.h rename to src/backend/kylin-dbus-interface.h diff --git a/src/kylin-network-interface.c b/src/backend/kylin-network-interface.c similarity index 100% rename from src/kylin-network-interface.c rename to src/backend/kylin-network-interface.c diff --git a/src/kylin-network-interface.h b/src/backend/kylin-network-interface.h similarity index 100% rename from src/kylin-network-interface.h rename to src/backend/kylin-network-interface.h diff --git a/src/sysdbusregister.cpp b/src/backend/sysdbusregister.cpp similarity index 100% rename from src/sysdbusregister.cpp rename to src/backend/sysdbusregister.cpp diff --git a/src/sysdbusregister.h b/src/backend/sysdbusregister.h similarity index 100% rename from src/sysdbusregister.h rename to src/backend/sysdbusregister.h diff --git a/src/utils.cpp b/src/backend/utils.cpp similarity index 100% rename from src/utils.cpp rename to src/backend/utils.cpp diff --git a/src/utils.h b/src/backend/utils.h similarity index 100% rename from src/utils.h rename to src/backend/utils.h diff --git a/src/wifi-auth-thread.cpp b/src/backend/wifi-auth-thread.cpp similarity index 100% rename from src/wifi-auth-thread.cpp rename to src/backend/wifi-auth-thread.cpp diff --git a/src/wifi-auth-thread.h b/src/backend/wifi-auth-thread.h similarity index 100% rename from src/wifi-auth-thread.h rename to src/backend/wifi-auth-thread.h diff --git a/src/conf/com.kylin.NetworkManager.qt.systemdbus.conf b/src/conf/com.kylin.NetworkManager.qt.systemdbus.conf deleted file mode 100644 index a8d38ccc..00000000 --- a/src/conf/com.kylin.NetworkManager.qt.systemdbus.conf +++ /dev/null @@ -1,22 +0,0 @@ - - - - - - - - - - - - - - - - - diff --git a/src/conf/com.kylin.NetworkManager.qt.systemdbus.service b/src/conf/com.kylin.NetworkManager.qt.systemdbus.service deleted file mode 100644 index 7b3e7a0e..00000000 --- a/src/conf/com.kylin.NetworkManager.qt.systemdbus.service +++ /dev/null @@ -1,4 +0,0 @@ -[D-BUS Service] -Name=com.kylin.NetworkManager.qt.systemdbus -Exec=/usr/bin/kylin-nm -User=root diff --git a/src/confform.cpp b/src/frontend/confform.cpp similarity index 100% rename from src/confform.cpp rename to src/frontend/confform.cpp diff --git a/src/confform.h b/src/frontend/confform.h similarity index 100% rename from src/confform.h rename to src/frontend/confform.h diff --git a/src/confform.ui b/src/frontend/confform.ui similarity index 100% rename from src/confform.ui rename to src/frontend/confform.ui diff --git a/src/frontend/frontend.pri b/src/frontend/frontend.pri new file mode 100644 index 00000000..dd46bb4d --- /dev/null +++ b/src/frontend/frontend.pri @@ -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 diff --git a/src/kylinwiredwidget.cpp b/src/frontend/kylinwiredwidget.cpp similarity index 100% rename from src/kylinwiredwidget.cpp rename to src/frontend/kylinwiredwidget.cpp diff --git a/src/kylinwiredwidget.h b/src/frontend/kylinwiredwidget.h similarity index 100% rename from src/kylinwiredwidget.h rename to src/frontend/kylinwiredwidget.h diff --git a/src/mainwindow.cpp b/src/frontend/mainwindow.cpp similarity index 99% rename from src/mainwindow.cpp rename to src/frontend/mainwindow.cpp index 09d9bb42..8d1298f7 100644 --- a/src/mainwindow.cpp +++ b/src/frontend/mainwindow.cpp @@ -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" diff --git a/src/mainwindow.h b/src/frontend/mainwindow.h similarity index 100% rename from src/mainwindow.h rename to src/frontend/mainwindow.h diff --git a/src/mainwindow.ui b/src/frontend/mainwindow.ui similarity index 100% rename from src/mainwindow.ui rename to src/frontend/mainwindow.ui diff --git a/src/nmdemo.cpp b/src/frontend/nmdemo.cpp similarity index 100% rename from src/nmdemo.cpp rename to src/frontend/nmdemo.cpp diff --git a/src/nmdemo.h b/src/frontend/nmdemo.h similarity index 100% rename from src/nmdemo.h rename to src/frontend/nmdemo.h diff --git a/src/oneconnform.cpp b/src/frontend/oneconnform.cpp similarity index 100% rename from src/oneconnform.cpp rename to src/frontend/oneconnform.cpp diff --git a/src/oneconnform.h b/src/frontend/oneconnform.h similarity index 100% rename from src/oneconnform.h rename to src/frontend/oneconnform.h diff --git a/src/oneconnform.ui b/src/frontend/oneconnform.ui similarity index 100% rename from src/oneconnform.ui rename to src/frontend/oneconnform.ui diff --git a/src/onelancform.cpp b/src/frontend/onelancform.cpp similarity index 100% rename from src/onelancform.cpp rename to src/frontend/onelancform.cpp diff --git a/src/onelancform.h b/src/frontend/onelancform.h similarity index 100% rename from src/onelancform.h rename to src/frontend/onelancform.h diff --git a/src/onelancform.ui b/src/frontend/onelancform.ui similarity index 100% rename from src/onelancform.ui rename to src/frontend/onelancform.ui diff --git a/src/loadingdiv.cpp b/src/frontend/tools/loadingdiv.cpp similarity index 100% rename from src/loadingdiv.cpp rename to src/frontend/tools/loadingdiv.cpp diff --git a/src/loadingdiv.h b/src/frontend/tools/loadingdiv.h similarity index 100% rename from src/loadingdiv.h rename to src/frontend/tools/loadingdiv.h diff --git a/src/switchbutton.cpp b/src/frontend/tools/switchbutton.cpp similarity index 100% rename from src/switchbutton.cpp rename to src/frontend/tools/switchbutton.cpp diff --git a/src/switchbutton.h b/src/frontend/tools/switchbutton.h similarity index 100% rename from src/switchbutton.h rename to src/frontend/tools/switchbutton.h diff --git a/src/frontend/tools/tools.pri b/src/frontend/tools/tools.pri new file mode 100644 index 00000000..008f4616 --- /dev/null +++ b/src/frontend/tools/tools.pri @@ -0,0 +1,10 @@ +INCLUDEPATH += $$PWD + +HEADERS += \ + $$PWD/loadingdiv.h \ + $$PWD/switchbutton.h + + +SOURCES += \ + $$PWD/loadingdiv.cpp \ + $$PWD/switchbutton.cpp diff --git a/src/wificonfigdialog.cpp b/src/frontend/wificonfigdialog.cpp similarity index 100% rename from src/wificonfigdialog.cpp rename to src/frontend/wificonfigdialog.cpp diff --git a/src/wificonfigdialog.h b/src/frontend/wificonfigdialog.h similarity index 100% rename from src/wificonfigdialog.h rename to src/frontend/wificonfigdialog.h diff --git a/src/wificonfigdialog.ui b/src/frontend/wificonfigdialog.ui similarity index 100% rename from src/wificonfigdialog.ui rename to src/frontend/wificonfigdialog.ui diff --git a/wireless-security/dlghidewifi.cpp b/src/frontend/wireless-security/dlghidewifi.cpp similarity index 99% rename from wireless-security/dlghidewifi.cpp rename to src/frontend/wireless-security/dlghidewifi.cpp index d0cc855c..243cbbe3 100644 --- a/wireless-security/dlghidewifi.cpp +++ b/src/frontend/wireless-security/dlghidewifi.cpp @@ -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 #include diff --git a/wireless-security/dlghidewifi.h b/src/frontend/wireless-security/dlghidewifi.h similarity index 100% rename from wireless-security/dlghidewifi.h rename to src/frontend/wireless-security/dlghidewifi.h diff --git a/wireless-security/dlghidewifi.ui b/src/frontend/wireless-security/dlghidewifi.ui similarity index 100% rename from wireless-security/dlghidewifi.ui rename to src/frontend/wireless-security/dlghidewifi.ui diff --git a/wireless-security/dlghidewifieapfast.cpp b/src/frontend/wireless-security/dlghidewifieapfast.cpp similarity index 99% rename from wireless-security/dlghidewifieapfast.cpp rename to src/frontend/wireless-security/dlghidewifieapfast.cpp index a42df36b..ca301e9b 100644 --- a/wireless-security/dlghidewifieapfast.cpp +++ b/src/frontend/wireless-security/dlghidewifieapfast.cpp @@ -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), diff --git a/wireless-security/dlghidewifieapfast.h b/src/frontend/wireless-security/dlghidewifieapfast.h similarity index 100% rename from wireless-security/dlghidewifieapfast.h rename to src/frontend/wireless-security/dlghidewifieapfast.h diff --git a/wireless-security/dlghidewifieapfast.ui b/src/frontend/wireless-security/dlghidewifieapfast.ui similarity index 100% rename from wireless-security/dlghidewifieapfast.ui rename to src/frontend/wireless-security/dlghidewifieapfast.ui diff --git a/wireless-security/dlghidewifieapleap.cpp b/src/frontend/wireless-security/dlghidewifieapleap.cpp similarity index 99% rename from wireless-security/dlghidewifieapleap.cpp rename to src/frontend/wireless-security/dlghidewifieapleap.cpp index 0e1c5bc0..34a27e83 100644 --- a/wireless-security/dlghidewifieapleap.cpp +++ b/src/frontend/wireless-security/dlghidewifieapleap.cpp @@ -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), diff --git a/wireless-security/dlghidewifieapleap.h b/src/frontend/wireless-security/dlghidewifieapleap.h similarity index 100% rename from wireless-security/dlghidewifieapleap.h rename to src/frontend/wireless-security/dlghidewifieapleap.h diff --git a/wireless-security/dlghidewifieapleap.ui b/src/frontend/wireless-security/dlghidewifieapleap.ui similarity index 100% rename from wireless-security/dlghidewifieapleap.ui rename to src/frontend/wireless-security/dlghidewifieapleap.ui diff --git a/wireless-security/dlghidewifieappeap.cpp b/src/frontend/wireless-security/dlghidewifieappeap.cpp similarity index 99% rename from wireless-security/dlghidewifieappeap.cpp rename to src/frontend/wireless-security/dlghidewifieappeap.cpp index c88f1ec8..829a4998 100644 --- a/wireless-security/dlghidewifieappeap.cpp +++ b/src/frontend/wireless-security/dlghidewifieappeap.cpp @@ -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 #include diff --git a/wireless-security/dlghidewifieappeap.h b/src/frontend/wireless-security/dlghidewifieappeap.h similarity index 100% rename from wireless-security/dlghidewifieappeap.h rename to src/frontend/wireless-security/dlghidewifieappeap.h diff --git a/wireless-security/dlghidewifieappeap.ui b/src/frontend/wireless-security/dlghidewifieappeap.ui similarity index 100% rename from wireless-security/dlghidewifieappeap.ui rename to src/frontend/wireless-security/dlghidewifieappeap.ui diff --git a/wireless-security/dlghidewifieappwd.cpp b/src/frontend/wireless-security/dlghidewifieappwd.cpp similarity index 99% rename from wireless-security/dlghidewifieappwd.cpp rename to src/frontend/wireless-security/dlghidewifieappwd.cpp index d4238d9d..9d00d4ab 100644 --- a/wireless-security/dlghidewifieappwd.cpp +++ b/src/frontend/wireless-security/dlghidewifieappwd.cpp @@ -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), diff --git a/wireless-security/dlghidewifieappwd.h b/src/frontend/wireless-security/dlghidewifieappwd.h similarity index 100% rename from wireless-security/dlghidewifieappwd.h rename to src/frontend/wireless-security/dlghidewifieappwd.h diff --git a/wireless-security/dlghidewifieappwd.ui b/src/frontend/wireless-security/dlghidewifieappwd.ui similarity index 100% rename from wireless-security/dlghidewifieappwd.ui rename to src/frontend/wireless-security/dlghidewifieappwd.ui diff --git a/wireless-security/dlghidewifieaptls.cpp b/src/frontend/wireless-security/dlghidewifieaptls.cpp similarity index 99% rename from wireless-security/dlghidewifieaptls.cpp rename to src/frontend/wireless-security/dlghidewifieaptls.cpp index 78b1dd3b..db5929cd 100644 --- a/wireless-security/dlghidewifieaptls.cpp +++ b/src/frontend/wireless-security/dlghidewifieaptls.cpp @@ -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 #include diff --git a/wireless-security/dlghidewifieaptls.h b/src/frontend/wireless-security/dlghidewifieaptls.h similarity index 100% rename from wireless-security/dlghidewifieaptls.h rename to src/frontend/wireless-security/dlghidewifieaptls.h diff --git a/wireless-security/dlghidewifieaptls.ui b/src/frontend/wireless-security/dlghidewifieaptls.ui similarity index 100% rename from wireless-security/dlghidewifieaptls.ui rename to src/frontend/wireless-security/dlghidewifieaptls.ui diff --git a/wireless-security/dlghidewifieapttls.cpp b/src/frontend/wireless-security/dlghidewifieapttls.cpp similarity index 99% rename from wireless-security/dlghidewifieapttls.cpp rename to src/frontend/wireless-security/dlghidewifieapttls.cpp index bd7cb984..ccc45f05 100644 --- a/wireless-security/dlghidewifieapttls.cpp +++ b/src/frontend/wireless-security/dlghidewifieapttls.cpp @@ -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), diff --git a/wireless-security/dlghidewifieapttls.h b/src/frontend/wireless-security/dlghidewifieapttls.h similarity index 100% rename from wireless-security/dlghidewifieapttls.h rename to src/frontend/wireless-security/dlghidewifieapttls.h diff --git a/wireless-security/dlghidewifieapttls.ui b/src/frontend/wireless-security/dlghidewifieapttls.ui similarity index 100% rename from wireless-security/dlghidewifieapttls.ui rename to src/frontend/wireless-security/dlghidewifieapttls.ui diff --git a/wireless-security/dlghidewifileap.cpp b/src/frontend/wireless-security/dlghidewifileap.cpp similarity index 99% rename from wireless-security/dlghidewifileap.cpp rename to src/frontend/wireless-security/dlghidewifileap.cpp index 3faaba04..97601dc8 100644 --- a/wireless-security/dlghidewifileap.cpp +++ b/src/frontend/wireless-security/dlghidewifileap.cpp @@ -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), diff --git a/wireless-security/dlghidewifileap.h b/src/frontend/wireless-security/dlghidewifileap.h similarity index 100% rename from wireless-security/dlghidewifileap.h rename to src/frontend/wireless-security/dlghidewifileap.h diff --git a/wireless-security/dlghidewifileap.ui b/src/frontend/wireless-security/dlghidewifileap.ui similarity index 100% rename from wireless-security/dlghidewifileap.ui rename to src/frontend/wireless-security/dlghidewifileap.ui diff --git a/wireless-security/dlghidewifiwep.cpp b/src/frontend/wireless-security/dlghidewifiwep.cpp similarity index 99% rename from wireless-security/dlghidewifiwep.cpp rename to src/frontend/wireless-security/dlghidewifiwep.cpp index abea8899..4b2b0423 100644 --- a/wireless-security/dlghidewifiwep.cpp +++ b/src/frontend/wireless-security/dlghidewifiwep.cpp @@ -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), diff --git a/wireless-security/dlghidewifiwep.h b/src/frontend/wireless-security/dlghidewifiwep.h similarity index 100% rename from wireless-security/dlghidewifiwep.h rename to src/frontend/wireless-security/dlghidewifiwep.h diff --git a/wireless-security/dlghidewifiwep.ui b/src/frontend/wireless-security/dlghidewifiwep.ui similarity index 100% rename from wireless-security/dlghidewifiwep.ui rename to src/frontend/wireless-security/dlghidewifiwep.ui diff --git a/wireless-security/dlghidewifiwpa.cpp b/src/frontend/wireless-security/dlghidewifiwpa.cpp similarity index 99% rename from wireless-security/dlghidewifiwpa.cpp rename to src/frontend/wireless-security/dlghidewifiwpa.cpp index 7fe86a2d..4bb77abe 100644 --- a/wireless-security/dlghidewifiwpa.cpp +++ b/src/frontend/wireless-security/dlghidewifiwpa.cpp @@ -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 #include diff --git a/wireless-security/dlghidewifiwpa.h b/src/frontend/wireless-security/dlghidewifiwpa.h similarity index 100% rename from wireless-security/dlghidewifiwpa.h rename to src/frontend/wireless-security/dlghidewifiwpa.h diff --git a/wireless-security/dlghidewifiwpa.ui b/src/frontend/wireless-security/dlghidewifiwpa.ui similarity index 100% rename from wireless-security/dlghidewifiwpa.ui rename to src/frontend/wireless-security/dlghidewifiwpa.ui diff --git a/wireless-security/kylinheadfile.cpp b/src/frontend/wireless-security/kylinheadfile.cpp similarity index 100% rename from wireless-security/kylinheadfile.cpp rename to src/frontend/wireless-security/kylinheadfile.cpp diff --git a/wireless-security/kylinheadfile.h b/src/frontend/wireless-security/kylinheadfile.h similarity index 100% rename from wireless-security/kylinheadfile.h rename to src/frontend/wireless-security/kylinheadfile.h diff --git a/src/frontend/wireless-security/wireless-security.pri b/src/frontend/wireless-security/wireless-security.pri new file mode 100644 index 00000000..97e665bf --- /dev/null +++ b/src/frontend/wireless-security/wireless-security.pri @@ -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 + diff --git a/src/wpawifidialog.cpp b/src/frontend/wpawifidialog.cpp similarity index 100% rename from src/wpawifidialog.cpp rename to src/frontend/wpawifidialog.cpp diff --git a/src/wpawifidialog.h b/src/frontend/wpawifidialog.h similarity index 100% rename from src/wpawifidialog.h rename to src/frontend/wpawifidialog.h diff --git a/src/wpawifidialog.ui b/src/frontend/wpawifidialog.ui similarity index 100% rename from src/wpawifidialog.ui rename to src/frontend/wpawifidialog.ui diff --git a/kylin-nm.desktop b/src/kylin-nm.desktop similarity index 100% rename from kylin-nm.desktop rename to src/kylin-nm.desktop diff --git a/src/src.pro b/src/src.pro new file mode 100644 index 00000000..9591c11c --- /dev/null +++ b/src/src.pro @@ -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 +}