feat: 网络模块插件化
移除network目录下的所有文件,将其放到dde-network-core插件中,作为网络库的一个插件,删除相关文件对网络模块的引用 Log: 提取单独的网络模块作为插件 Task: https://pms.uniontech.com/zentao/task-view-84600.html Change-Id: Ia402d74297fbd944ac254bfacfa48b43061b6e5f
2
debian/control
vendored
@ -21,7 +21,6 @@ Build-Depends: debhelper (>= 8.0.0),
|
||||
libdtkcore5-bin (>=5.4.14),
|
||||
libdtkgui-dev (>=5.4.13),
|
||||
libdframeworkdbus-dev (>=5.4.6),
|
||||
libdde-network-utils-dev (>=5.4.6),
|
||||
libgsettings-qt-dev,
|
||||
libdbusmenu-qt5-dev,
|
||||
libgtest-dev,
|
||||
@ -37,7 +36,6 @@ Depends: ${shlibs:Depends}, ${misc:Depends},
|
||||
libdtkcore5 (>=5.4.14),
|
||||
libdtkgui5 (>=5.4.13),
|
||||
libdframeworkdbus2 (>=5.4.6),
|
||||
libdde-network-utils (>=5.4.6),
|
||||
dde-qt5xcb-plugin (>=5.0.25),
|
||||
dde-daemon (>=5.13.12),
|
||||
startdde (>=5.8.9),
|
||||
|
@ -52,7 +52,6 @@ target_include_directories(${BIN_NAME} PUBLIC
|
||||
xcb
|
||||
../plugins/tray
|
||||
../plugins/show-desktop
|
||||
../plugins/network
|
||||
../plugins/datetime
|
||||
../plugins/onboard
|
||||
../plugins/trash
|
||||
|
@ -38,8 +38,6 @@
|
||||
//#include "../plugins/sound/componments/horizontalseparator.h"
|
||||
|
||||
#include "showdesktopwidget.h"
|
||||
#include "networkitem.h"
|
||||
#include "item/applet/devicecontrolwidget.h"
|
||||
#include "datetimewidget.h"
|
||||
#include "onboarditem.h"
|
||||
#include "trashwidget.h"
|
||||
@ -47,6 +45,7 @@
|
||||
#include "shutdownwidget.h"
|
||||
#include "multitaskingwidget.h"
|
||||
#include "overlaywarningwidget.h"
|
||||
#include "horizontalseperator.h"
|
||||
|
||||
#include <DIconButton>
|
||||
#include <DSwitchButton>
|
||||
@ -114,9 +113,7 @@ SET_FORM_ACCESSIBLE(QScrollArea, "QScrollArea")
|
||||
SET_FORM_ACCESSIBLE(QFrame, "QFrame")
|
||||
SET_FORM_ACCESSIBLE(QGraphicsView, "QGraphicsView")
|
||||
SET_FORM_ACCESSIBLE(DragWidget, "DragWidget")
|
||||
SET_FORM_ACCESSIBLE(NetworkItem, "NetworkItem")
|
||||
SET_FORM_ACCESSIBLE(StateButton, "StateButton")
|
||||
SET_FORM_ACCESSIBLE(DeviceControlWidget, "DeviceControlWidget")
|
||||
|
||||
QAccessibleInterface *accessibleFactory(const QString &classname, QObject *object)
|
||||
{
|
||||
@ -181,9 +178,7 @@ QAccessibleInterface *accessibleFactory(const QString &classname, QObject *objec
|
||||
ELSE_USE_ACCESSIBLE(classname, QFrame)
|
||||
ELSE_USE_ACCESSIBLE(classname, QGraphicsView)
|
||||
ELSE_USE_ACCESSIBLE(classname, DragWidget)
|
||||
ELSE_USE_ACCESSIBLE(classname, NetworkItem)
|
||||
ELSE_USE_ACCESSIBLE(classname, StateButton)
|
||||
ELSE_USE_ACCESSIBLE(classname, DeviceControlWidget)
|
||||
ELSE_USE_ACCESSIBLE(classname, HorizontalSeperator);
|
||||
|
||||
if (!interface && object->inherits("QWidget") && !ignoreLst.contains(classname)) {
|
||||
|
@ -192,11 +192,6 @@ int main(int argc, char *argv[])
|
||||
// 自动化标记由此开始
|
||||
QAccessible::installFactory(accessibleFactory);
|
||||
|
||||
// load dde-network-utils translator
|
||||
QTranslator translator;
|
||||
translator.load("/usr/share/dde-network-utils/translations/dde-network-utils_" + QLocale::system().name());
|
||||
app.installTranslator(&translator);
|
||||
|
||||
// 设置日志输出到控制台以及文件
|
||||
DLogManager::registerConsoleAppender();
|
||||
DLogManager::registerFileAppender();
|
||||
|
@ -1,6 +1,5 @@
|
||||
add_subdirectory("datetime")
|
||||
#add_subdirectory("disk-mount")
|
||||
add_subdirectory("network")
|
||||
add_subdirectory("shutdown")
|
||||
add_subdirectory("power")
|
||||
add_subdirectory("sound")
|
||||
|
@ -1,45 +0,0 @@
|
||||
|
||||
set(PLUGIN_NAME "network")
|
||||
|
||||
project(${PLUGIN_NAME})
|
||||
|
||||
# Sources files
|
||||
file(GLOB_RECURSE SRCS "*.h" "*.cpp" "../../widgets/*.h" "../../widgets/*.cpp"
|
||||
"../../frame/util/imageutil.h" "../../frame/util/imageutil.cpp"
|
||||
"../../frame/util/statebutton.h" "../../frame/util/statebutton.cpp"
|
||||
"../../frame/util/horizontalseperator.h" "../../frame/util/horizontalseperator.cpp")
|
||||
|
||||
find_package(PkgConfig REQUIRED)
|
||||
find_package(Qt5Widgets REQUIRED)
|
||||
find_package(Qt5Svg REQUIRED)
|
||||
find_package(Qt5DBus REQUIRED)
|
||||
find_package(DtkWidget REQUIRED)
|
||||
find_package(Qt5Network REQUIRED)
|
||||
|
||||
pkg_check_modules(DDE-Network-Utils REQUIRED dde-network-utils)
|
||||
pkg_check_modules(DFrameworkDBus REQUIRED dframeworkdbus)
|
||||
pkg_check_modules(QGSettings REQUIRED gsettings-qt)
|
||||
|
||||
add_definitions("${QT_DEFINITIONS} -DQT_PLUGIN")
|
||||
add_library(${PLUGIN_NAME} SHARED ${SRCS} network.qrc)
|
||||
set_target_properties(${PLUGIN_NAME} PROPERTIES LIBRARY_OUTPUT_DIRECTORY ../system-trays)
|
||||
target_include_directories(${PLUGIN_NAME} PUBLIC ${DtkWidget_INCLUDE_DIRS}
|
||||
${Qt5DBus_INCLUDE_DIRS}
|
||||
${DFrameworkDBus_INCLUDE_DIRS}
|
||||
${QGSettings_INCLUDE_DIRS}
|
||||
${DDE-Network-Utils_INCLUDE_DIRS}
|
||||
${Qt5Network_INCLUDE_DIRS}
|
||||
../../interfaces
|
||||
../../frame)
|
||||
target_link_libraries(${PLUGIN_NAME} PRIVATE
|
||||
${DtkWidget_LIBRARIES}
|
||||
${Qt5Widgets_LIBRARIES}
|
||||
${Qt5Svg_LIBRARIES}
|
||||
${Qt5DBus_LIBRARIES}
|
||||
${QGSettings_LIBRARIES}
|
||||
${DDE-Network-Utils_LIBRARIES}
|
||||
${DFrameworkDBus_LIBRARIES}
|
||||
${Qt5Network_LIBRARIES}
|
||||
)
|
||||
|
||||
install(TARGETS ${PLUGIN_NAME} LIBRARY DESTINATION lib/dde-dock/plugins/system-trays)
|
@ -1,107 +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_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;
|
||||
}
|
||||
|
||||
bool AccessPoint::isEmpty() const
|
||||
{
|
||||
return m_path.isEmpty();
|
||||
}
|
||||
|
||||
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();
|
||||
}
|
@ -1,59 +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;
|
||||
|
||||
bool isEmpty() 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
|
@ -1,239 +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 "util/utils.h"
|
||||
#include "../frame/util/imageutil.h"
|
||||
#include "../wireditem.h"
|
||||
#include "constants.h"
|
||||
#include "util/statebutton.h"
|
||||
|
||||
#include <DGuiApplicationHelper>
|
||||
#include <DApplication>
|
||||
|
||||
#include <QHBoxLayout>
|
||||
#include <QDebug>
|
||||
#include <QFontMetrics>
|
||||
#include <QIcon>
|
||||
#include <QPainter>
|
||||
|
||||
using namespace dde::network;
|
||||
|
||||
DWIDGET_USE_NAMESPACE
|
||||
DGUI_USE_NAMESPACE
|
||||
|
||||
extern const QString DarkType;
|
||||
extern const QString LightType;
|
||||
|
||||
AccessPointWidget::AccessPointWidget(QWidget *parent)
|
||||
: QFrame(parent)
|
||||
, m_activeState(NetworkDevice::Unknown)
|
||||
, m_ssidBtn(new SsidButton(this))
|
||||
, m_securityLabel(new QLabel(this))
|
||||
, m_strengthLabel(new QLabel(this))
|
||||
, m_stateButton(new StateButton(this))
|
||||
, m_isEnter(false)
|
||||
{
|
||||
m_ssidBtn->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Preferred);
|
||||
|
||||
m_ssidBtn->setObjectName("Ssid");
|
||||
m_ssidBtn->setForegroundRole(QPalette::BrightText);
|
||||
|
||||
bool isLight = (DGuiApplicationHelper::instance()->themeType() == DGuiApplicationHelper::LightType);
|
||||
|
||||
m_stateButton->setFixedSize(16, 16);
|
||||
m_stateButton->setType(StateButton::Check);
|
||||
m_stateButton->setVisible(false);
|
||||
|
||||
auto pixpath = QString(":/wireless/resources/wireless/security");
|
||||
pixpath = isLight ? pixpath + DarkType : pixpath + LightType;
|
||||
m_securityPixmap = Utils::renderSVG(pixpath, QSize(16, 16), devicePixelRatioF());
|
||||
m_securityIconSize = m_securityPixmap.size();
|
||||
m_securityLabel->setPixmap(m_securityPixmap);
|
||||
m_securityLabel->setFixedSize(m_securityIconSize / devicePixelRatioF());
|
||||
|
||||
QHBoxLayout *infoLayout = new QHBoxLayout;
|
||||
infoLayout->setMargin(0);
|
||||
infoLayout->setSpacing(0);
|
||||
infoLayout->addSpacing(12);
|
||||
infoLayout->addWidget(m_securityLabel);
|
||||
infoLayout->addSpacing(2);
|
||||
infoLayout->addWidget(m_strengthLabel);
|
||||
infoLayout->addSpacing(10);
|
||||
infoLayout->addWidget(m_ssidBtn);
|
||||
infoLayout->addWidget(m_stateButton);
|
||||
infoLayout->addSpacing(10);
|
||||
infoLayout->setSpacing(0);
|
||||
|
||||
QVBoxLayout *centralLayout = new QVBoxLayout;
|
||||
centralLayout->addLayout(infoLayout);
|
||||
centralLayout->setSpacing(0);
|
||||
centralLayout->setMargin(0);
|
||||
|
||||
setLayout(centralLayout);
|
||||
|
||||
connect(m_ssidBtn, &SsidButton::clicked, this, &AccessPointWidget::clicked);
|
||||
connect(m_ssidBtn, &SsidButton::clicked, this, &AccessPointWidget::ssidClicked);
|
||||
connect(DGuiApplicationHelper::instance(), &DGuiApplicationHelper::themeTypeChanged, this, [ = ] {
|
||||
setStrengthIcon(m_ap.strength());
|
||||
});
|
||||
|
||||
connect(qApp, &DApplication::iconThemeChanged, this, [ = ] {
|
||||
setStrengthIcon(m_ap.strength());
|
||||
});
|
||||
|
||||
connect(m_stateButton, &StateButton::click, this, &AccessPointWidget::disconnectBtnClicked);
|
||||
|
||||
setStrengthIcon(m_ap.strength());
|
||||
}
|
||||
|
||||
void AccessPointWidget::updateAP(const AccessPoint &ap)
|
||||
{
|
||||
m_ap = ap;
|
||||
|
||||
QString strSsid = ap.ssid();
|
||||
m_ssidBtn->setText(strSsid);
|
||||
|
||||
QFontMetrics fontMetrics(m_ssidBtn->font());
|
||||
if(fontMetrics.width(strSsid) > m_ssidBtn->width())
|
||||
{
|
||||
strSsid = QFontMetrics(m_ssidBtn->font()).elidedText(strSsid, Qt::ElideRight, m_ssidBtn->width());
|
||||
}
|
||||
m_ssidBtn->setText(strSsid);
|
||||
|
||||
setStrengthIcon(ap.strength());
|
||||
|
||||
if (!ap.secured()) {
|
||||
m_securityLabel->clear();
|
||||
} else if(!m_securityLabel->pixmap()) {
|
||||
m_securityLabel->setPixmap(m_securityPixmap);
|
||||
}
|
||||
|
||||
// reset state
|
||||
setActiveState(NetworkDevice::Unknown);
|
||||
}
|
||||
|
||||
bool AccessPointWidget::active() const
|
||||
{
|
||||
return m_activeState == NetworkDevice::Activated;
|
||||
}
|
||||
|
||||
void AccessPointWidget::setActiveState(const NetworkDevice::DeviceStatus state)
|
||||
{
|
||||
if (m_activeState == state)
|
||||
return;
|
||||
|
||||
m_activeState = state;
|
||||
|
||||
const bool isActive = active();
|
||||
|
||||
m_stateButton->setVisible(isActive);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief AccessPointWidget::paintEvent 根据主题颜色绘制wifi列表item背景色
|
||||
* @param event
|
||||
*/
|
||||
void AccessPointWidget::paintEvent(QPaintEvent *event)
|
||||
{
|
||||
Q_UNUSED(event);
|
||||
QPainter painter(this);
|
||||
painter.setPen(Qt::NoPen);
|
||||
if (DGuiApplicationHelper::instance()->themeType() == DGuiApplicationHelper::LightType) {
|
||||
if(m_isEnter) {
|
||||
painter.setBrush(QColor(0, 0, 0, 0.12*255));
|
||||
} else {
|
||||
painter.setBrush(Qt::transparent);
|
||||
}
|
||||
} else {
|
||||
if(m_isEnter) {
|
||||
painter.setBrush(QColor(255, 255, 255, 0.12*255));
|
||||
} else {
|
||||
painter.setBrush(Qt::transparent);
|
||||
}
|
||||
}
|
||||
|
||||
painter.drawRect(rect());
|
||||
}
|
||||
|
||||
void AccessPointWidget::enterEvent(QEvent *e)
|
||||
{
|
||||
m_isEnter = true;
|
||||
update();
|
||||
QWidget::enterEvent(e);
|
||||
}
|
||||
|
||||
void AccessPointWidget::leaveEvent(QEvent *e)
|
||||
{
|
||||
m_isEnter = false;
|
||||
update();
|
||||
QWidget::leaveEvent(e);
|
||||
}
|
||||
|
||||
void AccessPointWidget::setStrengthIcon(const int strength)
|
||||
{
|
||||
QPixmap iconPix;
|
||||
const QSize s = QSize(16, 16);
|
||||
|
||||
QString type;
|
||||
if (strength > 65)
|
||||
type = "80";
|
||||
else if (strength > 55)
|
||||
type = "60";
|
||||
else if (strength > 30)
|
||||
type = "40";
|
||||
else if (strength > 5)
|
||||
type = "20";
|
||||
else
|
||||
type = "0";
|
||||
|
||||
QString iconString = QString("wireless-%1-symbolic").arg(type);
|
||||
bool isLight = (DGuiApplicationHelper::instance()->themeType() == DGuiApplicationHelper::LightType);
|
||||
|
||||
if (isLight) {
|
||||
iconString.append("-dark");
|
||||
}
|
||||
|
||||
const auto ratio = devicePixelRatioF();
|
||||
iconPix = ImageUtil::loadSvg(iconString, ":/wireless/resources/wireless/", s.width(), ratio);
|
||||
|
||||
m_strengthLabel->setPixmap(iconPix);
|
||||
|
||||
m_securityPixmap = QIcon::fromTheme(isLight ? ":/wireless/resources/wireless/security_dark.svg" : ":/wireless/resources/wireless/security.svg").pixmap(s * devicePixelRatioF());
|
||||
m_securityPixmap.setDevicePixelRatio(devicePixelRatioF());
|
||||
m_securityLabel->setPixmap(m_securityPixmap);
|
||||
}
|
||||
|
||||
void AccessPointWidget::ssidClicked()
|
||||
{
|
||||
if (m_activeState == NetworkDevice::Activated)
|
||||
return;
|
||||
|
||||
setActiveState(NetworkDevice::Prepare);
|
||||
emit requestActiveAP(m_ap.path(), m_ap.ssid());
|
||||
}
|
||||
|
||||
void AccessPointWidget::disconnectBtnClicked()
|
||||
{
|
||||
setActiveState(NetworkDevice::Unknown);
|
||||
emit requestDeactiveAP(m_ap);
|
||||
}
|
@ -1,100 +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>
|
||||
|
||||
#include <QWidget>
|
||||
#include <QLabel>
|
||||
#include <QDBusObjectPath>
|
||||
|
||||
class StateButton;
|
||||
class SsidButton : public QLabel
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
explicit SsidButton(QWidget *parent = nullptr)
|
||||
: QLabel(parent) {}
|
||||
virtual ~SsidButton() override {}
|
||||
|
||||
signals:
|
||||
void clicked();
|
||||
|
||||
protected:
|
||||
void mouseReleaseEvent(QMouseEvent *event) override
|
||||
{
|
||||
QLabel::mouseReleaseEvent(event);
|
||||
|
||||
Q_EMIT clicked();
|
||||
}
|
||||
};
|
||||
|
||||
class AccessPointWidget : public QFrame
|
||||
{
|
||||
Q_OBJECT
|
||||
Q_PROPERTY(bool active READ active DESIGNABLE true)
|
||||
|
||||
public:
|
||||
explicit AccessPointWidget(QWidget *parent = nullptr);
|
||||
|
||||
const AccessPoint ap() const { return m_ap; }
|
||||
void updateAP(const AccessPoint &ap);
|
||||
|
||||
bool active() const;
|
||||
void setActiveState(const dde::network::NetworkDevice::DeviceStatus state);
|
||||
|
||||
signals:
|
||||
void requestActiveAP(const QString &apPath, const QString &ssid) const;
|
||||
void requestDeactiveAP(const AccessPoint &ap) const;
|
||||
void clicked() const;
|
||||
|
||||
private:
|
||||
void enterEvent(QEvent *e) override;
|
||||
void leaveEvent(QEvent *e) override;
|
||||
void setStrengthIcon(const int strength);
|
||||
|
||||
protected:
|
||||
void paintEvent(QPaintEvent *event) override;
|
||||
|
||||
private slots:
|
||||
void ssidClicked();
|
||||
void disconnectBtnClicked();
|
||||
|
||||
private:
|
||||
dde::network::NetworkDevice::DeviceStatus m_activeState;
|
||||
|
||||
AccessPoint m_ap;
|
||||
SsidButton *m_ssidBtn;
|
||||
QLabel *m_securityLabel;
|
||||
QLabel *m_strengthLabel;
|
||||
StateButton *m_stateButton;
|
||||
|
||||
QPixmap m_securityPixmap;
|
||||
QSize m_securityIconSize;
|
||||
|
||||
bool m_isEnter;
|
||||
};
|
||||
|
||||
#endif // ACCESSPOINTWIDGET_H
|
@ -1,133 +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 "../widgets/tipswidget.h"
|
||||
|
||||
#include <DHiDPIHelper>
|
||||
#include <DGuiApplicationHelper>
|
||||
|
||||
#include <QTimer>
|
||||
#include <QHBoxLayout>
|
||||
#include <QDebug>
|
||||
#include <QEvent>
|
||||
#include <QLabel>
|
||||
|
||||
DWIDGET_USE_NAMESPACE
|
||||
DGUI_USE_NAMESPACE
|
||||
|
||||
extern const int ItemHeight = 30;
|
||||
|
||||
DeviceControlWidget::DeviceControlWidget(QWidget *parent)
|
||||
: QWidget(parent)
|
||||
, m_deviceName(new QLabel(this))
|
||||
, m_switchBtn(new DSwitchButton(this))
|
||||
, m_loadingIndicator(new DLoadingIndicator(this))
|
||||
{
|
||||
m_deviceName->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Preferred);
|
||||
m_deviceName->setForegroundRole(QPalette::BrightText);
|
||||
|
||||
const QPixmap pixmap = DHiDPIHelper::loadNxPixmap(":/wireless/resources/wireless/refresh.svg");
|
||||
|
||||
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());
|
||||
m_loadingIndicator->viewport()->setAutoFillBackground(false);
|
||||
m_loadingIndicator->setFrameShape(QFrame::NoFrame);
|
||||
refreshIcon();
|
||||
|
||||
QHBoxLayout *infoLayout = new QHBoxLayout;
|
||||
infoLayout->setMargin(0);
|
||||
infoLayout->setSpacing(0);
|
||||
infoLayout->setContentsMargins(20, 0, 0, 0);
|
||||
infoLayout->addWidget(m_deviceName);
|
||||
infoLayout->addStretch();
|
||||
infoLayout->addWidget(m_loadingIndicator);
|
||||
infoLayout->addSpacing(4);
|
||||
infoLayout->addWidget(m_switchBtn);
|
||||
// DSwitchButton 按照设计要求: 在保持现有控件的尺寸下,这里需要预留绘制focusRect的区域,borderWidth为2,间隙宽度为2
|
||||
// 所以此处按设计的要求 10-4 = 6
|
||||
infoLayout->addSpacing(6);
|
||||
|
||||
QVBoxLayout *centralLayout = new QVBoxLayout;
|
||||
centralLayout->addLayout(infoLayout);
|
||||
centralLayout->setMargin(0);
|
||||
centralLayout->setSpacing(0);
|
||||
centralLayout->setContentsMargins(0, 0, 0, 0);
|
||||
|
||||
setLayout(centralLayout);
|
||||
setFixedHeight(ItemHeight);
|
||||
|
||||
connect(m_switchBtn, &DSwitchButton::clicked, this, &DeviceControlWidget::enableButtonToggled);
|
||||
connect(DGuiApplicationHelper::instance(), &DGuiApplicationHelper::themeTypeChanged, this, &DeviceControlWidget::refreshIcon);
|
||||
}
|
||||
|
||||
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::refreshIcon()
|
||||
{
|
||||
QPixmap pixmap;
|
||||
if (DGuiApplicationHelper::instance()->themeType() == DGuiApplicationHelper::LightType)
|
||||
pixmap = DHiDPIHelper::loadNxPixmap(":/wireless/resources/wireless/refresh_dark.svg");
|
||||
else
|
||||
pixmap = DHiDPIHelper::loadNxPixmap(":/wireless/resources/wireless/refresh.svg");
|
||||
|
||||
m_loadingIndicator->setImageSource(pixmap);
|
||||
}
|
@ -1,60 +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 <dloadingindicator.h>
|
||||
#include <dswitchbutton.h>
|
||||
|
||||
DWIDGET_USE_NAMESPACE
|
||||
class QLabel;
|
||||
class DeviceControlWidget : public QWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit DeviceControlWidget(QWidget *parent = 0);
|
||||
|
||||
void setDeviceName(const QString &name);
|
||||
void setDeviceEnabled(const bool enable);
|
||||
|
||||
signals:
|
||||
void enableButtonToggled(const bool enable) const;
|
||||
void requestRefresh() const;
|
||||
|
||||
protected:
|
||||
bool eventFilter(QObject *watched, QEvent *event) override;
|
||||
void refreshIcon();
|
||||
|
||||
private slots:
|
||||
void refreshNetwork();
|
||||
|
||||
private:
|
||||
QLabel *m_deviceName;
|
||||
Dtk::Widget::DSwitchButton *m_switchBtn;
|
||||
DLoadingIndicator *m_loadingIndicator;
|
||||
};
|
||||
|
||||
#endif // DEVICECONTROLWIDGET_H
|
@ -1,468 +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 "wirelesslist.h"
|
||||
#include "accesspointwidget.h"
|
||||
#include "constants.h"
|
||||
|
||||
#include <QJsonDocument>
|
||||
#include <QScreen>
|
||||
#include <QDebug>
|
||||
#include <QGuiApplication>
|
||||
#include <QVBoxLayout>
|
||||
#include <QScrollBar>
|
||||
#include <QTimer>
|
||||
|
||||
#include <dinputdialog.h>
|
||||
#include <DDBusSender>
|
||||
|
||||
DWIDGET_USE_NAMESPACE
|
||||
|
||||
using namespace dde::network;
|
||||
|
||||
extern const int ItemWidth = 250;
|
||||
extern const int ItemMargin = 10;
|
||||
extern const int ItemHeight;
|
||||
|
||||
WirelessList::WirelessList(WirelessDevice *deviceIter, QWidget *parent)
|
||||
: QScrollArea(parent)
|
||||
, m_device(deviceIter)
|
||||
, m_activeAP()
|
||||
, m_updateAPTimer(new QTimer(this))
|
||||
, m_centralLayout(new QVBoxLayout)
|
||||
, m_centralWidget(new QWidget(this))
|
||||
, m_controlPanel(new DeviceControlWidget(this))
|
||||
{
|
||||
setFixedHeight(ItemHeight);
|
||||
|
||||
m_updateAPTimer->setSingleShot(true);
|
||||
m_updateAPTimer->setInterval(100);
|
||||
|
||||
m_centralWidget->setFixedWidth(ItemWidth);
|
||||
m_centralWidget->setLayout(m_centralLayout);
|
||||
|
||||
m_centralLayout->addWidget(m_controlPanel);
|
||||
m_centralLayout->setSpacing(0);
|
||||
m_centralLayout->setMargin(0);
|
||||
|
||||
setWidget(m_centralWidget);
|
||||
setFrameShape(QFrame::NoFrame);
|
||||
setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
|
||||
setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
|
||||
m_centralWidget->setAutoFillBackground(false);
|
||||
viewport()->setAutoFillBackground(false);
|
||||
|
||||
m_loadingStat = new DSpinner(this);
|
||||
m_loadingStat->setFixedSize(PLUGIN_ICON_MAX_SIZE, PLUGIN_ICON_MAX_SIZE);
|
||||
m_loadingStat->setVisible(false);
|
||||
isHotposActive = false;
|
||||
|
||||
connect(m_device, &WirelessDevice::apAdded, this, &WirelessList::APAdded);
|
||||
connect(m_device, &WirelessDevice::apRemoved, this, &WirelessList::APRemoved);
|
||||
connect(m_device, &WirelessDevice::apInfoChanged, this, &WirelessList::APPropertiesChanged);
|
||||
connect(m_device, &WirelessDevice::enableChanged, this, &WirelessList::onDeviceEnableChanged);
|
||||
connect(m_device, &WirelessDevice::activateAccessPointFailed, this, &WirelessList::onActivateApFailed);
|
||||
connect(m_device, &WirelessDevice::hotspotEnabledChanged, this, &WirelessList::onHotspotEnabledChanged);
|
||||
|
||||
connect(m_controlPanel, &DeviceControlWidget::enableButtonToggled, this, &WirelessList::onEnableButtonToggle);
|
||||
connect(m_controlPanel, &DeviceControlWidget::requestRefresh, this, &WirelessList::requestWirelessScan);
|
||||
|
||||
connect(m_updateAPTimer, &QTimer::timeout, this, &WirelessList::updateAPList);
|
||||
|
||||
connect(m_device, &WirelessDevice::activeWirelessConnectionInfoChanged, this, &WirelessList::onActiveConnectionInfoChanged);
|
||||
connect(m_device, static_cast<void (WirelessDevice::*)(NetworkDevice::DeviceStatus stat) const>(&WirelessDevice::statusChanged), m_updateAPTimer, static_cast<void (QTimer::*)()>(&QTimer::start));
|
||||
connect(m_device, &WirelessDevice::activeConnectionsChanged, this, &WirelessList::updateIndicatorPos, Qt::QueuedConnection);
|
||||
|
||||
connect(this->verticalScrollBar(), &QScrollBar::valueChanged, this, [ = ] {
|
||||
auto apw = accessPointWidgetByAp(m_activatingAP);
|
||||
if (!apw)
|
||||
return;
|
||||
|
||||
const int h = -(apw->height() - m_loadingStat->height()) / 2;
|
||||
m_loadingStat->move(apw->mapTo(this, apw->rect().topRight()) - QPoint(23, h));
|
||||
});
|
||||
|
||||
QMetaObject::invokeMethod(this, "loadAPList", Qt::QueuedConnection);
|
||||
}
|
||||
|
||||
WirelessList::~WirelessList()
|
||||
{
|
||||
}
|
||||
|
||||
QWidget *WirelessList::controlPanel()
|
||||
{
|
||||
return m_controlPanel;
|
||||
}
|
||||
|
||||
int WirelessList::APcount()
|
||||
{
|
||||
return m_apList.size();
|
||||
}
|
||||
|
||||
void WirelessList::APAdded(const QJsonObject &apInfo)
|
||||
{
|
||||
AccessPoint ap(apInfo);
|
||||
const auto mIndex = m_apList.indexOf(ap);
|
||||
if (mIndex != -1) {
|
||||
if (ap.strength() < 5 && ap.path() == m_apList.at(mIndex).path())
|
||||
m_apList.removeAt(mIndex);
|
||||
else if ((ap.strength() < m_apList.at(mIndex).strength() && ap.path() == m_apList.at(mIndex).path())
|
||||
|| (ap.strength() > m_apList.at(mIndex).strength()))
|
||||
m_apList.replace(mIndex, ap);
|
||||
else
|
||||
return;
|
||||
} else {
|
||||
if (ap.strength() < 5)
|
||||
return;
|
||||
m_apList.append(ap);
|
||||
}
|
||||
|
||||
m_updateAPTimer->start();
|
||||
}
|
||||
|
||||
void WirelessList::APRemoved(const QJsonObject &apInfo)
|
||||
{
|
||||
AccessPoint ap(apInfo);
|
||||
const auto mIndex = m_apList.indexOf(ap);
|
||||
if (mIndex != -1) {
|
||||
if (ap.path() == m_apList.at(mIndex).path()) {
|
||||
m_apList.removeAt(mIndex);
|
||||
m_updateAPTimer->start();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void WirelessList::setDeviceInfo(const int index)
|
||||
{
|
||||
if (m_device.isNull()) {
|
||||
return;
|
||||
}
|
||||
|
||||
// set device enable state
|
||||
m_controlPanel->setDeviceEnabled(m_device->enabled());
|
||||
|
||||
// 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()
|
||||
{
|
||||
if (m_device.isNull()) {
|
||||
return;
|
||||
}
|
||||
|
||||
for (auto item : m_device->apList()) {
|
||||
AccessPoint ap(item.toObject());
|
||||
const auto mIndex = m_apList.indexOf(ap);
|
||||
if (mIndex != -1) {
|
||||
// indexOf() will use AccessPoint reimplemented function "operator==" as comparison condition
|
||||
// this means that the ssid of the AP is a comparison condition
|
||||
m_apList.replace(mIndex, ap);
|
||||
} else {
|
||||
m_apList.append(ap);
|
||||
}
|
||||
}
|
||||
|
||||
m_updateAPTimer->start();
|
||||
}
|
||||
|
||||
void WirelessList::APPropertiesChanged(const QJsonObject &apInfo)
|
||||
{
|
||||
AccessPoint ap(apInfo);
|
||||
const auto mIndex = m_apList.indexOf(ap);
|
||||
if(ap.strength() < 5)
|
||||
{
|
||||
if(mIndex != -1){
|
||||
if (ap.path() == m_apList.at(mIndex).path()) {
|
||||
m_apList.removeAt(mIndex);
|
||||
m_updateAPTimer->start();
|
||||
}
|
||||
}
|
||||
}else {
|
||||
if (mIndex != -1) {
|
||||
if ((ap.strength() < m_apList.at(mIndex).strength() && ap.path() == m_apList.at(mIndex).path())
|
||||
|| (ap.strength() > m_apList.at(mIndex).strength()))
|
||||
m_apList.replace(mIndex, ap);
|
||||
else
|
||||
return;
|
||||
}else {
|
||||
m_apList.append(ap);
|
||||
}
|
||||
m_updateAPTimer->start();
|
||||
}
|
||||
}
|
||||
|
||||
void WirelessList::updateAPList()
|
||||
{
|
||||
Q_ASSERT(sender() == m_updateAPTimer);
|
||||
|
||||
if (m_device.isNull()) {
|
||||
return;
|
||||
}
|
||||
|
||||
int avaliableAPCount = 0;
|
||||
|
||||
if (m_device->enabled()) {
|
||||
// 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(this);
|
||||
apw->setFixedHeight(ItemHeight);
|
||||
m_apwList << apw;
|
||||
m_centralLayout->addWidget(apw);
|
||||
|
||||
connect(apw, &AccessPointWidget::requestActiveAP, this, &WirelessList::activateAP);
|
||||
connect(apw, &AccessPointWidget::requestDeactiveAP, this, &WirelessList::deactiveAP);
|
||||
connect(apw, &AccessPointWidget::requestActiveAP, this, [ = ] {
|
||||
m_clickedAPW = apw;
|
||||
}, Qt::UniqueConnection);
|
||||
}
|
||||
} 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);
|
||||
apw->deleteLater();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
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();
|
||||
});
|
||||
|
||||
// update the content of AccessPointWidget by the order of ApList
|
||||
for (int i = 0; i != m_apList.size(); i++) {
|
||||
m_apwList[i]->updateAP(m_apList[i]);
|
||||
++avaliableAPCount;
|
||||
}
|
||||
|
||||
// update active AP state
|
||||
NetworkDevice::DeviceStatus deviceStatus = m_device->status();
|
||||
if (!m_apwList.isEmpty()) {
|
||||
AccessPointWidget *apw = m_apwList.first();
|
||||
|
||||
apw->setActiveState(deviceStatus);
|
||||
}
|
||||
|
||||
if (m_loadingStat->isVisible() && !m_activatingAP.isEmpty() && m_apList.contains(m_activatingAP)) {
|
||||
AccessPointWidget *apw = accessPointWidgetByAp(m_activatingAP);
|
||||
if (apw) {
|
||||
const int h = -(apw->height() - m_loadingStat->height()) / 2;
|
||||
m_loadingStat->move(apw->mapTo(this, apw->rect().topRight()) - QPoint(23, h));
|
||||
}
|
||||
}
|
||||
|
||||
if (deviceStatus <= NetworkDevice::Disconnected || deviceStatus >= NetworkDevice::Activated) {
|
||||
m_loadingStat->stop();
|
||||
m_loadingStat->hide();
|
||||
}
|
||||
}
|
||||
|
||||
const int contentHeight = avaliableAPCount * ItemHeight;
|
||||
m_centralWidget->setFixedHeight(contentHeight);
|
||||
setFixedHeight(contentHeight);
|
||||
emit requestUpdatePopup();
|
||||
|
||||
QTimer::singleShot(100, this, &WirelessList::updateIndicatorPos);
|
||||
}
|
||||
|
||||
void WirelessList::onEnableButtonToggle(const bool enable)
|
||||
{
|
||||
if (m_device.isNull()) {
|
||||
return;
|
||||
}
|
||||
|
||||
Q_EMIT requestSetDeviceEnable(m_device->path(), enable);
|
||||
m_updateAPTimer->start();
|
||||
}
|
||||
|
||||
void WirelessList::onDeviceEnableChanged(const bool enable)
|
||||
{
|
||||
m_controlPanel->setDeviceEnabled(enable);
|
||||
m_updateAPTimer->start();
|
||||
}
|
||||
|
||||
void WirelessList::activateAP(const QString &apPath, const QString &ssid)
|
||||
{
|
||||
if (m_device.isNull()) {
|
||||
return;
|
||||
}
|
||||
|
||||
QString uuid;
|
||||
|
||||
QList<QJsonObject> connections = m_device->connections();
|
||||
for (auto item : connections) {
|
||||
if (item.value("Ssid").toString() != ssid)
|
||||
continue;
|
||||
|
||||
uuid = item.value("Uuid").toString();
|
||||
if (!uuid.isEmpty())
|
||||
break;
|
||||
}
|
||||
|
||||
Q_EMIT requestActiveAP(m_device->path(), apPath, uuid);
|
||||
}
|
||||
|
||||
void WirelessList::deactiveAP()
|
||||
{
|
||||
if (m_device.isNull()) {
|
||||
return;
|
||||
}
|
||||
|
||||
Q_EMIT requestDeactiveAP(m_device->path());
|
||||
}
|
||||
|
||||
void WirelessList::updateIndicatorPos()
|
||||
{
|
||||
QString activeSsid;
|
||||
for (auto activeConnObj : m_device->activeConnections()) {
|
||||
if (activeConnObj.value("Vpn").toBool(false)) {
|
||||
continue;
|
||||
}
|
||||
// the State of Active Connection
|
||||
// 0:Unknow, 1:Activating, 2:Activated, 3:Deactivating, 4:Deactivated
|
||||
if (activeConnObj.value("State").toInt(0) != 1) {
|
||||
break;
|
||||
}
|
||||
activeSsid = activeConnObj.value("Id").toString();
|
||||
break;
|
||||
}
|
||||
|
||||
// if current is not activating wireless this will make m_activatingAP empty
|
||||
m_activatingAP = accessPointBySsid(activeSsid);
|
||||
AccessPointWidget *apw = accessPointWidgetByAp(m_activatingAP);
|
||||
|
||||
if (activeSsid.isEmpty() || m_activatingAP.isEmpty() || !apw) {
|
||||
m_loadingStat->hide();
|
||||
return;
|
||||
}
|
||||
|
||||
const int h = -(apw->height() - m_loadingStat->height()) / 2;
|
||||
m_loadingStat->move(apw->mapTo(this, apw->rect().topRight()) - QPoint(23, h));
|
||||
m_loadingStat->show();
|
||||
m_loadingStat->start();
|
||||
}
|
||||
|
||||
void WirelessList::onActiveConnectionInfoChanged()
|
||||
{
|
||||
if (m_device.isNull()) {
|
||||
return;
|
||||
}
|
||||
|
||||
// 在这个方法中需要通过m_device->activeApSsid()的信息设置m_activeAP的值
|
||||
// m_activeAP的值应该从m_apList中拿到,但在程序第一次启动后,当后端扫描无线网的数据还没有发过来,
|
||||
// 这时m_device中的ap list为空,导致本类初始化时调用loadAPList()后m_apList也是空的,
|
||||
// 那么也就无法给m_activeAP正确的值,所以在这里使用timer等待一下后端的数据,再执行遍历m_apList给m_activeAP赋值的操作
|
||||
if (m_device->enabled() && m_device->status() == NetworkDevice::Activated
|
||||
&& m_apList.size() == 0) {
|
||||
QTimer::singleShot(1000, [ = ] {onActiveConnectionInfoChanged();});
|
||||
return;
|
||||
}
|
||||
|
||||
for (int i = 0; i < m_apList.size(); ++i) {
|
||||
if (m_apList.at(i).ssid() == m_device->activeApSsid()) {
|
||||
m_activeAP = m_apList.at(i);
|
||||
m_updateAPTimer->start();
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void WirelessList::onActivateApFailed(const QString &apPath, const QString &uuid)
|
||||
{
|
||||
if (m_device.isNull() && !m_clickedAPW) {
|
||||
return;
|
||||
}
|
||||
|
||||
AccessPoint clickedAP = m_clickedAPW->ap();
|
||||
|
||||
if (clickedAP.isEmpty()) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (clickedAP.path() == apPath) {
|
||||
qDebug() << "wireless connect failed and may require more configuration,"
|
||||
<< "path:" << clickedAP.path() << "ssid" << clickedAP.ssid()
|
||||
<< "secret:" << clickedAP.secured() << "strength" << clickedAP.strength();
|
||||
m_updateAPTimer->start();
|
||||
|
||||
DDBusSender()
|
||||
.service("com.deepin.dde.ControlCenter")
|
||||
.interface("com.deepin.dde.ControlCenter")
|
||||
.path("/com/deepin/dde/ControlCenter")
|
||||
.method("ShowPage")
|
||||
.arg(QString("network"))
|
||||
.arg(QString("%1,%2").arg(m_device->path()).arg(uuid))
|
||||
.call();
|
||||
}
|
||||
}
|
||||
|
||||
void WirelessList::onHotspotEnabledChanged(const bool enabled)
|
||||
{
|
||||
// Note: the obtained hotspot info is not complete
|
||||
m_activeHotspotAP = enabled ? AccessPoint(m_device->activeHotspotInfo().value("Hotspot").toObject())
|
||||
: AccessPoint();
|
||||
isHotposActive = enabled;
|
||||
m_updateAPTimer->start();
|
||||
}
|
||||
|
||||
AccessPoint WirelessList::accessPointBySsid(const QString &ssid)
|
||||
{
|
||||
if (ssid.isEmpty()) {
|
||||
return AccessPoint();
|
||||
}
|
||||
|
||||
for (auto ap : m_apList) {
|
||||
if (ap.ssid() == ssid) {
|
||||
return ap;
|
||||
}
|
||||
}
|
||||
|
||||
return AccessPoint();
|
||||
}
|
||||
|
||||
AccessPointWidget *WirelessList::accessPointWidgetByAp(const AccessPoint ap)
|
||||
{
|
||||
if (ap.isEmpty()) {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
for (auto apw : m_apwList) {
|
||||
if (apw->ap().path() == ap.path()) {
|
||||
return apw;
|
||||
}
|
||||
}
|
||||
|
||||
return nullptr;
|
||||
}
|
@ -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/>.
|
||||
*/
|
||||
|
||||
#ifndef WIRELESSAPPLET_H
|
||||
#define WIRELESSAPPLET_H
|
||||
|
||||
#include "devicecontrolwidget.h"
|
||||
#include "accesspoint.h"
|
||||
|
||||
#include <QScrollArea>
|
||||
#include <QList>
|
||||
#include <QPointer>
|
||||
|
||||
#include <WirelessDevice>
|
||||
|
||||
#include <DSpinner>
|
||||
|
||||
DWIDGET_USE_NAMESPACE
|
||||
|
||||
class AccessPointWidget;
|
||||
class QVBoxLayout;
|
||||
class QTimer;
|
||||
class WirelessList : public QScrollArea
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit WirelessList(dde::network::WirelessDevice *deviceIter, QWidget *parent = 0);
|
||||
~WirelessList();
|
||||
|
||||
QWidget *controlPanel();
|
||||
int APcount();
|
||||
|
||||
public Q_SLOTS:
|
||||
void setDeviceInfo(const int index);
|
||||
void onEnableButtonToggle(const bool enable);
|
||||
|
||||
signals:
|
||||
void requestSetDeviceEnable(const QString &path, const bool enable) const;
|
||||
void requestActiveAP(const QString &devPath, const QString &apPath, const QString &uuid) const;
|
||||
void requestDeactiveAP(const QString &devPath) const;
|
||||
void requestWirelessScan();
|
||||
void requestUpdatePopup();
|
||||
|
||||
private slots:
|
||||
void loadAPList();
|
||||
void APAdded(const QJsonObject &apInfo);
|
||||
void APRemoved(const QJsonObject &apInfo);
|
||||
void APPropertiesChanged(const QJsonObject &apInfo);
|
||||
void updateAPList();
|
||||
void onDeviceEnableChanged(const bool enable);
|
||||
void activateAP(const QString &apPath, const QString &ssid);
|
||||
void deactiveAP();
|
||||
void updateIndicatorPos();
|
||||
void onActiveConnectionInfoChanged();
|
||||
void onActivateApFailed(const QString &apPath, const QString &uuid);
|
||||
void onHotspotEnabledChanged(const bool enabled);
|
||||
|
||||
private:
|
||||
AccessPoint accessPointBySsid(const QString &ssid);
|
||||
AccessPointWidget *accessPointWidgetByAp(const AccessPoint ap);
|
||||
|
||||
private:
|
||||
QPointer<dde::network::WirelessDevice> m_device;
|
||||
|
||||
AccessPoint m_activeAP;
|
||||
AccessPoint m_activatingAP;
|
||||
AccessPoint m_activeHotspotAP;
|
||||
QList<AccessPoint> m_apList;
|
||||
QList<AccessPointWidget *> m_apwList;
|
||||
|
||||
QTimer *m_updateAPTimer;
|
||||
DSpinner *m_loadingStat;
|
||||
|
||||
QVBoxLayout *m_centralLayout;
|
||||
QWidget *m_centralWidget;
|
||||
DeviceControlWidget *m_controlPanel;
|
||||
|
||||
AccessPointWidget *m_clickedAPW;
|
||||
|
||||
public:
|
||||
bool isHotposActive;
|
||||
};
|
||||
|
||||
#endif // WIRELESSAPPLET_H
|
@ -1,110 +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 "../frame/util/utils.h"
|
||||
|
||||
#include <DDBusSender>
|
||||
|
||||
#include <QJsonDocument>
|
||||
#include <QFile>
|
||||
|
||||
using namespace dde::network;
|
||||
|
||||
DeviceItem::DeviceItem(dde::network::NetworkDevice *device, QWidget *parent)
|
||||
: QWidget(parent),
|
||||
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()
|
||||
{
|
||||
if (m_device.isNull()) {
|
||||
return QString();
|
||||
}
|
||||
|
||||
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);
|
||||
|
||||
if (!QFile::exists(ICBC_CONF_FILE)) {
|
||||
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 (m_device.isNull()) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (menuId == "settings")
|
||||
DDBusSender()
|
||||
.service("com.deepin.dde.ControlCenter")
|
||||
.interface("com.deepin.dde.ControlCenter")
|
||||
.path("/com/deepin/dde/ControlCenter")
|
||||
.method("ShowPage")
|
||||
.arg(QString("network"))
|
||||
.arg(m_path)
|
||||
.call();
|
||||
else if (menuId == "enable")
|
||||
Q_EMIT requestSetDeviceEnable(m_path, !m_device->enabled());
|
||||
}
|
||||
|
||||
QWidget *DeviceItem::itemApplet()
|
||||
{
|
||||
return nullptr;
|
||||
}
|
@ -1,60 +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 <QWidget>
|
||||
#include <QPointer>
|
||||
|
||||
#include <NetworkDevice>
|
||||
|
||||
class DeviceItem : public QWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
explicit DeviceItem(dde::network::NetworkDevice *device, QWidget *parent = nullptr);
|
||||
|
||||
const QString &path() const { return m_path; }
|
||||
|
||||
inline const QPointer<dde::network::NetworkDevice> device() { return m_device; }
|
||||
|
||||
virtual const QString itemCommand() const;
|
||||
virtual const QString itemContextMenu();
|
||||
virtual QWidget *itemApplet();
|
||||
virtual QWidget *itemTips();
|
||||
virtual void invokeMenuItem(const QString &menuId);
|
||||
virtual void refreshConnectivity() {}
|
||||
|
||||
signals:
|
||||
void requestSetDeviceEnable(const QString &path, const bool enable) const;
|
||||
|
||||
protected:
|
||||
QSize sizeHint() const;
|
||||
|
||||
protected:
|
||||
QPointer<dde::network::NetworkDevice> m_device;
|
||||
|
||||
private:
|
||||
QString m_path;
|
||||
};
|
||||
|
||||
#endif // DEVICEITEM_H
|
@ -1,311 +0,0 @@
|
||||
/*
|
||||
* 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/horizontalseperator.h"
|
||||
#include "../widgets/tipswidget.h"
|
||||
#include "util/utils.h"
|
||||
#include "util/statebutton.h"
|
||||
#include "util/imageutil.h"
|
||||
|
||||
#include <DGuiApplicationHelper>
|
||||
|
||||
#include <QLabel>
|
||||
#include <QVBoxLayout>
|
||||
|
||||
#include <NetworkModel>
|
||||
|
||||
DGUI_USE_NAMESPACE
|
||||
|
||||
const int ItemHeight = 36;
|
||||
extern const QString DarkType = "_dark.svg";
|
||||
extern const QString LightType = ".svg";
|
||||
|
||||
WiredItem::WiredItem(WiredDevice *device, const QString &deviceName, QWidget *parent)
|
||||
: DeviceItem(device, parent)
|
||||
, m_deviceName(deviceName)
|
||||
, m_connectedName(new QLabel(this))
|
||||
, m_wiredIcon(new QLabel(this))
|
||||
, m_stateButton(new StateButton(this))
|
||||
, m_loadingStat(new DSpinner(this))
|
||||
, m_freshWiredIcon(new QTimer(this))
|
||||
{
|
||||
setFixedHeight(ItemHeight);
|
||||
|
||||
m_stateButton->setFixedSize(16, 16);
|
||||
m_stateButton->setType(StateButton::Check);
|
||||
m_stateButton->setVisible(false);
|
||||
m_loadingStat->setFixedSize(PLUGIN_ICON_MAX_SIZE, PLUGIN_ICON_MAX_SIZE);
|
||||
m_loadingStat->setVisible(false);
|
||||
|
||||
m_connectedName->setText(m_deviceName);
|
||||
m_connectedName->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed);
|
||||
m_connectedName->setForegroundRole(QPalette::BrightText);
|
||||
|
||||
auto connectionLayout = new QVBoxLayout(this);
|
||||
connectionLayout->setMargin(0);
|
||||
connectionLayout->setSpacing(0);
|
||||
|
||||
auto itemLayout = new QHBoxLayout;
|
||||
itemLayout->setMargin(0);
|
||||
itemLayout->setSpacing(0);
|
||||
itemLayout->addSpacing(28);
|
||||
itemLayout->addWidget(m_wiredIcon);
|
||||
itemLayout->addSpacing(8);
|
||||
itemLayout->addWidget(m_connectedName);
|
||||
itemLayout->addWidget(m_stateButton);
|
||||
itemLayout->addWidget(m_loadingStat);
|
||||
itemLayout->addSpacing(11);
|
||||
connectionLayout->addLayout(itemLayout);
|
||||
setLayout(connectionLayout);
|
||||
|
||||
connect(m_freshWiredIcon, &QTimer::timeout, this, &WiredItem::setWiredStateIcon);
|
||||
connect(m_device, static_cast<void (NetworkDevice::*)(const bool) const>(&NetworkDevice::enableChanged),
|
||||
this, &WiredItem::enableChanged);
|
||||
connect(m_device, static_cast<void (NetworkDevice::*)(NetworkDevice::DeviceStatus) const>(&NetworkDevice::statusChanged),
|
||||
this, &WiredItem::deviceStateChanged);
|
||||
connect(m_device, static_cast<void (NetworkDevice::*)(NetworkDevice::DeviceStatus) const>(&NetworkDevice::statusChanged),
|
||||
this, &WiredItem::setWiredStateIcon);
|
||||
connect(m_device, static_cast<void (NetworkDevice::*)(bool) const>(&NetworkDevice::enableChanged),
|
||||
this, &WiredItem::setWiredStateIcon);
|
||||
|
||||
connect(static_cast<WiredDevice *>(m_device.data()), &WiredDevice::activeWiredConnectionInfoChanged,
|
||||
this, &WiredItem::changedActiveWiredConnectionInfo);
|
||||
|
||||
connect(m_stateButton, &StateButton::click, this, [&] {
|
||||
auto enableState = m_device->enabled();
|
||||
emit requestSetDeviceEnable(path(), !enableState);
|
||||
});
|
||||
|
||||
deviceStateChanged(m_device->status());
|
||||
setWiredStateIcon();
|
||||
}
|
||||
|
||||
void WiredItem::setTitle(const QString &name)
|
||||
{
|
||||
if (m_device->status() != NetworkDevice::Activated)
|
||||
m_connectedName->setText(name);
|
||||
m_deviceName = name;
|
||||
}
|
||||
|
||||
bool WiredItem::deviceEabled()
|
||||
{
|
||||
return m_device->enabled();
|
||||
}
|
||||
|
||||
void WiredItem::setDeviceEnabled(bool enabled)
|
||||
{
|
||||
emit requestSetDeviceEnable(path(), enabled);
|
||||
}
|
||||
|
||||
WiredItem::WiredStatus WiredItem::getDeviceState()
|
||||
{
|
||||
if (!m_device->enabled()) {
|
||||
return Disabled;
|
||||
}
|
||||
if (m_device->status() == NetworkDevice::Activated
|
||||
&& NetworkModel::connectivity() != Connectivity::Full) {
|
||||
return ConnectNoInternet;
|
||||
}
|
||||
if (m_device->obtainIpFailed()) {
|
||||
return ObtainIpFailed;
|
||||
}
|
||||
|
||||
switch (m_device->status()) {
|
||||
case NetworkDevice::Unknown: return Unknown;
|
||||
case NetworkDevice::Unmanaged:
|
||||
case NetworkDevice::Unavailable: return Nocable;
|
||||
case NetworkDevice::Disconnected: return Disconnected;
|
||||
case NetworkDevice::Prepare:
|
||||
case NetworkDevice::Config: return Connecting;
|
||||
case NetworkDevice::NeedAuth: return Authenticating;
|
||||
case NetworkDevice::IpConfig:
|
||||
case NetworkDevice::IpCheck:
|
||||
case NetworkDevice::Secondaries: return ObtainingIP;
|
||||
case NetworkDevice::Activated: return Connected;
|
||||
case NetworkDevice::Deactivation:
|
||||
case NetworkDevice::Failed: return Failed;
|
||||
}
|
||||
Q_UNREACHABLE();
|
||||
}
|
||||
|
||||
QJsonObject WiredItem::getActiveWiredConnectionInfo()
|
||||
{
|
||||
return static_cast<WiredDevice *>(m_device.data())->activeWiredConnectionInfo();
|
||||
}
|
||||
|
||||
void WiredItem::setThemeType(DGuiApplicationHelper::ColorType themeType)
|
||||
{
|
||||
bool isLight = (themeType == DGuiApplicationHelper::LightType);
|
||||
|
||||
auto pixpath = QString(":/wired/resources/wired/network-wired-symbolic");
|
||||
pixpath = isLight ? pixpath + "-dark.svg" : pixpath + LightType;
|
||||
auto iconPix = Utils::renderSVG(pixpath, QSize(PLUGIN_ICON_MAX_SIZE, PLUGIN_ICON_MAX_SIZE), devicePixelRatioF());
|
||||
m_wiredIcon->setPixmap(iconPix);
|
||||
}
|
||||
|
||||
void WiredItem::setWiredStateIcon()
|
||||
{
|
||||
QPixmap pixmap;
|
||||
QString iconString;
|
||||
QString stateString;
|
||||
|
||||
auto ratio = devicePixelRatioF();
|
||||
|
||||
switch (m_deviceState) {
|
||||
case NetworkDevice::Unknown:
|
||||
case NetworkDevice::Unmanaged:
|
||||
case NetworkDevice::Unavailable: {
|
||||
stateString = "error";
|
||||
iconString = QString("network-%1-symbolic").arg(stateString);
|
||||
}
|
||||
break;
|
||||
case NetworkDevice::Disconnected: {
|
||||
stateString = "none";
|
||||
iconString = QString("network-%1-symbolic").arg(stateString);
|
||||
}
|
||||
break;
|
||||
case NetworkDevice::Deactivation:
|
||||
case NetworkDevice::Failed: {
|
||||
stateString = "offline";
|
||||
iconString = QString("network-%1-symbolic").arg(stateString);
|
||||
}
|
||||
break;
|
||||
case NetworkDevice::Prepare:
|
||||
case NetworkDevice::Config:
|
||||
case NetworkDevice::NeedAuth:
|
||||
case NetworkDevice::IpConfig:
|
||||
case NetworkDevice::IpCheck:
|
||||
case NetworkDevice::Secondaries: {
|
||||
m_freshWiredIcon->start(200);
|
||||
const int index = QTime::currentTime().msec() / 200 % 10;
|
||||
const int num = index + 1;
|
||||
qDebug() << num;
|
||||
iconString = QString("network-wired-symbolic-connecting%1").arg(num);
|
||||
if (DGuiApplicationHelper::instance()->themeType() == DGuiApplicationHelper::LightType)
|
||||
iconString.append(PLUGIN_MIN_ICON_NAME);
|
||||
pixmap = ImageUtil::loadSvg(iconString, ":/", PLUGIN_ICON_MAX_SIZE, ratio);
|
||||
m_wiredIcon->setPixmap(pixmap);
|
||||
update();
|
||||
return;
|
||||
}
|
||||
case NetworkDevice::Activated: {
|
||||
stateString = "online";
|
||||
iconString = QString("network-%1-symbolic").arg(stateString);
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
m_freshWiredIcon->stop();
|
||||
|
||||
if (m_deviceState == NetworkDevice::Activated && NetworkModel::connectivity() != Connectivity::Full) {
|
||||
stateString = "warning";
|
||||
iconString = QString("network-%1-symbolic").arg(stateString);
|
||||
}
|
||||
|
||||
if (!m_device->enabled()) {
|
||||
stateString = "disabled";
|
||||
iconString = QString("network-%1-symbolic").arg(stateString);
|
||||
}
|
||||
|
||||
if (DGuiApplicationHelper::instance()->themeType() == DGuiApplicationHelper::LightType)
|
||||
iconString.append(PLUGIN_MIN_ICON_NAME);
|
||||
|
||||
pixmap = ImageUtil::loadSvg(iconString, ":/", PLUGIN_ICON_MAX_SIZE, ratio);
|
||||
m_wiredIcon->setPixmap(pixmap);
|
||||
update();
|
||||
}
|
||||
|
||||
void WiredItem::refreshConnectivity()
|
||||
{
|
||||
setWiredStateIcon();
|
||||
}
|
||||
|
||||
QSize WiredItem::sizeHint() const
|
||||
{
|
||||
return QSize(DeviceItem::sizeHint().width(), ItemHeight);
|
||||
}
|
||||
|
||||
void WiredItem::deviceStateChanged(NetworkDevice::DeviceStatus state)
|
||||
{
|
||||
m_deviceState = state;
|
||||
switch (state) {
|
||||
case NetworkDevice::Unknown:
|
||||
case NetworkDevice::Unmanaged:
|
||||
case NetworkDevice::Unavailable:
|
||||
case NetworkDevice::Disconnected:
|
||||
case NetworkDevice::Deactivation:
|
||||
case NetworkDevice::Failed: {
|
||||
m_loadingStat->stop();
|
||||
m_loadingStat->hide();
|
||||
m_loadingStat->setVisible(false);
|
||||
if (!m_device->enabled())
|
||||
m_stateButton->setVisible(false);
|
||||
}
|
||||
break;
|
||||
case NetworkDevice::Prepare:
|
||||
case NetworkDevice::Config:
|
||||
case NetworkDevice::NeedAuth:
|
||||
case NetworkDevice::IpConfig:
|
||||
case NetworkDevice::IpCheck:
|
||||
case NetworkDevice::Secondaries: {
|
||||
m_stateButton->setVisible(false);
|
||||
m_loadingStat->setVisible(true);
|
||||
m_loadingStat->start();
|
||||
}
|
||||
break;
|
||||
case NetworkDevice::Activated: {
|
||||
m_loadingStat->stop();
|
||||
m_loadingStat->setVisible(false);
|
||||
m_stateButton->setVisible(true);
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
emit wiredStateChanged();
|
||||
}
|
||||
|
||||
void WiredItem::changedActiveWiredConnectionInfo(const QJsonObject &connInfo)
|
||||
{
|
||||
if (connInfo.isEmpty()) {
|
||||
m_stateButton->setVisible(false);
|
||||
} else {
|
||||
m_stateButton->setVisible(true);
|
||||
m_loadingStat->stop();
|
||||
m_loadingStat->setVisible(false);
|
||||
}
|
||||
|
||||
auto strTitle = connInfo.value("ConnectionName").toString();
|
||||
m_connectedName->setText(strTitle);
|
||||
QFontMetrics fontMetrics(m_connectedName->font());
|
||||
if (fontMetrics.width(strTitle) > m_connectedName->width()) {
|
||||
strTitle = QFontMetrics(m_connectedName->font()).elidedText(strTitle, Qt::ElideRight, m_connectedName->width());
|
||||
}
|
||||
|
||||
if (strTitle.isEmpty())
|
||||
m_connectedName->setText(m_deviceName);
|
||||
else
|
||||
m_connectedName->setText(strTitle);
|
||||
|
||||
emit activeConnectionChanged();
|
||||
}
|
@ -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 WIREDITEM_H
|
||||
#define WIREDITEM_H
|
||||
|
||||
#include "deviceitem.h"
|
||||
|
||||
#include <WiredDevice>
|
||||
|
||||
#include <DGuiApplicationHelper>
|
||||
#include <DSpinner>
|
||||
|
||||
using namespace dde::network;
|
||||
DGUI_USE_NAMESPACE
|
||||
DWIDGET_USE_NAMESPACE
|
||||
|
||||
class QLabel;
|
||||
class TipsWidget;
|
||||
class HorizontalSeperator;
|
||||
class StateButton;
|
||||
class WiredItem : public DeviceItem
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
enum WiredStatus {
|
||||
Unknown = 0,
|
||||
Enabled = 0x00000001,
|
||||
Disabled = 0x00000002,
|
||||
Connected = 0x00000004,
|
||||
Disconnected = 0x00000008,
|
||||
Connecting = 0x00000010,
|
||||
Authenticating = 0x00000020,
|
||||
ObtainingIP = 0x00000040,
|
||||
ObtainIpFailed = 0x00000080,
|
||||
ConnectNoInternet = 0x00000100,
|
||||
Nocable = 0x00000200,
|
||||
Failed = 0x00000400,
|
||||
};
|
||||
Q_ENUM(WiredStatus)
|
||||
|
||||
public:
|
||||
explicit WiredItem(dde::network::WiredDevice *device, const QString &deviceName, QWidget *parent = nullptr);
|
||||
void setTitle(const QString &name);
|
||||
bool deviceEabled();
|
||||
void setDeviceEnabled(bool enabled);
|
||||
WiredStatus getDeviceState();
|
||||
QJsonObject getActiveWiredConnectionInfo();
|
||||
inline QString &deviceName() { return m_deviceName; }
|
||||
void setThemeType(DGuiApplicationHelper::ColorType themeType);
|
||||
void setWiredStateIcon();
|
||||
void refreshConnectivity() override;
|
||||
|
||||
protected:
|
||||
QSize sizeHint() const;
|
||||
|
||||
signals:
|
||||
void requestActiveConnection(const QString &devPath, const QString &uuid);
|
||||
void wiredStateChanged();
|
||||
void enableChanged();
|
||||
void activeConnectionChanged();
|
||||
|
||||
private slots:
|
||||
void deviceStateChanged(NetworkDevice::DeviceStatus state);
|
||||
void changedActiveWiredConnectionInfo(const QJsonObject &connInfo);
|
||||
|
||||
private:
|
||||
QString m_deviceName;
|
||||
QLabel *m_connectedName;
|
||||
QLabel *m_wiredIcon;
|
||||
StateButton *m_stateButton;
|
||||
DSpinner *m_loadingStat;
|
||||
|
||||
QTimer *m_freshWiredIcon;
|
||||
NetworkDevice::DeviceStatus m_deviceState;
|
||||
};
|
||||
|
||||
#endif // WIREDITEM_H
|
@ -1,236 +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 "networkplugin.h"
|
||||
#include "../frame/util/imageutil.h"
|
||||
#include "../widgets/tipswidget.h"
|
||||
|
||||
#include <DGuiApplicationHelper>
|
||||
|
||||
#include <QPainter>
|
||||
#include <QMouseEvent>
|
||||
#include <QApplication>
|
||||
#include <QIcon>
|
||||
#include <QLayout>
|
||||
|
||||
using namespace dde::network;
|
||||
DGUI_USE_NAMESPACE
|
||||
|
||||
#define REFRESH_LIMIT 5
|
||||
#define REFRESH_TRY_TIME_SECOND 600000
|
||||
|
||||
WirelessItem::WirelessItem(WirelessDevice *device)
|
||||
: DeviceItem(device)
|
||||
, m_refreshLimit(0)
|
||||
, m_refreshLimitTimer(new QTimer(this))
|
||||
, m_refreshTimer(new QTimer(this))
|
||||
, m_wirelessApplet(new QWidget(this))
|
||||
, m_APList(nullptr)
|
||||
{
|
||||
m_refreshTimer->setSingleShot(true);
|
||||
m_refreshTimer->setInterval(10000);
|
||||
|
||||
m_refreshLimitTimer->setSingleShot(true);
|
||||
m_refreshLimitTimer->setInterval(REFRESH_TRY_TIME_SECOND);
|
||||
|
||||
connect(m_refreshTimer, &QTimer::timeout, [&] {
|
||||
if (m_device.isNull() || m_refreshLimitTimer->isActive()) {
|
||||
return;
|
||||
}
|
||||
|
||||
// NOTE(lxz): limit when 5 of failed, sleep 60s
|
||||
// If the network data always has problems, it can
|
||||
// alleviate repeated refresh. Failure should not
|
||||
// be triggered under normal circumstances
|
||||
if (m_refreshLimit == REFRESH_LIMIT) {
|
||||
m_refreshLimitTimer->start();
|
||||
m_refreshLimit = 0;
|
||||
return;
|
||||
}
|
||||
|
||||
WirelessDevice *dev = static_cast<WirelessDevice *>(m_device.data());
|
||||
// the status is Activated and activeApInfo is empty if the hotspot status of this wireless device is enabled
|
||||
if (m_device->status() == NetworkDevice::Activated && dev->activeApInfo().isEmpty() && !dev->hotspotEnabled())
|
||||
{
|
||||
Q_EMIT queryActiveConnInfo();
|
||||
++m_refreshLimit;
|
||||
return;
|
||||
}
|
||||
|
||||
m_refreshLimit = 0;
|
||||
});
|
||||
connect(m_device, static_cast<void (NetworkDevice::*)(const QString &statStr) const>(&NetworkDevice::statusChanged), this, &WirelessItem::deviceStateChanged);
|
||||
connect(static_cast<WirelessDevice *>(m_device.data()), &WirelessDevice::activeApInfoChanged, m_refreshTimer, static_cast<void (QTimer::*)()>(&QTimer::start));
|
||||
connect(static_cast<WirelessDevice *>(m_device.data()), &WirelessDevice::activeWirelessConnectionInfoChanged, m_refreshTimer, static_cast<void (QTimer::*)()>(&QTimer::start));
|
||||
connect(DGuiApplicationHelper::instance(), &DGuiApplicationHelper::themeTypeChanged, this, [ = ] {
|
||||
update();
|
||||
});
|
||||
|
||||
connect(static_cast<WirelessDevice *>(m_device.data()), &WirelessDevice::activeApInfoChanged, this, [ = ](QJsonObject activeApInfo) {
|
||||
m_activeApInfo = activeApInfo;
|
||||
update();
|
||||
});
|
||||
connect(m_refreshLimitTimer, &QTimer::timeout, m_refreshTimer, static_cast<void (QTimer::*)()>(&QTimer::start));
|
||||
|
||||
init();
|
||||
}
|
||||
|
||||
WirelessItem::~WirelessItem()
|
||||
{
|
||||
if (m_APList) {
|
||||
m_APList->deleteLater();
|
||||
|
||||
if (m_APList->controlPanel())
|
||||
m_APList->controlPanel()->deleteLater();
|
||||
}
|
||||
}
|
||||
|
||||
QWidget *WirelessItem::itemApplet()
|
||||
{
|
||||
return m_wirelessApplet;
|
||||
}
|
||||
|
||||
int WirelessItem::APcount()
|
||||
{
|
||||
return m_APList->APcount();
|
||||
}
|
||||
|
||||
bool WirelessItem::deviceEanbled()
|
||||
{
|
||||
return m_device->enabled();
|
||||
}
|
||||
|
||||
void WirelessItem::setDeviceEnabled(bool enable)
|
||||
{
|
||||
m_APList->onEnableButtonToggle(enable);
|
||||
}
|
||||
|
||||
WirelessItem::WirelessStatus WirelessItem::getDeviceState()
|
||||
{
|
||||
if (!m_device->enabled()) {
|
||||
return Disabled;
|
||||
}
|
||||
if (m_device->status() == NetworkDevice::Activated
|
||||
&& NetworkModel::connectivity() != Connectivity::Full) {
|
||||
return ConnectNoInternet;
|
||||
}
|
||||
if (m_device->obtainIpFailed()) {
|
||||
return ObtainIpFailed;
|
||||
}
|
||||
|
||||
switch (m_device->status()) {
|
||||
case NetworkDevice::Unknown: return Unknown;
|
||||
case NetworkDevice::Unmanaged:
|
||||
case NetworkDevice::Unavailable:
|
||||
case NetworkDevice::Disconnected: return Disconnected;
|
||||
case NetworkDevice::Prepare:
|
||||
case NetworkDevice::Config: return Connecting;
|
||||
case NetworkDevice::NeedAuth: return Authenticating;
|
||||
case NetworkDevice::IpConfig:
|
||||
case NetworkDevice::IpCheck:
|
||||
case NetworkDevice::Secondaries: return ObtainingIP;
|
||||
case NetworkDevice::Activated: return Connected;
|
||||
case NetworkDevice::Deactivation:
|
||||
case NetworkDevice::Failed: return Failed;
|
||||
}
|
||||
Q_UNREACHABLE();
|
||||
}
|
||||
|
||||
QJsonObject &WirelessItem::getConnectedApInfo()
|
||||
{
|
||||
return m_activeApInfo;
|
||||
}
|
||||
|
||||
QJsonObject WirelessItem::getActiveWirelessConnectionInfo()
|
||||
{
|
||||
return static_cast<WirelessDevice *>(m_device.data())->activeWirelessConnectionInfo();
|
||||
}
|
||||
|
||||
void WirelessItem::setControlPanelVisible(bool visible)
|
||||
{
|
||||
auto layout = m_wirelessApplet->layout();
|
||||
auto controlPanel = m_APList->controlPanel();
|
||||
if (layout && controlPanel) {
|
||||
if (visible) {
|
||||
layout->removeWidget(controlPanel);
|
||||
layout->removeWidget(m_APList);
|
||||
|
||||
layout->addWidget(controlPanel);
|
||||
layout->addWidget(m_APList);
|
||||
} else {
|
||||
layout->removeWidget(controlPanel);
|
||||
}
|
||||
controlPanel->setVisible(visible);
|
||||
adjustHeight(visible);
|
||||
}
|
||||
}
|
||||
|
||||
void WirelessItem::setDeviceInfo(const int index)
|
||||
{
|
||||
m_APList->setDeviceInfo(index);
|
||||
m_index = index;
|
||||
}
|
||||
|
||||
bool WirelessItem::eventFilter(QObject *o, QEvent *e)
|
||||
{
|
||||
if (o == m_APList && e->type() == QEvent::Resize)
|
||||
QMetaObject::invokeMethod(this, "adjustHeight", Qt::QueuedConnection,Q_ARG(bool, m_APList->controlPanel()->isVisible()));
|
||||
if (o == m_APList && e->type() == QEvent::Show)
|
||||
Q_EMIT requestWirelessScan();
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
void WirelessItem::init()
|
||||
{
|
||||
m_APList = new WirelessList(static_cast<WirelessDevice *>(m_device.data()));
|
||||
m_APList->installEventFilter(this);
|
||||
m_APList->setObjectName("wireless-" + m_device->path());
|
||||
|
||||
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::requestSetDeviceEnable, this, &WirelessItem::requestSetDeviceEnable);
|
||||
connect(m_APList, &WirelessList::requestActiveAP, this, &WirelessItem::requestActiveAP);
|
||||
connect(m_APList, &WirelessList::requestDeactiveAP, this, &WirelessItem::requestDeactiveAP);
|
||||
connect(m_APList, &WirelessList::requestWirelessScan, this, &WirelessItem::requestWirelessScan);
|
||||
connect(m_APList, &WirelessList::requestUpdatePopup, this, &WirelessItem::deviceStateChanged);
|
||||
|
||||
QTimer::singleShot(0, this, [ = ]() {
|
||||
m_refreshTimer->start();
|
||||
});
|
||||
}
|
||||
|
||||
void WirelessItem::adjustHeight(bool visibel)
|
||||
{
|
||||
auto controlPanel = m_APList->controlPanel();
|
||||
if (!controlPanel)
|
||||
return;
|
||||
|
||||
auto height = visibel ? (m_APList->height() + controlPanel->height())
|
||||
: m_APList->height();
|
||||
m_wirelessApplet->setFixedHeight(height);
|
||||
}
|
@ -1,102 +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/wirelesslist.h"
|
||||
|
||||
#include <QHash>
|
||||
#include <QLabel>
|
||||
|
||||
#include <WirelessDevice>
|
||||
|
||||
class TipsWidget;
|
||||
class WirelessItem : public DeviceItem
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
enum WirelessStatus {
|
||||
Unknown = 0,
|
||||
Enabled = 0x00010000,
|
||||
Disabled = 0x00020000,
|
||||
Connected = 0x00040000,
|
||||
Disconnected = 0x00080000,
|
||||
Connecting = 0x00100000,
|
||||
Authenticating = 0x00200000,
|
||||
ObtainingIP = 0x00400000,
|
||||
ObtainIpFailed = 0x00800000,
|
||||
ConnectNoInternet = 0x01000000,
|
||||
Failed = 0x02000000,
|
||||
};
|
||||
Q_ENUM(WirelessStatus)
|
||||
|
||||
public:
|
||||
explicit WirelessItem(dde::network::WirelessDevice *device);
|
||||
~WirelessItem() override;
|
||||
|
||||
QWidget *itemApplet() override;
|
||||
int APcount();
|
||||
bool deviceEanbled();
|
||||
void setDeviceEnabled(bool enable);
|
||||
WirelessStatus getDeviceState();
|
||||
QJsonObject &getConnectedApInfo();
|
||||
QJsonObject getActiveWirelessConnectionInfo();
|
||||
inline int deviceInfo() { return m_index; }
|
||||
void setControlPanelVisible(bool visible);
|
||||
|
||||
public Q_SLOTS:
|
||||
// set the device name displayed
|
||||
// in the top-left corner of the applet
|
||||
void setDeviceInfo(const int index);
|
||||
|
||||
Q_SIGNALS:
|
||||
void requestActiveAP(const QString &devPath, const QString &apPath, const QString &uuid) const;
|
||||
void requestDeactiveAP(const QString &devPath) const;
|
||||
void feedSecret(const QString &connectionPath, const QString &settingName, const QString &password, const bool autoConnect);
|
||||
void cancelSecret(const QString &connectionPath, const QString &settingName);
|
||||
void queryActiveConnInfo();
|
||||
void requestWirelessScan();
|
||||
void createApConfig(const QString &devPath, const QString &apPath);
|
||||
void queryConnectionSession(const QString &devPath, const QString &uuid);
|
||||
void deviceStateChanged();
|
||||
|
||||
protected:
|
||||
bool eventFilter(QObject *o, QEvent *e) override;
|
||||
|
||||
private slots:
|
||||
void init();
|
||||
void adjustHeight(bool visibel);
|
||||
|
||||
private:
|
||||
int m_refreshLimit;
|
||||
int m_index;
|
||||
QTimer *m_refreshLimitTimer;
|
||||
QTimer *m_refreshTimer;
|
||||
QWidget *m_wirelessApplet;
|
||||
WirelessList *m_APList;
|
||||
QJsonObject m_activeApInfo;
|
||||
};
|
||||
|
||||
#endif // WIRELESSITEM_H
|
@ -1,4 +0,0 @@
|
||||
{
|
||||
"api": "1.1.1",
|
||||
"depends-daemon-dbus-service": "com.deepin.daemon.Network"
|
||||
}
|
@ -1,150 +0,0 @@
|
||||
<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>
|
||||
<file>resources/wired/network-disabled-symbolic.svg</file>
|
||||
<file>resources/wired/network-error-symbolic.svg</file>
|
||||
<file>resources/wired/network-online-symbolic.svg</file>
|
||||
<file>resources/wired/network-offline-symbolic.svg</file>
|
||||
<file>resources/wired/network-wired-symbolic.svg</file>
|
||||
<file>resources/wired/network-online-symbolic-dark.svg</file>
|
||||
<file>resources/wired/network-wired-symbolic-connecting3-dark.svg</file>
|
||||
<file>resources/wired/network-disabled-symbolic-dark.svg</file>
|
||||
<file>resources/wired/network-none-symbolic.svg</file>
|
||||
<file>resources/wired/network-wired-symbolic-connecting1-dark.svg</file>
|
||||
<file>resources/wired/network-error-symbolic-dark.svg</file>
|
||||
<file>resources/wired/network-warning-symbolic.svg</file>
|
||||
<file>resources/wired/network-warning-symbolic-dark.svg</file>
|
||||
<file>resources/wired/network-wired-symbolic-connecting5-dark.svg</file>
|
||||
<file>resources/wired/network-wired-symbolic-dark.svg</file>
|
||||
<file>resources/wired/network-wired-symbolic-connecting2-dark.svg</file>
|
||||
<file>resources/wired/network-none-symbolic-dark.svg</file>
|
||||
<file>resources/wired/network-wired-symbolic-connecting4-dark.svg</file>
|
||||
</qresource>
|
||||
<qresource prefix="/wireless">
|
||||
<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-0-symbolic-dark.svg</file>
|
||||
<file>resources/wireless/wireless-20-symbolic-dark.svg</file>
|
||||
<file>resources/wireless/wireless-40-symbolic-dark.svg</file>
|
||||
<file>resources/wireless/wireless-60-symbolic-dark.svg</file>
|
||||
<file>resources/wireless/wireless-80-symbolic-dark.svg</file>
|
||||
<file>resources/wireless/wireless-disconnect-symbolic.svg</file>
|
||||
<file>resources/wireless/security.svg</file>
|
||||
<file>resources/wireless/security_dark.svg</file>
|
||||
<file>resources/wireless/select.svg</file>
|
||||
<file>resources/wireless/select_dark.svg</file>
|
||||
<file>resources/wireless/disconnect.svg</file>
|
||||
<file>resources/wireless/disconnect_dark.svg</file>
|
||||
<file>resources/wireless/refresh.svg</file>
|
||||
<file>resources/wireless/refresh_dark.svg</file>
|
||||
<file>resources/wireless/wireless-disabled-symbolic-dark.svg</file>
|
||||
<file>resources/wireless/wireless-disabled-symbolic.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>
|
||||
<qresource prefix="/common">
|
||||
<file>resources/common/list_select.png</file>
|
||||
<file>resources/common/list_select@2x.png</file>
|
||||
<file>resources/common/notify_close_press.png</file>
|
||||
<file>resources/common/notify_close_press@2x.png</file>
|
||||
</qresource>
|
||||
</RCC>
|
@ -1,147 +0,0 @@
|
||||
#ifndef NETWORKITEM_H
|
||||
#define NETWORKITEM_H
|
||||
|
||||
#include "com_deepin_daemon_network.h"
|
||||
|
||||
#include <DGuiApplicationHelper>
|
||||
#include <DSwitchButton>
|
||||
#include <dloadingindicator.h>
|
||||
|
||||
#include <QScrollArea>
|
||||
#include <QVBoxLayout>
|
||||
#include <QLabel>
|
||||
#include <QTimer>
|
||||
|
||||
DGUI_USE_NAMESPACE
|
||||
DWIDGET_USE_NAMESPACE
|
||||
|
||||
class PluginState;
|
||||
namespace Dock {
|
||||
class TipsWidget;
|
||||
}
|
||||
class WiredItem;
|
||||
class WirelessItem;
|
||||
class HorizontalSeperator;
|
||||
|
||||
using DbusNetwork = com::deepin::daemon::Network;
|
||||
|
||||
class NetworkItem : public QWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
enum PluginState
|
||||
{
|
||||
Unknow = 0,
|
||||
// A 无线 B 有线
|
||||
Disabled,
|
||||
Connected,
|
||||
Disconnected,
|
||||
Connecting,
|
||||
//有线无线都失败
|
||||
Failed,
|
||||
ConnectNoInternet,
|
||||
// Aenabled,
|
||||
// Benabled,
|
||||
Adisabled,
|
||||
Bdisabled,
|
||||
Aconnected,
|
||||
Bconnected,
|
||||
Adisconnected,
|
||||
Bdisconnected,
|
||||
Aconnecting,
|
||||
Bconnecting,
|
||||
AconnectNoInternet,
|
||||
BconnectNoInternet,
|
||||
Afailed,
|
||||
Bfailed,
|
||||
Nocable
|
||||
};
|
||||
public:
|
||||
explicit NetworkItem(QWidget *parent = nullptr);
|
||||
|
||||
QWidget *itemApplet();
|
||||
QWidget *itemTips();
|
||||
|
||||
void updateDeviceItems(QMap<QString, WiredItem *> &wiredItems, QMap<QString, WirelessItem*> &wirelessItems);
|
||||
|
||||
const QString contextMenu() const;
|
||||
void invokeMenuItem(const QString &menuId, const bool checked);
|
||||
void refreshTips();
|
||||
bool isShowControlCenter();
|
||||
|
||||
const QStringList currentIpList();
|
||||
const QStringList getActiveWiredList();
|
||||
const QStringList getActiveWirelessList();
|
||||
|
||||
public slots:
|
||||
void updateSelf();
|
||||
void refreshIcon();
|
||||
void wirelessScan();
|
||||
|
||||
protected:
|
||||
void resizeEvent(QResizeEvent *e) override;
|
||||
void paintEvent(QPaintEvent *e) override;
|
||||
bool eventFilter(QObject *obj,QEvent *event) override;
|
||||
QString getStrengthStateString(int strength = 0);
|
||||
|
||||
signals:
|
||||
void sendIpConflictDect(int index);
|
||||
|
||||
private slots:
|
||||
void wiredsEnable(bool enable);
|
||||
void wirelessEnable(bool enable);
|
||||
void onThemeTypeChanged(DGuiApplicationHelper::ColorType themeType);
|
||||
void ipConflict(const QString &ip, const QString &mac);
|
||||
void onSendIpConflictDect(int index = 0);
|
||||
void onDetectConflict();
|
||||
|
||||
private:
|
||||
void getPluginState();
|
||||
void updateMasterControlSwitch();
|
||||
void updateView();
|
||||
int getStrongestAp();
|
||||
|
||||
private:
|
||||
Dock::TipsWidget *m_tipsWidget;
|
||||
QScrollArea *m_applet;
|
||||
|
||||
DSwitchButton *m_switchWiredBtn;
|
||||
QVBoxLayout *m_wiredLayout;
|
||||
QWidget *m_wiredControlPanel;
|
||||
bool m_switchWiredBtnState;
|
||||
|
||||
DLoadingIndicator *m_loadingIndicator;
|
||||
DSwitchButton *m_switchWirelessBtn;
|
||||
QVBoxLayout *m_wirelessLayout;
|
||||
QWidget *m_wirelessControlPanel;
|
||||
bool m_switchWirelessBtnState;
|
||||
|
||||
bool m_switchWire;
|
||||
//判断定时的时间是否到,否则不重置计时器
|
||||
bool m_timeOut;
|
||||
|
||||
QMap<QString, WiredItem *> m_wiredItems;
|
||||
QMap<QString, WirelessItem *> m_wirelessItems;
|
||||
QMap<QString, WirelessItem *> m_connectedWirelessDevice;
|
||||
QMap<QString, WiredItem *> m_connectedWiredDevice;
|
||||
|
||||
QPixmap m_iconPixmap;
|
||||
PluginState m_pluginState;
|
||||
QTimer *refreshIconTimer;
|
||||
QTimer *m_switchWireTimer;
|
||||
QTimer *m_wirelessScanTimer;
|
||||
int m_wirelessScanInterval;
|
||||
|
||||
HorizontalSeperator *m_firstSeparator;
|
||||
HorizontalSeperator *m_secondSeparator;
|
||||
HorizontalSeperator *m_thirdSeparator;
|
||||
|
||||
DbusNetwork *m_networkInter;
|
||||
QStringList m_disconflictList; // 解除冲突数据列表
|
||||
QMap<QString, QString> m_conflictMap; // 缓存有线和无线冲突的ip列表
|
||||
QTimer *m_detectConflictTimer; // 定时器自检,当其他主机主动解除ip冲突,我方需要更新网络状态
|
||||
bool m_ipConflict; // ip冲突的标识
|
||||
bool m_ipConflictChecking; // 标记是否正在检测中
|
||||
};
|
||||
|
||||
#endif // NETWORKITEM_H
|
@ -1,268 +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 "networkitem.h"
|
||||
#include "item/wireditem.h"
|
||||
#include "item/wirelessitem.h"
|
||||
|
||||
#include <DDBusSender>
|
||||
|
||||
using namespace dde::network;
|
||||
|
||||
#define STATE_KEY "enabled"
|
||||
|
||||
NetworkPlugin::NetworkPlugin(QObject *parent)
|
||||
: QObject(parent)
|
||||
, m_networkModel(nullptr)
|
||||
, m_networkWorker(nullptr)
|
||||
, m_networkItem(nullptr)
|
||||
, m_hasDevice(false)
|
||||
{
|
||||
}
|
||||
|
||||
const QString NetworkPlugin::pluginName() const
|
||||
{
|
||||
return "network";
|
||||
}
|
||||
|
||||
const QString NetworkPlugin::pluginDisplayName() const
|
||||
{
|
||||
return tr("Network");
|
||||
}
|
||||
|
||||
void NetworkPlugin::init(PluginProxyInterface *proxyInter)
|
||||
{
|
||||
m_proxyInter = proxyInter;
|
||||
|
||||
if (m_networkItem)
|
||||
return;
|
||||
|
||||
m_networkItem.reset(new NetworkItem);
|
||||
|
||||
if (!pluginIsDisable()) {
|
||||
loadPlugin();
|
||||
}
|
||||
}
|
||||
|
||||
void NetworkPlugin::invokedMenuItem(const QString &itemKey, const QString &menuId, const bool checked)
|
||||
{
|
||||
if (itemKey == NETWORK_KEY) {
|
||||
return m_networkItem->invokeMenuItem(menuId, checked);
|
||||
}
|
||||
}
|
||||
|
||||
void NetworkPlugin::refreshIcon(const QString &itemKey)
|
||||
{
|
||||
if (itemKey == NETWORK_KEY) {
|
||||
m_networkItem->refreshIcon();
|
||||
}
|
||||
}
|
||||
|
||||
void NetworkPlugin::pluginStateSwitched()
|
||||
{
|
||||
m_proxyInter->saveValue(this, STATE_KEY, pluginIsDisable());
|
||||
|
||||
refreshPluginItemsVisible();
|
||||
}
|
||||
|
||||
bool NetworkPlugin::pluginIsDisable()
|
||||
{
|
||||
return !m_proxyInter->getValue(this, STATE_KEY, true).toBool();
|
||||
}
|
||||
|
||||
const QString NetworkPlugin::itemCommand(const QString &itemKey)
|
||||
{
|
||||
Q_UNUSED(itemKey)
|
||||
return (m_hasDevice && !m_networkItem->isShowControlCenter())
|
||||
? QString()
|
||||
: QString("dbus-send --print-reply "
|
||||
"--dest=com.deepin.dde.ControlCenter "
|
||||
"/com/deepin/dde/ControlCenter "
|
||||
"com.deepin.dde.ControlCenter.ShowModule "
|
||||
"\"string:network\"");
|
||||
}
|
||||
|
||||
const QString NetworkPlugin::itemContextMenu(const QString &itemKey)
|
||||
{
|
||||
if (itemKey == NETWORK_KEY) {
|
||||
return m_networkItem->contextMenu();
|
||||
}
|
||||
|
||||
return QString();
|
||||
}
|
||||
|
||||
QWidget *NetworkPlugin::itemWidget(const QString &itemKey)
|
||||
{
|
||||
if (itemKey == NETWORK_KEY) {
|
||||
return m_networkItem.data();
|
||||
}
|
||||
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
QWidget *NetworkPlugin::itemTipsWidget(const QString &itemKey)
|
||||
{
|
||||
if (itemKey == NETWORK_KEY) {
|
||||
return m_networkItem->itemTips();
|
||||
}
|
||||
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
QWidget *NetworkPlugin::itemPopupApplet(const QString &itemKey)
|
||||
{
|
||||
if (itemKey == NETWORK_KEY && m_hasDevice && !m_networkItem->isShowControlCenter()) {
|
||||
return m_networkItem->itemApplet();
|
||||
}
|
||||
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
int NetworkPlugin::itemSortKey(const QString &itemKey)
|
||||
{
|
||||
const QString key = QString("pos_%1_%2").arg(itemKey).arg(Dock::Efficient);
|
||||
|
||||
return m_proxyInter->getValue(this, key, 3).toInt();
|
||||
}
|
||||
|
||||
void NetworkPlugin::setSortKey(const QString &itemKey, const int order)
|
||||
{
|
||||
const QString key = QString("pos_%1_%2").arg(itemKey).arg(Dock::Efficient);
|
||||
|
||||
m_proxyInter->saveValue(this, key, order);
|
||||
}
|
||||
|
||||
void NetworkPlugin::pluginSettingsChanged()
|
||||
{
|
||||
refreshPluginItemsVisible();
|
||||
}
|
||||
|
||||
//bool NetworkPlugin::isConnectivity()
|
||||
//{
|
||||
// return NetworkModel::connectivity() == Connectivity::Full;
|
||||
//}
|
||||
|
||||
void NetworkPlugin::onDeviceListChanged(const QList<NetworkDevice *> devices)
|
||||
{
|
||||
QMap<QString, WirelessItem*> wirelessItems;
|
||||
QMap<QString, WiredItem *> wiredItems;
|
||||
|
||||
int wiredDeviceCnt = 0;
|
||||
int wirelessDeviceCnt = 0;
|
||||
for (auto device : devices) {
|
||||
if (device && device->type() == NetworkDevice::Wired)
|
||||
wiredDeviceCnt++;
|
||||
else
|
||||
wirelessDeviceCnt++;
|
||||
}
|
||||
|
||||
// 编号 (与控制中心有线设备保持一致命名)
|
||||
int wiredNum = 0;
|
||||
int wirelessNum = 0;
|
||||
QString text;
|
||||
|
||||
for (auto device : devices) {
|
||||
const QString &path = device->path();
|
||||
// new device
|
||||
DeviceItem *item = nullptr;
|
||||
switch (device->type()) {
|
||||
case NetworkDevice::Wired:
|
||||
wiredNum++;
|
||||
if (wiredDeviceCnt == 1)
|
||||
text = tr("Wired Network");
|
||||
else
|
||||
text = tr("Wired Network %1").arg(wiredNum);
|
||||
item = new WiredItem(static_cast<WiredDevice *>(device), text);
|
||||
wiredItems.insert(path, static_cast<WiredItem *>(item));
|
||||
|
||||
connect(static_cast<WiredItem *>(item), &WiredItem::wiredStateChanged,
|
||||
m_networkItem.data(), &NetworkItem::updateSelf);
|
||||
connect(static_cast<WiredItem *>(item), &WiredItem::enableChanged,
|
||||
m_networkItem.data(), &NetworkItem::updateSelf);
|
||||
connect(static_cast<WiredItem *>(item), &WiredItem::activeConnectionChanged,
|
||||
m_networkItem.data(), &NetworkItem::updateSelf);
|
||||
break;
|
||||
case NetworkDevice::Wireless:
|
||||
item = new WirelessItem(static_cast<WirelessDevice *>(device));
|
||||
static_cast<WirelessItem *>(item)->setDeviceInfo(wirelessDeviceCnt == 1 ? -1 : ++wirelessNum);
|
||||
wirelessItems.insert(path, static_cast<WirelessItem *>(item));
|
||||
|
||||
connect(static_cast<WirelessItem *>(item), &WirelessItem::queryActiveConnInfo,
|
||||
m_networkWorker.data(), &NetworkWorker::queryActiveConnInfo);
|
||||
connect(static_cast<WirelessItem *>(item), &WirelessItem::requestActiveAP,
|
||||
m_networkWorker.data(), &NetworkWorker::activateAccessPoint);
|
||||
connect(static_cast<WirelessItem *>(item), &WirelessItem::requestDeactiveAP,
|
||||
m_networkWorker.data(), &NetworkWorker::disconnectDevice);
|
||||
connect(static_cast<WirelessItem *>(item), &WirelessItem::feedSecret,
|
||||
m_networkWorker.data(), &NetworkWorker::feedSecret);
|
||||
connect(static_cast<WirelessItem *>(item), &WirelessItem::cancelSecret,
|
||||
m_networkWorker.data(), &NetworkWorker::cancelSecret);
|
||||
connect(static_cast<WirelessItem *>(item), &WirelessItem::requestWirelessScan,
|
||||
m_networkWorker.data(), &NetworkWorker::requestWirelessScan);
|
||||
connect(static_cast<WirelessItem *>(item), &WirelessItem::createApConfig,
|
||||
m_networkWorker.data(), &NetworkWorker::createApConfig);
|
||||
connect(static_cast<WirelessItem *>(item), &WirelessItem::queryConnectionSession,
|
||||
m_networkWorker.data(), &NetworkWorker::queryConnectionSession);
|
||||
|
||||
connect(static_cast<WirelessItem *>(item), &WirelessItem::deviceStateChanged,
|
||||
m_networkItem.data(), &NetworkItem::updateSelf);
|
||||
connect(static_cast<WirelessItem *>(item), &WirelessItem::requestWirelessScan,
|
||||
m_networkItem.data(), &NetworkItem::wirelessScan);
|
||||
|
||||
m_networkWorker->requestWirelessScan();
|
||||
break;
|
||||
default:
|
||||
Q_UNREACHABLE();
|
||||
}
|
||||
|
||||
connect(item, &DeviceItem::requestSetDeviceEnable, m_networkWorker.data(), &NetworkWorker::setDeviceEnable);
|
||||
connect(m_networkModel.data(), &NetworkModel::connectivityChanged, item, &DeviceItem::refreshConnectivity);
|
||||
connect(m_networkModel.data(), &NetworkModel::connectivityChanged, m_networkItem.data(), &NetworkItem::updateSelf);
|
||||
}
|
||||
|
||||
m_hasDevice = wiredItems.size() || wirelessItems.size();
|
||||
m_networkItem->updateDeviceItems(wiredItems, wirelessItems);
|
||||
}
|
||||
|
||||
void NetworkPlugin::loadPlugin()
|
||||
{
|
||||
m_networkModel.reset(new NetworkModel);
|
||||
m_networkWorker.reset(new NetworkWorker(m_networkModel.data()));
|
||||
|
||||
connect(m_networkModel.data(), &NetworkModel::deviceListChanged, this, &NetworkPlugin::onDeviceListChanged);
|
||||
|
||||
m_networkModel->moveToThread(qApp->thread());
|
||||
m_networkWorker->moveToThread(qApp->thread());
|
||||
|
||||
onDeviceListChanged(m_networkModel->devices());
|
||||
|
||||
m_proxyInter->itemAdded(this, NETWORK_KEY);
|
||||
}
|
||||
|
||||
void NetworkPlugin::refreshPluginItemsVisible()
|
||||
{
|
||||
if (pluginIsDisable()) {
|
||||
m_proxyInter->itemRemoved(this, NETWORK_KEY);
|
||||
} else {
|
||||
m_proxyInter->itemAdded(this, NETWORK_KEY);
|
||||
}
|
||||
}
|
@ -1,80 +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 "item/deviceitem.h"
|
||||
|
||||
#include <NetworkWorker>
|
||||
#include <NetworkModel>
|
||||
|
||||
#define NETWORK_KEY "network-item-key"
|
||||
|
||||
class NetworkItem;
|
||||
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 = nullptr);
|
||||
|
||||
const QString pluginName() const override;
|
||||
const QString pluginDisplayName() const override;
|
||||
void init(PluginProxyInterface *proxyInter) override;
|
||||
void invokedMenuItem(const QString &itemKey, const QString &menuId, const bool checked) override;
|
||||
void refreshIcon(const QString &itemKey) override;
|
||||
void pluginStateSwitched() override;
|
||||
bool pluginIsAllowDisable() override { return true; }
|
||||
bool pluginIsDisable() override;
|
||||
const QString itemCommand(const QString &itemKey) override;
|
||||
const QString itemContextMenu(const QString &itemKey) override;
|
||||
QWidget *itemWidget(const QString &itemKey) override;
|
||||
QWidget *itemTipsWidget(const QString &itemKey) override;
|
||||
QWidget *itemPopupApplet(const QString &itemKey) override;
|
||||
|
||||
int itemSortKey(const QString &itemKey) override;
|
||||
void setSortKey(const QString &itemKey, const int order) override;
|
||||
|
||||
void pluginSettingsChanged() override;
|
||||
|
||||
// static bool isConnectivity();
|
||||
|
||||
private slots:
|
||||
void onDeviceListChanged(const QList<dde::network::NetworkDevice *> devices);
|
||||
|
||||
private:
|
||||
void loadPlugin();
|
||||
void refreshPluginItemsVisible();
|
||||
|
||||
private:
|
||||
QScopedPointer<dde::network::NetworkModel> m_networkModel;
|
||||
QScopedPointer<dde::network::NetworkWorker> m_networkWorker;
|
||||
|
||||
QScopedPointer<NetworkItem> m_networkItem;
|
||||
|
||||
bool m_hasDevice;
|
||||
};
|
||||
|
||||
#endif // NETWORKPLUGIN_H
|
Before Width: | Height: | Size: 508 B |
Before Width: | Height: | Size: 1.1 KiB |
Before Width: | Height: | Size: 398 B |
Before Width: | Height: | Size: 749 B |
@ -1,6 +0,0 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 20 20">
|
||||
<g fill="none" fill-rule="evenodd">
|
||||
<path fill="#000" d="M12.1464466,12.1464466 C12.3417088,11.9511845 12.6582912,11.9511845 12.8535534,12.1464466 L12.8535534,12.1464466 L14.25,13.543 L15.6464466,12.1464466 C15.820013,11.9728803 16.0894374,11.9535951 16.2843055,12.0885912 L16.3535534,12.1464466 C16.5488155,12.3417088 16.5488155,12.6582912 16.3535534,12.8535534 L16.3535534,12.8535534 L14.957,14.25 L16.3535534,15.6464466 C16.5271197,15.820013 16.5464049,16.0894374 16.4114088,16.2843055 L16.3535534,16.3535534 C16.1582912,16.5488155 15.8417088,16.5488155 15.6464466,16.3535534 L15.6464466,16.3535534 L14.25,14.957 L12.8535534,16.3535534 C12.679987,16.5271197 12.4105626,16.5464049 12.2156945,16.4114088 L12.1464466,16.3535534 C11.9511845,16.1582912 11.9511845,15.8417088 12.1464466,15.6464466 L12.1464466,15.6464466 L13.543,14.25 L12.1464466,12.8535534 C11.9728803,12.679987 11.9535951,12.4105626 12.0885912,12.2156945 Z"/>
|
||||
<path fill="#000" d="M6.29495771,9.75770358 L7.70917127,11.1719171 C8.09969556,11.5624414 8.09969556,12.1956064 7.70917127,12.5861307 L6.21233603,14.0829659 C6.03789795,14.257404 5.80513765,14.361208 5.55879918,14.3744233 L3.92809205,14.4619057 L1.55392272,16.8360751 C1.30304307,17.0869547 0.896286788,17.0869547 0.645407136,16.8360751 C0.394527485,16.5851954 0.394527485,16.1784391 0.645407136,15.9275595 L3.01957647,13.5533902 L3.09514872,11.9125629 C3.10661884,11.6635233 3.21069874,11.427749 3.38698298,11.2514647 L4.88074414,9.75770358 C5.27126844,9.36717929 5.90443342,9.36717929 6.29495771,9.75770358 Z M15.9591048,0.599283615 C16.2099845,0.348403964 16.6167408,0.348403964 16.8676204,0.599283615 C17.1185001,0.850163266 17.1185001,1.25691955 16.8676204,1.5077992 L16.8676204,1.5077992 L14.4934511,3.88196853 L14.4059686,5.51267566 C14.3927533,5.75901413 14.2889494,5.99177443 14.1145113,6.16621251 L14.1145113,6.16621251 L12.617676,7.66304775 C12.2271518,8.05357204 11.5939868,8.05357204 11.2034625,7.66304775 L11.2034625,7.66304775 L9.78924892,6.24883419 C9.39872463,5.85830989 9.39872463,5.22514492 9.78924892,4.83462062 L9.78924892,4.83462062 L11.2830101,3.34085946 C11.4592943,3.16457521 11.6950687,3.06049532 11.9441082,3.0490252 L11.9441082,3.0490252 L13.5849355,2.97345295 Z" transform="translate(1.25 1.25)"/>
|
||||
</g>
|
||||
</svg>
|
Before Width: | Height: | Size: 2.3 KiB |
@ -1,6 +0,0 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 20 20">
|
||||
<g fill="none" fill-rule="evenodd">
|
||||
<path fill="#FFF" d="M12.1464466,12.1464466 C12.3417088,11.9511845 12.6582912,11.9511845 12.8535534,12.1464466 L12.8535534,12.1464466 L14.25,13.543 L15.6464466,12.1464466 C15.820013,11.9728803 16.0894374,11.9535951 16.2843055,12.0885912 L16.3535534,12.1464466 C16.5488155,12.3417088 16.5488155,12.6582912 16.3535534,12.8535534 L16.3535534,12.8535534 L14.957,14.25 L16.3535534,15.6464466 C16.5271197,15.820013 16.5464049,16.0894374 16.4114088,16.2843055 L16.3535534,16.3535534 C16.1582912,16.5488155 15.8417088,16.5488155 15.6464466,16.3535534 L15.6464466,16.3535534 L14.25,14.957 L12.8535534,16.3535534 C12.679987,16.5271197 12.4105626,16.5464049 12.2156945,16.4114088 L12.1464466,16.3535534 C11.9511845,16.1582912 11.9511845,15.8417088 12.1464466,15.6464466 L12.1464466,15.6464466 L13.543,14.25 L12.1464466,12.8535534 C11.9728803,12.679987 11.9535951,12.4105626 12.0885912,12.2156945 Z"/>
|
||||
<path fill="#FFF" d="M6.29495771,9.75770358 L7.70917127,11.1719171 C8.09969556,11.5624414 8.09969556,12.1956064 7.70917127,12.5861307 L6.21233603,14.0829659 C6.03789795,14.257404 5.80513765,14.361208 5.55879918,14.3744233 L3.92809205,14.4619057 L1.55392272,16.8360751 C1.30304307,17.0869547 0.896286788,17.0869547 0.645407136,16.8360751 C0.394527485,16.5851954 0.394527485,16.1784391 0.645407136,15.9275595 L3.01957647,13.5533902 L3.09514872,11.9125629 C3.10661884,11.6635233 3.21069874,11.427749 3.38698298,11.2514647 L4.88074414,9.75770358 C5.27126844,9.36717929 5.90443342,9.36717929 6.29495771,9.75770358 Z M15.9591048,0.599283615 C16.2099845,0.348403964 16.6167408,0.348403964 16.8676204,0.599283615 C17.1185001,0.850163266 17.1185001,1.25691955 16.8676204,1.5077992 L16.8676204,1.5077992 L14.4934511,3.88196853 L14.4059686,5.51267566 C14.3927533,5.75901413 14.2889494,5.99177443 14.1145113,6.16621251 L14.1145113,6.16621251 L12.617676,7.66304775 C12.2271518,8.05357204 11.5939868,8.05357204 11.2034625,7.66304775 L11.2034625,7.66304775 L9.78924892,6.24883419 C9.39872463,5.85830989 9.39872463,5.22514492 9.78924892,4.83462062 L9.78924892,4.83462062 L11.2830101,3.34085946 C11.4592943,3.16457521 11.6950687,3.06049532 11.9441082,3.0490252 L11.9441082,3.0490252 L13.5849355,2.97345295 Z" transform="translate(1.25 1.25)"/>
|
||||
</g>
|
||||
</svg>
|
Before Width: | Height: | Size: 2.3 KiB |
@ -1,6 +0,0 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 20 20">
|
||||
<g fill="none" fill-rule="evenodd">
|
||||
<path fill="#000" d="M8.83771031,9.7230306 L10.2519239,11.1372442 C10.6424482,11.5277685 10.6424482,12.1609334 10.2519239,12.5514577 L8.75508864,14.048293 C8.58065055,14.222731 8.34789026,14.326535 8.10155178,14.3397503 L6.47084466,14.4272328 L4.09667532,16.8014021 C3.84579567,17.0522817 3.43903939,17.0522817 3.18815974,16.8014021 C2.93728009,16.5505224 2.93728009,16.1437662 3.18815974,15.8928865 L5.56232907,13.5187172 L5.63790132,11.8778899 C5.64937144,11.6288503 5.75345134,11.393076 5.92973558,11.2167918 L7.42349675,9.7230306 C7.81402104,9.33250631 8.44718602,9.33250631 8.83771031,9.7230306 Z M15.8783083,3.18815974 C16.129188,2.93728009 16.5359443,2.93728009 16.7868239,3.18815974 C17.0377036,3.43903939 17.0377036,3.84579567 16.7868239,4.09667532 L16.7868239,4.09667532 L14.4126546,6.47084466 L14.3251721,8.10155178 C14.3119568,8.34789026 14.2081529,8.58065055 14.0337148,8.75508864 L14.0337148,8.75508864 L12.5368795,10.2519239 C12.1463552,10.6424482 11.5131903,10.6424482 11.122666,10.2519239 L11.122666,10.2519239 L9.70845241,8.83771031 C9.31792812,8.44718602 9.31792812,7.81402104 9.70845241,7.42349675 L9.70845241,7.42349675 L11.2022136,5.92973558 C11.3784978,5.75345134 11.6142722,5.64937144 11.8633117,5.63790132 L11.8633117,5.63790132 L13.504139,5.56232907 Z"/>
|
||||
<path stroke="#FF001F" stroke-linecap="round" d="M12.5 12.5L16 16M16 12.5L12.5 16"/>
|
||||
</g>
|
||||
</svg>
|
Before Width: | Height: | Size: 1.5 KiB |
@ -1,6 +0,0 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 20 20">
|
||||
<g fill="none" fill-rule="evenodd">
|
||||
<path fill="#FFF" d="M8.83771031,9.7230306 L10.2519239,11.1372442 C10.6424482,11.5277685 10.6424482,12.1609334 10.2519239,12.5514577 L8.75508864,14.048293 C8.58065055,14.222731 8.34789026,14.326535 8.10155178,14.3397503 L6.47084466,14.4272328 L4.09667532,16.8014021 C3.84579567,17.0522817 3.43903939,17.0522817 3.18815974,16.8014021 C2.93728009,16.5505224 2.93728009,16.1437662 3.18815974,15.8928865 L5.56232907,13.5187172 L5.63790132,11.8778899 C5.64937144,11.6288503 5.75345134,11.393076 5.92973558,11.2167918 L7.42349675,9.7230306 C7.81402104,9.33250631 8.44718602,9.33250631 8.83771031,9.7230306 Z M15.8783083,3.18815974 C16.129188,2.93728009 16.5359443,2.93728009 16.7868239,3.18815974 C17.0377036,3.43903939 17.0377036,3.84579567 16.7868239,4.09667532 L16.7868239,4.09667532 L14.4126546,6.47084466 L14.3251721,8.10155178 C14.3119568,8.34789026 14.2081529,8.58065055 14.0337148,8.75508864 L14.0337148,8.75508864 L12.5368795,10.2519239 C12.1463552,10.6424482 11.5131903,10.6424482 11.122666,10.2519239 L11.122666,10.2519239 L9.70845241,8.83771031 C9.31792812,8.44718602 9.31792812,7.81402104 9.70845241,7.42349675 L9.70845241,7.42349675 L11.2022136,5.92973558 C11.3784978,5.75345134 11.6142722,5.64937144 11.8633117,5.63790132 L11.8633117,5.63790132 L13.504139,5.56232907 Z"/>
|
||||
<path stroke="#FF001F" stroke-linecap="round" d="M12.5 12.5L16 16M16 12.5L12.5 16"/>
|
||||
</g>
|
||||
</svg>
|
Before Width: | Height: | Size: 1.5 KiB |
@ -1,3 +0,0 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 20 20">
|
||||
<path fill-opacity=".3" fill-rule="evenodd" d="M8.83771031,9.7230306 L10.2519239,11.1372442 C10.6424482,11.5277685 10.6424482,12.1609334 10.2519239,12.5514577 L8.75508864,14.048293 C8.58065055,14.222731 8.34789026,14.326535 8.10155178,14.3397503 L6.47084466,14.4272328 L4.09667532,16.8014021 C3.84579567,17.0522817 3.43903939,17.0522817 3.18815974,16.8014021 C2.93728009,16.5505224 2.93728009,16.1437662 3.18815974,15.8928865 L5.56232907,13.5187172 L5.63790132,11.8778899 C5.64937144,11.6288503 5.75345134,11.393076 5.92973558,11.2167918 L7.42349675,9.7230306 C7.81402104,9.33250631 8.44718602,9.33250631 8.83771031,9.7230306 Z M15.8783083,3.18815974 C16.129188,2.93728009 16.5359443,2.93728009 16.7868239,3.18815974 C17.0377036,3.43903939 17.0377036,3.84579567 16.7868239,4.09667532 L16.7868239,4.09667532 L14.4126546,6.47084466 L14.3251721,8.10155178 C14.3119568,8.34789026 14.2081529,8.58065055 14.0337148,8.75508864 L14.0337148,8.75508864 L12.5368795,10.2519239 C12.1463552,10.6424482 11.5131903,10.6424482 11.122666,10.2519239 L11.122666,10.2519239 L9.70845241,8.83771031 C9.31792812,8.44718602 9.31792812,7.81402104 9.70845241,7.42349675 L9.70845241,7.42349675 L11.2022136,5.92973558 C11.3784978,5.75345134 11.6142722,5.64937144 11.8633117,5.63790132 L11.8633117,5.63790132 L13.504139,5.56232907 Z"/>
|
||||
</svg>
|
Before Width: | Height: | Size: 1.4 KiB |
@ -1,3 +0,0 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 20 20">
|
||||
<path fill="#FFF" fill-rule="evenodd" d="M8.83771031,9.7230306 L10.2519239,11.1372442 C10.6424482,11.5277685 10.6424482,12.1609334 10.2519239,12.5514577 L8.75508864,14.048293 C8.58065055,14.222731 8.34789026,14.326535 8.10155178,14.3397503 L6.47084466,14.4272328 L4.09667532,16.8014021 C3.84579567,17.0522817 3.43903939,17.0522817 3.18815974,16.8014021 C2.93728009,16.5505224 2.93728009,16.1437662 3.18815974,15.8928865 L5.56232907,13.5187172 L5.63790132,11.8778899 C5.64937144,11.6288503 5.75345134,11.393076 5.92973558,11.2167918 L7.42349675,9.7230306 C7.81402104,9.33250631 8.44718602,9.33250631 8.83771031,9.7230306 Z M15.8783083,3.18815974 C16.129188,2.93728009 16.5359443,2.93728009 16.7868239,3.18815974 C17.0377036,3.43903939 17.0377036,3.84579567 16.7868239,4.09667532 L16.7868239,4.09667532 L14.4126546,6.47084466 L14.3251721,8.10155178 C14.3119568,8.34789026 14.2081529,8.58065055 14.0337148,8.75508864 L14.0337148,8.75508864 L12.5368795,10.2519239 C12.1463552,10.6424482 11.5131903,10.6424482 11.122666,10.2519239 L11.122666,10.2519239 L9.70845241,8.83771031 C9.31792812,8.44718602 9.31792812,7.81402104 9.70845241,7.42349675 L9.70845241,7.42349675 L11.2022136,5.92973558 C11.3784978,5.75345134 11.6142722,5.64937144 11.8633117,5.63790132 L11.8633117,5.63790132 L13.504139,5.56232907 Z" opacity=".3"/>
|
||||
</svg>
|
Before Width: | Height: | Size: 1.4 KiB |
@ -1,3 +0,0 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 20 20">
|
||||
<path fill="#FFF" fill-rule="evenodd" d="M14.5 16C14.7761424 16 15 16.2238576 15 16.5 15 16.7761424 14.7761424 17 14.5 17 14.2238576 17 14 16.7761424 14 16.5 14 16.2238576 14.2238576 16 14.5 16zM14.5 11C14.7761424 11 15 11.2238576 15 11.5L15 14.5C15 14.7761424 14.7761424 15 14.5 15 14.2238576 15 14 14.7761424 14 14.5L14 11.5C14 11.2238576 14.2238576 11 14.5 11zM8.83771031 9.7230306L10.2519239 11.1372442C10.6424482 11.5277685 10.6424482 12.1609334 10.2519239 12.5514577L8.75508864 14.048293C8.58065055 14.222731 8.34789026 14.326535 8.10155178 14.3397503L6.47084466 14.4272328 4.09667532 16.8014021C3.84579567 17.0522817 3.43903939 17.0522817 3.18815974 16.8014021 2.93728009 16.5505224 2.93728009 16.1437662 3.18815974 15.8928865L5.56232907 13.5187172 5.63790132 11.8778899C5.64937144 11.6288503 5.75345134 11.393076 5.92973558 11.2167918L7.42349675 9.7230306C7.81402104 9.33250631 8.44718602 9.33250631 8.83771031 9.7230306zM15.8783083 3.18815974C16.129188 2.93728009 16.5359443 2.93728009 16.7868239 3.18815974 17.0377036 3.43903939 17.0377036 3.84579567 16.7868239 4.09667532L16.7868239 4.09667532 14.4126546 6.47084466 14.3251721 8.10155178C14.3119568 8.34789026 14.2081529 8.58065055 14.0337148 8.75508864L14.0337148 8.75508864 12.5368795 10.2519239C12.1463552 10.6424482 11.5131903 10.6424482 11.122666 10.2519239L11.122666 10.2519239 9.70845241 8.83771031C9.31792812 8.44718602 9.31792812 7.81402104 9.70845241 7.42349675L9.70845241 7.42349675 11.2022136 5.92973558C11.3784978 5.75345134 11.6142722 5.64937144 11.8633117 5.63790132L11.8633117 5.63790132 13.504139 5.56232907z"/>
|
||||
</svg>
|
Before Width: | Height: | Size: 1.6 KiB |
@ -1 +0,0 @@
|
||||
network-wired-symbolic-dark.svg
|
@ -1 +0,0 @@
|
||||
network-wired-symbolic.svg
|
@ -1,6 +0,0 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 20 20">
|
||||
<g fill="none" fill-rule="evenodd">
|
||||
<path fill="#000" d="M14.5,16 C14.7761424,16 15,16.2238576 15,16.5 C15,16.7761424 14.7761424,17 14.5,17 C14.2238576,17 14,16.7761424 14,16.5 C14,16.2238576 14.2238576,16 14.5,16 Z M14.5,11 C14.7761424,11 15,11.2238576 15,11.5 L15,14.5 C15,14.7761424 14.7761424,15 14.5,15 C14.2238576,15 14,14.7761424 14,14.5 L14,11.5 C14,11.2238576 14.2238576,11 14.5,11 Z"/>
|
||||
<path fill="#000" fill-opacity=".3" d="M8.83771031,9.7230306 L10.2519239,11.1372442 C10.6424482,11.5277685 10.6424482,12.1609334 10.2519239,12.5514577 L8.75508864,14.048293 C8.58065055,14.222731 8.34789026,14.326535 8.10155178,14.3397503 L6.47084466,14.4272328 L4.09667532,16.8014021 C3.84579567,17.0522817 3.43903939,17.0522817 3.18815974,16.8014021 C2.93728009,16.5505224 2.93728009,16.1437662 3.18815974,15.8928865 L5.56232907,13.5187172 L5.63790132,11.8778899 C5.64937144,11.6288503 5.75345134,11.393076 5.92973558,11.2167918 L7.42349675,9.7230306 C7.81402104,9.33250631 8.44718602,9.33250631 8.83771031,9.7230306 Z M15.8783083,3.18815974 C16.129188,2.93728009 16.5359443,2.93728009 16.7868239,3.18815974 C17.0377036,3.43903939 17.0377036,3.84579567 16.7868239,4.09667532 L16.7868239,4.09667532 L14.4126546,6.47084466 L14.3251721,8.10155178 C14.3119568,8.34789026 14.2081529,8.58065055 14.0337148,8.75508864 L14.0337148,8.75508864 L12.5368795,10.2519239 C12.1463552,10.6424482 11.5131903,10.6424482 11.122666,10.2519239 L11.122666,10.2519239 L9.70845241,8.83771031 C9.31792812,8.44718602 9.31792812,7.81402104 9.70845241,7.42349675 L9.70845241,7.42349675 L11.2022136,5.92973558 C11.3784978,5.75345134 11.6142722,5.64937144 11.8633117,5.63790132 L11.8633117,5.63790132 L13.504139,5.56232907 Z"/>
|
||||
</g>
|
||||
</svg>
|
Before Width: | Height: | Size: 1.8 KiB |
@ -1,6 +0,0 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 20 20">
|
||||
<g fill="none" fill-rule="evenodd">
|
||||
<path fill="#FFF" d="M14.5,16 C14.7761424,16 15,16.2238576 15,16.5 C15,16.7761424 14.7761424,17 14.5,17 C14.2238576,17 14,16.7761424 14,16.5 C14,16.2238576 14.2238576,16 14.5,16 Z M14.5,11 C14.7761424,11 15,11.2238576 15,11.5 L15,14.5 C15,14.7761424 14.7761424,15 14.5,15 C14.2238576,15 14,14.7761424 14,14.5 L14,11.5 C14,11.2238576 14.2238576,11 14.5,11 Z"/>
|
||||
<path fill="#FFF" d="M8.83771031,9.7230306 L10.2519239,11.1372442 C10.6424482,11.5277685 10.6424482,12.1609334 10.2519239,12.5514577 L8.75508864,14.048293 C8.58065055,14.222731 8.34789026,14.326535 8.10155178,14.3397503 L6.47084466,14.4272328 L4.09667532,16.8014021 C3.84579567,17.0522817 3.43903939,17.0522817 3.18815974,16.8014021 C2.93728009,16.5505224 2.93728009,16.1437662 3.18815974,15.8928865 L5.56232907,13.5187172 L5.63790132,11.8778899 C5.64937144,11.6288503 5.75345134,11.393076 5.92973558,11.2167918 L7.42349675,9.7230306 C7.81402104,9.33250631 8.44718602,9.33250631 8.83771031,9.7230306 Z M15.8783083,3.18815974 C16.129188,2.93728009 16.5359443,2.93728009 16.7868239,3.18815974 C17.0377036,3.43903939 17.0377036,3.84579567 16.7868239,4.09667532 L16.7868239,4.09667532 L14.4126546,6.47084466 L14.3251721,8.10155178 C14.3119568,8.34789026 14.2081529,8.58065055 14.0337148,8.75508864 L14.0337148,8.75508864 L12.5368795,10.2519239 C12.1463552,10.6424482 11.5131903,10.6424482 11.122666,10.2519239 L11.122666,10.2519239 L9.70845241,8.83771031 C9.31792812,8.44718602 9.31792812,7.81402104 9.70845241,7.42349675 L9.70845241,7.42349675 L11.2022136,5.92973558 C11.3784978,5.75345134 11.6142722,5.64937144 11.8633117,5.63790132 L11.8633117,5.63790132 L13.504139,5.56232907 Z" opacity=".3"/>
|
||||
</g>
|
||||
</svg>
|
Before Width: | Height: | Size: 1.8 KiB |
@ -1,3 +0,0 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 20 20">
|
||||
<path fill-rule="evenodd" d="M6.33771031,7.4730306 L7.75192387,8.88724416 C8.14244816,9.27776845 8.14244816,9.91093343 7.75192387,10.3014577 L6.25508864,11.798293 C6.08065055,11.972731 5.84789026,12.076535 5.60155178,12.0897503 L3.97084466,12.1772328 L1.59667532,14.5514021 C1.34579567,14.8022817 0.93903939,14.8022817 0.688159738,14.5514021 C0.437280087,14.3005224 0.437280087,13.8937662 0.688159738,13.6428865 L3.06232907,11.2687172 L3.13790132,9.62788991 C3.14937144,9.37885034 3.25345134,9.14307601 3.42973558,8.96679176 L4.92349675,7.4730306 C5.31402104,7.08250631 5.94718602,7.08250631 6.33771031,7.4730306 Z M13.3783083,0.938159738 C13.629188,0.687280087 14.0359443,0.687280087 14.2868239,0.938159738 C14.5377036,1.18903939 14.5377036,1.59579567 14.2868239,1.84667532 L14.2868239,1.84667532 L11.9126546,4.22084466 L11.8251721,5.85155178 C11.8119568,6.09789026 11.7081529,6.33065055 11.5337148,6.50508864 L11.5337148,6.50508864 L10.0368795,8.00192387 C9.64635525,8.39244816 9.01319027,8.39244816 8.62266598,8.00192387 L8.62266598,8.00192387 L7.20845241,6.58771031 C6.81792812,6.19718602 6.81792812,5.56402104 7.20845241,5.17349675 L7.20845241,5.17349675 L8.70221358,3.67973558 C8.87849782,3.50345134 9.11427215,3.39937144 9.36331172,3.38790132 L9.36331172,3.38790132 L11.004139,3.31232907 Z" transform="translate(2.5 2.25)"/>
|
||||
</svg>
|
Before Width: | Height: | Size: 1.4 KiB |
@ -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 |
@ -1,3 +0,0 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 20 20">
|
||||
<path fill-rule="evenodd" d="M5.95845533,8.09755265 L7.37266889,9.51176621 C7.76319318,9.9022905 7.76319318,10.5354555 7.37266889,10.9259798 L5.87583366,12.422815 C5.70139557,12.5972531 5.46863528,12.701057 5.2222968,12.7142723 L3.59158968,12.8017548 L1.21742034,15.1759241 C0.966540692,15.4268038 0.559784409,15.4268038 0.308904758,15.1759241 C0.0580251071,14.9250445 0.0580251071,14.5182882 0.308904758,14.2674086 L2.68307409,11.8932392 L2.75864634,10.252412 C2.77011646,10.0033724 2.87419636,9.76759806 3.0504806,9.59131381 L4.54424177,8.09755265 C4.93476606,7.70702836 5.56793104,7.70702836 5.95845533,8.09755265 Z M14.2719301,0.289805053 C14.5228097,0.0389254018 14.929566,0.0389254018 15.1804457,0.289805053 C15.4313253,0.540684704 15.4313253,0.947440986 15.1804457,1.19832064 L15.1804457,1.19832064 L12.8062763,3.57248997 L12.7187938,5.2031971 C12.7055785,5.44953557 12.6017746,5.68229587 12.4273365,5.85673395 L12.4273365,5.85673395 L10.9305013,7.35356919 C10.539977,7.74409348 9.90681202,7.74409348 9.51628773,7.35356919 L9.51628773,7.35356919 L8.10207417,5.93935562 C7.71154988,5.54883133 7.71154988,4.91566635 8.10207417,4.52514206 L8.10207417,4.52514206 L9.59583533,3.0313809 C9.77211958,2.85509665 10.0078939,2.75101675 10.2569335,2.73954664 L10.2569335,2.73954664 L11.8977607,2.66397439 Z" transform="translate(2.25 2.25)"/>
|
||||
</svg>
|
Before Width: | Height: | Size: 1.4 KiB |
@ -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 |
@ -1,3 +0,0 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 20 20">
|
||||
<path fill-rule="evenodd" d="M6.29495771,9.75770358 L7.70917127,11.1719171 C8.09969556,11.5624414 8.09969556,12.1956064 7.70917127,12.5861307 L6.21233603,14.0829659 C6.03789795,14.257404 5.80513765,14.361208 5.55879918,14.3744233 L3.92809205,14.4619057 L1.55392272,16.8360751 C1.30304307,17.0869547 0.896286788,17.0869547 0.645407136,16.8360751 C0.394527485,16.5851954 0.394527485,16.1784391 0.645407136,15.9275595 L3.01957647,13.5533902 L3.09514872,11.9125629 C3.10661884,11.6635233 3.21069874,11.427749 3.38698298,11.2514647 L4.88074414,9.75770358 C5.27126844,9.36717929 5.90443342,9.36717929 6.29495771,9.75770358 Z M15.9591048,0.599283615 C16.2099845,0.348403964 16.6167408,0.348403964 16.8676204,0.599283615 C17.1185001,0.850163266 17.1185001,1.25691955 16.8676204,1.5077992 L16.8676204,1.5077992 L14.4934511,3.88196853 L14.4059686,5.51267566 C14.3927533,5.75901413 14.2889494,5.99177443 14.1145113,6.16621251 L14.1145113,6.16621251 L12.617676,7.66304775 C12.2271518,8.05357204 11.5939868,8.05357204 11.2034625,7.66304775 L11.2034625,7.66304775 L9.78924892,6.24883419 C9.39872463,5.85830989 9.39872463,5.22514492 9.78924892,4.83462062 L9.78924892,4.83462062 L11.2830101,3.34085946 C11.4592943,3.16457521 11.6950687,3.06049532 11.9441082,3.0490252 L11.9441082,3.0490252 L13.5849355,2.97345295 Z" transform="translate(1.25 1.25)"/>
|
||||
</svg>
|
Before Width: | Height: | Size: 1.4 KiB |
@ -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 |
@ -1,3 +0,0 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 20 20">
|
||||
<path fill-rule="evenodd" d="M5.95464235,10.6412146 L7.36885591,12.0554282 C7.7593802,12.4459525 7.7593802,13.0791174 7.36885591,13.4696417 L5.87202067,14.966477 C5.69758259,15.140915 5.46482229,15.244719 5.21848382,15.2579343 L3.58777669,15.3454168 L1.21360736,17.7195861 C0.962727708,17.9704657 0.555971426,17.9704657 0.305091775,17.7195861 C0.0542121235,17.4687064 0.0542121235,17.0619502 0.305091775,16.8110705 L2.67926111,14.4369012 L2.75483336,12.7960739 C2.76630348,12.5470343 2.87038337,12.31126 3.04666762,12.1349758 L4.54042878,10.6412146 C4.93095307,10.2506903 5.56411805,10.2506903 5.95464235,10.6412146 Z M16.7893235,0.240141323 C17.0402031,-0.0107383279 17.4469594,-0.0107383279 17.6978391,0.240141323 C17.9487187,0.491020974 17.9487187,0.897777257 17.6978391,1.14865691 L17.6978391,1.14865691 L15.3236697,3.52282624 L15.2361873,5.15353337 C15.222972,5.39987184 15.119168,5.63263214 14.9447299,5.80707022 L14.9447299,5.80707022 L13.4478947,7.30390546 C13.0573704,7.69442975 12.4242054,7.69442975 12.0336811,7.30390546 L12.0336811,7.30390546 L10.6194676,5.88969189 C10.2289433,5.4991676 10.2289433,4.86600262 10.6194676,4.47547833 L10.6194676,4.47547833 L12.1132287,2.98171717 C12.289513,2.80543292 12.5252873,2.70135303 12.7743269,2.68988291 L12.7743269,2.68988291 L14.4151542,2.61431066 Z" transform="translate(1 1)"/>
|
||||
</svg>
|
Before Width: | Height: | Size: 1.4 KiB |
@ -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 |
@ -1,3 +0,0 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 20 20">
|
||||
<path fill-rule="evenodd" d="M5.84594306,12.7290882 L7.26015663,14.1433017 C7.65068092,14.533826 7.65068092,15.166991 7.26015663,15.5575153 L5.76332139,17.0543505 C5.58888331,17.2287886 5.35612301,17.3325926 5.10978454,17.3458079 L3.47907741,17.4332903 L1.10490808,19.8074597 C0.854028427,20.0583393 0.447272144,20.0583393 0.196392493,19.8074597 C-0.0544871578,19.55658 -0.0544871578,19.1498237 0.196392493,18.8989441 L2.57056183,16.5247748 L2.64613408,14.8839475 C2.6576042,14.6349079 2.76168409,14.3991336 2.93796834,14.2228493 L4.4317295,12.7290882 C4.82225379,12.3385639 5.45541877,12.3385639 5.84594306,12.7290882 Z M18.8914666,0.203143417 C19.1423462,-0.047736234 19.5491025,-0.047736234 19.7999821,0.203143417 C20.0508618,0.454023068 20.0508618,0.86077935 19.7999821,1.111659 L19.7999821,1.111659 L17.4258128,3.48582833 L17.3383303,5.11653546 C17.325115,5.36287394 17.2213111,5.59563423 17.046873,5.77007231 L17.046873,5.77007231 L15.5500378,7.26690755 C15.1595135,7.65743184 14.5263485,7.65743184 14.1358242,7.26690755 L14.1358242,7.26690755 L12.7216107,5.85269399 C12.3310864,5.4621697 12.3310864,4.82900472 12.7216107,4.43848043 L12.7216107,4.43848043 L14.2153718,2.94471926 C14.3916561,2.76843502 14.6274304,2.66435512 14.87647,2.652885 L14.87647,2.652885 L16.5172972,2.57731275 Z"/>
|
||||
</svg>
|
Before Width: | Height: | Size: 1.4 KiB |
@ -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 |
@ -1,3 +0,0 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 20 20">
|
||||
<path fill-rule="evenodd" d="M8.83771031,9.7230306 L10.2519239,11.1372442 C10.6424482,11.5277685 10.6424482,12.1609334 10.2519239,12.5514577 L8.75508864,14.048293 C8.58065055,14.222731 8.34789026,14.326535 8.10155178,14.3397503 L6.47084466,14.4272328 L4.09667532,16.8014021 C3.84579567,17.0522817 3.43903939,17.0522817 3.18815974,16.8014021 C2.93728009,16.5505224 2.93728009,16.1437662 3.18815974,15.8928865 L5.56232907,13.5187172 L5.63790132,11.8778899 C5.64937144,11.6288503 5.75345134,11.393076 5.92973558,11.2167918 L7.42349675,9.7230306 C7.81402104,9.33250631 8.44718602,9.33250631 8.83771031,9.7230306 Z M15.8783083,3.18815974 C16.129188,2.93728009 16.5359443,2.93728009 16.7868239,3.18815974 C17.0377036,3.43903939 17.0377036,3.84579567 16.7868239,4.09667532 L16.7868239,4.09667532 L14.4126546,6.47084466 L14.3251721,8.10155178 C14.3119568,8.34789026 14.2081529,8.58065055 14.0337148,8.75508864 L14.0337148,8.75508864 L12.5368795,10.2519239 C12.1463552,10.6424482 11.5131903,10.6424482 11.122666,10.2519239 L11.122666,10.2519239 L9.70845241,8.83771031 C9.31792812,8.44718602 9.31792812,7.81402104 9.70845241,7.42349675 L9.70845241,7.42349675 L11.2022136,5.92973558 C11.3784978,5.75345134 11.6142722,5.64937144 11.8633117,5.63790132 L11.8633117,5.63790132 L13.504139,5.56232907 Z"/>
|
||||
</svg>
|
Before Width: | Height: | Size: 1.3 KiB |
@ -1,3 +0,0 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 20 20">
|
||||
<path fill="#FFF" fill-rule="evenodd" d="M8.83771031,9.7230306 L10.2519239,11.1372442 C10.6424482,11.5277685 10.6424482,12.1609334 10.2519239,12.5514577 L8.75508864,14.048293 C8.58065055,14.222731 8.34789026,14.326535 8.10155178,14.3397503 L6.47084466,14.4272328 L4.09667532,16.8014021 C3.84579567,17.0522817 3.43903939,17.0522817 3.18815974,16.8014021 C2.93728009,16.5505224 2.93728009,16.1437662 3.18815974,15.8928865 L5.56232907,13.5187172 L5.63790132,11.8778899 C5.64937144,11.6288503 5.75345134,11.393076 5.92973558,11.2167918 L7.42349675,9.7230306 C7.81402104,9.33250631 8.44718602,9.33250631 8.83771031,9.7230306 Z M15.8783083,3.18815974 C16.129188,2.93728009 16.5359443,2.93728009 16.7868239,3.18815974 C17.0377036,3.43903939 17.0377036,3.84579567 16.7868239,4.09667532 L16.7868239,4.09667532 L14.4126546,6.47084466 L14.3251721,8.10155178 C14.3119568,8.34789026 14.2081529,8.58065055 14.0337148,8.75508864 L14.0337148,8.75508864 L12.5368795,10.2519239 C12.1463552,10.6424482 11.5131903,10.6424482 11.122666,10.2519239 L11.122666,10.2519239 L9.70845241,8.83771031 C9.31792812,8.44718602 9.31792812,7.81402104 9.70845241,7.42349675 L9.70845241,7.42349675 L11.2022136,5.92973558 C11.3784978,5.75345134 11.6142722,5.64937144 11.8633117,5.63790132 L11.8633117,5.63790132 L13.504139,5.56232907 Z"/>
|
||||
</svg>
|
Before Width: | Height: | Size: 1.4 KiB |
@ -1,3 +0,0 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 20 20">
|
||||
<path fill="#FFF" fill-rule="evenodd" d="M10.0000013,1.27118983e-06 C15.5228488,1.27118983e-06 20.0000013,4.47715377 20.0000013,10.0000013 C20.0000013,15.5228488 15.5228488,20.0000013 10.0000013,20.0000013 C4.47715377,20.0000013 1.27118983e-06,15.5228488 1.27118983e-06,10.0000013 C1.27118983e-06,4.47715377 4.47715377,1.27118983e-06 10.0000013,1.27118983e-06 Z M7.2843055,6.58858366 C7.08943736,6.45358761 6.82001296,6.47287276 6.64644661,6.64643911 L6.64644661,6.64643911 L6.58859116,6.715687 C6.45359511,6.91055514 6.47288026,7.17997954 6.64644661,7.35354589 L6.64644661,7.35354589 L9.293,9.9999925 L6.64644661,12.6464391 L6.58859116,12.715687 C6.45359511,12.9105551 6.47288026,13.1799795 6.64644661,13.3535459 L6.64644661,13.3535459 L6.7156945,13.4114013 C6.91056264,13.5463974 7.17998704,13.5271122 7.35355339,13.3535459 L7.35355339,13.3535459 L10,10.7069925 L12.6464466,13.3535459 L12.7156945,13.4114013 C12.9105626,13.5463974 13.179987,13.5271122 13.3535534,13.3535459 L13.3535534,13.3535459 L13.4114088,13.284298 C13.5464049,13.0894299 13.5271197,12.8200055 13.3535534,12.6464391 L13.3535534,12.6464391 L10.707,9.9999925 L13.3535534,7.35354589 L13.4114088,7.284298 C13.5464049,7.08942986 13.5271197,6.82000546 13.3535534,6.64643911 L13.3535534,6.64643911 L13.2843055,6.58858366 C13.0894374,6.45358761 12.820013,6.47287276 12.6464466,6.64643911 L12.6464466,6.64643911 L10,9.2929925 L7.35355339,6.64643911 Z"/>
|
||||
</svg>
|
Before Width: | Height: | Size: 1.5 KiB |
@ -1,3 +0,0 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 20 20">
|
||||
<path fill-rule="evenodd" d="M10.0000013,1.27118983e-06 C15.5228488,1.27118983e-06 20.0000013,4.47715377 20.0000013,10.0000013 C20.0000013,15.5228488 15.5228488,20.0000013 10.0000013,20.0000013 C4.47715377,20.0000013 1.27118983e-06,15.5228488 1.27118983e-06,10.0000013 C1.27118983e-06,4.47715377 4.47715377,1.27118983e-06 10.0000013,1.27118983e-06 Z M7.2843055,6.58858366 C7.08943736,6.45358761 6.82001296,6.47287276 6.64644661,6.64643911 L6.64644661,6.64643911 L6.58859116,6.715687 C6.45359511,6.91055514 6.47288026,7.17997954 6.64644661,7.35354589 L6.64644661,7.35354589 L9.293,9.9999925 L6.64644661,12.6464391 L6.58859116,12.715687 C6.45359511,12.9105551 6.47288026,13.1799795 6.64644661,13.3535459 L6.64644661,13.3535459 L6.7156945,13.4114013 C6.91056264,13.5463974 7.17998704,13.5271122 7.35355339,13.3535459 L7.35355339,13.3535459 L10,10.7069925 L12.6464466,13.3535459 L12.7156945,13.4114013 C12.9105626,13.5463974 13.179987,13.5271122 13.3535534,13.3535459 L13.3535534,13.3535459 L13.4114088,13.284298 C13.5464049,13.0894299 13.5271197,12.8200055 13.3535534,12.6464391 L13.3535534,12.6464391 L10.707,9.9999925 L13.3535534,7.35354589 L13.4114088,7.284298 C13.5464049,7.08942986 13.5271197,6.82000546 13.3535534,6.64643911 L13.3535534,6.64643911 L13.2843055,6.58858366 C13.0894374,6.45358761 12.820013,6.47287276 12.6464466,6.64643911 L12.6464466,6.64643911 L10,9.2929925 L7.35355339,6.64643911 Z"/>
|
||||
</svg>
|
Before Width: | Height: | Size: 1.5 KiB |
@ -1,3 +0,0 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 20 20">
|
||||
<path fill="#FFF" d="M17,2 L17,8 L11,8 L14.0692732,4.93027904 C12.9431015,4.02647545 11.5199506,3.5 10,3.5 C6.41014912,3.5 3.5,6.41014912 3.5,10 C3.5,13.5898508 6.41014914,16.5 10,16.5 C12.6572393,16.5 15.0163846,14.8908134 16.012065,12.4756735 L16.012065,12.4756735 L16.9365798,12.8568197 C15.7878061,15.6433054 13.0658021,17.5 10,17.5 C5.85786439,17.5 2.5,14.1421356 2.5,10 C2.5,5.85786438 5.85786438,2.5 10,2.5 C11.7921585,2.5 13.4677532,3.13445568 14.7801646,4.21961165 L17,2 Z"/>
|
||||
</svg>
|
Before Width: | Height: | Size: 578 B |
@ -1,3 +0,0 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 20 20">
|
||||
<path fill-rule="evenodd" d="M17,2 L17,8 L11,8 L14.0692732,4.93027904 C12.9431015,4.02647545 11.5199506,3.5 10,3.5 C6.41014912,3.5 3.5,6.41014912 3.5,10 C3.5,13.5898508 6.41014914,16.5 10,16.5 C12.6572393,16.5 15.0163846,14.8908134 16.012065,12.4756735 L16.012065,12.4756735 L16.9365798,12.8568197 C15.7878061,15.6433054 13.0658021,17.5 10,17.5 C5.85786439,17.5 2.5,14.1421356 2.5,10 C2.5,5.85786438 5.85786438,2.5 10,2.5 C11.7921585,2.5 13.4677532,3.13445568 14.7801646,4.21961165 L17,2 Z"/>
|
||||
</svg>
|
Before Width: | Height: | Size: 586 B |
@ -1,3 +0,0 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 20 20">
|
||||
<path fill="#FFF" fill-rule="evenodd" d="M2.008,1.74 C2.008,1.341 2.333,1.016 2.732,1.016 L3.283,1.016 C3.683,1.016 4.008,1.341 4.008,1.74 L4.008,3.016 L2.008,3.016 L2.008,1.74 Z M5.459,3 L5,3 L5,1.74 C5,0.789 4.234,0 3.283,0 L2.732,0 C1.781,0 1,0.789 1,1.74 L1,3 L0.557,3 C0.254,3 0,3.261 0,3.565 L0,6.466 C0,6.77 0.254,7 0.557,7 L5.459,7 C5.762,7 6,6.77 6,6.466 L6,3.565 C6,3.261 5.762,3 5.459,3 L5.459,3 Z" transform="translate(7 6)"/>
|
||||
</svg>
|
Before Width: | Height: | Size: 532 B |
@ -1,3 +0,0 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 20 20">
|
||||
<path fill-rule="evenodd" d="M2.008,1.74 C2.008,1.341 2.333,1.016 2.732,1.016 L3.283,1.016 C3.683,1.016 4.008,1.341 4.008,1.74 L4.008,3.016 L2.008,3.016 L2.008,1.74 Z M5.459,3 L5,3 L5,1.74 C5,0.789 4.234,0 3.283,0 L2.732,0 C1.781,0 1,0.789 1,1.74 L1,3 L0.557,3 C0.254,3 0,3.261 0,3.565 L0,6.466 C0,6.77 0.254,7 0.557,7 L5.459,7 C5.762,7 6,6.77 6,6.466 L6,3.565 C6,3.261 5.762,3 5.459,3 L5.459,3 Z" transform="translate(7 6)"/>
|
||||
</svg>
|
Before Width: | Height: | Size: 520 B |
@ -1,3 +0,0 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 20 20">
|
||||
<path fill="#FFF" fill-rule="evenodd" d="M10,0 C15.5,0 20,4.5 20,10 C20,15.5 15.5,20 10,20 C4.5,20 0,15.5 0,10 C0,4.5 4.5,0 10,0 Z M14.1636213,5.63070157 L9.2152245,11.9670795 L7.038112,9.65378951 L6.16425285,10.4762068 L9.30003171,13.8081274 L15.109388,6.36929843 L14.1636213,5.63070157 Z"/>
|
||||
</svg>
|
Before Width: | Height: | Size: 386 B |
@ -1,3 +0,0 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 20 20">
|
||||
<path fill-rule="evenodd" d="M10,0 C15.5,0 20,4.5 20,10 C20,15.5 15.5,20 10,20 C4.5,20 0,15.5 0,10 C0,4.5 4.5,0 10,0 Z M14.1636213,5.63070157 L9.2152245,11.9670795 L7.038112,9.65378951 L6.16425285,10.4762068 L9.30003171,13.8081274 L15.109388,6.36929843 L14.1636213,5.63070157 Z"/>
|
||||
</svg>
|
Before Width: | Height: | Size: 374 B |
Before Width: | Height: | Size: 181 B |
Before Width: | Height: | Size: 183 B |
Before Width: | Height: | Size: 198 B |
Before Width: | Height: | Size: 192 B |
Before Width: | Height: | Size: 201 B |
Before Width: | Height: | Size: 224 B |
Before Width: | Height: | Size: 240 B |
Before Width: | Height: | Size: 262 B |
Before Width: | Height: | Size: 255 B |
Before Width: | Height: | Size: 303 B |
Before Width: | Height: | Size: 301 B |
Before Width: | Height: | Size: 327 B |
Before Width: | Height: | Size: 321 B |
Before Width: | Height: | Size: 306 B |
Before Width: | Height: | Size: 340 B |
Before Width: | Height: | Size: 368 B |
Before Width: | Height: | Size: 378 B |
Before Width: | Height: | Size: 384 B |
Before Width: | Height: | Size: 410 B |
Before Width: | Height: | Size: 392 B |
Before Width: | Height: | Size: 403 B |
Before Width: | Height: | Size: 417 B |
Before Width: | Height: | Size: 426 B |
Before Width: | Height: | Size: 417 B |
Before Width: | Height: | Size: 443 B |
Before Width: | Height: | Size: 428 B |
Before Width: | Height: | Size: 424 B |
Before Width: | Height: | Size: 431 B |
Before Width: | Height: | Size: 446 B |
Before Width: | Height: | Size: 443 B |
Before Width: | Height: | Size: 436 B |
Before Width: | Height: | Size: 450 B |
Before Width: | Height: | Size: 438 B |
Before Width: | Height: | Size: 430 B |
Before Width: | Height: | Size: 438 B |
Before Width: | Height: | Size: 437 B |
Before Width: | Height: | Size: 440 B |
Before Width: | Height: | Size: 443 B |
Before Width: | Height: | Size: 436 B |