refactor: network plugin

Change-Id: I7606a159304398d4471c21f677084a965f0a0a42
This commit is contained in:
listenerri 2018-06-19 23:44:49 +08:00
parent 7023154bec
commit 20951861e2
Notes: gerrit 2018-06-22 13:08:59 +08:00
Verified+1: <jenkins@deepin.com>
Code-Review+2: hualet <mr.asianwang@gmail.com>
Submitted-by: ListenerRi <listenerri@gmail.com>
Submitted-at: Fri, 22 Jun 2018 13:08:59 +0800
Reviewed-on: https://cr.deepin.io/35826
Project: dde/dde-dock
Branch: refs/heads/master
32 changed files with 1425 additions and 2 deletions

View File

@ -1,9 +1,13 @@
add_subdirectory("datetime")
#add_subdirectory("disk-mount")
add_subdirectory("network")
if (NOT (${CMAKE_BUILD_TYPE} MATCHES "Debug"))
add_subdirectory("network")
else()
add_subdirectory("new-network")
endif ()
add_subdirectory("shutdown")
add_subdirectory("sound")
add_subdirectory("system-tray")
#add_subdirectory("trash")
add_subdirectory("keyboard-layout")
add_subdirectory("keyboard-layout")

View File

@ -0,0 +1,35 @@
set(PLUGIN_NAME "new-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)
pkg_check_modules(DDE-Network-Utils REQUIRED dde-network-utils)
pkg_check_modules(DFrameworkDBus REQUIRED dframeworkdbus)
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}
${DFrameworkDBus_INCLUDE_DIRS}
${DDE-Network-Utils_INCLUDE_DIRS}
../../interfaces)
target_link_libraries(${PLUGIN_NAME} PRIVATE
${DtkWidget_LIBRARIES}
${Qt5Widgets_LIBRARIES}
${Qt5Svg_LIBRARIES}
${Qt5DBus_LIBRARIES}
${DDE-Network-Utils_LIBRARIES}
${DFrameworkDBus_LIBRARIES}
)
install(TARGETS ${PLUGIN_NAME} LIBRARY DESTINATION lib/dde-dock/plugins)

View File

@ -0,0 +1,99 @@
/*
* 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>
#include <QJsonDocument>
using namespace dde::network;
DeviceItem::DeviceItem(dde::network::NetworkDevice *device)
: QWidget(nullptr),
m_device(device),
m_path(device->path())
{
}
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 (!m_device->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::itemTips()
{
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")
Q_EMIT requestSetDeviceEnable(m_path, !m_device->enabled());
}
QWidget *DeviceItem::itemApplet()
{
return nullptr;
}

View File

@ -0,0 +1,61 @@
/*
* 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 <QWidget>
#include <NetworkDevice>
class DeviceItem : public QWidget
{
Q_OBJECT
public:
explicit DeviceItem(dde::network::NetworkDevice *device);
const QString &path() const { return m_path; }
const dde::network::NetworkDevice * device() { return m_device; };
virtual void refreshIcon() = 0;
virtual const QString itemCommand() const;
virtual const QString itemContextMenu();
virtual QWidget *itemApplet();
virtual QWidget *itemTips();
virtual void invokeMenuItem(const QString &menuId);
signals:
void requestContextMenu() const;
void requestSetDeviceEnable(const QString &path, const bool enable) const;
protected:
QSize sizeHint() const;
protected:
dde::network::NetworkDevice *m_device;
private:
QString m_path;
};
#endif // DEVICEITEM_H

View File

@ -0,0 +1,165 @@
/*
* Copyright (C) 2011 ~ 2018 Deepin Technology Co., Ltd.
*
* Author: sbw <sbw@sbw.so>
*
* Maintainer: sbw <sbw@sbw.so>
* listenerri <listenerri@gmail.com>
*
* 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>
using namespace dde::network;
WiredItem::WiredItem(WiredDevice *device)
: DeviceItem(device),
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-" + m_device->path());
m_itemTips->setVisible(false);
m_itemTips->setStyleSheet("color:white;"
"padding:0px 3px;");
connect(m_delayTimer, &QTimer::timeout, this, &WiredItem::reloadIcon);
connect(m_device, static_cast<void (NetworkDevice::*)(NetworkDevice::DeviceStatus) const>(&NetworkDevice::statusChanged), this, &WiredItem::deviceStateChanged);
}
QWidget *WiredItem::itemTips()
{
m_itemTips->setText(tr("Unknown"));
do {
if (m_device->status() != NetworkDevice::Activated)
{
m_itemTips->setText(tr("No Network"));
break;
}
const QJsonObject info = static_cast<WiredDevice *>(m_device)->activeConnection();
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-";
NetworkDevice::DeviceStatus devState = m_device->status();
if (devState != NetworkDevice::Activated)
{
if (devState < NetworkDevice::Disconnected)
iconName.append("error");
else
iconName.append("offline");
} else {
if (devState >= NetworkDevice::Prepare && devState <= NetworkDevice::Secondaries) {
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 (devState == NetworkDevice::Activated)
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::deviceStateChanged()
{
m_delayTimer->start();
}

View File

@ -0,0 +1,60 @@
/*
* 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>
#include <WiredDevice>
class WiredItem : public DeviceItem
{
Q_OBJECT
public:
explicit WiredItem(dde::network::WiredDevice *device);
QWidget *itemTips() 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 deviceStateChanged();
private:
QPixmap m_icon;
QLabel *m_itemTips;
QTimer *m_delayTimer;
};
#endif // WIREDITEM_H

View File

@ -0,0 +1,225 @@
/*
* 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>
#include <QIcon>
using namespace dde::network;
WirelessItem::WirelessItem(WirelessDevice *device)
: DeviceItem(device),
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_device->path());
m_wirelessPopup->setVisible(false);
m_wirelessPopup->setStyleSheet("color:white;"
"padding: 0px 3px;");
connect(m_device, static_cast<void (NetworkDevice::*) (const QString &statStr) const>(&NetworkDevice::statusChanged), m_refershTimer, static_cast<void (QTimer::*) ()>(&QTimer::start));
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();
}
QWidget *WirelessItem::itemApplet()
{
return m_wirelessApplet;
}
QWidget *WirelessItem::itemTips()
{
const NetworkDevice::DeviceStatus stat = m_device->status();
m_wirelessPopup->setText(tr("No Network"));
if (stat == NetworkDevice::Activated)
{
const QJsonObject obj = static_cast<WirelessDevice *>(m_device)->activeApInfo();
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)
{
/* TODO: refactor */
//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;
/* TODO: refactor */
//const auto state = m_APList->wirelessState();
const auto state = m_device->status();
if (state <= NetworkDevice::Disconnected)
{
type = "disconnect";
m_refershTimer->stop();
}
else
{
int strength = 0;
if (state == NetworkDevice::Activated)
{
strength = static_cast<WirelessDevice *>(m_device)->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()
{
/* TODO: refactor */
//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()
{
/* TODO: refactor */
//m_wirelessApplet->setFixedHeight(m_APList->height() + m_APList->controlPanel()->height());
}
void WirelessItem::refreshIcon()
{
update();
}

View File

@ -0,0 +1,72 @@
/*
* 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>
#include <QLabel>
#include <WirelessDevice>
class WirelessItem : public DeviceItem
{
Q_OBJECT
public:
explicit WirelessItem(dde::network::WirelessDevice *device);
~WirelessItem();
QWidget *itemApplet();
QWidget *itemTips();
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;
/* TODO: refactor */
//WirelessList *m_APList;
};
#endif // WIRELESSITEM_H

View File

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

View File

@ -0,0 +1,209 @@
/*
* 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>
using namespace dde::network;
#define WIRED_ITEM "wired"
#define WIRELESS_ITEM "wireless"
#define STATE_KEY "enabled"
NetworkPlugin::NetworkPlugin(QObject *parent)
: QObject(parent),
m_networkModel(nullptr),
m_networkWorker(nullptr),
m_settings("deepin", "dde-dock-network")
{
}
const QString NetworkPlugin::pluginName() const
{
return "new-network";
}
const QString NetworkPlugin::pluginDisplayName() const
{
return tr("NewNetwork");
}
void NetworkPlugin::init(PluginProxyInterface *proxyInter)
{
m_proxyInter = proxyInter;
m_networkModel = new NetworkModel;
m_networkWorker = new NetworkWorker(m_networkModel);
connect(m_networkModel, &NetworkModel::deviceListChanged, this, &NetworkPlugin::onDeviceListChanged);
m_networkModel->moveToThread(qApp->thread());
m_networkWorker->moveToThread(qApp->thread());
onDeviceListChanged(m_networkModel->devices());
}
void NetworkPlugin::invokedMenuItem(const QString &itemKey, const QString &menuId, const bool checked)
{
Q_UNUSED(checked)
DeviceItem *item = itemByPath(itemKey);
if (item) {
return item->invokeMenuItem(menuId);
}
Q_UNREACHABLE();
}
void NetworkPlugin::refershIcon(const QString &itemKey)
{
Q_UNUSED(itemKey);
}
void NetworkPlugin::pluginStateSwitched()
{
m_settings.setValue(STATE_KEY, !m_settings.value(STATE_KEY, true).toBool());
}
bool NetworkPlugin::pluginIsDisable()
{
return !m_settings.value(STATE_KEY, true).toBool();
}
const QString NetworkPlugin::itemCommand(const QString &itemKey)
{
DeviceItem *item = itemByPath(itemKey);
if (item) {
return item->itemCommand();
}
Q_UNREACHABLE();
return QString();
}
const QString NetworkPlugin::itemContextMenu(const QString &itemKey)
{
DeviceItem *item = itemByPath(itemKey);
if (item) {
return item->itemContextMenu();
}
Q_UNREACHABLE();
return QString();
}
QWidget *NetworkPlugin::itemWidget(const QString &itemKey)
{
return itemByPath(itemKey);
}
QWidget *NetworkPlugin::itemTipsWidget(const QString &itemKey)
{
DeviceItem *item = itemByPath(itemKey);
if (item) {
return item->itemTips();
}
Q_UNREACHABLE();
return nullptr;
}
QWidget *NetworkPlugin::itemPopupApplet(const QString &itemKey)
{
/* TODO: refactor */
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::onDeviceListChanged(const QList<NetworkDevice *> devices)
{
QList<QString> mPaths = m_itemsMap.keys();
QList<QString> newPaths;
for (auto device : devices) {
const QString &path = device->path();
newPaths << path;
// new device
if (!mPaths.contains(path)) {
DeviceItem *item = nullptr;
switch (device->type()) {
case NetworkDevice::Wired:
item = new WiredItem(static_cast<WiredDevice *>(device));
break;
case NetworkDevice::Wireless:
item = new WirelessItem(static_cast<WirelessDevice *>(device));
break;
default:
Q_UNREACHABLE();
}
mPaths << path;
m_itemsMap.insert(path, item);
m_proxyInter->itemAdded(this, path);
connect(item, &DeviceItem::requestContextMenu, this, &NetworkPlugin::contextMenuRequested);
connect(item, &DeviceItem::requestSetDeviceEnable, m_networkWorker, &NetworkWorker::setDeviceEnable);
}
}
for (auto mPath : mPaths) {
// removed device
if (!newPaths.contains(mPath)) {
m_proxyInter->itemRemoved(this, mPath);
m_itemsMap.take(mPath)->deleteLater();
}
}
}
DeviceItem *NetworkPlugin::itemByPath(const QString &path)
{
for (auto item : m_itemsMap.values()) {
if (item->path() == path) {
return item;
}
}
Q_UNREACHABLE();
return nullptr;
}
void NetworkPlugin::contextMenuRequested()
{
DeviceItem *item = qobject_cast<DeviceItem *>(sender());
Q_ASSERT(item);
m_proxyInter->requestContextMenu(this, item->path());
}

View File

@ -0,0 +1,73 @@
/*
* 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 <item/deviceitem.h>
#include <QSettings>
#include <NetworkWorker>
#include <NetworkModel>
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 onDeviceListChanged(const QList<dde::network::NetworkDevice *> devices);
void contextMenuRequested();
private:
DeviceItem *itemByPath(const QString &path);
private:
dde::network::NetworkModel *m_networkModel;
dde::network::NetworkWorker *m_networkWorker;
QMap<QString, DeviceItem *> m_itemsMap;
QSettings m_settings;
};
#endif // NETWORKPLUGIN_H

View File

@ -0,0 +1,24 @@
<RCC>
<qresource prefix="/wired">
<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>
</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>
</qresource>
</RCC>

View File

@ -0,0 +1,13 @@
<?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>

After

Width:  |  Height:  |  Size: 1.5 KiB

View File

@ -0,0 +1,13 @@
<?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>

After

Width:  |  Height:  |  Size: 1.6 KiB

View File

@ -0,0 +1,13 @@
<?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>

After

Width:  |  Height:  |  Size: 1.6 KiB

View File

@ -0,0 +1,13 @@
<?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>

After

Width:  |  Height:  |  Size: 1.6 KiB

View File

@ -0,0 +1,13 @@
<?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>

After

Width:  |  Height:  |  Size: 1.6 KiB

View File

@ -0,0 +1,27 @@
<?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 style="opacity:0.3;">
<path style="fill:#FFFFFF;" d="M14.958,7.079c-0.133,0-0.267-0.053-0.364-0.158C12.826,5.037,10.481,4,7.992,4
S3.158,5.037,1.391,6.921C1.203,7.124,0.884,7.133,0.685,6.943C0.482,6.755,0.473,6.438,0.662,6.237C2.62,4.149,5.224,3,7.992,3
s5.372,1.149,7.33,3.237c0.189,0.201,0.18,0.518-0.022,0.706C15.204,7.034,15.081,7.079,14.958,7.079z"/>
</g>
<g style="opacity:0.3;">
<path style="fill:#FFFFFF;" d="M12.968,9.199c-0.133,0-0.267-0.053-0.364-0.158C11.368,7.725,9.73,7,7.992,7
S4.616,7.725,3.381,9.041C3.193,9.244,2.874,9.253,2.675,9.063C2.473,8.875,2.463,8.559,2.652,8.357C4.078,6.837,5.975,6,7.992,6
s3.914,0.837,5.34,2.357c0.189,0.201,0.18,0.518-0.022,0.706C13.214,9.154,13.091,9.199,12.968,9.199z"/>
</g>
<g style="opacity:0.3;">
<path style="fill:#FFFFFF;" d="M5.006,11.318c-0.123,0-0.245-0.045-0.342-0.136c-0.201-0.188-0.212-0.505-0.022-0.706
C5.534,9.524,6.724,9,7.992,9c1.268,0,2.458,0.524,3.352,1.477c0.189,0.201,0.18,0.518-0.022,0.706
c-0.199,0.188-0.517,0.181-0.706-0.022c-1.407-1.497-3.842-1.496-5.245,0C5.272,11.266,5.139,11.318,5.006,11.318z"/>
</g>
<g style="opacity:0.3;">
<path style="fill:#FFFFFF;" d="M6.66,12.569L8,13.996l1.337-1.424c0,0-0.013-0.007-0.021-0.015
C8.582,11.775,7.324,11.862,6.66,12.569z"/>
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 1.7 KiB

View File

@ -0,0 +1,15 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg width="48px" height="48px" viewBox="0 0 48 48" 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>wireless-0-48px</title>
<desc>Created with Sketch.</desc>
<defs></defs>
<g id="Page-1" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd" opacity="0.2">
<g id="wireless-0-48px">
<path d="M38.0552595,20.0744361 C34.2435333,16.9056184 29.3443072,15 24,15 C18.7050453,15 13.8469893,16.8705857 10.0506174,19.9869716" id="Oval-53" stroke="#FFFFFF" stroke-width="2" stroke-linecap="round"></path>
<path d="M34.0650585,24.5616892 C31.3159579,22.3343608 27.8138073,21 24,21 C20.2485619,21 16.7986705,22.2910747 14.0704162,24.4531336" id="Oval-53" stroke="#FFFFFF" stroke-width="2" stroke-linecap="round"></path>
<path d="M30.0455976,29.0337207 C28.366534,27.7575116 26.2717301,27 24,27 C21.7498512,27 19.673283,27.7431873 18.0023678,28.9974896" id="Oval-53" stroke="#FFFFFF" stroke-width="2" stroke-linecap="round"></path>
<path d="M25.4364793,32.5635207 C24.6679257,31.7949671 23.4017563,31.8150651 22.6084107,32.6084107 C21.8150651,33.4017563 21.7949671,34.6679257 22.5635207,35.4364793 C23.3320743,36.2050329 24.5982437,36.1849349 25.3915893,35.3915893 C26.1849349,34.5982437 26.2050329,33.3320743 25.4364793,32.5635207 Z" id="Path" fill="#FFFFFF"></path>
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 1.5 KiB

View File

@ -0,0 +1,27 @@
<?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 style="opacity:0.3;">
<path style="fill:#FFFFFF;" d="M14.958,7.079c-0.133,0-0.267-0.053-0.364-0.158C12.826,5.037,10.481,4,7.992,4
S3.158,5.037,1.391,6.921C1.202,7.124,0.884,7.133,0.685,6.943C0.482,6.755,0.473,6.438,0.662,6.237C2.62,4.149,5.224,3,7.992,3
s5.372,1.149,7.33,3.237c0.189,0.201,0.18,0.518-0.022,0.706C15.204,7.034,15.081,7.079,14.958,7.079z"/>
</g>
<g style="opacity:0.3;">
<path style="fill:#FFFFFF;" d="M12.968,9.199c-0.133,0-0.267-0.053-0.364-0.158C11.368,7.725,9.73,7,7.992,7
S4.616,7.725,3.381,9.041C3.193,9.244,2.874,9.253,2.675,9.063C2.473,8.875,2.463,8.559,2.652,8.357C4.078,6.837,5.975,6,7.992,6
s3.914,0.837,5.34,2.357c0.189,0.201,0.18,0.518-0.022,0.706C13.214,9.154,13.091,9.199,12.968,9.199z"/>
</g>
<g style="opacity:0.3;">
<path style="fill:#FFFFFF;" d="M5.006,11.318c-0.123,0-0.245-0.045-0.342-0.136c-0.201-0.188-0.212-0.505-0.022-0.706
C5.534,9.524,6.724,9,7.992,9c1.268,0,2.458,0.524,3.352,1.477c0.189,0.201,0.18,0.518-0.022,0.706
c-0.199,0.188-0.517,0.181-0.706-0.022c-1.408-1.497-3.843-1.496-5.245,0C5.272,11.266,5.139,11.318,5.006,11.318z"/>
</g>
<g>
<path style="fill:#FFFFFF;" d="M6.66,12.569L8,13.996l1.337-1.424c0,0-0.013-0.007-0.021-0.015
C8.582,11.775,7.324,11.862,6.66,12.569z"/>
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 1.7 KiB

View File

@ -0,0 +1,15 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg width="48px" height="48px" viewBox="0 0 48 48" 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>wireless-20-48px</title>
<desc>Created with Sketch.</desc>
<defs></defs>
<g id="Page-1" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
<g id="wireless-20-48px">
<path d="M38.0552595,20.0744361 C34.2435333,16.9056184 29.3443072,15 24,15 C18.7050453,15 13.8469893,16.8705857 10.0506174,19.9869716" id="Oval-53" stroke="#FFFFFF" stroke-width="2" stroke-linecap="round" opacity="0.2"></path>
<path d="M34.0650585,24.5616892 C31.3159579,22.3343608 27.8138073,21 24,21 C20.2485619,21 16.7986705,22.2910747 14.0704162,24.4531336" id="Oval-53" stroke="#FFFFFF" stroke-width="2" stroke-linecap="round" opacity="0.2"></path>
<path d="M30.0455976,29.0337207 C28.366534,27.7575116 26.2717301,27 24,27 C21.7498512,27 19.673283,27.7431873 18.0023678,28.9974896" id="Oval-53" stroke="#FFFFFF" stroke-width="2" stroke-linecap="round" opacity="0.2"></path>
<path d="M25.4364793,32.5635207 C24.6679257,31.7949671 23.4017563,31.8150651 22.6084107,32.6084107 C21.8150651,33.4017563 21.7949671,34.6679257 22.5635207,35.4364793 C23.3320743,36.2050329 24.5982437,36.1849349 25.3915893,35.3915893 C26.1849349,34.5982437 26.2050329,33.3320743 25.4364793,32.5635207 Z" id="Path" fill="#FFFFFF"></path>
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 1.5 KiB

View File

@ -0,0 +1,27 @@
<?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 style="opacity:0.3;">
<path style="fill:#FFFFFF;" d="M14.958,7.079c-0.133,0-0.267-0.053-0.364-0.158C12.826,5.037,10.481,4,7.992,4
S3.158,5.037,1.391,6.921C1.202,7.124,0.884,7.133,0.685,6.943C0.482,6.755,0.473,6.438,0.662,6.237C2.62,4.149,5.224,3,7.992,3
s5.372,1.149,7.33,3.237c0.189,0.201,0.18,0.518-0.022,0.706C15.204,7.034,15.081,7.079,14.958,7.079z"/>
</g>
<g style="opacity:0.3;">
<path style="fill:#FFFFFF;" d="M12.968,9.199c-0.133,0-0.267-0.053-0.364-0.158C11.368,7.725,9.73,7,7.992,7
S4.616,7.725,3.381,9.041C3.192,9.244,2.873,9.253,2.675,9.063C2.473,8.875,2.463,8.559,2.652,8.357C4.078,6.837,5.975,6,7.992,6
s3.914,0.837,5.34,2.357c0.189,0.201,0.18,0.518-0.022,0.706C13.214,9.154,13.091,9.199,12.968,9.199z"/>
</g>
<g>
<path style="fill:#FFFFFF;" d="M5.006,11.318c-0.123,0-0.245-0.045-0.342-0.136c-0.201-0.188-0.212-0.505-0.022-0.706
C5.534,9.524,6.724,9,7.992,9c1.268,0,2.458,0.524,3.352,1.477c0.189,0.201,0.18,0.518-0.022,0.706
c-0.199,0.188-0.516,0.181-0.706-0.022c-1.408-1.497-3.843-1.496-5.245,0C5.272,11.266,5.139,11.318,5.006,11.318z"/>
</g>
<g>
<path style="fill:#FFFFFF;" d="M6.66,12.569L8,13.996l1.337-1.424c0,0-0.013-0.007-0.021-0.015
C8.582,11.775,7.324,11.862,6.66,12.569z"/>
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 1.7 KiB

View File

@ -0,0 +1,15 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg width="48px" height="48px" viewBox="0 0 48 48" 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>wireless-40-48px</title>
<desc>Created with Sketch.</desc>
<defs></defs>
<g id="Page-1" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
<g id="wireless-40-48px">
<path d="M38.0552595,20.0744361 C34.2435333,16.9056184 29.3443072,15 24,15 C18.7050453,15 13.8469893,16.8705857 10.0506174,19.9869716" id="Oval-53" stroke="#FFFFFF" stroke-width="2" stroke-linecap="round" opacity="0.2"></path>
<path d="M34.0650585,24.5616892 C31.3159579,22.3343608 27.8138073,21 24,21 C20.2485619,21 16.7986705,22.2910747 14.0704162,24.4531336" id="Oval-53" stroke="#FFFFFF" stroke-width="2" stroke-linecap="round" opacity="0.2"></path>
<path d="M30.0455976,29.0337207 C28.366534,27.7575116 26.2717301,27 24,27 C21.7498512,27 19.673283,27.7431873 18.0023678,28.9974896" id="Oval-53" stroke="#FFFFFF" stroke-width="2" stroke-linecap="round"></path>
<path d="M25.4364793,32.5635207 C24.6679257,31.7949671 23.4017563,31.8150651 22.6084107,32.6084107 C21.8150651,33.4017563 21.7949671,34.6679257 22.5635207,35.4364793 C23.3320743,36.2050329 24.5982437,36.1849349 25.3915893,35.3915893 C26.1849349,34.5982437 26.2050329,33.3320743 25.4364793,32.5635207 Z" id="Path" fill="#FFFFFF"></path>
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 1.5 KiB

View File

@ -0,0 +1,27 @@
<?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 style="opacity:0.3;">
<path style="fill:#FFFFFF;" d="M14.959,7.079c-0.133,0-0.267-0.053-0.364-0.158C12.827,5.037,10.482,4,7.993,4
S3.159,5.037,1.392,6.921C1.203,7.124,0.885,7.133,0.686,6.943C0.483,6.755,0.474,6.438,0.663,6.237C2.621,4.149,5.225,3,7.993,3
s5.372,1.149,7.33,3.237c0.189,0.201,0.18,0.518-0.022,0.706C15.205,7.034,15.082,7.079,14.959,7.079z"/>
</g>
<g>
<path style="fill:#FFFFFF;" d="M12.969,9.199c-0.133,0-0.267-0.053-0.364-0.158C11.369,7.725,9.731,7,7.993,7
S4.617,7.725,3.382,9.041C3.193,9.244,2.875,9.253,2.676,9.063C2.474,8.875,2.464,8.559,2.653,8.357C4.079,6.837,5.976,6,7.993,6
s3.914,0.837,5.34,2.357c0.189,0.201,0.18,0.518-0.022,0.706C13.215,9.154,13.092,9.199,12.969,9.199z"/>
</g>
<g>
<path style="fill:#FFFFFF;" d="M5.007,11.318c-0.123,0-0.245-0.045-0.342-0.136c-0.201-0.188-0.212-0.505-0.022-0.706
C5.535,9.524,6.725,9,7.993,9c1.268,0,2.458,0.524,3.352,1.477c0.189,0.201,0.18,0.518-0.022,0.706
c-0.199,0.188-0.517,0.181-0.706-0.022c-1.407-1.497-3.842-1.496-5.245,0C5.273,11.266,5.14,11.318,5.007,11.318z"/>
</g>
<g>
<path style="fill:#FFFFFF;" d="M6.661,12.569l1.339,1.427l1.337-1.424c0,0-0.013-0.007-0.021-0.015
C8.583,11.775,7.325,11.862,6.661,12.569z"/>
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 1.7 KiB

View File

@ -0,0 +1,15 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg width="48px" height="48px" viewBox="0 0 48 48" 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>wireless-60-48px</title>
<desc>Created with Sketch.</desc>
<defs></defs>
<g id="Page-1" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
<g id="wireless-60-48px">
<path d="M38.0552595,20.0744361 C34.2435333,16.9056184 29.3443072,15 24,15 C18.7050453,15 13.8469893,16.8705857 10.0506174,19.9869716" id="Oval-53" stroke="#FFFFFF" stroke-width="2" stroke-linecap="round" opacity="0.2"></path>
<path d="M34.0650585,24.5616892 C31.3159579,22.3343608 27.8138073,21 24,21 C20.2485619,21 16.7986705,22.2910747 14.0704162,24.4531336" id="Oval-53" stroke="#FFFFFF" stroke-width="2" stroke-linecap="round"></path>
<path d="M30.0455976,29.0337207 C28.366534,27.7575116 26.2717301,27 24,27 C21.7498512,27 19.673283,27.7431873 18.0023678,28.9974896" id="Oval-53" stroke="#FFFFFF" stroke-width="2" stroke-linecap="round"></path>
<path d="M25.4364793,32.5635207 C24.6679257,31.7949671 23.4017563,31.8150651 22.6084107,32.6084107 C21.8150651,33.4017563 21.7949671,34.6679257 22.5635207,35.4364793 C23.3320743,36.2050329 24.5982437,36.1849349 25.3915893,35.3915893 C26.1849349,34.5982437 26.2050329,33.3320743 25.4364793,32.5635207 Z" id="Path" fill="#FFFFFF"></path>
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 1.5 KiB

View File

@ -0,0 +1,29 @@
<?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="M14.966,7.072c-0.133,0-0.267-0.053-0.364-0.158C12.834,5.03,10.489,3.993,8,3.993
c-2.489,0-4.833,1.037-6.602,2.921C1.209,7.116,0.893,7.126,0.691,6.937C0.49,6.748,0.48,6.432,0.669,6.23
C2.628,4.143,5.232,2.993,8,2.993c2.769,0,5.372,1.149,7.33,3.237c0.189,0.201,0.18,0.518-0.022,0.706
C15.212,7.027,15.089,7.072,14.966,7.072z"/>
</g>
<g>
<path style="fill:#FFFFFF;" d="M3.024,9.192c-0.123,0-0.246-0.045-0.342-0.136C2.48,8.868,2.47,8.552,2.659,8.351
C4.086,6.83,5.982,5.993,8,5.993s3.914,0.837,5.34,2.357c0.189,0.201,0.18,0.518-0.022,0.706
c-0.199,0.188-0.518,0.181-0.706-0.022C11.376,7.718,9.738,6.993,8,6.993S4.624,7.718,3.389,9.034
C3.29,9.14,3.157,9.192,3.024,9.192z"/>
</g>
<g>
<path style="fill:#FFFFFF;" d="M10.987,11.311c-0.133,0-0.266-0.053-0.364-0.157c-1.406-1.496-3.839-1.496-5.246,0
c-0.189,0.201-0.506,0.211-0.707,0.021c-0.201-0.189-0.211-0.506-0.022-0.707C5.543,9.517,6.733,8.993,8,8.993
s2.458,0.523,3.352,1.475c0.189,0.201,0.18,0.518-0.021,0.707C11.233,11.266,11.11,11.311,10.987,11.311z"/>
</g>
<g>
<path style="fill:#FFFFFF;" d="M6.668,12.562l1.339,1.427l1.337-1.424c0,0-0.013-0.007-0.021-0.015
C8.59,11.768,7.332,11.855,6.668,12.562z"/>
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 1.7 KiB

View File

@ -0,0 +1,15 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg width="48px" height="48px" viewBox="0 0 48 48" 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>wireless-80-48px</title>
<desc>Created with Sketch.</desc>
<defs></defs>
<g id="Page-1" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
<g id="wireless-80-48px">
<path d="M25.4364793,32.5635207 C24.6679257,31.7949671 23.4017563,31.8150651 22.6084107,32.6084107 C21.8150651,33.4017563 21.7949671,34.6679257 22.5635207,35.4364793 C23.3320743,36.2050329 24.5982437,36.1849349 25.3915893,35.3915893 C26.1849349,34.5982437 26.2050329,33.3320743 25.4364793,32.5635207 Z" id="Path" fill="#FFFFFF"></path>
<path d="M38.0552595,20.0744361 C34.2435333,16.9056184 29.3443072,15 24,15 C18.7050453,15 13.8469893,16.8705857 10.0506174,19.9869716" id="Oval-53" stroke="#FFFFFF" stroke-width="2" stroke-linecap="round"></path>
<path d="M34.0650585,24.5616892 C31.3159579,22.3343608 27.8138073,21 24,21 C20.2485619,21 16.7986705,22.2910747 14.0704162,24.4531336" id="Oval-53" stroke="#FFFFFF" stroke-width="2" stroke-linecap="round"></path>
<path d="M30.0455976,29.0337207 C28.366534,27.7575116 26.2717301,27 24,27 C21.7498512,27 19.673283,27.7431873 18.0023678,28.9974896" id="Oval-53" stroke="#FFFFFF" stroke-width="2" stroke-linecap="round"></path>
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 1.5 KiB

View File

@ -0,0 +1,18 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg width="48px" height="48px" viewBox="0 0 48 48" 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>wireless-background-48px</title>
<desc>Created with Sketch.</desc>
<defs>
<linearGradient x1="50%" y1="3.4900079%" x2="50%" y2="97.1779337%" id="linearGradient-1">
<stop stop-color="#15C4FF" offset="0%"></stop>
<stop stop-color="#218AFF" offset="100%"></stop>
</linearGradient>
</defs>
<g id="Page-1" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
<g id="wireless-background-48px">
<image id="Bitmap" x="0" y="4" width="48" height="43" xlink:href="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAArCAYAAAA+EwvfAAAABGdBTUEAA1teXP8meAAAA1xJREFUaAXV2Idy20AMBNA4vddxkv//xXTHJXi0VnOSaFGUGJnCDHSFV3YBHO7ssweHy9liiZSabb3d4aZppJ6y+bR79a6NhlbIPOXD0rSBabVdx5hWfTP2elGmrdxZsvEuEzJWGdAAXJUq9xFrPSpV7kUmoLZtnjHZzFigWW5KYRRkSIwyaJiAu522+et7C/yy2oOLbi4zqsd+jxczBomE8foOLXBjLESPJfFuiNgXpg3p62zBm/B3Y9ZxO54stuv1xroHAh5zVhAy9y1wwAXTRvi2BAxykDAGPG6s6r0L4BS2FRIhEPBYCpk5gS84nfSSQOAUwC84dNaPJzojIzDXsAno9RKBnIlr4KPHTJProMa2ndEOtx9xP4dsM5YEgz8OgVOyfogyekcACTF1atIlH+DJs9vipH47zAgIn5cnBf0W7CvYEcgB/nBCJGCVTi/bm/j1ovNi5kTeFD7W/156EQLYkHelCMQr+uYkLwoM638r/VN6FQJVX75/3lf9V9P2bQ7ytECcl7I8fIx80xLghTxdsfxhQOkcxGX7pfTnQpcR0hIAFAHqcAunOZCA5Wvp71IEvJYZtjPuOoHq7z4g4e3tYCNxX+KyAh5oOFbAV3v5XwD1VuIJcefgYH4f8nmxaZdxqg7XSlj3eSBADTQBAUQcnGPKx9pM7N8JHphdCCAi74pFqesY4vx5HSzTZdVXLB8Q2wgYEy8oXSA8Ig7/pzh3b0tZ3sH11OkFX/1bPeA7aUmwDALLNGbAhCJchc5Krt+2/pAH2rmsT5DobsGuNd3P+kW11fLZdgyBeEJqm/q2lrLXL6o7wybglWMIGM8LNCSmuOhgAL73oqr+rTKWgMVCYorbOresByRjKFl+J+vXuNEeMIcknORpGWOf2zq3rFh3aDdu2eoblH08kEXjCYdP6gNijAgbhjCP5a23s+VrbCeHELBASPj71MWzqyfOa6zwOQh8zd87hMyNhMTz6qBD76ZPNUbWAT7peLTla24nh3rAIjkPiLiIaN+7ScwDz1vAD96yNWZQpiBgk5YEL7jsiANqD2dEzCMxGfhaa9J/aAEHLAvzAiL5f74Mw+L04LCpNZZi0ynFeg6n9ErVCU94Pyn3yjY1r1emJmCTrKlMXYjloKY09mD5B7MS9TLNDdZiAAAAAElFTkSuQmCC"></image>
<path d="M45.2189855,14.6551503 C39.9322125,8.71714181 32.3718058,5 23.9765638,5 C15.6145685,5 8.08080934,8.68775903 2.79705865,14.5847082 C2.46158664,14.959113 -1.10742981,19.0463299 2.85247564,23.0250696 C7.75054308,28.6708126 15.509578,37.2861027 20.1174886,42.1386521 C23.9765645,46.1356805 27.564689,42.5076988 27.9154661,42.138652 C32.5306456,37.283097 40.1987456,28.6772032 45.20822,22.9155737 C49.0605581,19.0463299 45.5527819,15.0300645 45.2189855,14.6551503 Z" id="Combined-Shape" fill="url(#linearGradient-1)"></path>
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 2.6 KiB

View File

@ -0,0 +1,12 @@
<?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>
<path style="fill:#FFFFFF;" d="M8.009,13.935c-0.127,0-0.253-0.048-0.351-0.144L0.684,6.936c-0.193-0.19-0.2-0.5-0.015-0.698
c0.95-1.013,2.058-1.81,3.292-2.367c2.559-1.154,5.52-1.154,8.078,0c1.234,0.558,2.342,1.354,3.292,2.367
c0.186,0.198,0.179,0.508-0.015,0.698l-6.957,6.855C8.263,13.887,8.136,13.935,8.009,13.935z M1.741,6.573l6.268,6.16l6.25-6.16
c-0.778-0.752-1.662-1.354-2.632-1.791c-2.297-1.039-4.957-1.039-7.254,0C3.403,5.22,2.521,5.821,1.741,6.573z"/>
</g>
</svg>

After

Width:  |  Height:  |  Size: 941 B

View File

@ -0,0 +1,14 @@
<?xml version="1.0" encoding="UTF-8"?>
<svg width="96px" height="96px" viewBox="0 0 96 96" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<!-- Generator: Sketch 47.1 (45422) - http://www.bohemiancoding.com/sketch -->
<title>wireless-disconnect</title>
<desc>Created with Sketch.</desc>
<defs></defs>
<g id="Page-1" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
<g id="wireless-disconnect" fill-rule="nonzero" fill="#FFFFFF">
<g id="Group" transform="translate(20.000000, 27.000000)">
<path d="M57.2785533,9.4359895 C58.1623447,10.1707154 58.2465314,11.497399 57.4627014,12.3379464 L29.4627014,42.3640032 C28.6719255,43.2119989 27.3280745,43.2119989 26.5372986,42.3640032 L-1.46270135,12.3379464 C-2.24988188,11.4938061 -2.16111181,10.1604189 -1.26897732,9.42807884 C8.08285201,1.75129956 16.7734997,-2 28,-2 C39.3006506,-2 48.0266916,1.74460189 57.2785533,9.4359895 Z M28,2 C18.458865,2 10.9784854,4.96404567 2.93600242,11.1898479 L28,38.0674556 C27.8035206,38.278152 28.5824597,37.4428495 30.9122986,34.9444254 L50.1622986,14.3015114 C51.889148,12.4497086 52.012228,12.3177227 53.0723852,11.1808533 C45.1144274,4.95457377 37.6109788,2 28,2 Z" id="Oval-53"></path>
</g>
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 1.3 KiB

View File

@ -0,0 +1,38 @@
/*
* 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 "imageutil.h"
#include <QPainter>
const QPixmap ImageUtil::loadSvg(const QString &path, const int size)
{
QPixmap pixmap(size, size);
QSvgRenderer renderer(path);
pixmap.fill(Qt::transparent);
QPainter painter;
painter.begin(&pixmap);
renderer.render(&painter);
painter.end();
return pixmap;
}

View File

@ -0,0 +1,34 @@
/*
* 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 IMAGEUTIL_H
#define IMAGEUTIL_H
#include <QPixmap>
#include <QSvgRenderer>
class ImageUtil
{
public:
static const QPixmap loadSvg(const QString &path, const int size);
};
#endif // IMAGEUTIL_H