2017-09-18 14:33:44 +08:00
|
|
|
/*
|
2018-02-07 11:52:47 +08:00
|
|
|
* Copyright (C) 2011 ~ 2018 Deepin Technology Co., Ltd.
|
2017-09-18 14:33:44 +08:00
|
|
|
*
|
|
|
|
* 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/>.
|
|
|
|
*/
|
|
|
|
|
2016-07-21 11:36:06 +08:00
|
|
|
#ifndef WIREDITEM_H
|
|
|
|
#define WIREDITEM_H
|
|
|
|
|
2016-07-22 15:17:42 +08:00
|
|
|
#include "deviceitem.h"
|
2016-07-21 17:14:54 +08:00
|
|
|
|
2016-07-21 11:36:06 +08:00
|
|
|
#include <QWidget>
|
2016-07-22 17:04:13 +08:00
|
|
|
#include <QLabel>
|
2016-09-05 16:45:30 +08:00
|
|
|
#include <QTimer>
|
2016-07-21 11:36:06 +08:00
|
|
|
|
2016-07-22 15:17:42 +08:00
|
|
|
class WiredItem : public DeviceItem
|
2016-07-21 11:36:06 +08:00
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
public:
|
2017-06-19 14:15:16 +08:00
|
|
|
explicit WiredItem(const QString &path);
|
2016-07-21 11:36:06 +08:00
|
|
|
|
2017-06-16 09:00:53 +08:00
|
|
|
NetworkDevice::NetworkType type() const override;
|
|
|
|
NetworkDevice::NetworkState state() const override;
|
|
|
|
QWidget *itemPopup() override;
|
2016-09-23 10:24:08 +08:00
|
|
|
const QString itemCommand() const override;
|
2016-07-22 17:04:13 +08:00
|
|
|
|
2016-07-21 11:36:06 +08:00
|
|
|
protected:
|
2017-06-16 09:00:53 +08:00
|
|
|
void paintEvent(QPaintEvent *e) override;
|
|
|
|
void resizeEvent(QResizeEvent *e) override;
|
|
|
|
void mousePressEvent(QMouseEvent *e) override;
|
2016-07-21 17:14:54 +08:00
|
|
|
|
2016-09-05 16:45:30 +08:00
|
|
|
private slots:
|
2017-06-16 09:00:53 +08:00
|
|
|
void refreshIcon() override;
|
2016-07-21 17:14:54 +08:00
|
|
|
void reloadIcon();
|
2017-06-19 14:15:16 +08:00
|
|
|
void activeConnectionChanged();
|
2016-09-05 16:45:30 +08:00
|
|
|
void deviceStateChanged(const NetworkDevice &device);
|
2016-07-21 17:14:54 +08:00
|
|
|
|
|
|
|
private:
|
2016-07-22 17:04:13 +08:00
|
|
|
bool m_connected;
|
2016-07-21 17:14:54 +08:00
|
|
|
QPixmap m_icon;
|
2016-07-22 17:04:13 +08:00
|
|
|
|
|
|
|
QLabel *m_itemTips;
|
2016-09-05 16:45:30 +08:00
|
|
|
QTimer *m_delayTimer;
|
2016-07-21 11:36:06 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif // WIREDITEM_H
|