remove: old network plugin

Change-Id: I68e053d86af834c55f7f269107e3b4ae82891001
This commit is contained in:
listenerri 2018-07-05 13:40:31 +08:00
parent 6ec510ac12
commit 4be6d0a57c
Notes: gerrit 2018-07-05 22:25:31 +08:00
Verified+1: <jenkins@deepin.com>
Code-Review+2: hualet <mr.asianwang@gmail.com>
Submitted-by: listenerri <listenerri@gmail.com>
Submitted-at: Thu, 05 Jul 2018 22:25:31 +0800
Reviewed-on: https://cr.deepin.io/36408
Project: dde/dde-dock
Branch: refs/heads/master
153 changed files with 1 additions and 4149 deletions

View File

@ -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")

View File

@ -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)

View File

@ -1,129 +0,0 @@
<interface name="com.deepin.daemon.Network">
<method name="ActivateAccessPoint">
<arg type="s" direction="in"></arg>
<arg type="o" direction="in"></arg>
<arg type="o" direction="in"></arg>
<arg type="o" direction="out"></arg>
</method>
<method name="ActivateConnection">
<arg type="s" direction="in"></arg>
<arg type="o" direction="in"></arg>
<arg type="o" direction="out"></arg>
</method>
<method name="CancelSecret">
<arg type="s" direction="in"></arg>
<arg type="s" direction="in"></arg>
</method>
<method name="CreateConnection">
<arg type="s" direction="in"></arg>
<arg type="o" direction="in"></arg>
<arg type="o" direction="out"></arg>
</method>
<method name="CreateConnectionForAccessPoint">
<arg type="o" direction="in"></arg>
<arg type="o" direction="in"></arg>
<arg type="o" direction="out"></arg>
</method>
<method name="DeactivateConnection">
<arg type="s" direction="in"></arg>
</method>
<method name="DeleteConnection">
<arg type="s" direction="in"></arg>
</method>
<method name="DisconnectDevice">
<arg type="o" direction="in"></arg>
</method>
<method name="EditConnection">
<arg type="s" direction="in"></arg>
<arg type="o" direction="in"></arg>
<arg type="o" direction="out"></arg>
</method>
<method name="EnableDevice">
<arg type="o" direction="in"></arg>
<arg type="b" direction="in"></arg>
</method>
<method name="FeedSecret">
<arg type="s" direction="in"></arg>
<arg type="s" direction="in"></arg>
<arg type="s" direction="in"></arg>
<arg type="b" direction="in"></arg>
</method>
<method name="GetAccessPoints">
<arg type="o" direction="in"></arg>
<arg type="s" direction="out"></arg>
</method>
<method name="GetActiveConnectionInfo">
<arg type="s" direction="out"></arg>
</method>
<method name="GetAutoProxy">
<arg type="s" direction="out"></arg>
</method>
<method name="GetProxy">
<arg type="s" direction="in"></arg>
<arg type="s" direction="out"></arg>
<arg type="s" direction="out"></arg>
</method>
<method name="GetProxyIgnoreHosts">
<arg type="s" direction="out"></arg>
</method>
<method name="GetProxyMethod">
<arg type="s" direction="out"></arg>
</method>
<method name="GetSupportedConnectionTypes">
<arg type="as" direction="out"></arg>
</method>
<method name="GetWiredConnectionUuid">
<arg type="o" direction="in"></arg>
<arg type="s" direction="out"></arg>
</method>
<method name="IsDeviceEnabled">
<arg type="o" direction="in"></arg>
<arg type="b" direction="out"></arg>
</method>
<method name="SetAutoProxy">
<arg type="s" direction="in"></arg>
</method>
<method name="SetProxy">
<arg type="s" direction="in"></arg>
<arg type="s" direction="in"></arg>
<arg type="s" direction="in"></arg>
</method>
<method name="SetProxyIgnoreHosts">
<arg type="s" direction="in"></arg>
</method>
<method name="SetProxyMethod">
<arg type="s" direction="in"></arg>
</method>
<signal name="NeedSecrets">
<arg type="s"></arg>
<arg type="s"></arg>
<arg type="s"></arg>
<arg type="b"></arg>
</signal>
<signal name="NeedSecretsFinished">
<arg type="s"></arg>
<arg type="s"></arg>
</signal>
<signal name="AccessPointAdded">
<arg type="s"></arg>
<arg type="s"></arg>
</signal>
<signal name="AccessPointRemoved">
<arg type="s"></arg>
<arg type="s"></arg>
</signal>
<signal name="AccessPointPropertiesChanged">
<arg type="s"></arg>
<arg type="s"></arg>
</signal>
<signal name="DeviceEnabled">
<arg type="s"></arg>
<arg type="b"></arg>
</signal>
<property name="State" type="u" access="read"></property>
<property name="NetworkingEnabled" type="b" access="readwrite"></property>
<property name="VpnEnabled" type="b" access="readwrite"></property>
<property name="Devices" type="s" access="read"></property>
<property name="Connections" type="s" access="read"></property>
<property name="ActiveConnections" type="s" access="read"></property>
</interface>

View File

@ -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)));
}

View File

@ -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 <QtCore/QObject>
#include <QtCore/QByteArray>
#include <QtCore/QList>
#include <QtCore/QMap>
#include <QtCore/QString>
#include <QtCore/QStringList>
#include <QtCore/QVariant>
#include <QtDBus/QtDBus>
/*
* Proxy class for interface com.deepin.daemon.Network
*/
class DBusNetwork: public QDBusAbstractInterface
{
Q_OBJECT
Q_SLOT void __propertyChanged__(const QDBusMessage& msg)
{
QList<QVariant> 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<QVariantMap>(arguments.at(1).value<QDBusArgument>());
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<QDBusObjectPath> ActivateAccessPoint(const QString &in0, const QDBusObjectPath &in1, const QDBusObjectPath &in2)
{
QList<QVariant> argumentList;
argumentList << QVariant::fromValue(in0) << QVariant::fromValue(in1) << QVariant::fromValue(in2);
return asyncCallWithArgumentList(QStringLiteral("ActivateAccessPoint"), argumentList);
}
inline QDBusPendingReply<QDBusObjectPath> ActivateConnection(const QString &in0, const QDBusObjectPath &in1)
{
QList<QVariant> argumentList;
argumentList << QVariant::fromValue(in0) << QVariant::fromValue(in1);
return asyncCallWithArgumentList(QStringLiteral("ActivateConnection"), argumentList);
}
inline QDBusPendingReply<> CancelSecret(const QString &in0, const QString &in1)
{
QList<QVariant> argumentList;
argumentList << QVariant::fromValue(in0) << QVariant::fromValue(in1);
return asyncCallWithArgumentList(QStringLiteral("CancelSecret"), argumentList);
}
inline QDBusPendingReply<QDBusObjectPath> CreateConnection(const QString &in0, const QDBusObjectPath &in1)
{
QList<QVariant> argumentList;
argumentList << QVariant::fromValue(in0) << QVariant::fromValue(in1);
return asyncCallWithArgumentList(QStringLiteral("CreateConnection"), argumentList);
}
inline QDBusPendingReply<QDBusObjectPath> CreateConnectionForAccessPoint(const QDBusObjectPath &in0, const QDBusObjectPath &in1)
{
QList<QVariant> argumentList;
argumentList << QVariant::fromValue(in0) << QVariant::fromValue(in1);
return asyncCallWithArgumentList(QStringLiteral("CreateConnectionForAccessPoint"), argumentList);
}
inline QDBusPendingReply<> DeactivateConnection(const QString &in0)
{
QList<QVariant> argumentList;
argumentList << QVariant::fromValue(in0);
return asyncCallWithArgumentList(QStringLiteral("DeactivateConnection"), argumentList);
}
inline QDBusPendingReply<> DeleteConnection(const QString &in0)
{
QList<QVariant> argumentList;
argumentList << QVariant::fromValue(in0);
return asyncCallWithArgumentList(QStringLiteral("DeleteConnection"), argumentList);
}
inline QDBusPendingReply<> DisconnectDevice(const QDBusObjectPath &in0)
{
QList<QVariant> argumentList;
argumentList << QVariant::fromValue(in0);
return asyncCallWithArgumentList(QStringLiteral("DisconnectDevice"), argumentList);
}
inline QDBusPendingReply<QDBusObjectPath> EditConnection(const QString &in0, const QDBusObjectPath &in1)
{
QList<QVariant> argumentList;
argumentList << QVariant::fromValue(in0) << QVariant::fromValue(in1);
return asyncCallWithArgumentList(QStringLiteral("EditConnection"), argumentList);
}
inline QDBusPendingReply<> EnableDevice(const QDBusObjectPath &devPath, bool enable)
{
QList<QVariant> 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<QVariant> argumentList;
argumentList << QVariant::fromValue(in0) << QVariant::fromValue(in1) << QVariant::fromValue(in2) << QVariant::fromValue(in3);
return asyncCallWithArgumentList(QStringLiteral("FeedSecret"), argumentList);
}
inline QDBusPendingReply<QString> GetAccessPoints(const QDBusObjectPath &in0)
{
QList<QVariant> argumentList;
argumentList << QVariant::fromValue(in0);
return asyncCallWithArgumentList(QStringLiteral("GetAccessPoints"), argumentList);
}
inline QDBusPendingReply<QString> GetActiveConnectionInfo()
{
QList<QVariant> argumentList;
return asyncCallWithArgumentList(QStringLiteral("GetActiveConnectionInfo"), argumentList);
}
inline QDBusPendingReply<QString> GetAutoProxy()
{
QList<QVariant> argumentList;
return asyncCallWithArgumentList(QStringLiteral("GetAutoProxy"), argumentList);
}
inline QDBusPendingReply<QString, QString> GetProxy(const QString &in0)
{
QList<QVariant> argumentList;
argumentList << QVariant::fromValue(in0);
return asyncCallWithArgumentList(QStringLiteral("GetProxy"), argumentList);
}
inline QDBusReply<QString> GetProxy(const QString &in0, QString &out1)
{
QList<QVariant> 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<QString>(reply.arguments().at(1));
}
return reply;
}
inline QDBusPendingReply<QString> GetProxyIgnoreHosts()
{
QList<QVariant> argumentList;
return asyncCallWithArgumentList(QStringLiteral("GetProxyIgnoreHosts"), argumentList);
}
inline QDBusPendingReply<QString> GetProxyMethod()
{
QList<QVariant> argumentList;
return asyncCallWithArgumentList(QStringLiteral("GetProxyMethod"), argumentList);
}
inline QDBusPendingReply<QStringList> GetSupportedConnectionTypes()
{
QList<QVariant> argumentList;
return asyncCallWithArgumentList(QStringLiteral("GetSupportedConnectionTypes"), argumentList);
}
inline QDBusPendingReply<QString> GetWiredConnectionUuid(const QDBusObjectPath &in0)
{
QList<QVariant> argumentList;
argumentList << QVariant::fromValue(in0);
return asyncCallWithArgumentList(QStringLiteral("GetWiredConnectionUuid"), argumentList);
}
inline QDBusPendingReply<bool> IsDeviceEnabled(const QDBusObjectPath &in0)
{
QList<QVariant> argumentList;
argumentList << QVariant::fromValue(in0);
return asyncCallWithArgumentList(QStringLiteral("IsDeviceEnabled"), argumentList);
}
inline QDBusPendingReply<> SetAutoProxy(const QString &in0)
{
QList<QVariant> argumentList;
argumentList << QVariant::fromValue(in0);
return asyncCallWithArgumentList(QStringLiteral("SetAutoProxy"), argumentList);
}
inline QDBusPendingReply<> SetProxy(const QString &in0, const QString &in1, const QString &in2)
{
QList<QVariant> argumentList;
argumentList << QVariant::fromValue(in0) << QVariant::fromValue(in1) << QVariant::fromValue(in2);
return asyncCallWithArgumentList(QStringLiteral("SetProxy"), argumentList);
}
inline QDBusPendingReply<> SetProxyIgnoreHosts(const QString &in0)
{
QList<QVariant> argumentList;
argumentList << QVariant::fromValue(in0);
return asyncCallWithArgumentList(QStringLiteral("SetProxyIgnoreHosts"), argumentList);
}
inline QDBusPendingReply<> SetProxyMethod(const QString &in0)
{
QList<QVariant> argumentList;
argumentList << QVariant::fromValue(in0);
return asyncCallWithArgumentList(QStringLiteral("SetProxyMethod"), argumentList);
}
inline QDBusPendingReply<> RequestWirelessScan()
{
QList<QVariant> 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

View File

@ -1,103 +0,0 @@
/*
* Copyright (C) 2011 ~ 2018 Deepin Technology Co., Ltd.
*
* Author: sbw <sbw@sbw.so>
*
* Maintainer: sbw <sbw@sbw.so>
*
* 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 <http://www.gnu.org/licenses/>.
*/
#include "accesspoint.h"
#include <QDebug>
#include <QJsonDocument>
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();
}

View File

@ -1,57 +0,0 @@
/*
* Copyright (C) 2011 ~ 2018 Deepin Technology Co., Ltd.
*
* Author: sbw <sbw@sbw.so>
*
* Maintainer: sbw <sbw@sbw.so>
*
* 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 <http://www.gnu.org/licenses/>.
*/
#ifndef ACCESSPOINT_H
#define ACCESSPOINT_H
#include <QObject>
#include <QJsonObject>
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

View File

@ -1,173 +0,0 @@
/*
* Copyright (C) 2011 ~ 2018 Deepin Technology Co., Ltd.
*
* Author: sbw <sbw@sbw.so>
*
* Maintainer: sbw <sbw@sbw.so>
*
* 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 <http://www.gnu.org/licenses/>.
*/
#include "accesspointwidget.h"
#include "horizontalseperator.h"
#include <QHBoxLayout>
#include <QDebug>
#include <DSvgRenderer>
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);
}

View File

@ -1,73 +0,0 @@
/*
* Copyright (C) 2011 ~ 2018 Deepin Technology Co., Ltd.
*
* Author: sbw <sbw@sbw.so>
*
* Maintainer: sbw <sbw@sbw.so>
*
* 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 <http://www.gnu.org/licenses/>.
*/
#ifndef ACCESSPOINTWIDGET_H
#define ACCESSPOINTWIDGET_H
#include "accesspoint.h"
#include "networkdevice.h"
#include <QWidget>
#include <QLabel>
#include <QPushButton>
#include <QDBusObjectPath>
#include <dimagebutton.h>
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

View File

@ -1,119 +0,0 @@
/*
* Copyright (C) 2011 ~ 2018 Deepin Technology Co., Ltd.
*
* Author: sbw <sbw@sbw.so>
*
* Maintainer: sbw <sbw@sbw.so>
*
* 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 <http://www.gnu.org/licenses/>.
*/
#include "devicecontrolwidget.h"
#include "horizontalseperator.h"
#include <DHiDPIHelper>
#include <QTimer>
#include <QHBoxLayout>
#include <QDebug>
#include <QEvent>
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);
//}

View File

@ -1,62 +0,0 @@
/*
* Copyright (C) 2011 ~ 2018 Deepin Technology Co., Ltd.
*
* Author: sbw <sbw@sbw.so>
*
* Maintainer: sbw <sbw@sbw.so>
*
* 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 <http://www.gnu.org/licenses/>.
*/
#ifndef DEVICECONTROLWIDGET_H
#define DEVICECONTROLWIDGET_H
#include "horizontalseperator.h"
#include <QWidget>
#include <QLabel>
#include <dloadingindicator.h>
#include <dswitchbutton.h>
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

View File

@ -1,44 +0,0 @@
/*
* Copyright (C) 2011 ~ 2018 Deepin Technology Co., Ltd.
*
* Author: sbw <sbw@sbw.so>
*
* Maintainer: sbw <sbw@sbw.so>
*
* 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 <http://www.gnu.org/licenses/>.
*/
#include "horizontalseperator.h"
#include <QPainter>
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);
}

View File

@ -1,43 +0,0 @@
/*
* Copyright (C) 2011 ~ 2018 Deepin Technology Co., Ltd.
*
* Author: sbw <sbw@sbw.so>
*
* Maintainer: sbw <sbw@sbw.so>
*
* 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 <http://www.gnu.org/licenses/>.
*/
#ifndef HORIZONTALSEPERATOR_H
#define HORIZONTALSEPERATOR_H
#include <QWidget>
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

View File

@ -1,519 +0,0 @@
/*
* Copyright (C) 2011 ~ 2018 Deepin Technology Co., Ltd.
*
* Author: sbw <sbw@sbw.so>
*
* Maintainer: sbw <sbw@sbw.so>
*
* 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 <http://www.gnu.org/licenses/>.
*/
#include "wirelessapplet.h"
#include "accesspointwidget.h"
#include <QJsonDocument>
#include <QScreen>
#include <QDebug>
#include <QGuiApplication>
#include <dinputdialog.h>
#include <QScrollBar>
DWIDGET_USE_NAMESPACE
#define WIDTH 300
#define MAX_HEIGHT 300
#define ITEM_HEIGHT 30
WirelessList::WirelessList(const QSet<NetworkDevice>::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<int, int>(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<void (QTimer::*)()>(&QTimer::start));
connect(this, &WirelessList::wirelessStateChanged, m_updateAPTimer, static_cast<void (QTimer::*)()>(&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<AccessPoint>());
// 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 <font color=\"#faca57\">%1</font>").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<AccessPointWidget*>(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();
}

View File

@ -1,106 +0,0 @@
/*
* Copyright (C) 2011 ~ 2018 Deepin Technology Co., Ltd.
*
* Author: sbw <sbw@sbw.so>
*
* Maintainer: sbw <sbw@sbw.so>
*
* 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 <http://www.gnu.org/licenses/>.
*/
#ifndef WIRELESSAPPLET_H
#define WIRELESSAPPLET_H
#include "devicecontrolwidget.h"
#include "accesspoint.h"
#include "../../networkdevice.h"
#include "../../dbus/dbusnetwork.h"
#include <QScrollArea>
#include <QVBoxLayout>
#include <QList>
#include <QTimer>
#include <QCheckBox>
#include <dpicturesequenceview.h>
#include <dinputdialog.h>
DWIDGET_USE_NAMESPACE
class AccessPointWidget;
class WirelessList : public QScrollArea
{
Q_OBJECT
public:
explicit WirelessList(const QSet<NetworkDevice>::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<AccessPoint> m_apList;
QList<AccessPointWidget*> 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

View File

@ -1,106 +0,0 @@
/*
* Copyright (C) 2011 ~ 2018 Deepin Technology Co., Ltd.
*
* Author: sbw <sbw@sbw.so>
*
* Maintainer: sbw <sbw@sbw.so>
*
* 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 <http://www.gnu.org/licenses/>.
*/
#include "deviceitem.h"
#include <DDBusSender>
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<QVariant> items;
items.reserve(2);
QMap<QString, QVariant> 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<QString, QVariant> settings;
settings["itemId"] = "settings";
settings["itemText"] = tr("Network settings");
settings["isActive"] = true;
items.push_back(settings);
QMap<QString, QVariant> 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;
}

View File

@ -1,61 +0,0 @@
/*
* Copyright (C) 2011 ~ 2018 Deepin Technology Co., Ltd.
*
* Author: sbw <sbw@sbw.so>
*
* Maintainer: sbw <sbw@sbw.so>
*
* 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 <http://www.gnu.org/licenses/>.
*/
#ifndef DEVICEITEM_H
#define DEVICEITEM_H
#include "networkmanager.h"
#include <QWidget>
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

View File

@ -1,191 +0,0 @@
/*
* Copyright (C) 2011 ~ 2018 Deepin Technology Co., Ltd.
*
* Author: sbw <sbw@sbw.so>
*
* Maintainer: sbw <sbw@sbw.so>
*
* 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 <http://www.gnu.org/licenses/>.
*/
#include "constants.h"
#include "wireditem.h"
#include "util/imageutil.h"
#include <QPainter>
#include <QMouseEvent>
#include <QIcon>
#include <QApplication>
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<void (QTimer::*)()>(&QTimer::start));
connect(m_networkManager, &NetworkManager::deviceChanged, this, &WiredItem::deviceStateChanged);
connect(m_networkManager, &NetworkManager::networkStateChanged, m_delayTimer, static_cast<void (QTimer::*)()>(&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<Dock::DisplayMode>();
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();
}

View File

@ -1,62 +0,0 @@
/*
* Copyright (C) 2011 ~ 2018 Deepin Technology Co., Ltd.
*
* Author: sbw <sbw@sbw.so>
*
* Maintainer: sbw <sbw@sbw.so>
*
* 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 <http://www.gnu.org/licenses/>.
*/
#ifndef WIREDITEM_H
#define WIREDITEM_H
#include "deviceitem.h"
#include <QWidget>
#include <QLabel>
#include <QTimer>
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

View File

@ -1,226 +0,0 @@
/*
* Copyright (C) 2011 ~ 2018 Deepin Technology Co., Ltd.
*
* Author: sbw <sbw@sbw.so>
*
* Maintainer: sbw <sbw@sbw.so>
*
* 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 <http://www.gnu.org/licenses/>.
*/
#include "wirelessitem.h"
#include "util/imageutil.h"
#include <QPainter>
#include <QMouseEvent>
#include <QApplication>
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<void (WirelessItem::*)()>(&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<Dock::DisplayMode>();
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<void (WirelessItem::*)()>(&WirelessItem::update));
connect(m_APList, &WirelessList::wirelessStateChanged, this, static_cast<void (WirelessItem::*)()>(&WirelessItem::update));
}
void WirelessItem::adjustHeight()
{
m_wirelessApplet->setFixedHeight(m_APList->height() + m_APList->controlPanel()->height());
}
void WirelessItem::refreshIcon()
{
update();
}

View File

@ -1,70 +0,0 @@
/*
* Copyright (C) 2011 ~ 2018 Deepin Technology Co., Ltd.
*
* Author: sbw <sbw@sbw.so>
*
* Maintainer: sbw <sbw@sbw.so>
*
* 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 <http://www.gnu.org/licenses/>.
*/
#ifndef WIRELESSITEM_H
#define WIRELESSITEM_H
#include "constants.h"
#include "deviceitem.h"
#include "applet/wirelessapplet.h"
#include <QHash>
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<QString, QPixmap> m_icons;
QTimer *m_refershTimer;
QWidget *m_wirelessApplet;
QLabel *m_wirelessPopup;
WirelessList *m_APList;
};
#endif // WIRELESSITEM_H

View File

@ -1,3 +0,0 @@
{
"api": "1.0"
}

View File

@ -1,98 +0,0 @@
/*
* Copyright (C) 2011 ~ 2018 Deepin Technology Co., Ltd.
*
* Author: sbw <sbw@sbw.so>
*
* Maintainer: sbw <sbw@sbw.so>
*
* 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 <http://www.gnu.org/licenses/>.
*/
#include "networkdevice.h"
#include <QDebug>
#include <QJsonObject>
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;
}

View File

@ -1,89 +0,0 @@
/*
* Copyright (C) 2011 ~ 2018 Deepin Technology Co., Ltd.
*
* Author: sbw <sbw@sbw.so>
*
* Maintainer: sbw <sbw@sbw.so>
*
* 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 <http://www.gnu.org/licenses/>.
*/
#ifndef NETWORKDEVICE_H
#define NETWORKDEVICE_H
#include "networkdevice.h"
#include <QUuid>
#include <QDBusObjectPath>
#include <QJsonObject>
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

View File

@ -1,256 +0,0 @@
/*
* Copyright (C) 2011 ~ 2018 Deepin Technology Co., Ltd.
*
* Author: sbw <sbw@sbw.so>
*
* Maintainer: sbw <sbw@sbw.so>
*
* 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 <http://www.gnu.org/licenses/>.
*/
#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<NetworkDevice> NetworkManager::deviceList() const
{
return m_deviceSet;
}
const QSet<QUuid> 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<NetworkDevice>::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<NetworkDevice> 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<NetworkDevice> 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<QUuid> 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<QUuid> 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<QString> 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;
}

View File

@ -1,97 +0,0 @@
/*
* Copyright (C) 2011 ~ 2018 Deepin Technology Co., Ltd.
*
* Author: sbw <sbw@sbw.so>
*
* Maintainer: sbw <sbw@sbw.so>
*
* 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 <http://www.gnu.org/licenses/>.
*/
#ifndef NETWORKMANAGER_H
#define NETWORKMANAGER_H
#include "dbus/dbusnetwork.h"
#include "networkdevice.h"
#include <QJsonObject>
#include <QJsonDocument>
#include <QJsonArray>
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<NetworkDevice> deviceList() const;
const QSet<QUuid> activeConnSet() const;
const QSet<QString> 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<NetworkDevice>::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<NetworkDevice> m_deviceSet;
QSet<QUuid> m_activeConnSet;
QSet<QString> m_activeDeviceSet;
static NetworkManager *INSTANCE;
};
#endif // NETWORKMANAGER_H

View File

@ -1,244 +0,0 @@
/*
* Copyright (C) 2011 ~ 2018 Deepin Technology Co., Ltd.
*
* Author: sbw <sbw@sbw.so>
*
* Maintainer: sbw <sbw@sbw.so>
*
* 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 <http://www.gnu.org/licenses/>.
*/
#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<void (QTimer::*)(void)>(&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<DeviceItem *>(sender());
Q_ASSERT(item);
m_proxyInter->requestContextMenu(this, item->path());
}

View File

@ -1,73 +0,0 @@
/*
* Copyright (C) 2011 ~ 2018 Deepin Technology Co., Ltd.
*
* Author: sbw <sbw@sbw.so>
*
* Maintainer: sbw <sbw@sbw.so>
*
* 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 <http://www.gnu.org/licenses/>.
*/
#ifndef NETWORKPLUGIN_H
#define NETWORKPLUGIN_H
#include "pluginsiteminterface.h"
#include "networkmanager.h"
#include "item/deviceitem.h"
#include <QSettings>
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<DeviceItem *> m_deviceItemList;
};
#endif // NETWORKPLUGIN_H

View File

@ -1,130 +0,0 @@
<RCC>
<qresource prefix="/wired">
<file>resources/wired/wired-connected-small.svg</file>
<file>resources/wired/wired-connected.svg</file>
<file>resources/wired/wired-disconnected-small.svg</file>
<file>resources/wired/wired-disconnected.svg</file>
<file>resources/wired/network-wired-symbolic-connecting1.svg</file>
<file>resources/wired/network-wired-symbolic-connecting2.svg</file>
<file>resources/wired/network-wired-symbolic-connecting3.svg</file>
<file>resources/wired/network-wired-symbolic-connecting4.svg</file>
<file>resources/wired/network-wired-symbolic-connecting5.svg</file>
<file>resources/wired/wired-error-small.svg</file>
<file>resources/wired/wired-unaccessable-small.svg</file>
</qresource>
<qresource prefix="/wireless">
<file>resources/wireless/wireless-0.svg</file>
<file>resources/wireless/wireless-20.svg</file>
<file>resources/wireless/wireless-40.svg</file>
<file>resources/wireless/wireless-60.svg</file>
<file>resources/wireless/wireless-80.svg</file>
<file>resources/wireless/wireless-background.svg</file>
<file>resources/wireless/wireless-disconnect.svg</file>
<file>resources/wireless/wireless-0-symbolic.svg</file>
<file>resources/wireless/wireless-20-symbolic.svg</file>
<file>resources/wireless/wireless-40-symbolic.svg</file>
<file>resources/wireless/wireless-60-symbolic.svg</file>
<file>resources/wireless/wireless-80-symbolic.svg</file>
<file>resources/wireless/wireless-disconnect-symbolic.svg</file>
<file>resources/wireless/security.svg</file>
<file>resources/wireless/refresh_press.svg</file>
<file>resources/wireless/refresh_normal.svg</file>
<file>resources/wireless/refresh_hover.svg</file>
<file>resources/wireless/select.svg</file>
<file>resources/wireless/disconnect_hover.svg</file>
<file>resources/wireless/disconnect_press.svg</file>
<file>resources/wireless/disconnect.svg</file>
</qresource>
<qresource prefix="/wireless/indicator">
<file>resources/wireless/spinner14/Spinner01.png</file>
<file>resources/wireless/spinner14/Spinner02.png</file>
<file>resources/wireless/spinner14/Spinner03.png</file>
<file>resources/wireless/spinner14/Spinner04.png</file>
<file>resources/wireless/spinner14/Spinner05.png</file>
<file>resources/wireless/spinner14/Spinner06.png</file>
<file>resources/wireless/spinner14/Spinner07.png</file>
<file>resources/wireless/spinner14/Spinner08.png</file>
<file>resources/wireless/spinner14/Spinner09.png</file>
<file>resources/wireless/spinner14/Spinner10.png</file>
<file>resources/wireless/spinner14/Spinner11.png</file>
<file>resources/wireless/spinner14/Spinner12.png</file>
<file>resources/wireless/spinner14/Spinner13.png</file>
<file>resources/wireless/spinner14/Spinner14.png</file>
<file>resources/wireless/spinner14/Spinner15.png</file>
<file>resources/wireless/spinner14/Spinner16.png</file>
<file>resources/wireless/spinner14/Spinner17.png</file>
<file>resources/wireless/spinner14/Spinner18.png</file>
<file>resources/wireless/spinner14/Spinner19.png</file>
<file>resources/wireless/spinner14/Spinner20.png</file>
<file>resources/wireless/spinner14/Spinner21.png</file>
<file>resources/wireless/spinner14/Spinner22.png</file>
<file>resources/wireless/spinner14/Spinner23.png</file>
<file>resources/wireless/spinner14/Spinner24.png</file>
<file>resources/wireless/spinner14/Spinner25.png</file>
<file>resources/wireless/spinner14/Spinner26.png</file>
<file>resources/wireless/spinner14/Spinner27.png</file>
<file>resources/wireless/spinner14/Spinner28.png</file>
<file>resources/wireless/spinner14/Spinner29.png</file>
<file>resources/wireless/spinner14/Spinner30.png</file>
<file>resources/wireless/spinner14/Spinner31.png</file>
<file>resources/wireless/spinner14/Spinner32.png</file>
<file>resources/wireless/spinner14/Spinner33.png</file>
<file>resources/wireless/spinner14/Spinner34.png</file>
<file>resources/wireless/spinner14/Spinner35.png</file>
<file>resources/wireless/spinner14/Spinner36.png</file>
<file>resources/wireless/spinner14/Spinner37.png</file>
<file>resources/wireless/spinner14/Spinner38.png</file>
<file>resources/wireless/spinner14/Spinner39.png</file>
<file>resources/wireless/spinner14/Spinner40.png</file>
<file>resources/wireless/spinner14/Spinner41.png</file>
<file>resources/wireless/spinner14/Spinner42.png</file>
<file>resources/wireless/spinner14/Spinner43.png</file>
<file>resources/wireless/spinner14/Spinner44.png</file>
<file>resources/wireless/spinner14/Spinner45.png</file>
<file>resources/wireless/spinner14/Spinner46.png</file>
<file>resources/wireless/spinner14/Spinner47.png</file>
<file>resources/wireless/spinner14/Spinner48.png</file>
<file>resources/wireless/spinner14/Spinner49.png</file>
<file>resources/wireless/spinner14/Spinner50.png</file>
<file>resources/wireless/spinner14/Spinner51.png</file>
<file>resources/wireless/spinner14/Spinner52.png</file>
<file>resources/wireless/spinner14/Spinner53.png</file>
<file>resources/wireless/spinner14/Spinner54.png</file>
<file>resources/wireless/spinner14/Spinner55.png</file>
<file>resources/wireless/spinner14/Spinner56.png</file>
<file>resources/wireless/spinner14/Spinner57.png</file>
<file>resources/wireless/spinner14/Spinner58.png</file>
<file>resources/wireless/spinner14/Spinner59.png</file>
<file>resources/wireless/spinner14/Spinner60.png</file>
<file>resources/wireless/spinner14/Spinner61.png</file>
<file>resources/wireless/spinner14/Spinner62.png</file>
<file>resources/wireless/spinner14/Spinner63.png</file>
<file>resources/wireless/spinner14/Spinner64.png</file>
<file>resources/wireless/spinner14/Spinner65.png</file>
<file>resources/wireless/spinner14/Spinner66.png</file>
<file>resources/wireless/spinner14/Spinner67.png</file>
<file>resources/wireless/spinner14/Spinner68.png</file>
<file>resources/wireless/spinner14/Spinner69.png</file>
<file>resources/wireless/spinner14/Spinner70.png</file>
<file>resources/wireless/spinner14/Spinner71.png</file>
<file>resources/wireless/spinner14/Spinner72.png</file>
<file>resources/wireless/spinner14/Spinner73.png</file>
<file>resources/wireless/spinner14/Spinner74.png</file>
<file>resources/wireless/spinner14/Spinner75.png</file>
<file>resources/wireless/spinner14/Spinner76.png</file>
<file>resources/wireless/spinner14/Spinner77.png</file>
<file>resources/wireless/spinner14/Spinner78.png</file>
<file>resources/wireless/spinner14/Spinner79.png</file>
<file>resources/wireless/spinner14/Spinner80.png</file>
<file>resources/wireless/spinner14/Spinner81.png</file>
<file>resources/wireless/spinner14/Spinner82.png</file>
<file>resources/wireless/spinner14/Spinner83.png</file>
<file>resources/wireless/spinner14/Spinner84.png</file>
<file>resources/wireless/spinner14/Spinner85.png</file>
<file>resources/wireless/spinner14/Spinner86.png</file>
<file>resources/wireless/spinner14/Spinner87.png</file>
<file>resources/wireless/spinner14/Spinner88.png</file>
<file>resources/wireless/spinner14/Spinner89.png</file>
<file>resources/wireless/spinner14/Spinner90.png</file>
</qresource>
</RCC>

View File

@ -1,13 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<svg width="16px" height="16px" viewBox="0 0 16 16" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<!-- Generator: Sketch 46.2 (44496) - http://www.bohemiancoding.com/sketch -->
<title>network-wired-symbolic-connecting1</title>
<desc>Created with Sketch.</desc>
<defs></defs>
<g id="Page-1" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
<g id="network-wired-symbolic-connecting1" fill-rule="nonzero" fill="#FFFFFF">
<path d="M6.3577,7.5115 C6.1667,7.5385 5.9857,7.6315 5.8547,7.7715 L4.6647,8.9595 C4.5037,9.1145 4.4077,9.3325 4.4037,9.5535 L4.4037,10.7415 L4.4037,10.7605 L2.1747,12.9605 C1.9417,13.1935 1.9417,13.5815 2.1747,13.8145 C2.4097,14.0465 2.7977,14.0465 3.0317,13.8145 L5.2587,11.5955 L6.4507,11.5955 C6.6717,11.5905 6.8907,11.4955 7.0457,11.3355 L8.2357,10.1475 C8.5427,9.8325 8.5427,9.2735 8.2357,8.9595 L7.0457,7.7715 C6.8697,7.5895 6.6097,7.4905 6.3577,7.5115" id="Fill-124"></path>
<path d="M9.6438,8.4652 C9.8338,8.4392 10.0138,8.3452 10.1468,8.2052 L11.3358,7.0182 C11.4978,6.8622 11.5928,6.6452 11.5968,6.4232 L11.5968,5.2352 L11.5968,5.2172 L13.8248,3.0162 C14.0588,2.7842 14.0588,2.3952 13.8248,2.1622 C13.5918,1.9302 13.2028,1.9302 12.9688,2.1622 L10.7408,4.3812 L9.5508,4.3812 C9.3288,4.3862 9.1098,4.4822 8.9548,4.6422 L7.7638,5.8292 C7.4578,6.1442 7.4578,6.7032 7.7638,7.0182 L8.9548,8.2052 C9.1308,8.3882 9.3908,8.4862 9.6438,8.4652" id="Fill-126"></path>
</g>
</g>
</svg>

Before

Width:  |  Height:  |  Size: 1.5 KiB

View File

@ -1,13 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<svg width="16px" height="16px" viewBox="0 0 16 16" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<!-- Generator: Sketch 46.2 (44496) - http://www.bohemiancoding.com/sketch -->
<title>network-wired-symbolic-connecting2</title>
<desc>Created with Sketch.</desc>
<defs></defs>
<g id="Page-1" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
<g id="network-wired-symbolic-connecting2" fill-rule="nonzero" fill="#FFFFFF">
<path d="M5.85775,8.00278155 C5.66675,8.02978155 5.48575,8.12278155 5.35475,8.26278155 L4.16475,9.45078155 C4.00375,9.60578155 3.90775,9.82378155 3.90375,10.0447816 L3.90375,11.2327816 L3.90375,11.2517816 L1.67475,13.4517816 C1.44175,13.6847816 1.44175,14.0727816 1.67475,14.3057816 C1.90975,14.5377816 2.29775,14.5377816 2.53175,14.3057816 L4.75875,12.0867816 L5.95075,12.0867816 C6.17175,12.0817816 6.39075,11.9867816 6.54575,11.8267816 L7.73575,10.6387816 C8.04275,10.3237816 8.04275,9.76478155 7.73575,9.45078155 L6.54575,8.26278155 C6.36975,8.08078155 6.10975,7.98178155 5.85775,8.00278155" id="Fill-124"></path>
<path d="M10.1095,7.977 C10.2995,7.951 10.4795,7.857 10.6125,7.717 L11.8015,6.53 C11.9635,6.374 12.0585,6.157 12.0625,5.935 L12.0625,4.747 L12.0625,4.729 L14.2905,2.528 C14.5245,2.296 14.5245,1.907 14.2905,1.674 C14.0575,1.442 13.6685,1.442 13.4345,1.674 L11.2065,3.893 L10.0165,3.893 C9.7945,3.898 9.5755,3.994 9.4205,4.154 L8.2295,5.341 C7.9235,5.656 7.9235,6.215 8.2295,6.53 L9.4205,7.717 C9.5965,7.9 9.8565,7.998 10.1095,7.977" id="Fill-126"></path>
</g>
</g>
</svg>

Before

Width:  |  Height:  |  Size: 1.6 KiB

View File

@ -1,13 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<svg width="16px" height="16px" viewBox="0 0 16 16" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<!-- Generator: Sketch 46.2 (44496) - http://www.bohemiancoding.com/sketch -->
<title>network-wired-symbolic-connecting3</title>
<desc>Created with Sketch.</desc>
<defs></defs>
<g id="Page-1" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
<g id="network-wired-symbolic-connecting3" fill-rule="nonzero" fill="#FFFFFF">
<path d="M5.35775,8.50278155 C5.16675,8.52978155 4.98575,8.62278155 4.85475,8.76278155 L3.66475,9.95078155 C3.50375,10.1057816 3.40775,10.3237816 3.40375,10.5447816 L3.40375,11.7327816 L3.40375,11.7517816 L1.17475,13.9517816 C0.94175,14.1847816 0.94175,14.5727816 1.17475,14.8057816 C1.40975,15.0377816 1.79775,15.0377816 2.03175,14.8057816 L4.25875,12.5867816 L5.45075,12.5867816 C5.67175,12.5817816 5.89075,12.4867816 6.04575,12.3267816 L7.23575,11.1387816 C7.54275,10.8237816 7.54275,10.2647816 7.23575,9.95078155 L6.04575,8.76278155 C5.86975,8.58078155 5.60975,8.48178155 5.35775,8.50278155" id="Fill-124"></path>
<path d="M10.6095,7.477 C10.7995,7.451 10.9795,7.357 11.1125,7.217 L12.3015,6.03 C12.4635,5.874 12.5585,5.657 12.5625,5.435 L12.5625,4.247 L12.5625,4.229 L14.7905,2.028 C15.0245,1.796 15.0245,1.407 14.7905,1.174 C14.5575,0.942 14.1685,0.942 13.9345,1.174 L11.7065,3.393 L10.5165,3.393 C10.2945,3.398 10.0755,3.494 9.9205,3.654 L8.7295,4.841 C8.4235,5.156 8.4235,5.715 8.7295,6.03 L9.9205,7.217 C10.0965,7.4 10.3565,7.498 10.6095,7.477" id="Fill-126"></path>
</g>
</g>
</svg>

Before

Width:  |  Height:  |  Size: 1.6 KiB

View File

@ -1,13 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<svg width="16px" height="16px" viewBox="0 0 16 16" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<!-- Generator: Sketch 46.2 (44496) - http://www.bohemiancoding.com/sketch -->
<title>network-wired-symbolic-connecting4</title>
<desc>Created with Sketch.</desc>
<defs></defs>
<g id="Page-1" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
<g id="network-wired-symbolic-connecting4" fill-rule="nonzero" fill="#FFFFFF">
<path d="M4.85775,9.00278155 C4.66675,9.02978155 4.48575,9.12278155 4.35475,9.26278155 L3.16475,10.4507816 C3.00375,10.6057816 2.90775,10.8237816 2.90375,11.0447816 L2.90375,12.2327816 L2.90375,12.2517816 L0.67475,14.4517816 C0.44175,14.6847816 0.44175,15.0727816 0.67475,15.3057816 C0.90975,15.5377816 1.29775,15.5377816 1.53175,15.3057816 L3.75875,13.0867816 L4.95075,13.0867816 C5.17175,13.0817816 5.39075,12.9867816 5.54575,12.8267816 L6.73575,11.6387816 C7.04275,11.3237816 7.04275,10.7647816 6.73575,10.4507816 L5.54575,9.26278155 C5.36975,9.08078155 5.10975,8.98178155 4.85775,9.00278155" id="Fill-124"></path>
<path d="M11.1095,6.977 C11.2995,6.951 11.4795,6.857 11.6125,6.717 L12.8015,5.53 C12.9635,5.374 13.0585,5.157 13.0625,4.935 L13.0625,3.747 L13.0625,3.729 L15.2905,1.528 C15.5245,1.296 15.5245,0.907 15.2905,0.674 C15.0575,0.442 14.6685,0.442 14.4345,0.674 L12.2065,2.893 L11.0165,2.893 C10.7945,2.898 10.5755,2.994 10.4205,3.154 L9.2295,4.341 C8.9235,4.656 8.9235,5.215 9.2295,5.53 L10.4205,6.717 C10.5965,6.9 10.8565,6.998 11.1095,6.977" id="Fill-126"></path>
</g>
</g>
</svg>

Before

Width:  |  Height:  |  Size: 1.6 KiB

View File

@ -1,13 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<svg width="16px" height="16px" viewBox="0 0 16 16" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<!-- Generator: Sketch 46.2 (44496) - http://www.bohemiancoding.com/sketch -->
<title>network-wired-symbolic-connecting5</title>
<desc>Created with Sketch.</desc>
<defs></defs>
<g id="Page-1" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
<g id="network-wired-symbolic-connecting5" fill-rule="nonzero" fill="#FFFFFF">
<path d="M4.35775,9.50278155 C4.16675,9.52978155 3.98575,9.62278155 3.85475,9.76278155 L2.66475,10.9507816 C2.50375,11.1057816 2.40775,11.3237816 2.40375,11.5447816 L2.40375,12.7327816 L2.40375,12.7517816 L0.17475,14.9517816 C-0.05825,15.1847816 -0.05825,15.5727816 0.17475,15.8057816 C0.40975,16.0377816 0.79775,16.0377816 1.03175,15.8057816 L3.25875,13.5867816 L4.45075,13.5867816 C4.67175,13.5817816 4.89075,13.4867816 5.04575,13.3267816 L6.23575,12.1387816 C6.54275,11.8237816 6.54275,11.2647816 6.23575,10.9507816 L5.04575,9.76278155 C4.86975,9.58078155 4.60975,9.48178155 4.35775,9.50278155" id="Fill-124"></path>
<path d="M11.6095,6.477 C11.7995,6.451 11.9795,6.357 12.1125,6.217 L13.3015,5.03 C13.4635,4.874 13.5585,4.657 13.5625,4.435 L13.5625,3.247 L13.5625,3.229 L15.7905,1.028 C16.0245,0.796 16.0245,0.407 15.7905,0.174 C15.5575,-0.058 15.1685,-0.058 14.9345,0.174 L12.7065,2.393 L11.5165,2.393 C11.2945,2.398 11.0755,2.494 10.9205,2.654 L9.7295,3.841 C9.4235,4.156 9.4235,4.715 9.7295,5.03 L10.9205,6.217 C11.0965,6.4 11.3565,6.498 11.6095,6.477" id="Fill-126"></path>
</g>
</g>
</svg>

Before

Width:  |  Height:  |  Size: 1.6 KiB

View File

@ -1,20 +0,0 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- Generator: Adobe Illustrator 18.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg version="1.1" id="&#x56FE;&#x5C42;_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px"
y="0px" viewBox="0 0 16 16" style="enable-background:new 0 0 16 16;" xml:space="preserve">
<g>
<g>
<path style="fill:#FFFFFF;" d="M6.358,7.511c-0.191,0.027-0.372,0.12-0.503,0.26L4.664,8.959c-0.16,0.155-0.256,0.373-0.261,0.595
v1.188c0,0.005,0,0.012,0,0.019l-2.229,2.2c-0.233,0.233-0.233,0.621,0,0.854c0.234,0.231,0.623,0.231,0.856,0l2.228-2.219H6.45
c0.222-0.006,0.44-0.101,0.596-0.26l1.19-1.188c0.306-0.316,0.306-0.874,0-1.189l-1.19-1.188C6.87,7.589,6.61,7.49,6.358,7.511z"
/>
</g>
<g>
<path style="fill:#FFFFFF;" d="M9.644,8.465c0.19-0.026,0.37-0.12,0.502-0.26l1.19-1.188c0.161-0.155,0.256-0.373,0.261-0.595
V5.235c0-0.006,0-0.012,0-0.018l2.228-2.201c0.233-0.232,0.233-0.621,0-0.853c-0.233-0.232-0.623-0.232-0.856,0L10.74,4.381H9.55
C9.328,4.386,9.11,4.482,8.955,4.642L7.764,5.829c-0.306,0.315-0.306,0.874,0,1.189l1.191,1.188
C9.131,8.388,9.39,8.487,9.644,8.465z"/>
</g>
</g>
</svg>

Before

Width:  |  Height:  |  Size: 1.3 KiB

File diff suppressed because one or more lines are too long

Before

Width:  |  Height:  |  Size: 148 KiB

View File

@ -1,20 +0,0 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- Generator: Adobe Illustrator 18.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg version="1.1" id="&#x56FE;&#x5C42;_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px"
y="0px" viewBox="0 0 16 16" style="enable-background:new 0 0 16 16;" xml:space="preserve">
<g style="opacity:0.3;">
<g>
<path style="fill:#FFFFFF;" d="M6.358,7.511c-0.191,0.027-0.372,0.12-0.503,0.26L4.664,8.959c-0.16,0.155-0.256,0.373-0.261,0.595
v1.188c0,0.005,0,0.012,0,0.019l-2.229,2.2c-0.233,0.233-0.233,0.621,0,0.854c0.234,0.231,0.623,0.231,0.856,0l2.228-2.219H6.45
c0.222-0.006,0.44-0.101,0.596-0.26l1.19-1.188c0.306-0.316,0.306-0.874,0-1.189l-1.19-1.188C6.87,7.589,6.61,7.49,6.358,7.511z"
/>
</g>
<g>
<path style="fill:#FFFFFF;" d="M9.644,8.465c0.19-0.026,0.37-0.12,0.502-0.26l1.19-1.188c0.161-0.155,0.256-0.373,0.261-0.595
V5.235c0-0.006,0-0.012,0-0.018l2.228-2.201c0.233-0.232,0.233-0.621,0-0.853c-0.233-0.232-0.623-0.232-0.856,0L10.74,4.381H9.55
C9.328,4.386,9.11,4.482,8.955,4.642L7.764,5.829c-0.306,0.315-0.306,0.874,0,1.189l1.191,1.188
C9.131,8.388,9.39,8.487,9.644,8.465z"/>
</g>
</g>
</svg>

Before

Width:  |  Height:  |  Size: 1.3 KiB

File diff suppressed because one or more lines are too long

Before

Width:  |  Height:  |  Size: 148 KiB

View File

@ -1,40 +0,0 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- Generator: Adobe Illustrator 18.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg version="1.1" id="&#x56FE;&#x5C42;_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px"
y="0px" viewBox="0 0 16 16" style="enable-background:new 0 0 16 16;" xml:space="preserve">
<g>
<g>
<g>
<path style="fill:#FFFFFF;" d="M6.358,7.523c-0.191,0.027-0.372,0.12-0.503,0.26l-1.19,1.188
c-0.16,0.155-0.256,0.373-0.261,0.595v1.188c0,0.005,0,0.012,0,0.019l-2.229,2.2c-0.233,0.233-0.233,0.621,0,0.854
c0.234,0.231,0.623,0.231,0.856,0l2.227-2.219H6.45c0.222-0.006,0.441-0.101,0.596-0.26l1.19-1.188
c0.306-0.315,0.306-0.874,0-1.188l-1.19-1.188C6.87,7.601,6.61,7.502,6.358,7.523z"/>
</g>
<g>
<path style="fill:#FFFFFF;" d="M9.644,8.477c0.19-0.026,0.37-0.12,0.502-0.26l1.19-1.187c0.161-0.155,0.256-0.373,0.261-0.595
V5.246c0-0.006,0-0.012,0-0.018l2.228-2.201c0.233-0.232,0.233-0.621,0-0.853c-0.233-0.232-0.623-0.232-0.856,0l-2.228,2.218
h-1.19C9.328,4.398,9.11,4.493,8.955,4.653L7.764,5.84c-0.306,0.315-0.306,0.874,0,1.189l1.191,1.187
C9.131,8.4,9.39,8.498,9.644,8.477z"/>
</g>
</g>
<path style="fill:#C30D23;" d="M11.713,11.989l1.143-1.143c0.195-0.195,0.196-0.513,0-0.709c-0.195-0.195-0.514-0.195-0.709,0
l-1.144,1.143L9.86,10.137c-0.195-0.195-0.514-0.195-0.709,0c-0.196,0.196-0.195,0.514,0,0.709l1.143,1.143l-1.143,1.143
c-0.195,0.195-0.196,0.513,0,0.709c0.098,0.098,0.227,0.146,0.354,0.146s0.257-0.049,0.354-0.146l1.144-1.143l1.144,1.143
c0.098,0.098,0.227,0.146,0.354,0.146s0.257-0.049,0.354-0.146c0.196-0.196,0.195-0.514,0-0.709L11.713,11.989z"/>
</g>
<g style="opacity:0.3;">
<g>
<path style="fill:#FFFFFF;" d="M6.358,7.511c-0.191,0.027-0.372,0.12-0.503,0.26L4.664,8.959c-0.16,0.155-0.256,0.373-0.261,0.595
v1.188c0,0.005,0,0.012,0,0.019l-2.229,2.2c-0.233,0.233-0.233,0.621,0,0.854c0.234,0.231,0.623,0.231,0.856,0l2.228-2.219H6.45
c0.222-0.006,0.44-0.101,0.596-0.26l1.19-1.188c0.306-0.316,0.306-0.874,0-1.189l-1.19-1.188C6.87,7.589,6.61,7.49,6.358,7.511z"
/>
</g>
<g>
<path style="fill:#FFFFFF;" d="M9.644,8.465c0.19-0.026,0.37-0.12,0.502-0.26l1.19-1.188c0.161-0.155,0.256-0.373,0.261-0.595
V5.235c0-0.006,0-0.012,0-0.018l2.228-2.201c0.233-0.232,0.233-0.621,0-0.853c-0.233-0.232-0.623-0.232-0.856,0L10.74,4.381H9.55
C9.328,4.386,9.11,4.482,8.955,4.642L7.764,5.829c-0.306,0.315-0.306,0.874,0,1.189l1.191,1.188
C9.131,8.388,9.39,8.487,9.644,8.465z"/>
</g>
</g>
</svg>

Before

Width:  |  Height:  |  Size: 2.6 KiB

View File

@ -1,44 +0,0 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- Generator: Adobe Illustrator 18.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg version="1.1" id="&#x56FE;&#x5C42;_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px"
y="0px" viewBox="0 0 16 16" style="enable-background:new 0 0 16 16;" xml:space="preserve">
<g style="opacity:0.3;">
<g>
<path style="fill:#FFFFFF;" d="M6.358,7.511c-0.191,0.027-0.372,0.12-0.503,0.26L4.664,8.959c-0.16,0.155-0.256,0.373-0.261,0.595
v1.188c0,0.005,0,0.012,0,0.019l-2.229,2.2c-0.233,0.233-0.233,0.621,0,0.854c0.234,0.231,0.623,0.231,0.856,0l2.228-2.219H6.45
c0.222-0.006,0.44-0.101,0.596-0.26l1.19-1.188c0.306-0.316,0.306-0.874,0-1.189l-1.19-1.188C6.87,7.589,6.61,7.49,6.358,7.511z"
/>
</g>
<g>
<path style="fill:#FFFFFF;" d="M9.644,8.465c0.19-0.026,0.37-0.12,0.502-0.26l1.19-1.188c0.161-0.155,0.256-0.373,0.261-0.595
V5.235c0-0.006,0-0.012,0-0.018l2.228-2.201c0.233-0.232,0.233-0.621,0-0.853c-0.233-0.232-0.623-0.232-0.856,0L10.74,4.381H9.55
C9.328,4.386,9.11,4.482,8.955,4.642L7.764,5.829c-0.306,0.315-0.306,0.874,0,1.189l1.191,1.188
C9.131,8.388,9.39,8.487,9.644,8.465z"/>
</g>
</g>
<g>
<g>
<g>
<path style="fill:#FFFFFF;" d="M6.358,7.523c-0.191,0.027-0.372,0.12-0.503,0.26l-1.19,1.188
c-0.16,0.155-0.256,0.373-0.261,0.595v1.188c0,0.005,0,0.012,0,0.019l-2.229,2.2c-0.233,0.233-0.233,0.621,0,0.854
c0.234,0.231,0.623,0.231,0.856,0l2.227-2.219H6.45c0.222-0.006,0.441-0.101,0.596-0.26l1.19-1.188
c0.306-0.315,0.306-0.874,0-1.188l-1.19-1.188C6.87,7.601,6.61,7.502,6.358,7.523z"/>
</g>
<g>
<path style="fill:#FFFFFF;" d="M9.644,8.477c0.19-0.026,0.37-0.12,0.502-0.26l1.19-1.187c0.161-0.155,0.256-0.373,0.261-0.595
V5.246c0-0.006,0-0.012,0-0.018l2.228-2.201c0.233-0.232,0.233-0.621,0-0.853c-0.233-0.232-0.623-0.232-0.856,0l-2.228,2.218
h-1.19C9.328,4.398,9.11,4.493,8.955,4.653L7.764,5.84c-0.306,0.315-0.306,0.874,0,1.189l1.191,1.187
C9.131,8.4,9.39,8.498,9.644,8.477z"/>
</g>
</g>
<g>
<path style="fill:#FFFFFF;" d="M11.495,13.999L11.495,13.999c-0.276,0-0.5-0.224-0.5-0.5v0c0-0.276,0.224-0.5,0.5-0.5h0
c0.276,0,0.5,0.224,0.5,0.5v0C11.995,13.775,11.771,13.999,11.495,13.999z"/>
</g>
<g>
<path style="fill:#FFFFFF;" d="M11.543,11.98h-0.134c-0.239,0-0.433-0.194-0.433-0.433V9.413c0-0.239,0.194-0.433,0.433-0.433
h0.134c0.239,0,0.433,0.194,0.433,0.433v2.134C11.976,11.786,11.782,11.98,11.543,11.98z"/>
</g>
</g>
</svg>

Before

Width:  |  Height:  |  Size: 2.6 KiB

View File

@ -1,16 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<svg width="16px" height="16px" viewBox="0 0 16 16" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<!-- Generator: Sketch 46.2 (44496) - http://www.bohemiancoding.com/sketch -->
<title>disconnect</title>
<desc>Created with Sketch.</desc>
<defs></defs>
<g id="Symbols" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
<g id="disconnect">
<circle id="Oval-58" fill="#FFFFFF" opacity="0.800000012" cx="8" cy="8" r="8"></circle>
<g id="Group" transform="translate(5.500000, 5.500000)" stroke="#303030" stroke-width="1.2" stroke-linecap="round">
<path d="M0.384439573,4.94443861 L5.05110624,0.277771944" id="Stroke-12"></path>
<path d="M5.05110624,4.94443861 L0.384439573,0.277771944" id="Stroke-13"></path>
</g>
</g>
</g>
</svg>

Before

Width:  |  Height:  |  Size: 932 B

View File

@ -1,16 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<svg width="16px" height="16px" viewBox="0 0 16 16" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<!-- Generator: Sketch 46.2 (44496) - http://www.bohemiancoding.com/sketch -->
<title>disconnect_hover</title>
<desc>Created with Sketch.</desc>
<defs></defs>
<g id="Symbols" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
<g id="disconnect_hover">
<circle id="Oval-58" fill="#FFFFFF" cx="8" cy="8" r="8"></circle>
<g id="Group" transform="translate(5.500000, 5.500000)" stroke="#303030" stroke-width="1.2" stroke-linecap="round">
<path d="M0.384439573,4.94443861 L5.05110624,0.277771944" id="Stroke-12"></path>
<path d="M5.05110624,4.94443861 L0.384439573,0.277771944" id="Stroke-13"></path>
</g>
</g>
</g>
</svg>

Before

Width:  |  Height:  |  Size: 922 B

View File

@ -1,16 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<svg width="16px" height="16px" viewBox="0 0 16 16" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<!-- Generator: Sketch 46.2 (44496) - http://www.bohemiancoding.com/sketch -->
<title>disconnect_press</title>
<desc>Created with Sketch.</desc>
<defs></defs>
<g id="Symbols" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
<g id="disconnect_press">
<circle id="Oval-58" fill="#FFFFFF" opacity="0.200000003" cx="8" cy="8" r="8"></circle>
<g id="Group" transform="translate(5.500000, 5.500000)" stroke="#2CA7F8" stroke-width="1.2" stroke-linecap="round">
<path d="M0.384439573,4.94443861 L5.05110624,0.277771944" id="Stroke-12"></path>
<path d="M5.05110624,4.94443861 L0.384439573,0.277771944" id="Stroke-13"></path>
</g>
</g>
</g>
</svg>

Before

Width:  |  Height:  |  Size: 944 B

View File

@ -1,15 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<svg width="16px" height="16px" viewBox="0 0 16 16" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<!-- Generator: Sketch 46.2 (44496) - http://www.bohemiancoding.com/sketch -->
<title>refresh_hover</title>
<desc>Created with Sketch.</desc>
<defs></defs>
<g id="dock位置" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
<g id="refresh_hover" stroke="#FFFFFF">
<g id="Group-9" transform="translate(1.000000, 0.000000)">
<path d="M13.4319825,5.23329444 C12.3594699,2.74325894 9.88331491,1 7,1 C3.13400675,1 0,4.13400675 0,8 C0,11.8659932 3.13400675,15 7,15 L7,15 C9.92193589,15 12.4257313,13.2097276 13.4743224,10.6662466" id="Oval-5"></path>
<path d="M13.5,1.20710678 L9.20710678,5.5 L13.5,5.5 L13.5,1.20710678 Z" id="Rectangle"></path>
</g>
</g>
</g>
</svg>

Before

Width:  |  Height:  |  Size: 956 B

View File

@ -1,15 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<svg width="16px" height="16px" viewBox="0 0 16 16" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<!-- Generator: Sketch 46.2 (44496) - http://www.bohemiancoding.com/sketch -->
<title>refresh_normal</title>
<desc>Created with Sketch.</desc>
<defs></defs>
<g id="dock位置" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd" opacity="0.600000024">
<g id="refresh_normal" stroke="#FFFFFF">
<g id="Group-9" transform="translate(1.000000, 0.000000)">
<path d="M13.4319825,5.23329444 C12.3594699,2.74325894 9.88331491,1 7,1 C3.13400675,1 0,4.13400675 0,8 C0,11.8659932 3.13400675,15 7,15 L7,15 C9.92193589,15 12.4257313,13.2097276 13.4743224,10.6662466" id="Oval-5"></path>
<path d="M13.5,1.20710678 L9.20710678,5.5 L13.5,5.5 L13.5,1.20710678 Z" id="Rectangle"></path>
</g>
</g>
</g>
</svg>

Before

Width:  |  Height:  |  Size: 980 B

View File

@ -1,15 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<svg width="16px" height="16px" viewBox="0 0 16 16" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<!-- Generator: Sketch 46.2 (44496) - http://www.bohemiancoding.com/sketch -->
<title>refresh_press</title>
<desc>Created with Sketch.</desc>
<defs></defs>
<g id="dock位置" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
<g id="refresh_press" stroke="#2CA7F8">
<g id="Group-9" transform="translate(1.000000, 0.000000)">
<path d="M13.4319825,5.23329444 C12.3594699,2.74325894 9.88331491,1 7,1 C3.13400675,1 0,4.13400675 0,8 C0,11.8659932 3.13400675,15 7,15 L7,15 C9.92193589,15 12.4257313,13.2097276 13.4743224,10.6662466" id="Oval-5"></path>
<path d="M13.5,1.20710678 L9.20710678,5.5 L13.5,5.5 L13.5,1.20710678 Z" id="Rectangle"></path>
</g>
</g>
</g>
</svg>

Before

Width:  |  Height:  |  Size: 956 B

View File

@ -1,12 +0,0 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg width="16px" height="16px" viewBox="0 0 16 16" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<!-- Generator: Sketch 3.8.3 (29802) - http://www.bohemiancoding.com/sketch -->
<title>小锁</title>
<desc>Created with Sketch.</desc>
<defs></defs>
<g id="Page-1" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
<g id="小锁" fill="#FFFFFF">
<path d="M5.987,11.006 L9.994,11.006 L9.994,9 L5.987,9 L5.987,11.006 Z M7.008,6.74 C7.008,6.341 7.333,6.016 7.732,6.016 L8.283,6.016 C8.683,6.016 9.008,6.341 9.008,6.74 L9.008,8.016 L7.008,8.016 L7.008,6.74 Z M10.459,8 L10,8 L10,6.74 C10,5.789 9.234,5 8.283,5 L7.732,5 C6.781,5 6,5.789 6,6.74 L6,8 L5.557,8 C5.254,8 5,8.261 5,8.565 L5,11.466 C5,11.77 5.254,12 5.557,12 L10.459,12 C10.762,12 11,11.77 11,11.466 L11,8.565 C11,8.261 10.762,8 10.459,8 L10.459,8 Z" id="Page-1"></path>
</g>
</g>
</svg>

Before

Width:  |  Height:  |  Size: 1009 B

View File

@ -1,15 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<svg width="16px" height="16px" viewBox="0 0 16 16" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<!-- Generator: Sketch 46.2 (44496) - http://www.bohemiancoding.com/sketch -->
<title>select</title>
<desc>Created with Sketch.</desc>
<defs></defs>
<g id="UI" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
<g id="select">
<path d="M8,0 C3.6,0 0,3.59334258 0,7.98520574 C0,12.3770689 3.6,15.9704115 8,15.9704115 C12.4,15.9704115 16,12.3770689 16,7.98520574 C16,3.59334258 12.4,0 8,0 L8,0 Z" id="select_active-copy-24" fill="#FFFFFF" opacity="0.800000012"></path>
<g transform="translate(4.000000, 4.000000)" id="Path-1112" stroke-width="1.2" stroke="#303030">
<polyline points="0.601182426 4.06499815 3.2576281 6.88760344 8.63650463 0"></polyline>
</g>
</g>
</g>
</svg>

Before

Width:  |  Height:  |  Size: 962 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 181 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 183 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 198 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 192 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 201 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 224 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 240 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 262 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 255 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 303 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 301 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 327 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 321 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 306 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 340 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 368 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 378 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 384 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 410 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 392 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 403 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 417 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 426 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 417 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 443 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 428 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 424 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 431 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 446 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 443 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 436 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 450 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 438 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 430 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 438 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 437 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 440 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 443 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 436 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 412 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 406 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 410 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 388 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 400 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 394 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 387 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 367 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 364 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 327 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 321 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 302 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 297 B

Some files were not shown because too many files have changed in this diff Show More