diff --git a/plugins/CMakeLists.txt b/plugins/CMakeLists.txt
index bc853e70a..f4fe18704 100644
--- a/plugins/CMakeLists.txt
+++ b/plugins/CMakeLists.txt
@@ -1,11 +1,7 @@
add_subdirectory("datetime")
#add_subdirectory("disk-mount")
-if (NOT (${CMAKE_BUILD_TYPE} MATCHES "Debug"))
- add_subdirectory("network")
-else()
- add_subdirectory("new-network")
-endif ()
+add_subdirectory("new-network")
add_subdirectory("shutdown")
add_subdirectory("sound")
add_subdirectory("system-tray")
diff --git a/plugins/network/CMakeLists.txt b/plugins/network/CMakeLists.txt
deleted file mode 100644
index 62cae0870..000000000
--- a/plugins/network/CMakeLists.txt
+++ /dev/null
@@ -1,28 +0,0 @@
-
-set(PLUGIN_NAME "network")
-
-project(${PLUGIN_NAME})
-
-# Sources files
-file(GLOB_RECURSE SRCS "*.h" "*.cpp")
-
-find_package(PkgConfig REQUIRED)
-find_package(Qt5Widgets REQUIRED)
-find_package(Qt5Svg REQUIRED)
-find_package(Qt5DBus REQUIRED)
-find_package(DtkWidget REQUIRED)
-
-add_definitions("${QT_DEFINITIONS} -DQT_PLUGIN")
-add_library(${PLUGIN_NAME} SHARED ${SRCS} resources.qrc)
-set_target_properties(${PLUGIN_NAME} PROPERTIES LIBRARY_OUTPUT_DIRECTORY ../)
-target_include_directories(${PLUGIN_NAME} PUBLIC ${DtkWidget_INCLUDE_DIRS}
- ${Qt5DBus_INCLUDE_DIRS}
- ../../interfaces)
-target_link_libraries(${PLUGIN_NAME} PRIVATE
- ${DtkWidget_LIBRARIES}
- ${Qt5Widgets_LIBRARIES}
- ${Qt5Svg_LIBRARIES}
- ${Qt5DBus_LIBRARIES}
-)
-
-install(TARGETS ${PLUGIN_NAME} LIBRARY DESTINATION lib/dde-dock/plugins)
diff --git a/plugins/network/dbus/com.deepin.daemon.Network.xml b/plugins/network/dbus/com.deepin.daemon.Network.xml
deleted file mode 100644
index eea5ff873..000000000
--- a/plugins/network/dbus/com.deepin.daemon.Network.xml
+++ /dev/null
@@ -1,129 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/plugins/network/dbus/dbusnetwork.cpp b/plugins/network/dbus/dbusnetwork.cpp
deleted file mode 100644
index 80a0992c5..000000000
--- a/plugins/network/dbus/dbusnetwork.cpp
+++ /dev/null
@@ -1,28 +0,0 @@
-/*
- * This file was generated by qdbusxml2cpp version 0.8
- * Command line was: qdbusxml2cpp -c DBusNetwork -p dbusnetwork com.deepin.daemon.Network.xml
- *
- * qdbusxml2cpp is Copyright (C) 2015 Digia Plc and/or its subsidiary(-ies).
- *
- * This is an auto-generated file.
- * This file may have been hand-edited. Look for HAND-EDIT comments
- * before re-generating it.
- */
-
-#include "dbusnetwork.h"
-
-/*
- * Implementation of interface class DBusNetwork
- */
-
-DBusNetwork::DBusNetwork(QObject *parent)
- : QDBusAbstractInterface("com.deepin.daemon.Network", "/com/deepin/daemon/Network", staticInterfaceName(), QDBusConnection::sessionBus(), parent)
-{
- QDBusConnection::sessionBus().connect(this->service(), this->path(), "org.freedesktop.DBus.Properties", "PropertiesChanged","sa{sv}as", this, SLOT(__propertyChanged__(QDBusMessage)));
-}
-
-DBusNetwork::~DBusNetwork()
-{
- QDBusConnection::sessionBus().disconnect(service(), path(), "org.freedesktop.DBus.Properties", "PropertiesChanged", "sa{sv}as", this, SLOT(propertyChanged(QDBusMessage)));
-}
-
diff --git a/plugins/network/dbus/dbusnetwork.h b/plugins/network/dbus/dbusnetwork.h
deleted file mode 100644
index 4451e8d52..000000000
--- a/plugins/network/dbus/dbusnetwork.h
+++ /dev/null
@@ -1,289 +0,0 @@
-/*
- * This file was generated by qdbusxml2cpp version 0.8
- * Command line was: qdbusxml2cpp -c DBusNetwork -p dbusnetwork com.deepin.daemon.Network.xml
- *
- * qdbusxml2cpp is Copyright (C) 2015 Digia Plc and/or its subsidiary(-ies).
- *
- * This is an auto-generated file.
- * Do not edit! All changes made to it will be lost.
- */
-
-#ifndef DBUSNETWORK_H_1469068798
-#define DBUSNETWORK_H_1469068798
-
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-
-/*
- * Proxy class for interface com.deepin.daemon.Network
- */
-class DBusNetwork: public QDBusAbstractInterface
-{
- Q_OBJECT
-
- Q_SLOT void __propertyChanged__(const QDBusMessage& msg)
- {
- QList arguments = msg.arguments();
- if (3 != arguments.count())
- return;
- QString interfaceName = msg.arguments().at(0).toString();
- if (interfaceName !="com.deepin.daemon.Network")
- return;
- QVariantMap changedProps = qdbus_cast(arguments.at(1).value());
- foreach(const QString &prop, changedProps.keys()) {
- const QMetaObject* self = metaObject();
- for (int i=self->propertyOffset(); i < self->propertyCount(); ++i) {
- QMetaProperty p = self->property(i);
- if (p.name() == prop) {
- Q_EMIT p.notifySignal().invoke(this);
- }
- }
- }
- }
-public:
- static inline const char *staticInterfaceName()
- { return "com.deepin.daemon.Network"; }
-
-public:
- explicit DBusNetwork(QObject *parent = 0);
-
- ~DBusNetwork();
-
- Q_PROPERTY(QString ActiveConnections READ activeConnections NOTIFY ActiveConnectionsChanged)
- inline QString activeConnections() const
- { return qvariant_cast< QString >(property("ActiveConnections")); }
-
- Q_PROPERTY(QString Connections READ connections NOTIFY ConnectionsChanged)
- inline QString connections() const
- { return qvariant_cast< QString >(property("Connections")); }
-
- Q_PROPERTY(QString Devices READ devices NOTIFY DevicesChanged)
- inline QString devices() const
- { return qvariant_cast< QString >(property("Devices")); }
-
- Q_PROPERTY(bool NetworkingEnabled READ networkingEnabled WRITE setNetworkingEnabled NOTIFY NetworkingEnabledChanged)
- inline bool networkingEnabled() const
- { return qvariant_cast< bool >(property("NetworkingEnabled")); }
- inline void setNetworkingEnabled(bool value)
- { setProperty("NetworkingEnabled", QVariant::fromValue(value)); }
-
- Q_PROPERTY(uint State READ state NOTIFY StateChanged)
- inline uint state() const
- { return qvariant_cast< uint >(property("State")); }
-
- Q_PROPERTY(bool VpnEnabled READ vpnEnabled WRITE setVpnEnabled NOTIFY VpnEnabledChanged)
- inline bool vpnEnabled() const
- { return qvariant_cast< bool >(property("VpnEnabled")); }
- inline void setVpnEnabled(bool value)
- { setProperty("VpnEnabled", QVariant::fromValue(value)); }
-
-public Q_SLOTS: // METHODS
- inline QDBusPendingReply ActivateAccessPoint(const QString &in0, const QDBusObjectPath &in1, const QDBusObjectPath &in2)
- {
- QList argumentList;
- argumentList << QVariant::fromValue(in0) << QVariant::fromValue(in1) << QVariant::fromValue(in2);
- return asyncCallWithArgumentList(QStringLiteral("ActivateAccessPoint"), argumentList);
- }
-
- inline QDBusPendingReply ActivateConnection(const QString &in0, const QDBusObjectPath &in1)
- {
- QList argumentList;
- argumentList << QVariant::fromValue(in0) << QVariant::fromValue(in1);
- return asyncCallWithArgumentList(QStringLiteral("ActivateConnection"), argumentList);
- }
-
- inline QDBusPendingReply<> CancelSecret(const QString &in0, const QString &in1)
- {
- QList argumentList;
- argumentList << QVariant::fromValue(in0) << QVariant::fromValue(in1);
- return asyncCallWithArgumentList(QStringLiteral("CancelSecret"), argumentList);
- }
-
- inline QDBusPendingReply CreateConnection(const QString &in0, const QDBusObjectPath &in1)
- {
- QList argumentList;
- argumentList << QVariant::fromValue(in0) << QVariant::fromValue(in1);
- return asyncCallWithArgumentList(QStringLiteral("CreateConnection"), argumentList);
- }
-
- inline QDBusPendingReply CreateConnectionForAccessPoint(const QDBusObjectPath &in0, const QDBusObjectPath &in1)
- {
- QList argumentList;
- argumentList << QVariant::fromValue(in0) << QVariant::fromValue(in1);
- return asyncCallWithArgumentList(QStringLiteral("CreateConnectionForAccessPoint"), argumentList);
- }
-
- inline QDBusPendingReply<> DeactivateConnection(const QString &in0)
- {
- QList argumentList;
- argumentList << QVariant::fromValue(in0);
- return asyncCallWithArgumentList(QStringLiteral("DeactivateConnection"), argumentList);
- }
-
- inline QDBusPendingReply<> DeleteConnection(const QString &in0)
- {
- QList argumentList;
- argumentList << QVariant::fromValue(in0);
- return asyncCallWithArgumentList(QStringLiteral("DeleteConnection"), argumentList);
- }
-
- inline QDBusPendingReply<> DisconnectDevice(const QDBusObjectPath &in0)
- {
- QList argumentList;
- argumentList << QVariant::fromValue(in0);
- return asyncCallWithArgumentList(QStringLiteral("DisconnectDevice"), argumentList);
- }
-
- inline QDBusPendingReply EditConnection(const QString &in0, const QDBusObjectPath &in1)
- {
- QList argumentList;
- argumentList << QVariant::fromValue(in0) << QVariant::fromValue(in1);
- return asyncCallWithArgumentList(QStringLiteral("EditConnection"), argumentList);
- }
-
- inline QDBusPendingReply<> EnableDevice(const QDBusObjectPath &devPath, bool enable)
- {
- QList argumentList;
- argumentList << QVariant::fromValue(devPath) << QVariant::fromValue(enable);
- return asyncCallWithArgumentList(QStringLiteral("EnableDevice"), argumentList);
- }
-
- inline QDBusPendingReply<> FeedSecret(const QString &in0, const QString &in1, const QString &in2, bool in3)
- {
- QList argumentList;
- argumentList << QVariant::fromValue(in0) << QVariant::fromValue(in1) << QVariant::fromValue(in2) << QVariant::fromValue(in3);
- return asyncCallWithArgumentList(QStringLiteral("FeedSecret"), argumentList);
- }
-
- inline QDBusPendingReply GetAccessPoints(const QDBusObjectPath &in0)
- {
- QList argumentList;
- argumentList << QVariant::fromValue(in0);
- return asyncCallWithArgumentList(QStringLiteral("GetAccessPoints"), argumentList);
- }
-
- inline QDBusPendingReply GetActiveConnectionInfo()
- {
- QList argumentList;
- return asyncCallWithArgumentList(QStringLiteral("GetActiveConnectionInfo"), argumentList);
- }
-
- inline QDBusPendingReply GetAutoProxy()
- {
- QList argumentList;
- return asyncCallWithArgumentList(QStringLiteral("GetAutoProxy"), argumentList);
- }
-
- inline QDBusPendingReply GetProxy(const QString &in0)
- {
- QList argumentList;
- argumentList << QVariant::fromValue(in0);
- return asyncCallWithArgumentList(QStringLiteral("GetProxy"), argumentList);
- }
- inline QDBusReply GetProxy(const QString &in0, QString &out1)
- {
- QList argumentList;
- argumentList << QVariant::fromValue(in0);
- QDBusMessage reply = callWithArgumentList(QDBus::Block, QStringLiteral("GetProxy"), argumentList);
- if (reply.type() == QDBusMessage::ReplyMessage && reply.arguments().count() == 2) {
- out1 = qdbus_cast(reply.arguments().at(1));
- }
- return reply;
- }
-
- inline QDBusPendingReply GetProxyIgnoreHosts()
- {
- QList argumentList;
- return asyncCallWithArgumentList(QStringLiteral("GetProxyIgnoreHosts"), argumentList);
- }
-
- inline QDBusPendingReply GetProxyMethod()
- {
- QList argumentList;
- return asyncCallWithArgumentList(QStringLiteral("GetProxyMethod"), argumentList);
- }
-
- inline QDBusPendingReply GetSupportedConnectionTypes()
- {
- QList argumentList;
- return asyncCallWithArgumentList(QStringLiteral("GetSupportedConnectionTypes"), argumentList);
- }
-
- inline QDBusPendingReply GetWiredConnectionUuid(const QDBusObjectPath &in0)
- {
- QList argumentList;
- argumentList << QVariant::fromValue(in0);
- return asyncCallWithArgumentList(QStringLiteral("GetWiredConnectionUuid"), argumentList);
- }
-
- inline QDBusPendingReply IsDeviceEnabled(const QDBusObjectPath &in0)
- {
- QList argumentList;
- argumentList << QVariant::fromValue(in0);
- return asyncCallWithArgumentList(QStringLiteral("IsDeviceEnabled"), argumentList);
- }
-
- inline QDBusPendingReply<> SetAutoProxy(const QString &in0)
- {
- QList argumentList;
- argumentList << QVariant::fromValue(in0);
- return asyncCallWithArgumentList(QStringLiteral("SetAutoProxy"), argumentList);
- }
-
- inline QDBusPendingReply<> SetProxy(const QString &in0, const QString &in1, const QString &in2)
- {
- QList argumentList;
- argumentList << QVariant::fromValue(in0) << QVariant::fromValue(in1) << QVariant::fromValue(in2);
- return asyncCallWithArgumentList(QStringLiteral("SetProxy"), argumentList);
- }
-
- inline QDBusPendingReply<> SetProxyIgnoreHosts(const QString &in0)
- {
- QList argumentList;
- argumentList << QVariant::fromValue(in0);
- return asyncCallWithArgumentList(QStringLiteral("SetProxyIgnoreHosts"), argumentList);
- }
-
- inline QDBusPendingReply<> SetProxyMethod(const QString &in0)
- {
- QList argumentList;
- argumentList << QVariant::fromValue(in0);
- return asyncCallWithArgumentList(QStringLiteral("SetProxyMethod"), argumentList);
- }
-
- inline QDBusPendingReply<> RequestWirelessScan()
- {
- QList argumentList;
- return asyncCallWithArgumentList(QStringLiteral("RequestWirelessScan"), argumentList);
- }
-
-Q_SIGNALS: // SIGNALS
- void AccessPointAdded(const QString &in0, const QString &in1);
- void AccessPointPropertiesChanged(const QString &in0, const QString &in1);
- void AccessPointRemoved(const QString &in0, const QString &in1);
- void DeviceEnabled(const QString &in0, bool in1);
- void NeedSecrets(const QString &in0);
- void NeedSecretsFinished(const QString &in0, const QString &in1);
-// begin property changed signals
-void ActiveConnectionsChanged();
-void ConnectionsChanged();
-void DevicesChanged();
-void NetworkingEnabledChanged();
-void StateChanged();
-void VpnEnabledChanged();
-};
-
-namespace com {
- namespace deepin {
- namespace daemon {
- typedef ::DBusNetwork Network;
- }
- }
-}
-#endif
diff --git a/plugins/network/item/applet/accesspoint.cpp b/plugins/network/item/applet/accesspoint.cpp
deleted file mode 100644
index c48abb76c..000000000
--- a/plugins/network/item/applet/accesspoint.cpp
+++ /dev/null
@@ -1,103 +0,0 @@
-/*
- * Copyright (C) 2011 ~ 2018 Deepin Technology Co., Ltd.
- *
- * Author: sbw
- *
- * Maintainer: sbw
- *
- * 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 of the License, or
- * 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 .
- */
-
-#include "accesspoint.h"
-
-#include
-#include
-
-AccessPoint::AccessPoint(const QJsonObject &apInfo)
- : QObject(nullptr)
-{
- loadApInfo(apInfo);
-}
-
-AccessPoint::AccessPoint(const AccessPoint &ap)
- : QObject(nullptr)
-{
- *this = ap;
-}
-
-AccessPoint::AccessPoint(const QString &info)
-{
- const QJsonDocument doc = QJsonDocument::fromJson(info.toUtf8());
- Q_ASSERT(doc.isObject());
- loadApInfo(doc.object());
-}
-
-AccessPoint::AccessPoint()
- : QObject(nullptr),
- m_strength(0),
- m_secured(false),
- m_securedInEap(false)
-{
-}
-
-bool AccessPoint::operator==(const AccessPoint &ap) const
-{
-// return m_path == ap.m_path;
- return m_ssid == ap.ssid();
-}
-
-bool AccessPoint::operator>(const AccessPoint &ap) const
-{
- return m_strength > ap.m_strength;
-}
-
-AccessPoint &AccessPoint::operator=(const AccessPoint &ap)
-{
- m_strength = ap.m_strength;
- m_secured = ap.m_secured;
- m_securedInEap = ap.m_securedInEap;
- m_path = ap.m_path;
- m_ssid = ap.m_ssid;
-
- return *this;
-}
-
-const QString AccessPoint::ssid() const
-{
- return m_ssid;
-}
-
-const QString AccessPoint::path() const
-{
- return m_path;
-}
-
-int AccessPoint::strength() const
-{
- return m_strength;
-}
-
-bool AccessPoint::secured() const
-{
- return m_secured;
-}
-
-void AccessPoint::loadApInfo(const QJsonObject &apInfo)
-{
- m_strength = apInfo.value("Strength").toInt();
- m_secured = apInfo.value("Secured").toBool();
- m_securedInEap = apInfo.value("SecuredInEap").toBool();
- m_path = apInfo.value("Path").toString();
- m_ssid = apInfo.value("Ssid").toString();
-}
diff --git a/plugins/network/item/applet/accesspoint.h b/plugins/network/item/applet/accesspoint.h
deleted file mode 100644
index 051227ac4..000000000
--- a/plugins/network/item/applet/accesspoint.h
+++ /dev/null
@@ -1,57 +0,0 @@
-/*
- * Copyright (C) 2011 ~ 2018 Deepin Technology Co., Ltd.
- *
- * Author: sbw
- *
- * Maintainer: sbw
- *
- * 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 of the License, or
- * 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 .
- */
-
-#ifndef ACCESSPOINT_H
-#define ACCESSPOINT_H
-
-#include
-#include
-
-class AccessPoint : public QObject
-{
- Q_OBJECT
-
-public:
- explicit AccessPoint(const QJsonObject &apInfo);
- explicit AccessPoint(const QString &info);
- explicit AccessPoint();
- AccessPoint(const AccessPoint &ap);
- bool operator==(const AccessPoint &ap) const;
- bool operator>(const AccessPoint &ap) const;
- AccessPoint &operator=(const AccessPoint &ap);
-
- const QString ssid() const;
- const QString path() const;
- int strength() const;
- bool secured() const;
-
-private:
- void loadApInfo(const QJsonObject &apInfo);
-
-private:
- int m_strength;
- bool m_secured;
- bool m_securedInEap;
- QString m_path;
- QString m_ssid;
-};
-
-#endif // ACCESSPOINT_H
diff --git a/plugins/network/item/applet/accesspointwidget.cpp b/plugins/network/item/applet/accesspointwidget.cpp
deleted file mode 100644
index e2b8922e1..000000000
--- a/plugins/network/item/applet/accesspointwidget.cpp
+++ /dev/null
@@ -1,173 +0,0 @@
-/*
- * Copyright (C) 2011 ~ 2018 Deepin Technology Co., Ltd.
- *
- * Author: sbw
- *
- * Maintainer: sbw
- *
- * 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 of the License, or
- * 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 .
- */
-
-#include "accesspointwidget.h"
-#include "horizontalseperator.h"
-
-#include
-#include
-
-#include
-
-DWIDGET_USE_NAMESPACE
-
-AccessPointWidget::AccessPointWidget()
- : QFrame(nullptr),
-
- m_activeState(NetworkDevice::Unknow),
- m_ssidBtn(new QPushButton(this)),
- m_disconnectBtn(new DImageButton(this)),
- m_securityIcon(new QLabel),
- m_strengthIcon(new QLabel)
-{
- const auto ratio = devicePixelRatioF();
- m_ssidBtn->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Preferred);
-
- m_ssidBtn->setObjectName("Ssid");
-
- m_disconnectBtn->setVisible(false);
- m_disconnectBtn->setNormalPic(":/wireless/resources/wireless/select.svg");
- m_disconnectBtn->setHoverPic(":/wireless/resources/wireless/disconnect_hover.svg");
- m_disconnectBtn->setPressPic(":/wireless/resources/wireless/disconnect_press.svg");
-
- QPixmap iconPix = DSvgRenderer::render(":/wireless/resources/wireless/security.svg", QSize(16, 16) * ratio);
- iconPix.setDevicePixelRatio(ratio);
- m_securityIcon->setPixmap(iconPix);
- m_securityIcon->hide();
-
- QHBoxLayout *infoLayout = new QHBoxLayout;
- infoLayout->addWidget(m_securityIcon);
- infoLayout->addSpacing(5);
- infoLayout->addWidget(m_strengthIcon);
- infoLayout->addSpacing(10);
- infoLayout->addWidget(m_ssidBtn);
- infoLayout->addWidget(m_disconnectBtn);
- infoLayout->addSpacing(20);
- infoLayout->setSpacing(0);
- infoLayout->setContentsMargins(15, 0, 0, 0);
-
- QVBoxLayout *centralLayout = new QVBoxLayout;
- centralLayout->addLayout(infoLayout);
- centralLayout->setSpacing(0);
- centralLayout->setMargin(0);
-
- setLayout(centralLayout);
- setStyleSheet("AccessPointWidget #Ssid {"
- "color:white;"
- "background-color:transparent;"
- "border:none;"
- "text-align:left;"
- "}"
- "AccessPointWidget {"
- "border-radius:4px;"
- "margin:0 2px;"
- "border-top:1px solid rgba(255, 255, 255, .05);"
- "}"
- "AccessPointWidget:hover {"
- "border:none;"
- "margin:0;"
- "background-color:rgba(255, 255, 255, .1);"
- "}"
- "AccessPointWidget[active=true] #Ssid {"
-// "color:#2ca7f8;"
- "}");
-
- connect(m_ssidBtn, &QPushButton::clicked, this, &AccessPointWidget::clicked);
- connect(m_disconnectBtn, &DImageButton::clicked, this, &AccessPointWidget::disconnectBtnClicked);
-}
-
-void AccessPointWidget::updateAP(const AccessPoint &ap)
-{
- m_ap = ap;
-
- m_ssidBtn->setText(ap.ssid());
-
- setStrengthIcon(ap.strength());
-
- m_securityIcon->setVisible(ap.secured());
-
- // reset state
- setActiveState(NetworkDevice::Unknow);
-}
-
-bool AccessPointWidget::active() const
-{
- return m_activeState == NetworkDevice::Activated;
-}
-
-void AccessPointWidget::setActiveState(const NetworkDevice::NetworkState state)
-{
- if (m_activeState == state)
- return;
-
- m_activeState = state;
- setStyleSheet(styleSheet());
-
- const bool isActive = active();
- m_disconnectBtn->setVisible(isActive);
-}
-
-void AccessPointWidget::enterEvent(QEvent *e)
-{
- QWidget::enterEvent(e);
- m_disconnectBtn->setNormalPic(":/wireless/resources/wireless/disconnect.svg");
-}
-
-void AccessPointWidget::leaveEvent(QEvent *e)
-{
- QWidget::leaveEvent(e);
- m_disconnectBtn->setNormalPic(":/wireless/resources/wireless/select.svg");
-}
-
-void AccessPointWidget::setStrengthIcon(const int strength)
-{
- QPixmap iconPix;
- const auto ratio = devicePixelRatioF();
- const QSize s = QSize(16, 16) * ratio;
-
- QString type;
- if (strength == 100)
- type = "80";
- else if (strength < 20)
- type = "0";
- else
- type = QString::number(strength / 10 & ~0x1) + "0";
-
- iconPix = DSvgRenderer::render(QString(":/wireless/resources/wireless/wireless-%1-symbolic.svg").arg(type), s);
- iconPix.setDevicePixelRatio(ratio);
-
- m_strengthIcon->setPixmap(iconPix);
-}
-
-void AccessPointWidget::ssidClicked()
-{
- if (m_activeState == NetworkDevice::Activated)
- return;
-
- setActiveState(NetworkDevice::Prepare);
- emit requestActiveAP(QDBusObjectPath(m_ap.path()), m_ap.ssid());
-}
-
-void AccessPointWidget::disconnectBtnClicked()
-{
- setActiveState(NetworkDevice::Unknow);
- emit requestDeactiveAP(m_ap);
-}
diff --git a/plugins/network/item/applet/accesspointwidget.h b/plugins/network/item/applet/accesspointwidget.h
deleted file mode 100644
index 4d0cb9da0..000000000
--- a/plugins/network/item/applet/accesspointwidget.h
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * Copyright (C) 2011 ~ 2018 Deepin Technology Co., Ltd.
- *
- * Author: sbw
- *
- * Maintainer: sbw
- *
- * 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 of the License, or
- * 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 .
- */
-
-#ifndef ACCESSPOINTWIDGET_H
-#define ACCESSPOINTWIDGET_H
-
-#include "accesspoint.h"
-#include "networkdevice.h"
-
-#include
-#include
-#include
-#include
-
-#include
-
-class AccessPointWidget : public QFrame
-{
- Q_OBJECT
- Q_PROPERTY(bool active READ active DESIGNABLE true)
-
-public:
- explicit AccessPointWidget();
-
- const AccessPoint ap() const { return m_ap; }
- void updateAP(const AccessPoint &ap);
-
- bool active() const;
- void setActiveState(const NetworkDevice::NetworkState state);
-
-signals:
- void requestActiveAP(const QDBusObjectPath &apPath, const QString &ssid) const;
- void requestDeactiveAP(const AccessPoint &ap) const;
- void clicked() const;
-
-private:
- void enterEvent(QEvent *e);
- void leaveEvent(QEvent *e);
- void setStrengthIcon(const int strength);
-
-private slots:
- void ssidClicked();
- void disconnectBtnClicked();
-
-private:
- NetworkDevice::NetworkState m_activeState;
-
- AccessPoint m_ap;
- QPushButton *m_ssidBtn;
- Dtk::Widget::DImageButton *m_disconnectBtn;
- QLabel *m_securityIcon;
- QLabel *m_strengthIcon;
-};
-
-#endif // ACCESSPOINTWIDGET_H
diff --git a/plugins/network/item/applet/devicecontrolwidget.cpp b/plugins/network/item/applet/devicecontrolwidget.cpp
deleted file mode 100644
index b674a3cca..000000000
--- a/plugins/network/item/applet/devicecontrolwidget.cpp
+++ /dev/null
@@ -1,119 +0,0 @@
-/*
- * Copyright (C) 2011 ~ 2018 Deepin Technology Co., Ltd.
- *
- * Author: sbw
- *
- * Maintainer: sbw
- *
- * 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 of the License, or
- * 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 .
- */
-
-#include "devicecontrolwidget.h"
-#include "horizontalseperator.h"
-
-#include
-#include
-#include
-#include
-#include
-
-DWIDGET_USE_NAMESPACE
-
-DeviceControlWidget::DeviceControlWidget(QWidget *parent)
- : QWidget(parent)
-{
- m_deviceName = new QLabel;
- m_deviceName->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Preferred);
- m_deviceName->setStyleSheet("color:white;");
-
- m_switchBtn = new DSwitchButton;
-
- const QPixmap pixmap = DHiDPIHelper::loadNxPixmap(":/wireless/resources/wireless/refresh_normal.svg");
-
- m_loadingIndicator = new DLoadingIndicator;
- m_loadingIndicator->setImageSource(pixmap);
- m_loadingIndicator->setLoading(false);
- m_loadingIndicator->setSmooth(true);
- m_loadingIndicator->setAniDuration(1000);
- m_loadingIndicator->setAniEasingCurve(QEasingCurve::InOutCirc);
- m_loadingIndicator->installEventFilter(this);
- m_loadingIndicator->setFixedSize(pixmap.size() / devicePixelRatioF());
-
- QHBoxLayout *infoLayout = new QHBoxLayout;
- infoLayout->addWidget(m_deviceName);
- infoLayout->addWidget(m_loadingIndicator);
- infoLayout->addSpacing(10);
- infoLayout->addWidget(m_switchBtn);
- infoLayout->setSpacing(0);
- infoLayout->setContentsMargins(15, 0, 5, 0);
-
-// m_seperator = new HorizontalSeperator;
-// m_seperator->setFixedHeight(1);
-// m_seperator->setColor(Qt::black);
-
- QVBoxLayout *centralLayout = new QVBoxLayout;
- centralLayout->addStretch();
- centralLayout->addLayout(infoLayout);
- centralLayout->addStretch();
-// centralLayout->addWidget(m_seperator);
- centralLayout->setMargin(0);
- centralLayout->setSpacing(0);
-
- setLayout(centralLayout);
- setFixedHeight(30);
-
- connect(m_switchBtn, &DSwitchButton::checkedChanged, this, &DeviceControlWidget::deviceEnableChanged);
-}
-
-void DeviceControlWidget::setDeviceName(const QString &name)
-{
- m_deviceName->setText(name);
-}
-
-void DeviceControlWidget::setDeviceEnabled(const bool enable)
-{
- m_switchBtn->blockSignals(true);
- m_switchBtn->setChecked(enable);
- m_loadingIndicator->setVisible(enable);
- m_switchBtn->blockSignals(false);
-}
-
-bool DeviceControlWidget::eventFilter(QObject *watched, QEvent *event)
-{
- if (watched == m_loadingIndicator) {
- if (event->type() == QEvent::MouseButtonPress) {
- if (!m_loadingIndicator->loading()) {
- refreshNetwork();
- }
- }
- }
-
- return QWidget::eventFilter(watched, event);
-}
-
-void DeviceControlWidget::refreshNetwork()
-{
- emit requestRefresh();
-
- m_loadingIndicator->setLoading(true);
-
- QTimer::singleShot(1000, this, [=] {
- m_loadingIndicator->setLoading(false);
- });
-}
-
-//void DeviceControlWidget::setSeperatorVisible(const bool visible)
-//{
-// m_seperator->setVisible(visible);
-//}
diff --git a/plugins/network/item/applet/devicecontrolwidget.h b/plugins/network/item/applet/devicecontrolwidget.h
deleted file mode 100644
index e9178c814..000000000
--- a/plugins/network/item/applet/devicecontrolwidget.h
+++ /dev/null
@@ -1,62 +0,0 @@
-/*
- * Copyright (C) 2011 ~ 2018 Deepin Technology Co., Ltd.
- *
- * Author: sbw
- *
- * Maintainer: sbw
- *
- * 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 of the License, or
- * 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 .
- */
-
-#ifndef DEVICECONTROLWIDGET_H
-#define DEVICECONTROLWIDGET_H
-
-#include "horizontalseperator.h"
-
-#include
-#include
-#include
-#include
-
-DWIDGET_USE_NAMESPACE
-
-class DeviceControlWidget : public QWidget
-{
- Q_OBJECT
-
-public:
- explicit DeviceControlWidget(QWidget *parent = 0);
-
- void setDeviceName(const QString &name);
- void setDeviceEnabled(const bool enable);
-// void setSeperatorVisible(const bool visible);
-
-signals:
- void deviceEnableChanged(const bool enable) const;
- void requestRefresh() const;
-
-protected:
- bool eventFilter(QObject *watched, QEvent *event) Q_DECL_OVERRIDE;
-
-private slots:
- void refreshNetwork();
-
-private:
- QLabel *m_deviceName;
- Dtk::Widget::DSwitchButton *m_switchBtn;
-// HorizontalSeperator *m_seperator;
- DLoadingIndicator *m_loadingIndicator;
-};
-
-#endif // DEVICECONTROLWIDGET_H
diff --git a/plugins/network/item/applet/horizontalseperator.cpp b/plugins/network/item/applet/horizontalseperator.cpp
deleted file mode 100644
index 91affbfdf..000000000
--- a/plugins/network/item/applet/horizontalseperator.cpp
+++ /dev/null
@@ -1,44 +0,0 @@
-/*
- * Copyright (C) 2011 ~ 2018 Deepin Technology Co., Ltd.
- *
- * Author: sbw
- *
- * Maintainer: sbw
- *
- * 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 of the License, or
- * 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 .
- */
-
-#include "horizontalseperator.h"
-
-#include
-
-HorizontalSeperator::HorizontalSeperator(QWidget *parent)
- : QWidget(parent),
- m_color(255, 255, 255, 255 * 0.1)
-{
- setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed);
-}
-
-void HorizontalSeperator::setColor(const QColor color)
-{
- m_color = color;
-}
-
-void HorizontalSeperator::paintEvent(QPaintEvent *e)
-{
- QWidget::paintEvent(e);
-
- QPainter painter(this);
- painter.fillRect(rect(), m_color);
-}
diff --git a/plugins/network/item/applet/horizontalseperator.h b/plugins/network/item/applet/horizontalseperator.h
deleted file mode 100644
index bd29cbca4..000000000
--- a/plugins/network/item/applet/horizontalseperator.h
+++ /dev/null
@@ -1,43 +0,0 @@
-/*
- * Copyright (C) 2011 ~ 2018 Deepin Technology Co., Ltd.
- *
- * Author: sbw
- *
- * Maintainer: sbw
- *
- * 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 of the License, or
- * 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 .
- */
-
-#ifndef HORIZONTALSEPERATOR_H
-#define HORIZONTALSEPERATOR_H
-
-#include
-
-class HorizontalSeperator : public QWidget
-{
- Q_OBJECT
-
-public:
- explicit HorizontalSeperator(QWidget *parent = 0);
-
- void setColor(const QColor color);
-
-protected:
- void paintEvent(QPaintEvent *e);
-
-private:
- QColor m_color;
-};
-
-#endif // HORIZONTALSEPERATOR_H
diff --git a/plugins/network/item/applet/wirelessapplet.cpp b/plugins/network/item/applet/wirelessapplet.cpp
deleted file mode 100644
index 2616c5ec7..000000000
--- a/plugins/network/item/applet/wirelessapplet.cpp
+++ /dev/null
@@ -1,519 +0,0 @@
-/*
- * Copyright (C) 2011 ~ 2018 Deepin Technology Co., Ltd.
- *
- * Author: sbw
- *
- * Maintainer: sbw
- *
- * 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 of the License, or
- * 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 .
- */
-
-#include "wirelessapplet.h"
-#include "accesspointwidget.h"
-
-#include
-#include
-#include
-#include
-
-#include
-#include
-
-DWIDGET_USE_NAMESPACE
-
-#define WIDTH 300
-#define MAX_HEIGHT 300
-#define ITEM_HEIGHT 30
-
-WirelessList::WirelessList(const QSet::const_iterator &deviceIter, QWidget *parent)
- : QScrollArea(parent),
-
- m_device(*deviceIter),
- m_activeAP(),
-
- m_updateAPTimer(new QTimer(this)),
- m_pwdDialog(new DInputDialog(nullptr)),
- m_autoConnBox(new QCheckBox),
-
- m_centralLayout(new QVBoxLayout),
- m_centralWidget(new QWidget),
- m_controlPanel(new DeviceControlWidget),
- m_networkInter(new DBusNetwork(this))
-{
- setFixedHeight(WIDTH);
-
- m_currentClickAPW = nullptr;
-
- m_autoConnBox->setText(tr("Auto-connect"));
-
- const auto ratio = qApp->devicePixelRatio();
- QPixmap iconPix = QIcon::fromTheme("notification-network-wireless-full").pixmap(QSize(48, 48) * ratio);
- iconPix.setDevicePixelRatio(ratio);
-
- m_pwdDialog->setTextEchoMode(QLineEdit::Password);
- m_pwdDialog->setWindowFlags(Qt::WindowStaysOnTopHint | Qt::FramelessWindowHint | Qt::Dialog);
- m_pwdDialog->setTextEchoMode(DLineEdit::Password);
- m_pwdDialog->setIcon(iconPix);
- m_pwdDialog->addSpacing(10);
- m_pwdDialog->addContent(m_autoConnBox, Qt::AlignLeft);
- m_pwdDialog->setOkButtonText(tr("Connect"));
- m_pwdDialog->setCancelButtonText(tr("Cancel"));
-
- m_updateAPTimer->setSingleShot(true);
- m_updateAPTimer->setInterval(100);
-
- m_centralWidget->setFixedWidth(WIDTH);
- m_centralWidget->setLayout(m_centralLayout);
-
-// m_centralLayout->addWidget(m_controlPanel);
- m_centralLayout->setSpacing(0);
- m_centralLayout->setMargin(0);
-
- // initialization state.
- m_deviceEnabled = m_networkInter->IsDeviceEnabled(m_device.dbusPath());
-
- setWidget(m_centralWidget);
- setFrameStyle(QFrame::NoFrame);
- setFixedWidth(300);
- setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
- setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
- setStyleSheet("background-color:transparent;");
-
- m_indicator = new DPictureSequenceView(this);
- m_indicator->setPictureSequence(":/wireless/indicator/resources/wireless/spinner14/Spinner%1.png", QPair(1, 91), 2);
- m_indicator->setFixedSize(QSize(14, 14) * ratio);
- m_indicator->setVisible(false);
-
- connect(m_networkInter, &DBusNetwork::AccessPointAdded, this, &WirelessList::APAdded);
- connect(m_networkInter, &DBusNetwork::AccessPointRemoved, this, &WirelessList::APRemoved);
- connect(m_networkInter, &DBusNetwork::AccessPointPropertiesChanged, this, &WirelessList::APPropertiesChanged);
- connect(m_networkInter, &DBusNetwork::DevicesChanged, this, &WirelessList::deviceStateChanged);
- connect(m_networkInter, &DBusNetwork::NeedSecrets, this, &WirelessList::needSecrets);
- connect(m_networkInter, &DBusNetwork::DeviceEnabled, this, &WirelessList::deviceEnabled);
-
- connect(m_controlPanel, &DeviceControlWidget::deviceEnableChanged, this, &WirelessList::deviceEnableChanged);
- connect(m_controlPanel, &DeviceControlWidget::requestRefresh, m_networkInter, &DBusNetwork::RequestWirelessScan);
-
- connect(m_updateAPTimer, &QTimer::timeout, this, &WirelessList::updateAPList);
-
- connect(this, &WirelessList::activeAPChanged, m_updateAPTimer, static_cast(&QTimer::start));
- connect(this, &WirelessList::wirelessStateChanged, m_updateAPTimer, static_cast(&QTimer::start));
-
- connect(m_networkInter, &DBusNetwork::NeedSecretsFinished, m_pwdDialog, &DInputDialog::close);
- connect(m_pwdDialog, &DInputDialog::textValueChanged, this, &WirelessList::onPwdDialogTextChanged);
- connect(m_pwdDialog, &DInputDialog::cancelButtonClicked, this, &WirelessList::pwdDialogCanceled);
- connect(m_pwdDialog, &DInputDialog::accepted, this, &WirelessList::pwdDialogAccepted);
-
- connect(this->verticalScrollBar(), &QScrollBar::valueChanged, this, [=] {
- if (!m_currentClickAPW) return;
-
- const int h = -(m_currentClickAPW->height() - m_indicator->height()) / 2;
- m_indicator->move(m_currentClickAPW->mapTo(this, m_currentClickAPW->rect().topRight()) - QPoint(35, h));
- });
-
- QMetaObject::invokeMethod(this, "init", Qt::QueuedConnection);
-}
-
-WirelessList::~WirelessList()
-{
- m_pwdDialog->deleteLater();
-}
-
-NetworkDevice::NetworkState WirelessList::wirelessState() const
-{
- return m_device.state();
-}
-
-int WirelessList::activeAPStrgength() const
-{
- return m_activeAP.strength();
-}
-
-QWidget *WirelessList::controlPanel()
-{
- return m_controlPanel;
-}
-
-void WirelessList::init()
-{
- loadAPList();
- onActiveAPChanged();
- deviceStateChanged();
-}
-
-void WirelessList::APAdded(const QString &devPath, const QString &info)
-{
- if (devPath != m_device.path())
- return;
-
- AccessPoint ap(info);
- if (m_apList.contains(ap))
- return;
-
- m_apList.append(ap);
- m_updateAPTimer->start();
-}
-
-void WirelessList::APRemoved(const QString &devPath, const QString &info)
-{
- if (devPath != m_device.path())
- return;
-
- AccessPoint ap(info);
- if (ap.ssid() == m_activeAP.ssid())
- return;
-
-// m_apList.removeOne(ap);
-// m_updateAPTimer->start();
-
- // NOTE: if one ap removed, prehaps another ap has same ssid, so we need to refersh ap list instead of remove it
- m_apList.clear();
- loadAPList();
-}
-
-void WirelessList::setDeviceInfo(const int index)
-{
- // set device enable state
- m_controlPanel->setDeviceEnabled(m_deviceEnabled);
-
- // set device name
- if (index == -1)
- m_controlPanel->setDeviceName(tr("Wireless Network"));
- else
- m_controlPanel->setDeviceName(tr("Wireless Network %1").arg(index));
-}
-
-void WirelessList::loadAPList()
-{
- const QString data = m_networkInter->GetAccessPoints(m_device.dbusPath());
- const QJsonDocument doc = QJsonDocument::fromJson(data.toUtf8());
- Q_ASSERT(doc.isArray());
-
- for (auto item : doc.array())
- {
- Q_ASSERT(item.isObject());
-
- AccessPoint ap(item.toObject());
- if (!m_apList.contains(ap))
- m_apList.append(ap);
- }
-
- m_updateAPTimer->start();
-}
-
-void WirelessList::APPropertiesChanged(const QString &devPath, const QString &info)
-{
- if (devPath != m_device.path())
- return;
-
- QJsonDocument doc = QJsonDocument::fromJson(info.toUtf8());
- Q_ASSERT(doc.isObject());
- const AccessPoint ap(doc.object());
-
- auto it = std::find_if(m_apList.begin(), m_apList.end(),
- [&] (const AccessPoint &a) {return a == ap;});
-
- if (it == m_apList.end())
- return;
-
- *it = ap;
- if (m_activeAP.path() == ap.path())
- {
- m_activeAP = ap;
- emit activeAPChanged();
- }
-
-// if (*it > ap)
-// {
-// *it = ap;
-// m_activeAP = ap;
-// m_updateAPTimer->start();
-
-// emit activeAPChanged();
-// }
-}
-
-void WirelessList::updateAPList()
-{
- Q_ASSERT(sender() == m_updateAPTimer);
-
- int avaliableAPCount = 0;
-
- if (m_networkInter->IsDeviceEnabled(m_device.dbusPath()))
- {
- m_currentClickAPW = nullptr;
- // sort ap list by strength
- // std::sort(m_apList.begin(), m_apList.end(), std::greater());
- // const bool wirelessActived = m_device.state() == NetworkDevice::Activated;
-
- // NOTE: Keep the amount consistent
- if(m_apList.size() > m_apwList.size()) {
- int i = m_apList.size() - m_apwList.size();
- for (int index = 0; index != i; index++) {
- AccessPointWidget *apw = new AccessPointWidget;
- apw->setFixedHeight(ITEM_HEIGHT);
- m_apwList << apw;
- m_centralLayout->addWidget(apw);
-
- connect(apw, &AccessPointWidget::requestActiveAP, this, &WirelessList::activateAP);
- connect(apw, &AccessPointWidget::requestDeactiveAP, this, &WirelessList::deactiveAP);
- }
- } else if (m_apList.size() < m_apwList.size()) {
- if (!m_apwList.isEmpty()) {
- int i = m_apwList.size() - m_apList.size();
- for (int index = 0; index != i; index++) {
- AccessPointWidget *apw = m_apwList.last();
- m_apwList.removeLast();
- m_centralLayout->removeWidget(apw);
- disconnect(apw, &AccessPointWidget::clicked, this, &WirelessList::updateIndicatorPos);
- apw->deleteLater();
- }
- }
- }
-
- if (m_apList.isEmpty()) return;
-
- std::sort(m_apList.begin(), m_apList.end(), [&] (const AccessPoint &ap1, const AccessPoint &ap2) {
- if (ap1 == m_activeAP)
- return true;
-
- if (ap2 == m_activeAP)
- return false;
-
- return ap1.strength() > ap2.strength();
- });
-
- for (int i = 0; i != m_apList.size(); i++) {
- m_apwList[i]->updateAP(m_apList[i]);
- ++avaliableAPCount;
- connect(m_apwList[i], &AccessPointWidget::clicked, this, &WirelessList::updateIndicatorPos, Qt::UniqueConnection);
- }
-
- // update active AP state
- AccessPointWidget *apw = m_apwList.first();
- apw->setActiveState(m_device.state());
-
- // If the order of item changes
- if (m_apList.contains(m_currentClickAP) && m_indicator->isVisible()) {
- m_currentClickAPW = m_apwList.at(m_apList.indexOf(m_currentClickAP));
- const int h = -(m_currentClickAPW->height() - m_indicator->height()) / 2;
- m_indicator->move(m_currentClickAPW->mapTo(this, m_currentClickAPW->rect().topRight()) - QPoint(35, h));
- }
-
- if (m_device.state() == NetworkDevice::Activated ||
- m_device.state() == NetworkDevice::Failed ||
- m_device.state() == NetworkDevice::Unknow) {
- m_indicator->stop();
- m_indicator->hide();
- }
- }
-
- const int contentHeight = avaliableAPCount * ITEM_HEIGHT;
- m_centralWidget->setFixedHeight(contentHeight);
- setFixedHeight(std::min(contentHeight, MAX_HEIGHT));
-}
-
-void WirelessList::deviceEnableChanged(const bool enable)
-{
- m_networkInter->EnableDevice(m_device.dbusPath(), enable);
- m_updateAPTimer->start();
-}
-
-void WirelessList::deviceStateChanged()
-{
- const QJsonDocument doc = QJsonDocument::fromJson(m_networkInter->devices().toUtf8());
- Q_ASSERT(doc.isObject());
- const QJsonObject obj = doc.object();
-
- for (auto infoList(obj.constBegin()); infoList != obj.constEnd(); ++infoList)
- {
- Q_ASSERT(infoList.value().isArray());
-
- if (infoList.key() != "wireless")
- continue;
-
- const auto list = infoList.value().toArray();
- for (auto i(0); i != list.size(); ++i)
- {
- const QJsonObject info = list[i].toObject();
- if (info.value("Path") == m_device.path())
- {
- const NetworkDevice prevInfo = m_device;
- m_device = NetworkDevice(NetworkDevice::Wireless, info);
-
- setDeviceInfo(list.size() == 1 ? -1 : i + 1);
-
- if (prevInfo.state() != m_device.state())
- emit wirelessStateChanged(m_device.state());
- if (prevInfo.activeAp() != m_device.activeAp())
- onActiveAPChanged();
-
- return;
- }
- }
- }
-}
-
-void WirelessList::onActiveAPChanged()
-{
- const QJsonDocument doc = QJsonDocument::fromJson(m_networkInter->GetAccessPoints(m_device.dbusPath()).value().toUtf8());
- Q_ASSERT(doc.isArray());
-
- for (auto dev : doc.array())
- {
- Q_ASSERT(dev.isObject());
- const QJsonObject obj = dev.toObject();
-
- if (obj.value("Path").toString() != m_device.activeAp())
- continue;
-
- m_activeAP = AccessPoint(obj);
- break;
- }
-
- emit activeAPChanged();
-}
-
-void WirelessList::pwdDialogAccepted()
-{
- if (m_pwdDialog->textValue().isEmpty())
- return m_pwdDialog->setTextAlert(true);
- m_networkInter->FeedSecret(m_lastConnPath, m_lastConnSecurity, m_pwdDialog->textValue(), m_autoConnBox->isChecked());
-}
-
-void WirelessList::pwdDialogCanceled()
-{
- m_networkInter->CancelSecret(m_lastConnPath, m_lastConnSecurity);
- m_pwdDialog->close();
-}
-
-void WirelessList::onPwdDialogTextChanged(const QString &text)
-{
- m_pwdDialog->setTextAlert(false);
-
- do {
- if (text.isEmpty())
- break;
- const int len = text.length();
-
- // in wpa, password length must >= 8
- if (len < 8 && m_lastConnSecurityType.startsWith("wifi-wpa"))
- break;
- if (!(len == 5 || len == 13 || len == 16) && m_lastConnSecurityType.startsWith("wifi-wep"))
- break;
-
- return m_pwdDialog->setOkButtonEnabled(true);
- } while (false);
-
- m_pwdDialog->setOkButtonEnabled(false);
-}
-
-void WirelessList::deviceEnabled(const QString &devPath, const bool enable)
-{
- if (devPath != m_device.path())
- return;
-
- if (m_deviceEnabled != enable) {
- m_deviceEnabled = enable;
- m_controlPanel->setDeviceEnabled(enable);
- m_updateAPTimer->start();
- }
-}
-
-void WirelessList::activateAP(const QDBusObjectPath &apPath, const QString &ssid)
-{
- QString uuid;
-
- const QJsonDocument doc = QJsonDocument::fromJson(m_networkInter->connections().toUtf8());
- for (auto it : doc.object().value("wireless").toArray())
- {
- const QJsonObject obj = it.toObject();
- if (obj.value("Ssid").toString() != ssid)
- continue;
- if (obj.value("HwAddress").toString() != m_device.usingHwAddr())
- continue;
-
- uuid = obj.value("Uuid").toString();
- if (!uuid.isEmpty())
- break;
- }
-
- m_networkInter->ActivateAccessPoint(uuid, apPath, m_device.dbusPath()).waitForFinished();
-}
-
-void WirelessList::deactiveAP()
-{
- m_activeAP = AccessPoint();
- m_networkInter->DisconnectDevice(QDBusObjectPath(m_device.path()));
-}
-
-void WirelessList::needSecrets(const QString &info)
-{
- const QJsonObject infoObject = QJsonDocument::fromJson(info.toUtf8()).object();
- const QString connPath = infoObject.value("ConnectionPath").toString();
- const QString security = infoObject.value("SettingName").toString();
- const QString securityType = infoObject.value("KeyType").toString();
- const QString ssid = infoObject.value("ConnectionId").toString();
- const bool defaultAutoConnect = infoObject.value("AutoConnect").toBool();
-
- // check is our device' ap
- QString connHwAddr;
- QJsonDocument conns = QJsonDocument::fromJson(m_networkInter->connections().toUtf8());
- for (auto item : conns.object()["wireless"].toArray())
- {
- auto info = item.toObject();
- if (info["Path"].toString() != connPath)
- continue;
- connHwAddr = info["HwAddress"].toString();
- break;
- }
- if (connHwAddr != m_device.usingHwAddr())
- return;
-
- m_lastConnPath = connPath;
- m_lastConnSecurity = security;
- m_lastConnSecurityType = securityType;
-
- m_autoConnBox->setChecked(defaultAutoConnect);
- m_pwdDialog->setTitle(tr("Password required to connect to %1").arg(ssid));
-
- // clear old config
- m_pwdDialog->setTextValue(QString());
- m_pwdDialog->setTextAlert(true);
- m_pwdDialog->setOkButtonEnabled(false);
-
- // check if controlcenter handle this request
-// QDBusInterface iface("com.deepin.dde.ControlCenter",
-// "/com/deepin/dde/ControlCenter/Network",
-// "com.deepin.dde.ControlCenter.Network");
-// if (iface.isValid() && iface.call("active").arguments().first().toBool())
-// return m_pwdDialog->hide();
-
- if (!m_pwdDialog->isVisible())
- m_pwdDialog->show();
-}
-
-void WirelessList::updateIndicatorPos()
-{
- m_currentClickAPW = static_cast(sender());
-
- if (m_currentClickAPW->active()) return;
-
- m_currentClickAP = m_currentClickAPW->ap();
-
- const int h = -(m_currentClickAPW->height() - m_indicator->height()) / 2;
- m_indicator->move(m_currentClickAPW->mapTo(this, m_currentClickAPW->rect().topRight()) - QPoint(35, h));
- m_indicator->show();
- m_indicator->play();
-}
diff --git a/plugins/network/item/applet/wirelessapplet.h b/plugins/network/item/applet/wirelessapplet.h
deleted file mode 100644
index 2a0036d80..000000000
--- a/plugins/network/item/applet/wirelessapplet.h
+++ /dev/null
@@ -1,106 +0,0 @@
-/*
- * Copyright (C) 2011 ~ 2018 Deepin Technology Co., Ltd.
- *
- * Author: sbw
- *
- * Maintainer: sbw
- *
- * 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 of the License, or
- * 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 .
- */
-
-#ifndef WIRELESSAPPLET_H
-#define WIRELESSAPPLET_H
-
-#include "devicecontrolwidget.h"
-#include "accesspoint.h"
-#include "../../networkdevice.h"
-#include "../../dbus/dbusnetwork.h"
-
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-
-DWIDGET_USE_NAMESPACE
-
-class AccessPointWidget;
-class WirelessList : public QScrollArea
-{
- Q_OBJECT
-
-public:
- explicit WirelessList(const QSet::const_iterator &deviceIter, QWidget *parent = 0);
- ~WirelessList();
-
- NetworkDevice::NetworkState wirelessState() const;
- int activeAPStrgength() const;
- QWidget *controlPanel();
-
-signals:
- void wirelessStateChanged(const NetworkDevice::NetworkState state) const;
- void activeAPChanged() const;
-
-private:
- void setDeviceInfo(const int index);
- void loadAPList();
-
-private slots:
- void init();
- void APAdded(const QString &devPath, const QString &info);
- void APRemoved(const QString &devPath, const QString &info);
- void APPropertiesChanged(const QString &devPath, const QString &info);
- void updateAPList();
- void deviceEnableChanged(const bool enable);
- void deviceStateChanged();
- void onActiveAPChanged();
- void pwdDialogAccepted();
- void pwdDialogCanceled();
- void onPwdDialogTextChanged(const QString &text);
- void deviceEnabled(const QString &devPath, const bool enable);
- void activateAP(const QDBusObjectPath &apPath, const QString &ssid);
- void deactiveAP();
- void needSecrets(const QString &info);
- void updateIndicatorPos();
-
-
-private:
- NetworkDevice m_device;
-
- AccessPoint m_activeAP;
- QList m_apList;
- QList m_apwList;
-
- QTimer *m_updateAPTimer;
- Dtk::Widget::DInputDialog *m_pwdDialog;
- QCheckBox *m_autoConnBox;
- Dtk::Widget::DPictureSequenceView *m_indicator;
- AccessPointWidget *m_currentClickAPW;
- AccessPoint m_currentClickAP;
-
- QString m_lastConnPath;
- QString m_lastConnSecurity;
- QString m_lastConnSecurityType;
-
- QVBoxLayout *m_centralLayout;
- QWidget *m_centralWidget;
- DeviceControlWidget *m_controlPanel;
- DBusNetwork *m_networkInter;
- bool m_deviceEnabled;
-
-};
-
-#endif // WIRELESSAPPLET_H
diff --git a/plugins/network/item/deviceitem.cpp b/plugins/network/item/deviceitem.cpp
deleted file mode 100644
index e8aacb89b..000000000
--- a/plugins/network/item/deviceitem.cpp
+++ /dev/null
@@ -1,106 +0,0 @@
-/*
- * Copyright (C) 2011 ~ 2018 Deepin Technology Co., Ltd.
- *
- * Author: sbw
- *
- * Maintainer: sbw
- *
- * 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 of the License, or
- * 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 .
- */
-
-#include "deviceitem.h"
-#include
-
-DeviceItem::DeviceItem(const QString &path)
- : QWidget(nullptr),
- m_devicePath(path),
-
- m_networkManager(NetworkManager::instance(this))
-{
-
-}
-
-QSize DeviceItem::sizeHint() const
-{
- return QSize(26, 26);
-}
-
-const QString DeviceItem::itemCommand() const
-{
- return QString();
-}
-
-const QString DeviceItem::itemContextMenu()
-{
- QList items;
- items.reserve(2);
-
- QMap enable;
- enable["itemId"] = "enable";
- if (!enabled())
- enable["itemText"] = tr("Enable network");
- else
- enable["itemText"] = tr("Disable network");
- enable["isActive"] = true;
- items.push_back(enable);
-
- QMap settings;
- settings["itemId"] = "settings";
- settings["itemText"] = tr("Network settings");
- settings["isActive"] = true;
- items.push_back(settings);
-
- QMap menu;
- menu["items"] = items;
- menu["checkableMenu"] = false;
- menu["singleCheck"] = false;
-
- return QJsonDocument::fromVariant(menu).toJson();
-}
-
-QWidget *DeviceItem::itemPopup()
-{
- return nullptr;
-}
-
-void DeviceItem::invokeMenuItem(const QString &menuId)
-{
- if (menuId == "settings")
- //QProcess::startDetached("dbus-send --print-reply --dest=com.deepin.dde.ControlCenter /com/deepin/dde/ControlCenter com.deepin.dde.ControlCenter.ShowModule \"string:network\"");
- DDBusSender()
- .service("com.deepin.dde.ControlCenter")
- .interface("com.deepin.dde.ControlCenter")
- .path("/com/deepin/dde/ControlCenter")
- .method("ShowModule")
- .arg(QString("network"))
- .call();
-
- else if (menuId == "enable")
- setEnabled(!enabled());
-}
-
-bool DeviceItem::enabled() const
-{
- return m_networkManager->deviceEnabled(m_devicePath);
-}
-
-void DeviceItem::setEnabled(const bool enable)
-{
- m_networkManager->setDeviceEnabled(m_devicePath, enable);
-}
-
-QWidget *DeviceItem::itemApplet()
-{
- return nullptr;
-}
diff --git a/plugins/network/item/deviceitem.h b/plugins/network/item/deviceitem.h
deleted file mode 100644
index 47c6c1640..000000000
--- a/plugins/network/item/deviceitem.h
+++ /dev/null
@@ -1,61 +0,0 @@
-/*
- * Copyright (C) 2011 ~ 2018 Deepin Technology Co., Ltd.
- *
- * Author: sbw
- *
- * Maintainer: sbw
- *
- * 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 of the License, or
- * 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 .
- */
-
-#ifndef DEVICEITEM_H
-#define DEVICEITEM_H
-
-#include "networkmanager.h"
-
-#include
-
-class DeviceItem : public QWidget
-{
- Q_OBJECT
-
-public:
- explicit DeviceItem(const QString &path);
-
- const QString path() const { return m_devicePath; }
-
- virtual NetworkDevice::NetworkType type() const = 0;
- virtual NetworkDevice::NetworkState state() const = 0;
- virtual void refreshIcon() = 0;
- virtual const QString itemCommand() const;
- virtual const QString itemContextMenu();
- virtual QWidget *itemApplet();
- virtual QWidget *itemPopup();
- virtual void invokeMenuItem(const QString &menuId);
-
-signals:
- void requestContextMenu() const;
-
-protected:
- bool enabled() const;
- void setEnabled(const bool enable);
- QSize sizeHint() const;
-
-protected:
- const QString m_devicePath;
-
- NetworkManager *m_networkManager;
-};
-
-#endif // DEVICEITEM_H
diff --git a/plugins/network/item/wireditem.cpp b/plugins/network/item/wireditem.cpp
deleted file mode 100644
index 0bd2b8f7d..000000000
--- a/plugins/network/item/wireditem.cpp
+++ /dev/null
@@ -1,191 +0,0 @@
-/*
- * Copyright (C) 2011 ~ 2018 Deepin Technology Co., Ltd.
- *
- * Author: sbw
- *
- * Maintainer: sbw
- *
- * 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 of the License, or
- * 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 .
- */
-
-#include "constants.h"
-#include "wireditem.h"
-#include "util/imageutil.h"
-
-#include
-#include
-#include
-#include
-
-WiredItem::WiredItem(const QString &path)
- : DeviceItem(path),
-
- m_connected(false),
- m_itemTips(new QLabel(this)),
- m_delayTimer(new QTimer(this))
-{
-// QIcon::setThemeName("deepin");
-
- m_delayTimer->setSingleShot(false);
- m_delayTimer->setInterval(200);
-
- m_itemTips->setObjectName("wired-" + path);
- m_itemTips->setVisible(false);
- m_itemTips->setStyleSheet("color:white;"
- "padding:0px 3px;");
-
- connect(m_delayTimer, &QTimer::timeout, this, &WiredItem::reloadIcon);
-
- connect(m_networkManager, &NetworkManager::globalNetworkStateChanged, m_delayTimer, static_cast(&QTimer::start));
- connect(m_networkManager, &NetworkManager::deviceChanged, this, &WiredItem::deviceStateChanged);
- connect(m_networkManager, &NetworkManager::networkStateChanged, m_delayTimer, static_cast(&QTimer::start));
- connect(m_networkManager, &NetworkManager::activeConnectionChanged, this, &WiredItem::activeConnectionChanged);
-}
-
-NetworkDevice::NetworkType WiredItem::type() const
-{
- return NetworkDevice::Wired;
-}
-
-NetworkDevice::NetworkState WiredItem::state() const
-{
- return m_connected ? NetworkDevice::Activated : NetworkDevice::Disconnected;
-}
-
-QWidget *WiredItem::itemPopup()
-{
- m_itemTips->setText(tr("Unknown"));
-
- do {
- if (!m_connected)
- {
- m_itemTips->setText(tr("No Network"));
- break;
- }
-
- const QJsonObject info = m_networkManager->deviceConnInfo(m_devicePath);
- if (!info.contains("Ip4"))
- break;
- const QJsonObject ipv4 = info.value("Ip4").toObject();
- if (!ipv4.contains("Address"))
- break;
- m_itemTips->setText(tr("Wired connection: %1").arg(ipv4.value("Address").toString()));
- } while (false);
-
- return m_itemTips;
-}
-
-const QString WiredItem::itemCommand() const
-{
- return "dbus-send --print-reply --dest=com.deepin.dde.ControlCenter /com/deepin/dde/ControlCenter com.deepin.dde.ControlCenter.ShowModule \"string:network\"";
-}
-
-void WiredItem::paintEvent(QPaintEvent *e)
-{
- QWidget::paintEvent(e);
-
- QPainter painter(this);
- const auto ratio = qApp->devicePixelRatio();
- const int x = rect().center().x() - m_icon.rect().center().x() / ratio;
- const int y = rect().center().y() - m_icon.rect().center().y() / ratio;
- painter.drawPixmap(x, y, m_icon);
-}
-
-void WiredItem::resizeEvent(QResizeEvent *e)
-{
- DeviceItem::resizeEvent(e);
-
- m_delayTimer->start();
-}
-
-void WiredItem::mousePressEvent(QMouseEvent *e)
-{
- if (e->button() != Qt::RightButton)
- return QWidget::mousePressEvent(e);
-
- const QPoint p(e->pos() - rect().center());
- if (p.manhattanLength() < std::min(width(), height()) * 0.8 * 0.5)
- {
- emit requestContextMenu();
- return;
- }
-
- return QWidget::mousePressEvent(e);
-}
-
-void WiredItem::refreshIcon()
-{
- m_delayTimer->start();
-}
-
-void WiredItem::reloadIcon()
-{
- Q_ASSERT(sender() == m_delayTimer);
-
- const Dock::DisplayMode displayMode = qApp->property(PROP_DISPLAY_MODE).value();
-
- QString iconName = "network-";
- if (!m_connected)
- {
- NetworkDevice::NetworkState devState = m_networkManager->deviceState(m_devicePath);
-
- if (devState < NetworkDevice::Disconnected)
- iconName.append("error");
- else
- iconName.append("offline");
- } else {
- NetworkManager::GlobalNetworkState gState = m_networkManager->globalNetworkState();
-
- if (gState == NetworkManager::Connecting) {
- m_delayTimer->start();
- const quint64 index = QDateTime::currentMSecsSinceEpoch() / 200;
- const int num = (index % 5) + 1;
- m_icon = QPixmap(QString(":/wired/resources/wired/network-wired-symbolic-connecting%1.svg").arg(num));
- update();
- return;
- }
-
- if (gState == NetworkManager::ConnectedGlobal)
- iconName.append("online");
- else
- iconName.append("idle");
- }
-
- m_delayTimer->stop();
-
- if (displayMode == Dock::Efficient)
- iconName.append("-symbolic");
-
- const auto ratio = qApp->devicePixelRatio();
- const int size = displayMode == Dock::Efficient ? 16 : std::min(width(), height()) * 0.8;
- m_icon = QIcon::fromTheme(iconName).pixmap(size * ratio, size * ratio);
- m_icon.setDevicePixelRatio(ratio);
- update();
-}
-
-void WiredItem::activeConnectionChanged()
-{
-// if (path != m_devicePath)
-// return;
-
- m_connected = m_networkManager->activeDeviceSet().contains(m_devicePath);
- m_delayTimer->start();
-}
-
-void WiredItem::deviceStateChanged(const NetworkDevice &device)
-{
- if (device.path() != m_devicePath)
- return;
- m_delayTimer->start();
-}
diff --git a/plugins/network/item/wireditem.h b/plugins/network/item/wireditem.h
deleted file mode 100644
index 6df33a84a..000000000
--- a/plugins/network/item/wireditem.h
+++ /dev/null
@@ -1,62 +0,0 @@
-/*
- * Copyright (C) 2011 ~ 2018 Deepin Technology Co., Ltd.
- *
- * Author: sbw
- *
- * Maintainer: sbw
- *
- * 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 of the License, or
- * 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 .
- */
-
-#ifndef WIREDITEM_H
-#define WIREDITEM_H
-
-#include "deviceitem.h"
-
-#include
-#include
-#include
-
-class WiredItem : public DeviceItem
-{
- Q_OBJECT
-
-public:
- explicit WiredItem(const QString &path);
-
- NetworkDevice::NetworkType type() const override;
- NetworkDevice::NetworkState state() const override;
- QWidget *itemPopup() override;
- const QString itemCommand() const override;
-
-protected:
- void paintEvent(QPaintEvent *e) override;
- void resizeEvent(QResizeEvent *e) override;
- void mousePressEvent(QMouseEvent *e) override;
-
-private slots:
- void refreshIcon() override;
- void reloadIcon();
- void activeConnectionChanged();
- void deviceStateChanged(const NetworkDevice &device);
-
-private:
- bool m_connected;
- QPixmap m_icon;
-
- QLabel *m_itemTips;
- QTimer *m_delayTimer;
-};
-
-#endif // WIREDITEM_H
diff --git a/plugins/network/item/wirelessitem.cpp b/plugins/network/item/wirelessitem.cpp
deleted file mode 100644
index 21306b124..000000000
--- a/plugins/network/item/wirelessitem.cpp
+++ /dev/null
@@ -1,226 +0,0 @@
-/*
- * Copyright (C) 2011 ~ 2018 Deepin Technology Co., Ltd.
- *
- * Author: sbw
- *
- * Maintainer: sbw
- *
- * 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 of the License, or
- * 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 .
- */
-
-#include "wirelessitem.h"
-#include "util/imageutil.h"
-
-#include
-#include
-#include
-
-WirelessItem::WirelessItem(const QString &path)
- : DeviceItem(path),
-
- m_refershTimer(new QTimer(this)),
- m_wirelessApplet(new QWidget),
- m_wirelessPopup(new QLabel),
- m_APList(nullptr)
-{
- m_refershTimer->setSingleShot(false);
- m_refershTimer->setInterval(100);
-
- m_wirelessApplet->setVisible(false);
- m_wirelessPopup->setObjectName("wireless-" + m_devicePath);
- m_wirelessPopup->setVisible(false);
- m_wirelessPopup->setStyleSheet("color:white;"
- "padding: 0px 3px;");
-
- connect(m_refershTimer, &QTimer::timeout, this, static_cast(&WirelessItem::update));
- QMetaObject::invokeMethod(this, "init", Qt::QueuedConnection);
-}
-
-WirelessItem::~WirelessItem()
-{
- m_APList->deleteLater();
- m_APList->controlPanel()->deleteLater();
-}
-
-NetworkDevice::NetworkType WirelessItem::type() const
-{
- return NetworkDevice::Wireless;
-}
-
-NetworkDevice::NetworkState WirelessItem::state() const
-{
- return m_APList->wirelessState();
-}
-
-QWidget *WirelessItem::itemApplet()
-{
- return m_wirelessApplet;
-}
-
-QWidget *WirelessItem::itemPopup()
-{
- const NetworkDevice::NetworkState stat = state();
-
- m_wirelessPopup->setText(tr("No Network"));
-
- if (stat == NetworkDevice::Activated)
- {
- const QJsonObject obj = m_networkManager->deviceConnInfo(m_devicePath);
- if (obj.contains("Ip4"))
- {
- const QJsonObject ip4 = obj["Ip4"].toObject();
- if (ip4.contains("Address"))
- {
- m_wirelessPopup->setText(tr("Wireless Connection: %1").arg(ip4["Address"].toString()));
- }
- }
- }
-
- return m_wirelessPopup;
-}
-
-bool WirelessItem::eventFilter(QObject *o, QEvent *e)
-{
- if (o == m_APList && e->type() == QEvent::Resize)
- QMetaObject::invokeMethod(this, "adjustHeight", Qt::QueuedConnection);
-
- return false;
-}
-
-void WirelessItem::paintEvent(QPaintEvent *e)
-{
- DeviceItem::paintEvent(e);
-
- const Dock::DisplayMode displayMode = qApp->property(PROP_DISPLAY_MODE).value();
-
- const auto ratio = qApp->devicePixelRatio();
- const int iconSize = displayMode == Dock::Fashion ? std::min(width(), height()) * 0.8 : 16;
- QPixmap pixmap = iconPix(displayMode, iconSize * ratio);
- pixmap.setDevicePixelRatio(ratio);
-
- QPainter painter(this);
- if (displayMode == Dock::Fashion)
- {
- QPixmap pixmap = backgroundPix(iconSize * ratio);
- pixmap.setDevicePixelRatio(ratio);
- painter.drawPixmap(rect().center() - pixmap.rect().center() / ratio, pixmap);
- }
- painter.drawPixmap(rect().center() - pixmap.rect().center() / ratio, pixmap);
-}
-
-void WirelessItem::resizeEvent(QResizeEvent *e)
-{
- DeviceItem::resizeEvent(e);
-
- m_icons.clear();
-}
-
-void WirelessItem::mousePressEvent(QMouseEvent *e)
-{
- if (e->button() != Qt::RightButton)
- return e->ignore();
-
- const QPoint p(e->pos() - rect().center());
- if (p.manhattanLength() < std::min(width(), height()) * 0.8 * 0.5)
- {
- emit requestContextMenu();
- return;
- }
-
- return QWidget::mousePressEvent(e);
-}
-
-const QPixmap WirelessItem::iconPix(const Dock::DisplayMode displayMode, const int size)
-{
- QString type;
-
- const auto state = m_APList->wirelessState();
- if (state <= NetworkDevice::Disconnected)
- {
- type = "disconnect";
- m_refershTimer->stop();
- }
- else
- {
- int strength = 0;
- if (state == NetworkDevice::Activated)
- {
- strength = m_APList->activeAPStrgength();
- m_refershTimer->stop();
- }
- else
- {
- strength = QTime::currentTime().msec() / 10 % 100;
- if (!m_refershTimer->isActive())
- m_refershTimer->start();
- }
-
- if (strength == 100)
- type = "80";
- else if (strength < 20)
- type = "0";
- else
- type = QString::number(strength / 10 & ~0x1) + "0";
- }
-
- const QString key = QString("wireless-%1%2")
- .arg(type)
- .arg(displayMode == Dock::Fashion ? "" : "-symbolic");
-
- return cachedPix(key, size);
-}
-
-const QPixmap WirelessItem::backgroundPix(const int size)
-{
- return cachedPix("wireless-background", size);
-}
-
-const QPixmap WirelessItem::cachedPix(const QString &key, const int size)
-{
- if (!m_icons.contains(key))
- m_icons.insert(key, QIcon::fromTheme(key,
- QIcon(":/wireless/resources/wireless/" + key + ".svg")).pixmap(size));
-
- return m_icons.value(key);
-}
-
-void WirelessItem::init()
-{
- const auto devInfo = m_networkManager->device(m_devicePath);
-
- m_APList = new WirelessList(devInfo);
- m_APList->installEventFilter(this);
- m_APList->setObjectName("wireless-" + m_devicePath);
-
- QVBoxLayout *vLayout = new QVBoxLayout;
- vLayout->addWidget(m_APList->controlPanel());
- vLayout->addWidget(m_APList);
- vLayout->setMargin(0);
- vLayout->setSpacing(0);
- m_wirelessApplet->setLayout(vLayout);
-
- connect(m_APList, &WirelessList::activeAPChanged, this, static_cast(&WirelessItem::update));
- connect(m_APList, &WirelessList::wirelessStateChanged, this, static_cast(&WirelessItem::update));
-}
-
-void WirelessItem::adjustHeight()
-{
- m_wirelessApplet->setFixedHeight(m_APList->height() + m_APList->controlPanel()->height());
-}
-
-void WirelessItem::refreshIcon()
-{
- update();
-}
-
diff --git a/plugins/network/item/wirelessitem.h b/plugins/network/item/wirelessitem.h
deleted file mode 100644
index bbba493d1..000000000
--- a/plugins/network/item/wirelessitem.h
+++ /dev/null
@@ -1,70 +0,0 @@
-/*
- * Copyright (C) 2011 ~ 2018 Deepin Technology Co., Ltd.
- *
- * Author: sbw
- *
- * Maintainer: sbw
- *
- * 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 of the License, or
- * 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 .
- */
-
-#ifndef WIRELESSITEM_H
-#define WIRELESSITEM_H
-
-#include "constants.h"
-
-#include "deviceitem.h"
-#include "applet/wirelessapplet.h"
-
-#include
-
-class WirelessItem : public DeviceItem
-{
- Q_OBJECT
-
-public:
- explicit WirelessItem(const QString &path);
- ~WirelessItem();
-
- NetworkDevice::NetworkType type() const;
- NetworkDevice::NetworkState state() const;
- QWidget *itemApplet();
- QWidget *itemPopup();
-
-protected:
- bool eventFilter(QObject *o, QEvent *e);
- void paintEvent(QPaintEvent *e);
- void resizeEvent(QResizeEvent *e);
- void mousePressEvent(QMouseEvent *e);
-
-private:
- const QPixmap iconPix(const Dock::DisplayMode displayMode, const int size);
- const QPixmap backgroundPix(const int size);
- const QPixmap cachedPix(const QString &key, const int size);
-
-private slots:
- void init();
- void adjustHeight();
- void refreshIcon();
-
-private:
- QHash m_icons;
-
- QTimer *m_refershTimer;
- QWidget *m_wirelessApplet;
- QLabel *m_wirelessPopup;
- WirelessList *m_APList;
-};
-
-#endif // WIRELESSITEM_H
diff --git a/plugins/network/network.json b/plugins/network/network.json
deleted file mode 100644
index b9b78cb89..000000000
--- a/plugins/network/network.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "api": "1.0"
-}
diff --git a/plugins/network/networkdevice.cpp b/plugins/network/networkdevice.cpp
deleted file mode 100644
index 1ad744768..000000000
--- a/plugins/network/networkdevice.cpp
+++ /dev/null
@@ -1,98 +0,0 @@
-/*
- * Copyright (C) 2011 ~ 2018 Deepin Technology Co., Ltd.
- *
- * Author: sbw
- *
- * Maintainer: sbw
- *
- * 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 of the License, or
- * 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 .
- */
-
-#include "networkdevice.h"
-
-#include
-#include
-
-NetworkDevice::NetworkDevice(const NetworkType type, const QJsonObject &info)
- : m_type(type),
- m_infoObj(info)
-{
- m_devicePath = info.value("Path").toString();
-}
-
-bool NetworkDevice::operator==(const QString &path) const
-{
- return m_devicePath == path;
-}
-
-bool NetworkDevice::operator==(const NetworkDevice &device) const
-{
- return m_devicePath == device.m_devicePath;
-}
-
-NetworkDevice::NetworkState NetworkDevice::state() const
-{
- return NetworkState(m_infoObj.value("State").toInt());
-}
-
-NetworkDevice::NetworkType NetworkDevice::type() const
-{
- return m_type;
-}
-
-const QString NetworkDevice::path() const
-{
- return m_devicePath;
-}
-
-const QDBusObjectPath NetworkDevice::dbusPath() const
-{
- return QDBusObjectPath(m_devicePath);
-}
-
-const QString NetworkDevice::usingHwAddr() const
-{
- const auto &hwAdr = m_infoObj.value("HwAddress").toString();
- const auto &clonedAdr = m_infoObj.value("ClonedAddress").toString();
-
- return clonedAdr.isEmpty() ? hwAdr : clonedAdr;
-}
-
-const QString NetworkDevice::vendor() const
-{
- return m_infoObj.value("Vendor").toString();
-}
-
-const QString NetworkDevice::activeAp() const
-{
- return m_infoObj.value("ActiveAp").toString();
-}
-
-NetworkDevice::NetworkType NetworkDevice::deviceType(const QString &type)
-{
- if (type == "bt")
- return NetworkDevice::Bluetooth;
- if (type == "generic")
- return NetworkDevice::Generic;
- if (type == "wired")
- return NetworkDevice::Wired;
- if (type == "wireless")
- return NetworkDevice::Wireless;
- if (type == "bridge")
- return NetworkDevice::Bridge;
-
- Q_ASSERT(false);
-
- return NetworkDevice::None;
-}
diff --git a/plugins/network/networkdevice.h b/plugins/network/networkdevice.h
deleted file mode 100644
index ded7dc602..000000000
--- a/plugins/network/networkdevice.h
+++ /dev/null
@@ -1,89 +0,0 @@
-/*
- * Copyright (C) 2011 ~ 2018 Deepin Technology Co., Ltd.
- *
- * Author: sbw
- *
- * Maintainer: sbw
- *
- * 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 of the License, or
- * 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 .
- */
-
-#ifndef NETWORKDEVICE_H
-#define NETWORKDEVICE_H
-
-#include "networkdevice.h"
-
-#include
-#include
-#include
-
-class NetworkDevice
-{
-public:
- enum NetworkState {
- Unknow = 0,
- Unmanaged = 10,
- Unavailable = 20,
- Disconnected = 30,
- Prepare = 40,
- Config = 50,
- NeedAuth = 60,
- IpConfig = 70,
- IpCheck = 80,
- Secondaries = 90,
- Activated = 100,
- Deactivation = 110,
- Failed = 120,
- };
-
- enum NetworkType {
- None = 0,
- Generic = 1 << 0,
- Wired = 1 << 1,
- Wireless = 1 << 2,
- Bluetooth = 1 << 3,
- Bridge = 1 << 4,
- };
- Q_DECLARE_FLAGS(NetworkTypes, NetworkType)
-
-public:
- static NetworkType deviceType(const QString &type);
-
- explicit NetworkDevice(const NetworkType type, const QJsonObject &info);
- bool operator==(const QString &path) const;
- bool operator==(const NetworkDevice &device) const;
-
- NetworkState state() const;
- NetworkType type() const;
- const QString path() const;
- const QDBusObjectPath dbusPath() const;
- const QString usingHwAddr() const;
- const QString vendor() const;
- const QString activeAp() const;
-
-private:
- NetworkType m_type;
-
- QString m_devicePath;
- QJsonObject m_infoObj;
-};
-
-inline uint qHash(const NetworkDevice &device)
-{
- return qHash(device.path());
-}
-
-Q_DECLARE_OPERATORS_FOR_FLAGS(NetworkDevice::NetworkTypes)
-
-#endif // NETWORKDEVICE_H
diff --git a/plugins/network/networkmanager.cpp b/plugins/network/networkmanager.cpp
deleted file mode 100644
index 7fabc01f7..000000000
--- a/plugins/network/networkmanager.cpp
+++ /dev/null
@@ -1,256 +0,0 @@
-/*
- * Copyright (C) 2011 ~ 2018 Deepin Technology Co., Ltd.
- *
- * Author: sbw
- *
- * Maintainer: sbw
- *
- * 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 of the License, or
- * 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 .
- */
-
-#include "networkmanager.h"
-#include "networkdevice.h"
-
-NetworkManager *NetworkManager::INSTANCE = nullptr;
-
-NetworkManager *NetworkManager::instance(QObject *parent)
-{
- if (!INSTANCE)
- INSTANCE = new NetworkManager(parent);
-
- return INSTANCE;
-}
-
-void NetworkManager::init()
-{
- QTimer *dbusCheckTimer = new QTimer;
- dbusCheckTimer->setInterval(100);
- dbusCheckTimer->setSingleShot(false);
-
- auto checkFunc = [=] {
- if (!m_networkInter->isValid())
- return;
-
- QTimer::singleShot(100, this, &NetworkManager::reloadDevices);
- QTimer::singleShot(150, this, &NetworkManager::reloadActiveConnections);
- dbusCheckTimer->deleteLater();
- };
-
- connect(dbusCheckTimer, &QTimer::timeout, checkFunc);
- dbusCheckTimer->start();
-}
-
-NetworkManager::GlobalNetworkState NetworkManager::globalNetworkState() const
-{
- return GlobalNetworkState(m_networkInter->state());
-}
-
-const NetworkDevice::NetworkTypes NetworkManager::states() const
-{
- return m_states;
-}
-
-const NetworkDevice::NetworkTypes NetworkManager::types() const
-{
- return m_types;
-}
-
-const QSet NetworkManager::deviceList() const
-{
- return m_deviceSet;
-}
-
-const QSet NetworkManager::activeConnSet() const
-{
- return m_activeConnSet;
-}
-
-NetworkDevice::NetworkState NetworkManager::deviceState(const QString &path) const
-{
- const auto item = device(path);
- if (item == m_deviceSet.cend())
- return NetworkDevice::Unknow;
-
- return item->state();
-}
-
-bool NetworkManager::deviceEnabled(const QString &path) const
-{
- return m_networkInter->IsDeviceEnabled(QDBusObjectPath(path));
-}
-
-void NetworkManager::setDeviceEnabled(const QString path, const bool enable)
-{
- m_networkInter->EnableDevice(QDBusObjectPath(path), enable);
-}
-
-const QString NetworkManager::deviceHwAddr(const QString &path) const
-{
- const auto item = device(path);
- if (item == m_deviceSet.cend())
- return QString();
-
- return item->usingHwAddr();
-}
-
-const QString NetworkManager::devicePath(const QString &path) const
-{
- const auto item = device(path);
- if (item == m_deviceSet.cend())
- return QString();
-
- return item->path();
-}
-
-const QJsonObject NetworkManager::deviceConnInfo(const QString &path) const
-{
- const QString addr = deviceHwAddr(path);
- if (addr.isEmpty())
- return QJsonObject();
-
- const QJsonDocument infos = QJsonDocument::fromJson(m_networkInter->GetActiveConnectionInfo().value().toUtf8());
- Q_ASSERT(infos.isArray());
-
- for (auto info : infos.array())
- {
- Q_ASSERT(info.isObject());
- const QJsonObject obj = info.toObject();
- if (obj.contains("HwAddress") && obj.value("HwAddress").toString() == addr)
- return obj;
- }
-
- return QJsonObject();
-}
-
-NetworkManager::NetworkManager(QObject *parent)
- : QObject(parent),
-
- m_states(NetworkDevice::None),
- m_types(NetworkDevice::None),
-
- m_networkInter(new DBusNetwork(this))
-{
- connect(m_networkInter, &DBusNetwork::StateChanged, this, &NetworkManager::globalNetworkStateChanged);
- connect(m_networkInter, &DBusNetwork::DevicesChanged, this, &NetworkManager::reloadDevices);
- connect(m_networkInter, &DBusNetwork::ActiveConnectionsChanged, this, &NetworkManager::reloadActiveConnections);
-}
-
-const QSet::const_iterator NetworkManager::device(const QString &path) const
-{
- return std::find_if(m_deviceSet.cbegin(), m_deviceSet.cend(),
- [&] (const NetworkDevice &dev) {return dev.path() == path;});
-}
-
-void NetworkManager::reloadDevices()
-{
- const QJsonDocument doc = QJsonDocument::fromJson(m_networkInter->devices().toUtf8());
- Q_ASSERT(doc.isObject());
- const QJsonObject obj = doc.object();
-
- NetworkDevice::NetworkTypes types = NetworkDevice::None;
- QSet deviceSet;
- for (auto infoList(obj.constBegin()); infoList != obj.constEnd(); ++infoList)
- {
- Q_ASSERT(infoList.value().isArray());
- const NetworkDevice::NetworkType deviceType = NetworkDevice::deviceType(infoList.key());
-
- const auto list = infoList.value().toArray();
- if (list.isEmpty())
- continue;
-
- types |= deviceType;
-
- for (auto device : list)
- deviceSet.insert(NetworkDevice(deviceType, device.toObject()));
- }
-
- const QSet removedDeviceList = m_deviceSet - deviceSet;
- for (auto dev : removedDeviceList)
- emit deviceRemoved(dev);
- for (auto dev : deviceSet)
- {
- if (m_deviceSet.contains(dev))
- emit deviceChanged(dev);
- else
- emit deviceAdded(dev);
- }
-
- m_deviceSet = std::move(deviceSet);
- if (m_types == types)
- return;
-
- m_types = types;
- emit deviceTypesChanged(m_types);
-
-// qDebug() << "device type: " << m_types;
-}
-
-void NetworkManager::reloadActiveConnections()
-{
- const QJsonDocument doc = QJsonDocument::fromJson(m_networkInter->activeConnections().toUtf8());
- Q_ASSERT(doc.isObject());
- const QJsonObject obj = doc.object();
-
- QSet activeConnList;
- for (auto info(obj.constBegin()); info != obj.constEnd(); ++info)
- {
- Q_ASSERT(info.value().isObject());
- const QJsonObject infoObj = info.value().toObject();
- const QUuid uuid = infoObj.value("Uuid").toString();
-
- activeConnList.insert(uuid);
- }
-
- const QSet removedConnList = m_activeConnSet - activeConnList;
- m_activeConnSet = std::move(activeConnList);
-
- reloadNetworkState();
-
- for (auto uuid : removedConnList)
- emit activeConnectionChanged(uuid);
-
- for (auto uuid : m_activeConnSet)
- emit activeConnectionChanged(uuid);
-}
-
-void NetworkManager::reloadNetworkState()
-{
- NetworkDevice::NetworkTypes states = NetworkDevice::None;
- QSet activedDevices;
-
- const QJsonDocument doc = QJsonDocument::fromJson(m_networkInter->GetActiveConnectionInfo().value().toUtf8());
- for (const auto info : doc.array())
- {
- const auto detail = info.toObject();
- const QString type = detail.value("ConnectionType").toString();
- const QString device = detail.value("Device").toString();
-
- activedDevices.insert(device);
-
- if (type == "wired")
- states |= NetworkDevice::Wired;
- else if (type == "wireless")
- states |= NetworkDevice::Wireless;
- }
-
- m_activeDeviceSet = std::move(activedDevices);
-
- if (m_states == states)
- return;
-
- m_states = states;
- emit networkStateChanged(m_states);
-
-// qDebug() << "network states: " << m_states;
-}
diff --git a/plugins/network/networkmanager.h b/plugins/network/networkmanager.h
deleted file mode 100644
index 18ce1b212..000000000
--- a/plugins/network/networkmanager.h
+++ /dev/null
@@ -1,97 +0,0 @@
-/*
- * Copyright (C) 2011 ~ 2018 Deepin Technology Co., Ltd.
- *
- * Author: sbw
- *
- * Maintainer: sbw
- *
- * 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 of the License, or
- * 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 .
- */
-
-#ifndef NETWORKMANAGER_H
-#define NETWORKMANAGER_H
-
-#include "dbus/dbusnetwork.h"
-#include "networkdevice.h"
-
-#include
-#include
-#include
-
-class NetworkManager : public QObject
-{
- Q_OBJECT
-
-public:
- enum GlobalNetworkState {
- Unknown = 0,
- Asleep = 10,
- Disconnected = 20,
- Disconnecting = 30,
- Connecting = 40,
- ConnectedLocal = 50,
- ConnectedSite = 60,
- ConnectedGlobal = 70,
- };
-
-public:
- static NetworkManager *instance(QObject *parent = nullptr);
-
- void init();
-
- GlobalNetworkState globalNetworkState() const;
- const NetworkDevice::NetworkTypes states() const;
- const NetworkDevice::NetworkTypes types() const;
- const QSet deviceList() const;
- const QSet activeConnSet() const;
- const QSet activeDeviceSet() const { return m_activeDeviceSet; }
-
- NetworkDevice::NetworkState deviceState(const QString &path) const;
- bool deviceEnabled(const QString &path) const;
- void setDeviceEnabled(const QString path, const bool enable);
- const QString deviceHwAddr(const QString &path) const;
- const QString devicePath(const QString &path) const;
- const QJsonObject deviceConnInfo(const QString &path) const;
- const QSet::const_iterator device(const QString &path) const;
-
-signals:
- void globalNetworkStateChanged() const;
- void deviceAdded(const NetworkDevice &device) const;
- void deviceChanged(const NetworkDevice &device) const;
- void deviceRemoved(const NetworkDevice &device) const;
- void activeConnectionChanged(const QUuid &uuid) const;
- void networkStateChanged(const NetworkDevice::NetworkTypes &states) const;
- void deviceTypesChanged(const NetworkDevice::NetworkTypes &types) const;
-
-private:
- explicit NetworkManager(QObject *parent = 0);
-
-
-private slots:
- void reloadDevices();
- void reloadActiveConnections();
- void reloadNetworkState();
-
-private:
- NetworkDevice::NetworkTypes m_states;
- NetworkDevice::NetworkTypes m_types;
- DBusNetwork *m_networkInter;
-
- QSet m_deviceSet;
- QSet m_activeConnSet;
- QSet m_activeDeviceSet;
-
- static NetworkManager *INSTANCE;
-};
-#endif // NETWORKMANAGER_H
diff --git a/plugins/network/networkplugin.cpp b/plugins/network/networkplugin.cpp
deleted file mode 100644
index dab843b61..000000000
--- a/plugins/network/networkplugin.cpp
+++ /dev/null
@@ -1,244 +0,0 @@
-/*
- * Copyright (C) 2011 ~ 2018 Deepin Technology Co., Ltd.
- *
- * Author: sbw
- *
- * Maintainer: sbw
- *
- * 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 of the License, or
- * 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 .
- */
-
-#include "networkplugin.h"
-#include "item/wireditem.h"
-#include "item/wirelessitem.h"
-
-#define WIRED_ITEM "wired"
-#define WIRELESS_ITEM "wireless"
-#define STATE_KEY "enabled"
-
-NetworkPlugin::NetworkPlugin(QObject *parent)
- : QObject(parent),
-
- m_settings("deepin", "dde-dock-network"),
- m_networkManager(NetworkManager::instance(this)),
- m_refershTimer(new QTimer(this))
-{
-}
-
-const QString NetworkPlugin::pluginName() const
-{
- return "network";
-}
-
-const QString NetworkPlugin::pluginDisplayName() const
-{
- return tr("Network");
-}
-
-void NetworkPlugin::init(PluginProxyInterface *proxyInter)
-{
- m_proxyInter = proxyInter;
-
- m_refershTimer->setInterval(100);
- m_refershTimer->setSingleShot(true);
-
- connect(m_networkManager, &NetworkManager::networkStateChanged, this, &NetworkPlugin::networkStateChanged);
- connect(m_networkManager, &NetworkManager::deviceTypesChanged, this, &NetworkPlugin::deviceTypesChanged);
- connect(m_networkManager, &NetworkManager::deviceAdded, this, &NetworkPlugin::deviceAdded);
- connect(m_networkManager, &NetworkManager::deviceRemoved, this, &NetworkPlugin::deviceRemoved);
- connect(m_networkManager, &NetworkManager::deviceChanged, m_refershTimer, static_cast(&QTimer::start));
- connect(m_refershTimer, &QTimer::timeout, this, &NetworkPlugin::refershDeviceItemVisible);
-
- m_networkManager->init();
-}
-
-void NetworkPlugin::invokedMenuItem(const QString &itemKey, const QString &menuId, const bool checked)
-{
- Q_UNUSED(checked)
-
- for (auto item : m_deviceItemList)
- if (item->path() == itemKey)
- return item->invokeMenuItem(menuId);
-
- Q_UNREACHABLE();
-}
-
-void NetworkPlugin::refershIcon(const QString &itemKey)
-{
- Q_UNUSED(itemKey);
-
- for (auto *item : m_deviceItemList)
- item->refreshIcon();
-}
-
-void NetworkPlugin::pluginStateSwitched()
-{
- m_settings.setValue(STATE_KEY, !m_settings.value(STATE_KEY, true).toBool());
-
- m_refershTimer->start();
-}
-
-bool NetworkPlugin::pluginIsDisable()
-{
- return !m_settings.value(STATE_KEY, true).toBool();
-}
-
-const QString NetworkPlugin::itemCommand(const QString &itemKey)
-{
- for (auto deviceItem : m_deviceItemList)
- if (deviceItem->path() == itemKey)
- return deviceItem->itemCommand();
-
- Q_UNREACHABLE();
- return QString();
-}
-
-const QString NetworkPlugin::itemContextMenu(const QString &itemKey)
-{
- for (auto item : m_deviceItemList)
- if (item->path() == itemKey)
- return item->itemContextMenu();
-
- Q_UNREACHABLE();
- return QString();
-}
-
-QWidget *NetworkPlugin::itemWidget(const QString &itemKey)
-{
- for (auto deviceItem : m_deviceItemList)
- if (deviceItem->path() == itemKey)
- {
- return deviceItem;
- }
-
- return nullptr;
-}
-
-QWidget *NetworkPlugin::itemTipsWidget(const QString &itemKey)
-{
- for (auto deviceItem : m_deviceItemList)
- if (deviceItem->path() == itemKey)
- return deviceItem->itemPopup();
-
- return nullptr;
-}
-
-QWidget *NetworkPlugin::itemPopupApplet(const QString &itemKey)
-{
- for (auto deviceItem : m_deviceItemList)
- if (deviceItem->path() == itemKey)
- return deviceItem->itemApplet();
-
- return nullptr;
-}
-
-int NetworkPlugin::itemSortKey(const QString &itemKey)
-{
- const QString key = QString("pos_%1_%2").arg(itemKey).arg(displayMode());
- return m_settings.value(key, 0).toInt();
-}
-
-void NetworkPlugin::setSortKey(const QString &itemKey, const int order)
-{
- const QString key = QString("pos_%1_%2").arg(itemKey).arg(displayMode());
- m_settings.setValue(key, order);
-}
-
-void NetworkPlugin::deviceAdded(const NetworkDevice &device)
-{
- DeviceItem *item = nullptr;
- switch (device.type())
- {
- case NetworkDevice::Wired: item = new WiredItem(device.path()); break;
- case NetworkDevice::Wireless: item = new WirelessItem(device.path()); break;
- default:;
- }
-
- if (!item)
- return;
- connect(item, &DeviceItem::requestContextMenu, this, &NetworkPlugin::contextMenuRequested);
-
- m_deviceItemList.append(item);
- m_refershTimer->start();
-}
-
-void NetworkPlugin::deviceRemoved(const NetworkDevice &device)
-{
- const auto item = std::find_if(m_deviceItemList.begin(), m_deviceItemList.end(),
- [&] (DeviceItem *dev) {return device == dev->path();});
-
- if (item == m_deviceItemList.cend())
- return;
-
- m_proxyInter->itemRemoved(this, (*item)->path());
- (*item)->deleteLater();
- m_deviceItemList.erase(item);
-}
-
-void NetworkPlugin::networkStateChanged(const NetworkDevice::NetworkTypes &states)
-{
- Q_UNUSED(states)
-
- m_refershTimer->start();
-}
-
-void NetworkPlugin::deviceTypesChanged(const NetworkDevice::NetworkTypes &types)
-{
- Q_UNUSED(types)
-
- m_refershTimer->start();
-}
-
-void NetworkPlugin::refershDeviceItemVisible()
-{
- const NetworkDevice::NetworkTypes types = m_networkManager->types();
- const bool hasWiredDevice = types.testFlag(NetworkDevice::Wired);
- const bool hasWirelessDevice = types.testFlag(NetworkDevice::Wireless);
-
-// qDebug() << hasWiredDevice << hasWirelessDevice;
-
- if (m_settings.value(STATE_KEY, true).toBool())
- {
- for (auto item : m_deviceItemList)
- {
- switch (item->type())
- {
- case NetworkDevice::Wireless:
- m_proxyInter->itemAdded(this, item->path());
- break;
-
- case NetworkDevice::Wired:
- if (hasWiredDevice && (item->state() == NetworkDevice::Activated || !hasWirelessDevice))
- m_proxyInter->itemAdded(this, item->path());
- else
- m_proxyInter->itemRemoved(this, item->path());
- break;
-
- default:
- Q_UNREACHABLE();
- }
- }
- } else {
- for (auto item : m_deviceItemList)
- m_proxyInter->itemRemoved(this, item->path());
- }
-}
-
-void NetworkPlugin::contextMenuRequested()
-{
- DeviceItem *item = qobject_cast(sender());
- Q_ASSERT(item);
-
- m_proxyInter->requestContextMenu(this, item->path());
-}
diff --git a/plugins/network/networkplugin.h b/plugins/network/networkplugin.h
deleted file mode 100644
index 03c1d052a..000000000
--- a/plugins/network/networkplugin.h
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * Copyright (C) 2011 ~ 2018 Deepin Technology Co., Ltd.
- *
- * Author: sbw
- *
- * Maintainer: sbw
- *
- * 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 of the License, or
- * 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 .
- */
-
-#ifndef NETWORKPLUGIN_H
-#define NETWORKPLUGIN_H
-
-#include "pluginsiteminterface.h"
-#include "networkmanager.h"
-#include "item/deviceitem.h"
-
-#include
-
-class NetworkPlugin : public QObject, PluginsItemInterface
-{
- Q_OBJECT
- Q_INTERFACES(PluginsItemInterface)
- Q_PLUGIN_METADATA(IID "com.deepin.dock.PluginsItemInterface" FILE "network.json")
-
-public:
- explicit NetworkPlugin(QObject *parent = 0);
-
- const QString pluginName() const;
- const QString pluginDisplayName() const;
- void init(PluginProxyInterface *proxyInter);
- void invokedMenuItem(const QString &itemKey, const QString &menuId, const bool checked);
- void refershIcon(const QString &itemKey);
- void pluginStateSwitched();
- bool pluginIsAllowDisable() { return true; }
- bool pluginIsDisable();
- const QString itemCommand(const QString &itemKey);
- const QString itemContextMenu(const QString &itemKey);
- QWidget *itemWidget(const QString &itemKey);
- QWidget *itemTipsWidget(const QString &itemKey);
- QWidget *itemPopupApplet(const QString &itemKey);
-
- int itemSortKey(const QString &itemKey);
- void setSortKey(const QString &itemKey, const int order);
-
-private slots:
- void deviceAdded(const NetworkDevice &device);
- void deviceRemoved(const NetworkDevice &device);
- void networkStateChanged(const NetworkDevice::NetworkTypes &states);
- void deviceTypesChanged(const NetworkDevice::NetworkTypes &types);
- void refershDeviceItemVisible();
- void contextMenuRequested();
-
-private:
- QSettings m_settings;
- NetworkManager *m_networkManager;
- QTimer *m_refershTimer;
-
- QList m_deviceItemList;
-};
-
-#endif // NETWORKPLUGIN_H
diff --git a/plugins/network/resources.qrc b/plugins/network/resources.qrc
deleted file mode 100644
index 7b2260529..000000000
--- a/plugins/network/resources.qrc
+++ /dev/null
@@ -1,130 +0,0 @@
-
-
- resources/wired/wired-connected-small.svg
- resources/wired/wired-connected.svg
- resources/wired/wired-disconnected-small.svg
- resources/wired/wired-disconnected.svg
- resources/wired/network-wired-symbolic-connecting1.svg
- resources/wired/network-wired-symbolic-connecting2.svg
- resources/wired/network-wired-symbolic-connecting3.svg
- resources/wired/network-wired-symbolic-connecting4.svg
- resources/wired/network-wired-symbolic-connecting5.svg
- resources/wired/wired-error-small.svg
- resources/wired/wired-unaccessable-small.svg
-
-
- resources/wireless/wireless-0.svg
- resources/wireless/wireless-20.svg
- resources/wireless/wireless-40.svg
- resources/wireless/wireless-60.svg
- resources/wireless/wireless-80.svg
- resources/wireless/wireless-background.svg
- resources/wireless/wireless-disconnect.svg
- resources/wireless/wireless-0-symbolic.svg
- resources/wireless/wireless-20-symbolic.svg
- resources/wireless/wireless-40-symbolic.svg
- resources/wireless/wireless-60-symbolic.svg
- resources/wireless/wireless-80-symbolic.svg
- resources/wireless/wireless-disconnect-symbolic.svg
- resources/wireless/security.svg
- resources/wireless/refresh_press.svg
- resources/wireless/refresh_normal.svg
- resources/wireless/refresh_hover.svg
- resources/wireless/select.svg
- resources/wireless/disconnect_hover.svg
- resources/wireless/disconnect_press.svg
- resources/wireless/disconnect.svg
-
-
- resources/wireless/spinner14/Spinner01.png
- resources/wireless/spinner14/Spinner02.png
- resources/wireless/spinner14/Spinner03.png
- resources/wireless/spinner14/Spinner04.png
- resources/wireless/spinner14/Spinner05.png
- resources/wireless/spinner14/Spinner06.png
- resources/wireless/spinner14/Spinner07.png
- resources/wireless/spinner14/Spinner08.png
- resources/wireless/spinner14/Spinner09.png
- resources/wireless/spinner14/Spinner10.png
- resources/wireless/spinner14/Spinner11.png
- resources/wireless/spinner14/Spinner12.png
- resources/wireless/spinner14/Spinner13.png
- resources/wireless/spinner14/Spinner14.png
- resources/wireless/spinner14/Spinner15.png
- resources/wireless/spinner14/Spinner16.png
- resources/wireless/spinner14/Spinner17.png
- resources/wireless/spinner14/Spinner18.png
- resources/wireless/spinner14/Spinner19.png
- resources/wireless/spinner14/Spinner20.png
- resources/wireless/spinner14/Spinner21.png
- resources/wireless/spinner14/Spinner22.png
- resources/wireless/spinner14/Spinner23.png
- resources/wireless/spinner14/Spinner24.png
- resources/wireless/spinner14/Spinner25.png
- resources/wireless/spinner14/Spinner26.png
- resources/wireless/spinner14/Spinner27.png
- resources/wireless/spinner14/Spinner28.png
- resources/wireless/spinner14/Spinner29.png
- resources/wireless/spinner14/Spinner30.png
- resources/wireless/spinner14/Spinner31.png
- resources/wireless/spinner14/Spinner32.png
- resources/wireless/spinner14/Spinner33.png
- resources/wireless/spinner14/Spinner34.png
- resources/wireless/spinner14/Spinner35.png
- resources/wireless/spinner14/Spinner36.png
- resources/wireless/spinner14/Spinner37.png
- resources/wireless/spinner14/Spinner38.png
- resources/wireless/spinner14/Spinner39.png
- resources/wireless/spinner14/Spinner40.png
- resources/wireless/spinner14/Spinner41.png
- resources/wireless/spinner14/Spinner42.png
- resources/wireless/spinner14/Spinner43.png
- resources/wireless/spinner14/Spinner44.png
- resources/wireless/spinner14/Spinner45.png
- resources/wireless/spinner14/Spinner46.png
- resources/wireless/spinner14/Spinner47.png
- resources/wireless/spinner14/Spinner48.png
- resources/wireless/spinner14/Spinner49.png
- resources/wireless/spinner14/Spinner50.png
- resources/wireless/spinner14/Spinner51.png
- resources/wireless/spinner14/Spinner52.png
- resources/wireless/spinner14/Spinner53.png
- resources/wireless/spinner14/Spinner54.png
- resources/wireless/spinner14/Spinner55.png
- resources/wireless/spinner14/Spinner56.png
- resources/wireless/spinner14/Spinner57.png
- resources/wireless/spinner14/Spinner58.png
- resources/wireless/spinner14/Spinner59.png
- resources/wireless/spinner14/Spinner60.png
- resources/wireless/spinner14/Spinner61.png
- resources/wireless/spinner14/Spinner62.png
- resources/wireless/spinner14/Spinner63.png
- resources/wireless/spinner14/Spinner64.png
- resources/wireless/spinner14/Spinner65.png
- resources/wireless/spinner14/Spinner66.png
- resources/wireless/spinner14/Spinner67.png
- resources/wireless/spinner14/Spinner68.png
- resources/wireless/spinner14/Spinner69.png
- resources/wireless/spinner14/Spinner70.png
- resources/wireless/spinner14/Spinner71.png
- resources/wireless/spinner14/Spinner72.png
- resources/wireless/spinner14/Spinner73.png
- resources/wireless/spinner14/Spinner74.png
- resources/wireless/spinner14/Spinner75.png
- resources/wireless/spinner14/Spinner76.png
- resources/wireless/spinner14/Spinner77.png
- resources/wireless/spinner14/Spinner78.png
- resources/wireless/spinner14/Spinner79.png
- resources/wireless/spinner14/Spinner80.png
- resources/wireless/spinner14/Spinner81.png
- resources/wireless/spinner14/Spinner82.png
- resources/wireless/spinner14/Spinner83.png
- resources/wireless/spinner14/Spinner84.png
- resources/wireless/spinner14/Spinner85.png
- resources/wireless/spinner14/Spinner86.png
- resources/wireless/spinner14/Spinner87.png
- resources/wireless/spinner14/Spinner88.png
- resources/wireless/spinner14/Spinner89.png
- resources/wireless/spinner14/Spinner90.png
-
-
diff --git a/plugins/network/resources/wired/network-wired-symbolic-connecting1.svg b/plugins/network/resources/wired/network-wired-symbolic-connecting1.svg
deleted file mode 100644
index 4df47e0d9..000000000
--- a/plugins/network/resources/wired/network-wired-symbolic-connecting1.svg
+++ /dev/null
@@ -1,13 +0,0 @@
-
-
\ No newline at end of file
diff --git a/plugins/network/resources/wired/network-wired-symbolic-connecting2.svg b/plugins/network/resources/wired/network-wired-symbolic-connecting2.svg
deleted file mode 100644
index 0dc1af6f3..000000000
--- a/plugins/network/resources/wired/network-wired-symbolic-connecting2.svg
+++ /dev/null
@@ -1,13 +0,0 @@
-
-
\ No newline at end of file
diff --git a/plugins/network/resources/wired/network-wired-symbolic-connecting3.svg b/plugins/network/resources/wired/network-wired-symbolic-connecting3.svg
deleted file mode 100644
index 4c6ce3716..000000000
--- a/plugins/network/resources/wired/network-wired-symbolic-connecting3.svg
+++ /dev/null
@@ -1,13 +0,0 @@
-
-
\ No newline at end of file
diff --git a/plugins/network/resources/wired/network-wired-symbolic-connecting4.svg b/plugins/network/resources/wired/network-wired-symbolic-connecting4.svg
deleted file mode 100644
index 487a15eb7..000000000
--- a/plugins/network/resources/wired/network-wired-symbolic-connecting4.svg
+++ /dev/null
@@ -1,13 +0,0 @@
-
-
\ No newline at end of file
diff --git a/plugins/network/resources/wired/network-wired-symbolic-connecting5.svg b/plugins/network/resources/wired/network-wired-symbolic-connecting5.svg
deleted file mode 100644
index 1f76ba5ce..000000000
--- a/plugins/network/resources/wired/network-wired-symbolic-connecting5.svg
+++ /dev/null
@@ -1,13 +0,0 @@
-
-
\ No newline at end of file
diff --git a/plugins/network/resources/wired/wired-connected-small.svg b/plugins/network/resources/wired/wired-connected-small.svg
deleted file mode 100644
index a7cf30abd..000000000
--- a/plugins/network/resources/wired/wired-connected-small.svg
+++ /dev/null
@@ -1,20 +0,0 @@
-
-
-
-
diff --git a/plugins/network/resources/wired/wired-connected.svg b/plugins/network/resources/wired/wired-connected.svg
deleted file mode 100644
index 0e046d7ca..000000000
--- a/plugins/network/resources/wired/wired-connected.svg
+++ /dev/null
@@ -1,14 +0,0 @@
-
-
\ No newline at end of file
diff --git a/plugins/network/resources/wired/wired-disconnected-small.svg b/plugins/network/resources/wired/wired-disconnected-small.svg
deleted file mode 100644
index 09861ce16..000000000
--- a/plugins/network/resources/wired/wired-disconnected-small.svg
+++ /dev/null
@@ -1,20 +0,0 @@
-
-
-
-
diff --git a/plugins/network/resources/wired/wired-disconnected.svg b/plugins/network/resources/wired/wired-disconnected.svg
deleted file mode 100644
index 780ccbf0a..000000000
--- a/plugins/network/resources/wired/wired-disconnected.svg
+++ /dev/null
@@ -1,14 +0,0 @@
-
-
\ No newline at end of file
diff --git a/plugins/network/resources/wired/wired-error-small.svg b/plugins/network/resources/wired/wired-error-small.svg
deleted file mode 100644
index ac43ee72b..000000000
--- a/plugins/network/resources/wired/wired-error-small.svg
+++ /dev/null
@@ -1,40 +0,0 @@
-
-
-
-
diff --git a/plugins/network/resources/wired/wired-unaccessable-small.svg b/plugins/network/resources/wired/wired-unaccessable-small.svg
deleted file mode 100644
index bb9b3f971..000000000
--- a/plugins/network/resources/wired/wired-unaccessable-small.svg
+++ /dev/null
@@ -1,44 +0,0 @@
-
-
-
-
diff --git a/plugins/network/resources/wireless/disconnect.svg b/plugins/network/resources/wireless/disconnect.svg
deleted file mode 100644
index fde0f93f0..000000000
--- a/plugins/network/resources/wireless/disconnect.svg
+++ /dev/null
@@ -1,16 +0,0 @@
-
-
\ No newline at end of file
diff --git a/plugins/network/resources/wireless/disconnect_hover.svg b/plugins/network/resources/wireless/disconnect_hover.svg
deleted file mode 100644
index 22ce9769d..000000000
--- a/plugins/network/resources/wireless/disconnect_hover.svg
+++ /dev/null
@@ -1,16 +0,0 @@
-
-
\ No newline at end of file
diff --git a/plugins/network/resources/wireless/disconnect_press.svg b/plugins/network/resources/wireless/disconnect_press.svg
deleted file mode 100644
index afe99042b..000000000
--- a/plugins/network/resources/wireless/disconnect_press.svg
+++ /dev/null
@@ -1,16 +0,0 @@
-
-
\ No newline at end of file
diff --git a/plugins/network/resources/wireless/refresh_hover.svg b/plugins/network/resources/wireless/refresh_hover.svg
deleted file mode 100644
index 802c39536..000000000
--- a/plugins/network/resources/wireless/refresh_hover.svg
+++ /dev/null
@@ -1,15 +0,0 @@
-
-
\ No newline at end of file
diff --git a/plugins/network/resources/wireless/refresh_normal.svg b/plugins/network/resources/wireless/refresh_normal.svg
deleted file mode 100644
index 3d352f553..000000000
--- a/plugins/network/resources/wireless/refresh_normal.svg
+++ /dev/null
@@ -1,15 +0,0 @@
-
-
\ No newline at end of file
diff --git a/plugins/network/resources/wireless/refresh_press.svg b/plugins/network/resources/wireless/refresh_press.svg
deleted file mode 100644
index 14e61f879..000000000
--- a/plugins/network/resources/wireless/refresh_press.svg
+++ /dev/null
@@ -1,15 +0,0 @@
-
-
\ No newline at end of file
diff --git a/plugins/network/resources/wireless/security.svg b/plugins/network/resources/wireless/security.svg
deleted file mode 100644
index 3cfe4e7bb..000000000
--- a/plugins/network/resources/wireless/security.svg
+++ /dev/null
@@ -1,12 +0,0 @@
-
-
\ No newline at end of file
diff --git a/plugins/network/resources/wireless/select.svg b/plugins/network/resources/wireless/select.svg
deleted file mode 100644
index c71125b2e..000000000
--- a/plugins/network/resources/wireless/select.svg
+++ /dev/null
@@ -1,15 +0,0 @@
-
-
\ No newline at end of file
diff --git a/plugins/network/resources/wireless/spinner14/Spinner01.png b/plugins/network/resources/wireless/spinner14/Spinner01.png
deleted file mode 100644
index b2e1ac2b7..000000000
Binary files a/plugins/network/resources/wireless/spinner14/Spinner01.png and /dev/null differ
diff --git a/plugins/network/resources/wireless/spinner14/Spinner02.png b/plugins/network/resources/wireless/spinner14/Spinner02.png
deleted file mode 100644
index 96291dece..000000000
Binary files a/plugins/network/resources/wireless/spinner14/Spinner02.png and /dev/null differ
diff --git a/plugins/network/resources/wireless/spinner14/Spinner03.png b/plugins/network/resources/wireless/spinner14/Spinner03.png
deleted file mode 100644
index 7cfeadf1e..000000000
Binary files a/plugins/network/resources/wireless/spinner14/Spinner03.png and /dev/null differ
diff --git a/plugins/network/resources/wireless/spinner14/Spinner04.png b/plugins/network/resources/wireless/spinner14/Spinner04.png
deleted file mode 100644
index 639485b02..000000000
Binary files a/plugins/network/resources/wireless/spinner14/Spinner04.png and /dev/null differ
diff --git a/plugins/network/resources/wireless/spinner14/Spinner05.png b/plugins/network/resources/wireless/spinner14/Spinner05.png
deleted file mode 100644
index a9a65ae09..000000000
Binary files a/plugins/network/resources/wireless/spinner14/Spinner05.png and /dev/null differ
diff --git a/plugins/network/resources/wireless/spinner14/Spinner06.png b/plugins/network/resources/wireless/spinner14/Spinner06.png
deleted file mode 100644
index d45832f10..000000000
Binary files a/plugins/network/resources/wireless/spinner14/Spinner06.png and /dev/null differ
diff --git a/plugins/network/resources/wireless/spinner14/Spinner07.png b/plugins/network/resources/wireless/spinner14/Spinner07.png
deleted file mode 100644
index bc268048d..000000000
Binary files a/plugins/network/resources/wireless/spinner14/Spinner07.png and /dev/null differ
diff --git a/plugins/network/resources/wireless/spinner14/Spinner08.png b/plugins/network/resources/wireless/spinner14/Spinner08.png
deleted file mode 100644
index 0f9a5e2dc..000000000
Binary files a/plugins/network/resources/wireless/spinner14/Spinner08.png and /dev/null differ
diff --git a/plugins/network/resources/wireless/spinner14/Spinner09.png b/plugins/network/resources/wireless/spinner14/Spinner09.png
deleted file mode 100644
index 5a8209203..000000000
Binary files a/plugins/network/resources/wireless/spinner14/Spinner09.png and /dev/null differ
diff --git a/plugins/network/resources/wireless/spinner14/Spinner10.png b/plugins/network/resources/wireless/spinner14/Spinner10.png
deleted file mode 100644
index 0670f68f9..000000000
Binary files a/plugins/network/resources/wireless/spinner14/Spinner10.png and /dev/null differ
diff --git a/plugins/network/resources/wireless/spinner14/Spinner11.png b/plugins/network/resources/wireless/spinner14/Spinner11.png
deleted file mode 100644
index 9014f8b4d..000000000
Binary files a/plugins/network/resources/wireless/spinner14/Spinner11.png and /dev/null differ
diff --git a/plugins/network/resources/wireless/spinner14/Spinner12.png b/plugins/network/resources/wireless/spinner14/Spinner12.png
deleted file mode 100644
index 8234d08f1..000000000
Binary files a/plugins/network/resources/wireless/spinner14/Spinner12.png and /dev/null differ
diff --git a/plugins/network/resources/wireless/spinner14/Spinner13.png b/plugins/network/resources/wireless/spinner14/Spinner13.png
deleted file mode 100644
index 1a30fbce8..000000000
Binary files a/plugins/network/resources/wireless/spinner14/Spinner13.png and /dev/null differ
diff --git a/plugins/network/resources/wireless/spinner14/Spinner14.png b/plugins/network/resources/wireless/spinner14/Spinner14.png
deleted file mode 100644
index c110d6abb..000000000
Binary files a/plugins/network/resources/wireless/spinner14/Spinner14.png and /dev/null differ
diff --git a/plugins/network/resources/wireless/spinner14/Spinner15.png b/plugins/network/resources/wireless/spinner14/Spinner15.png
deleted file mode 100644
index 7ed071de2..000000000
Binary files a/plugins/network/resources/wireless/spinner14/Spinner15.png and /dev/null differ
diff --git a/plugins/network/resources/wireless/spinner14/Spinner16.png b/plugins/network/resources/wireless/spinner14/Spinner16.png
deleted file mode 100644
index ce8649fbb..000000000
Binary files a/plugins/network/resources/wireless/spinner14/Spinner16.png and /dev/null differ
diff --git a/plugins/network/resources/wireless/spinner14/Spinner17.png b/plugins/network/resources/wireless/spinner14/Spinner17.png
deleted file mode 100644
index 7eb564c65..000000000
Binary files a/plugins/network/resources/wireless/spinner14/Spinner17.png and /dev/null differ
diff --git a/plugins/network/resources/wireless/spinner14/Spinner18.png b/plugins/network/resources/wireless/spinner14/Spinner18.png
deleted file mode 100644
index ea4ad0de3..000000000
Binary files a/plugins/network/resources/wireless/spinner14/Spinner18.png and /dev/null differ
diff --git a/plugins/network/resources/wireless/spinner14/Spinner19.png b/plugins/network/resources/wireless/spinner14/Spinner19.png
deleted file mode 100644
index 81593d46b..000000000
Binary files a/plugins/network/resources/wireless/spinner14/Spinner19.png and /dev/null differ
diff --git a/plugins/network/resources/wireless/spinner14/Spinner20.png b/plugins/network/resources/wireless/spinner14/Spinner20.png
deleted file mode 100644
index efa6ae18a..000000000
Binary files a/plugins/network/resources/wireless/spinner14/Spinner20.png and /dev/null differ
diff --git a/plugins/network/resources/wireless/spinner14/Spinner21.png b/plugins/network/resources/wireless/spinner14/Spinner21.png
deleted file mode 100644
index 8333023ce..000000000
Binary files a/plugins/network/resources/wireless/spinner14/Spinner21.png and /dev/null differ
diff --git a/plugins/network/resources/wireless/spinner14/Spinner22.png b/plugins/network/resources/wireless/spinner14/Spinner22.png
deleted file mode 100644
index c8219ede7..000000000
Binary files a/plugins/network/resources/wireless/spinner14/Spinner22.png and /dev/null differ
diff --git a/plugins/network/resources/wireless/spinner14/Spinner23.png b/plugins/network/resources/wireless/spinner14/Spinner23.png
deleted file mode 100644
index 51010052d..000000000
Binary files a/plugins/network/resources/wireless/spinner14/Spinner23.png and /dev/null differ
diff --git a/plugins/network/resources/wireless/spinner14/Spinner24.png b/plugins/network/resources/wireless/spinner14/Spinner24.png
deleted file mode 100644
index 375450e5f..000000000
Binary files a/plugins/network/resources/wireless/spinner14/Spinner24.png and /dev/null differ
diff --git a/plugins/network/resources/wireless/spinner14/Spinner25.png b/plugins/network/resources/wireless/spinner14/Spinner25.png
deleted file mode 100644
index 4e6818ce6..000000000
Binary files a/plugins/network/resources/wireless/spinner14/Spinner25.png and /dev/null differ
diff --git a/plugins/network/resources/wireless/spinner14/Spinner26.png b/plugins/network/resources/wireless/spinner14/Spinner26.png
deleted file mode 100644
index 34f1a9c7a..000000000
Binary files a/plugins/network/resources/wireless/spinner14/Spinner26.png and /dev/null differ
diff --git a/plugins/network/resources/wireless/spinner14/Spinner27.png b/plugins/network/resources/wireless/spinner14/Spinner27.png
deleted file mode 100644
index b52301cc2..000000000
Binary files a/plugins/network/resources/wireless/spinner14/Spinner27.png and /dev/null differ
diff --git a/plugins/network/resources/wireless/spinner14/Spinner28.png b/plugins/network/resources/wireless/spinner14/Spinner28.png
deleted file mode 100644
index 497373444..000000000
Binary files a/plugins/network/resources/wireless/spinner14/Spinner28.png and /dev/null differ
diff --git a/plugins/network/resources/wireless/spinner14/Spinner29.png b/plugins/network/resources/wireless/spinner14/Spinner29.png
deleted file mode 100644
index aee02d365..000000000
Binary files a/plugins/network/resources/wireless/spinner14/Spinner29.png and /dev/null differ
diff --git a/plugins/network/resources/wireless/spinner14/Spinner30.png b/plugins/network/resources/wireless/spinner14/Spinner30.png
deleted file mode 100644
index 7ab37f3ec..000000000
Binary files a/plugins/network/resources/wireless/spinner14/Spinner30.png and /dev/null differ
diff --git a/plugins/network/resources/wireless/spinner14/Spinner31.png b/plugins/network/resources/wireless/spinner14/Spinner31.png
deleted file mode 100644
index ba34a0f79..000000000
Binary files a/plugins/network/resources/wireless/spinner14/Spinner31.png and /dev/null differ
diff --git a/plugins/network/resources/wireless/spinner14/Spinner32.png b/plugins/network/resources/wireless/spinner14/Spinner32.png
deleted file mode 100644
index 9d98949d9..000000000
Binary files a/plugins/network/resources/wireless/spinner14/Spinner32.png and /dev/null differ
diff --git a/plugins/network/resources/wireless/spinner14/Spinner33.png b/plugins/network/resources/wireless/spinner14/Spinner33.png
deleted file mode 100644
index d20df2e09..000000000
Binary files a/plugins/network/resources/wireless/spinner14/Spinner33.png and /dev/null differ
diff --git a/plugins/network/resources/wireless/spinner14/Spinner34.png b/plugins/network/resources/wireless/spinner14/Spinner34.png
deleted file mode 100644
index d7be3789c..000000000
Binary files a/plugins/network/resources/wireless/spinner14/Spinner34.png and /dev/null differ
diff --git a/plugins/network/resources/wireless/spinner14/Spinner35.png b/plugins/network/resources/wireless/spinner14/Spinner35.png
deleted file mode 100644
index 817553418..000000000
Binary files a/plugins/network/resources/wireless/spinner14/Spinner35.png and /dev/null differ
diff --git a/plugins/network/resources/wireless/spinner14/Spinner36.png b/plugins/network/resources/wireless/spinner14/Spinner36.png
deleted file mode 100644
index fb43e8748..000000000
Binary files a/plugins/network/resources/wireless/spinner14/Spinner36.png and /dev/null differ
diff --git a/plugins/network/resources/wireless/spinner14/Spinner37.png b/plugins/network/resources/wireless/spinner14/Spinner37.png
deleted file mode 100644
index 8fcb0b2b4..000000000
Binary files a/plugins/network/resources/wireless/spinner14/Spinner37.png and /dev/null differ
diff --git a/plugins/network/resources/wireless/spinner14/Spinner38.png b/plugins/network/resources/wireless/spinner14/Spinner38.png
deleted file mode 100644
index 6e85f11bb..000000000
Binary files a/plugins/network/resources/wireless/spinner14/Spinner38.png and /dev/null differ
diff --git a/plugins/network/resources/wireless/spinner14/Spinner39.png b/plugins/network/resources/wireless/spinner14/Spinner39.png
deleted file mode 100644
index 35308a9c7..000000000
Binary files a/plugins/network/resources/wireless/spinner14/Spinner39.png and /dev/null differ
diff --git a/plugins/network/resources/wireless/spinner14/Spinner40.png b/plugins/network/resources/wireless/spinner14/Spinner40.png
deleted file mode 100644
index 8835eb199..000000000
Binary files a/plugins/network/resources/wireless/spinner14/Spinner40.png and /dev/null differ
diff --git a/plugins/network/resources/wireless/spinner14/Spinner41.png b/plugins/network/resources/wireless/spinner14/Spinner41.png
deleted file mode 100644
index 2ab5b2b3e..000000000
Binary files a/plugins/network/resources/wireless/spinner14/Spinner41.png and /dev/null differ
diff --git a/plugins/network/resources/wireless/spinner14/Spinner42.png b/plugins/network/resources/wireless/spinner14/Spinner42.png
deleted file mode 100644
index 4e9b6184f..000000000
Binary files a/plugins/network/resources/wireless/spinner14/Spinner42.png and /dev/null differ
diff --git a/plugins/network/resources/wireless/spinner14/Spinner43.png b/plugins/network/resources/wireless/spinner14/Spinner43.png
deleted file mode 100644
index 211c1d4c5..000000000
Binary files a/plugins/network/resources/wireless/spinner14/Spinner43.png and /dev/null differ
diff --git a/plugins/network/resources/wireless/spinner14/Spinner44.png b/plugins/network/resources/wireless/spinner14/Spinner44.png
deleted file mode 100644
index b579e835e..000000000
Binary files a/plugins/network/resources/wireless/spinner14/Spinner44.png and /dev/null differ
diff --git a/plugins/network/resources/wireless/spinner14/Spinner45.png b/plugins/network/resources/wireless/spinner14/Spinner45.png
deleted file mode 100644
index 431883e8f..000000000
Binary files a/plugins/network/resources/wireless/spinner14/Spinner45.png and /dev/null differ
diff --git a/plugins/network/resources/wireless/spinner14/Spinner46.png b/plugins/network/resources/wireless/spinner14/Spinner46.png
deleted file mode 100644
index fc681afa0..000000000
Binary files a/plugins/network/resources/wireless/spinner14/Spinner46.png and /dev/null differ
diff --git a/plugins/network/resources/wireless/spinner14/Spinner47.png b/plugins/network/resources/wireless/spinner14/Spinner47.png
deleted file mode 100644
index 267ed5c9c..000000000
Binary files a/plugins/network/resources/wireless/spinner14/Spinner47.png and /dev/null differ
diff --git a/plugins/network/resources/wireless/spinner14/Spinner48.png b/plugins/network/resources/wireless/spinner14/Spinner48.png
deleted file mode 100644
index 8027bcd8b..000000000
Binary files a/plugins/network/resources/wireless/spinner14/Spinner48.png and /dev/null differ
diff --git a/plugins/network/resources/wireless/spinner14/Spinner49.png b/plugins/network/resources/wireless/spinner14/Spinner49.png
deleted file mode 100644
index 1f74cf5d3..000000000
Binary files a/plugins/network/resources/wireless/spinner14/Spinner49.png and /dev/null differ
diff --git a/plugins/network/resources/wireless/spinner14/Spinner50.png b/plugins/network/resources/wireless/spinner14/Spinner50.png
deleted file mode 100644
index 3470e9f7f..000000000
Binary files a/plugins/network/resources/wireless/spinner14/Spinner50.png and /dev/null differ
diff --git a/plugins/network/resources/wireless/spinner14/Spinner51.png b/plugins/network/resources/wireless/spinner14/Spinner51.png
deleted file mode 100644
index 86cbe0e00..000000000
Binary files a/plugins/network/resources/wireless/spinner14/Spinner51.png and /dev/null differ
diff --git a/plugins/network/resources/wireless/spinner14/Spinner52.png b/plugins/network/resources/wireless/spinner14/Spinner52.png
deleted file mode 100644
index c80d234fd..000000000
Binary files a/plugins/network/resources/wireless/spinner14/Spinner52.png and /dev/null differ
diff --git a/plugins/network/resources/wireless/spinner14/Spinner53.png b/plugins/network/resources/wireless/spinner14/Spinner53.png
deleted file mode 100644
index 51d84493d..000000000
Binary files a/plugins/network/resources/wireless/spinner14/Spinner53.png and /dev/null differ
diff --git a/plugins/network/resources/wireless/spinner14/Spinner54.png b/plugins/network/resources/wireless/spinner14/Spinner54.png
deleted file mode 100644
index 5b9141471..000000000
Binary files a/plugins/network/resources/wireless/spinner14/Spinner54.png and /dev/null differ
diff --git a/plugins/network/resources/wireless/spinner14/Spinner55.png b/plugins/network/resources/wireless/spinner14/Spinner55.png
deleted file mode 100644
index 307fd8888..000000000
Binary files a/plugins/network/resources/wireless/spinner14/Spinner55.png and /dev/null differ
diff --git a/plugins/network/resources/wireless/spinner14/Spinner56.png b/plugins/network/resources/wireless/spinner14/Spinner56.png
deleted file mode 100644
index e82720c5d..000000000
Binary files a/plugins/network/resources/wireless/spinner14/Spinner56.png and /dev/null differ
diff --git a/plugins/network/resources/wireless/spinner14/Spinner57.png b/plugins/network/resources/wireless/spinner14/Spinner57.png
deleted file mode 100644
index 6a383a129..000000000
Binary files a/plugins/network/resources/wireless/spinner14/Spinner57.png and /dev/null differ
diff --git a/plugins/network/resources/wireless/spinner14/Spinner58.png b/plugins/network/resources/wireless/spinner14/Spinner58.png
deleted file mode 100644
index 60a39cbb9..000000000
Binary files a/plugins/network/resources/wireless/spinner14/Spinner58.png and /dev/null differ
diff --git a/plugins/network/resources/wireless/spinner14/Spinner59.png b/plugins/network/resources/wireless/spinner14/Spinner59.png
deleted file mode 100644
index bed30374e..000000000
Binary files a/plugins/network/resources/wireless/spinner14/Spinner59.png and /dev/null differ
diff --git a/plugins/network/resources/wireless/spinner14/Spinner60.png b/plugins/network/resources/wireless/spinner14/Spinner60.png
deleted file mode 100644
index 24ea1db8a..000000000
Binary files a/plugins/network/resources/wireless/spinner14/Spinner60.png and /dev/null differ
diff --git a/plugins/network/resources/wireless/spinner14/Spinner61.png b/plugins/network/resources/wireless/spinner14/Spinner61.png
deleted file mode 100644
index 1647134aa..000000000
Binary files a/plugins/network/resources/wireless/spinner14/Spinner61.png and /dev/null differ
diff --git a/plugins/network/resources/wireless/spinner14/Spinner62.png b/plugins/network/resources/wireless/spinner14/Spinner62.png
deleted file mode 100644
index 09f6020d7..000000000
Binary files a/plugins/network/resources/wireless/spinner14/Spinner62.png and /dev/null differ
diff --git a/plugins/network/resources/wireless/spinner14/Spinner63.png b/plugins/network/resources/wireless/spinner14/Spinner63.png
deleted file mode 100644
index 7809e9446..000000000
Binary files a/plugins/network/resources/wireless/spinner14/Spinner63.png and /dev/null differ
diff --git a/plugins/network/resources/wireless/spinner14/Spinner64.png b/plugins/network/resources/wireless/spinner14/Spinner64.png
deleted file mode 100644
index 8b177d7c3..000000000
Binary files a/plugins/network/resources/wireless/spinner14/Spinner64.png and /dev/null differ
diff --git a/plugins/network/resources/wireless/spinner14/Spinner65.png b/plugins/network/resources/wireless/spinner14/Spinner65.png
deleted file mode 100644
index c67300ce3..000000000
Binary files a/plugins/network/resources/wireless/spinner14/Spinner65.png and /dev/null differ
diff --git a/plugins/network/resources/wireless/spinner14/Spinner66.png b/plugins/network/resources/wireless/spinner14/Spinner66.png
deleted file mode 100644
index c780d4f71..000000000
Binary files a/plugins/network/resources/wireless/spinner14/Spinner66.png and /dev/null differ
diff --git a/plugins/network/resources/wireless/spinner14/Spinner67.png b/plugins/network/resources/wireless/spinner14/Spinner67.png
deleted file mode 100644
index 3226774a4..000000000
Binary files a/plugins/network/resources/wireless/spinner14/Spinner67.png and /dev/null differ
diff --git a/plugins/network/resources/wireless/spinner14/Spinner68.png b/plugins/network/resources/wireless/spinner14/Spinner68.png
deleted file mode 100644
index 51cdf72c5..000000000
Binary files a/plugins/network/resources/wireless/spinner14/Spinner68.png and /dev/null differ
diff --git a/plugins/network/resources/wireless/spinner14/Spinner69.png b/plugins/network/resources/wireless/spinner14/Spinner69.png
deleted file mode 100644
index ac926c2cb..000000000
Binary files a/plugins/network/resources/wireless/spinner14/Spinner69.png and /dev/null differ
diff --git a/plugins/network/resources/wireless/spinner14/Spinner70.png b/plugins/network/resources/wireless/spinner14/Spinner70.png
deleted file mode 100644
index d7b6d59f8..000000000
Binary files a/plugins/network/resources/wireless/spinner14/Spinner70.png and /dev/null differ
diff --git a/plugins/network/resources/wireless/spinner14/Spinner71.png b/plugins/network/resources/wireless/spinner14/Spinner71.png
deleted file mode 100644
index fb4d8abf1..000000000
Binary files a/plugins/network/resources/wireless/spinner14/Spinner71.png and /dev/null differ
diff --git a/plugins/network/resources/wireless/spinner14/Spinner72.png b/plugins/network/resources/wireless/spinner14/Spinner72.png
deleted file mode 100644
index 7b40b2ac3..000000000
Binary files a/plugins/network/resources/wireless/spinner14/Spinner72.png and /dev/null differ
diff --git a/plugins/network/resources/wireless/spinner14/Spinner73.png b/plugins/network/resources/wireless/spinner14/Spinner73.png
deleted file mode 100644
index 36bc2e074..000000000
Binary files a/plugins/network/resources/wireless/spinner14/Spinner73.png and /dev/null differ
diff --git a/plugins/network/resources/wireless/spinner14/Spinner74.png b/plugins/network/resources/wireless/spinner14/Spinner74.png
deleted file mode 100644
index d27ef9b66..000000000
Binary files a/plugins/network/resources/wireless/spinner14/Spinner74.png and /dev/null differ
diff --git a/plugins/network/resources/wireless/spinner14/Spinner75.png b/plugins/network/resources/wireless/spinner14/Spinner75.png
deleted file mode 100644
index 6c2dbe620..000000000
Binary files a/plugins/network/resources/wireless/spinner14/Spinner75.png and /dev/null differ
diff --git a/plugins/network/resources/wireless/spinner14/Spinner76.png b/plugins/network/resources/wireless/spinner14/Spinner76.png
deleted file mode 100644
index 868215519..000000000
Binary files a/plugins/network/resources/wireless/spinner14/Spinner76.png and /dev/null differ
diff --git a/plugins/network/resources/wireless/spinner14/Spinner77.png b/plugins/network/resources/wireless/spinner14/Spinner77.png
deleted file mode 100644
index d28437d8a..000000000
Binary files a/plugins/network/resources/wireless/spinner14/Spinner77.png and /dev/null differ
diff --git a/plugins/network/resources/wireless/spinner14/Spinner78.png b/plugins/network/resources/wireless/spinner14/Spinner78.png
deleted file mode 100644
index 3d549fb2f..000000000
Binary files a/plugins/network/resources/wireless/spinner14/Spinner78.png and /dev/null differ
diff --git a/plugins/network/resources/wireless/spinner14/Spinner79.png b/plugins/network/resources/wireless/spinner14/Spinner79.png
deleted file mode 100644
index cb455ae5d..000000000
Binary files a/plugins/network/resources/wireless/spinner14/Spinner79.png and /dev/null differ
diff --git a/plugins/network/resources/wireless/spinner14/Spinner80.png b/plugins/network/resources/wireless/spinner14/Spinner80.png
deleted file mode 100644
index 523f66815..000000000
Binary files a/plugins/network/resources/wireless/spinner14/Spinner80.png and /dev/null differ
diff --git a/plugins/network/resources/wireless/spinner14/Spinner81.png b/plugins/network/resources/wireless/spinner14/Spinner81.png
deleted file mode 100644
index 5ce1fd6e7..000000000
Binary files a/plugins/network/resources/wireless/spinner14/Spinner81.png and /dev/null differ
diff --git a/plugins/network/resources/wireless/spinner14/Spinner82.png b/plugins/network/resources/wireless/spinner14/Spinner82.png
deleted file mode 100644
index fd699d944..000000000
Binary files a/plugins/network/resources/wireless/spinner14/Spinner82.png and /dev/null differ
diff --git a/plugins/network/resources/wireless/spinner14/Spinner83.png b/plugins/network/resources/wireless/spinner14/Spinner83.png
deleted file mode 100644
index c9cda3e73..000000000
Binary files a/plugins/network/resources/wireless/spinner14/Spinner83.png and /dev/null differ
diff --git a/plugins/network/resources/wireless/spinner14/Spinner84.png b/plugins/network/resources/wireless/spinner14/Spinner84.png
deleted file mode 100644
index f2e5cb990..000000000
Binary files a/plugins/network/resources/wireless/spinner14/Spinner84.png and /dev/null differ
diff --git a/plugins/network/resources/wireless/spinner14/Spinner85.png b/plugins/network/resources/wireless/spinner14/Spinner85.png
deleted file mode 100644
index 318c09cae..000000000
Binary files a/plugins/network/resources/wireless/spinner14/Spinner85.png and /dev/null differ
diff --git a/plugins/network/resources/wireless/spinner14/Spinner86.png b/plugins/network/resources/wireless/spinner14/Spinner86.png
deleted file mode 100644
index d2adfe551..000000000
Binary files a/plugins/network/resources/wireless/spinner14/Spinner86.png and /dev/null differ
diff --git a/plugins/network/resources/wireless/spinner14/Spinner87.png b/plugins/network/resources/wireless/spinner14/Spinner87.png
deleted file mode 100644
index f2da2085b..000000000
Binary files a/plugins/network/resources/wireless/spinner14/Spinner87.png and /dev/null differ
diff --git a/plugins/network/resources/wireless/spinner14/Spinner88.png b/plugins/network/resources/wireless/spinner14/Spinner88.png
deleted file mode 100644
index 4b3924181..000000000
Binary files a/plugins/network/resources/wireless/spinner14/Spinner88.png and /dev/null differ
diff --git a/plugins/network/resources/wireless/spinner14/Spinner89.png b/plugins/network/resources/wireless/spinner14/Spinner89.png
deleted file mode 100644
index 94e22cda8..000000000
Binary files a/plugins/network/resources/wireless/spinner14/Spinner89.png and /dev/null differ
diff --git a/plugins/network/resources/wireless/spinner14/Spinner90.png b/plugins/network/resources/wireless/spinner14/Spinner90.png
deleted file mode 100644
index 814b87468..000000000
Binary files a/plugins/network/resources/wireless/spinner14/Spinner90.png and /dev/null differ
diff --git a/plugins/network/resources/wireless/wireless-0-symbolic.svg b/plugins/network/resources/wireless/wireless-0-symbolic.svg
deleted file mode 100644
index de52a5bd5..000000000
--- a/plugins/network/resources/wireless/wireless-0-symbolic.svg
+++ /dev/null
@@ -1,27 +0,0 @@
-
-
-
-
diff --git a/plugins/network/resources/wireless/wireless-0.svg b/plugins/network/resources/wireless/wireless-0.svg
deleted file mode 100644
index b7d094690..000000000
--- a/plugins/network/resources/wireless/wireless-0.svg
+++ /dev/null
@@ -1,15 +0,0 @@
-
-
\ No newline at end of file
diff --git a/plugins/network/resources/wireless/wireless-20-symbolic.svg b/plugins/network/resources/wireless/wireless-20-symbolic.svg
deleted file mode 100644
index b1b133602..000000000
--- a/plugins/network/resources/wireless/wireless-20-symbolic.svg
+++ /dev/null
@@ -1,27 +0,0 @@
-
-
-
-
diff --git a/plugins/network/resources/wireless/wireless-20.svg b/plugins/network/resources/wireless/wireless-20.svg
deleted file mode 100644
index 2622c854f..000000000
--- a/plugins/network/resources/wireless/wireless-20.svg
+++ /dev/null
@@ -1,15 +0,0 @@
-
-
\ No newline at end of file
diff --git a/plugins/network/resources/wireless/wireless-40-symbolic.svg b/plugins/network/resources/wireless/wireless-40-symbolic.svg
deleted file mode 100644
index e93447e2d..000000000
--- a/plugins/network/resources/wireless/wireless-40-symbolic.svg
+++ /dev/null
@@ -1,27 +0,0 @@
-
-
-
-
diff --git a/plugins/network/resources/wireless/wireless-40.svg b/plugins/network/resources/wireless/wireless-40.svg
deleted file mode 100644
index 8dfb6b036..000000000
--- a/plugins/network/resources/wireless/wireless-40.svg
+++ /dev/null
@@ -1,15 +0,0 @@
-
-
\ No newline at end of file
diff --git a/plugins/network/resources/wireless/wireless-60-symbolic.svg b/plugins/network/resources/wireless/wireless-60-symbolic.svg
deleted file mode 100644
index f9287496d..000000000
--- a/plugins/network/resources/wireless/wireless-60-symbolic.svg
+++ /dev/null
@@ -1,27 +0,0 @@
-
-
-
-
diff --git a/plugins/network/resources/wireless/wireless-60.svg b/plugins/network/resources/wireless/wireless-60.svg
deleted file mode 100644
index 7c8cfa65a..000000000
--- a/plugins/network/resources/wireless/wireless-60.svg
+++ /dev/null
@@ -1,15 +0,0 @@
-
-
\ No newline at end of file
diff --git a/plugins/network/resources/wireless/wireless-80-symbolic.svg b/plugins/network/resources/wireless/wireless-80-symbolic.svg
deleted file mode 100644
index 050bc1aee..000000000
--- a/plugins/network/resources/wireless/wireless-80-symbolic.svg
+++ /dev/null
@@ -1,29 +0,0 @@
-
-
-
-
diff --git a/plugins/network/resources/wireless/wireless-80.svg b/plugins/network/resources/wireless/wireless-80.svg
deleted file mode 100644
index 701826cf1..000000000
--- a/plugins/network/resources/wireless/wireless-80.svg
+++ /dev/null
@@ -1,15 +0,0 @@
-
-
\ No newline at end of file
diff --git a/plugins/network/resources/wireless/wireless-background.svg b/plugins/network/resources/wireless/wireless-background.svg
deleted file mode 100644
index ba17ed434..000000000
--- a/plugins/network/resources/wireless/wireless-background.svg
+++ /dev/null
@@ -1,18 +0,0 @@
-
-
\ No newline at end of file
diff --git a/plugins/network/resources/wireless/wireless-disconnect-symbolic.svg b/plugins/network/resources/wireless/wireless-disconnect-symbolic.svg
deleted file mode 100644
index f8c6010ad..000000000
--- a/plugins/network/resources/wireless/wireless-disconnect-symbolic.svg
+++ /dev/null
@@ -1,12 +0,0 @@
-
-
-
-
diff --git a/plugins/network/resources/wireless/wireless-disconnect.svg b/plugins/network/resources/wireless/wireless-disconnect.svg
deleted file mode 100644
index 724b3902a..000000000
--- a/plugins/network/resources/wireless/wireless-disconnect.svg
+++ /dev/null
@@ -1,14 +0,0 @@
-
-
\ No newline at end of file
diff --git a/plugins/network/util/imageutil.cpp b/plugins/network/util/imageutil.cpp
deleted file mode 100644
index 2ff32f629..000000000
--- a/plugins/network/util/imageutil.cpp
+++ /dev/null
@@ -1,38 +0,0 @@
-/*
- * Copyright (C) 2011 ~ 2018 Deepin Technology Co., Ltd.
- *
- * Author: sbw
- *
- * Maintainer: sbw
- *
- * 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 of the License, or
- * 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 .
- */
-
-#include "imageutil.h"
-
-#include
-
-const QPixmap ImageUtil::loadSvg(const QString &path, const int size)
-{
- QPixmap pixmap(size, size);
- QSvgRenderer renderer(path);
- pixmap.fill(Qt::transparent);
-
- QPainter painter;
- painter.begin(&pixmap);
- renderer.render(&painter);
- painter.end();
-
- return pixmap;
-}
diff --git a/plugins/network/util/imageutil.h b/plugins/network/util/imageutil.h
deleted file mode 100644
index 59c90c06d..000000000
--- a/plugins/network/util/imageutil.h
+++ /dev/null
@@ -1,34 +0,0 @@
-/*
- * Copyright (C) 2011 ~ 2018 Deepin Technology Co., Ltd.
- *
- * Author: sbw
- *
- * Maintainer: sbw
- *
- * 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 of the License, or
- * 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 .
- */
-
-#ifndef IMAGEUTIL_H
-#define IMAGEUTIL_H
-
-#include
-#include
-
-class ImageUtil
-{
-public:
- static const QPixmap loadSvg(const QString &path, const int size);
-};
-
-#endif // IMAGEUTIL_H