2
Copyright 2009 Sebastian Kügler <sebas@kde.org>
4
This program is free software; you can redistribute it and/or
5
modify it under the terms of the GNU General Public License as
6
published by the Free Software Foundation; either version 2 of
7
the License or (at your option) version 3 or any later version
8
accepted by the membership of KDE e.V. (or its successor approved
9
by the membership of KDE e.V.), which shall act as a proxy
10
defined in Section 14 of version 3 of the license.
12
This program is distributed in the hope that it will be useful,
13
but WITHOUT ANY WARRANTY; without even the implied warranty of
14
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15
GNU General Public License for more details.
17
You should have received a copy of the GNU General Public License
18
along with this program. If not, see <http://www.gnu.org/licenses/>.
24
#include <QGraphicsWidget>
26
#include <Plasma/CheckBox>
27
#include <Plasma/Frame>
28
#include <Plasma/IconWidget>
29
#include <Plasma/Label>
30
#include <Plasma/PushButton>
31
#include <Plasma/TabBar>
33
#include <solid/networking.h>
34
#include <solid/control/networkinterface.h>
36
#include "activatable.h"
38
class QGraphicsLinearLayout;
39
class QGraphicsGridLayout;
41
class RemoteActivatable;
42
class RemoteActivatableList;
44
class ActivatableListWidget;
46
class InterfaceDetailsWidget;
47
class VpnInterfaceItem;
49
class NMPopup: public QGraphicsWidget
53
NMPopup(RemoteActivatableList *, QGraphicsWidget* parent = 0);
57
Solid::Control::NetworkInterfaceNm09* defaultInterface();
58
bool available(int state);
61
QHash<QString, InterfaceItem*> m_interfaces;
64
void interfaceAdded(const QString&);
65
void interfaceRemoved(const QString&);
66
void managerWirelessEnabledChanged(bool);
67
void managerWirelessHardwareEnabledChanged(bool);
68
void wirelessEnabledToggled(bool checked);
69
void managerWwanEnabledChanged(bool);
70
void managerWwanHardwareEnabledChanged(bool);
71
void wwanEnabledToggled(bool checked);
72
void networkingEnabledToggled(bool checked);
73
void managerNetworkingEnabledChanged(bool);
74
void manageConnections();
77
void handleConnectionStateChange(int new_state, int old_state, int reason);
78
void toggleInterfaceTab();
79
void deleteInterfaceItem();
82
void configNeedsSaving();
86
void checkShowMore(RemoteActivatable *);
87
void uncheckShowMore(RemoteActivatable *);
89
void showInterfaceDetails(const QString & uni);
92
void addInterfaceInternal(Solid::Control::NetworkInterfaceNm09 *);
93
void addVpnInterface();
94
void updateHasWireless(bool checked = true);
97
RemoteActivatableList* m_activatables;
98
bool m_hasWirelessInterface;
99
bool m_showMoreChecked, m_oldShowMoreChecked;
101
QGraphicsWidget* m_widget;
102
QGraphicsGridLayout* m_mainLayout;
104
Plasma::Label* m_leftLabel;
105
// Container for interface overview and interface details widgets
106
Plasma::TabBar* m_leftWidget;
107
// Overall layout for interface overview
108
QGraphicsLinearLayout* m_leftLayout;
109
// Inner layout for interface list
110
QGraphicsLinearLayout* m_interfaceLayout;
112
InterfaceDetailsWidget* m_interfaceDetailsWidget;
115
Plasma::Label* m_rightLabel;
116
// Container for connection List
117
QGraphicsWidget* m_rightWidget;
119
QGraphicsLinearLayout* m_rightLayout;
121
Plasma::CheckBox* m_networkingCheckBox;
122
Plasma::CheckBox* m_wifiCheckBox;
123
Plasma::CheckBox* m_wwanCheckBox;
124
Plasma::PushButton* m_connectionsButton;
125
Plasma::PushButton* m_showMoreButton;
127
ActivatableListWidget* m_connectionList;
128
VpnInterfaceItem* m_vpnItem;