~ubuntu-branches/ubuntu/trusty/networkmanagement/trusty

« back to all changes in this revision

Viewing changes to .pc/fix-and-workaround-graphical-artifacts.diff/applet/nmpopup.h

  • Committer: Package Import Robot
  • Author(s): Philip Muškovac
  • Date: 2012-02-11 20:44:55 UTC
  • Revision ID: package-import@ubuntu.com-20120211204455-se2bx8iwlyhnp89u
Tags: 0.9.0~rc4-0ubuntu2
Cherry pick upstream commit 6a5e30e94ee539b7765eb5ad054bf9e1a6785703
as fix-and-workaround-graphical-artifacts.diff
to fix graphical artifacts in buttons with the default plasma theme.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
Copyright 2009 Sebastian Kügler <sebas@kde.org>
 
3
 
 
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.
 
11
 
 
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.
 
16
 
 
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/>.
 
19
*/
 
20
 
 
21
#ifndef NMPOPUP_H
 
22
#define NMPOPUP_H
 
23
 
 
24
#include <QGraphicsWidget>
 
25
 
 
26
#include <Plasma/CheckBox>
 
27
#include <Plasma/Frame>
 
28
#include <Plasma/IconWidget>
 
29
#include <Plasma/Label>
 
30
#include <Plasma/PushButton>
 
31
#include <Plasma/TabBar>
 
32
 
 
33
#include <solid/networking.h>
 
34
#include <solid/control/networkinterface.h>
 
35
 
 
36
#include "activatable.h"
 
37
 
 
38
class QGraphicsLinearLayout;
 
39
class QGraphicsGridLayout;
 
40
 
 
41
class RemoteActivatable;
 
42
class RemoteActivatableList;
 
43
 
 
44
class ActivatableListWidget;
 
45
class InterfaceItem;
 
46
class InterfaceDetailsWidget;
 
47
class VpnInterfaceItem;
 
48
 
 
49
class NMPopup: public QGraphicsWidget
 
50
{
 
51
Q_OBJECT
 
52
public:
 
53
    NMPopup(RemoteActivatableList *, QGraphicsWidget* parent = 0);
 
54
    virtual ~NMPopup();
 
55
 
 
56
    void init();
 
57
    Solid::Control::NetworkInterfaceNm09* defaultInterface();
 
58
    bool available(int state);
 
59
    bool hasWireless();
 
60
 
 
61
    QHash<QString, InterfaceItem*> m_interfaces;
 
62
 
 
63
public Q_SLOTS:
 
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();
 
75
    void showMore();
 
76
    void showMore(bool);
 
77
    void handleConnectionStateChange(int new_state, int old_state, int reason);
 
78
    void toggleInterfaceTab();
 
79
    void deleteInterfaceItem();
 
80
 
 
81
Q_SIGNALS:
 
82
    void configNeedsSaving();
 
83
 
 
84
private Q_SLOTS:
 
85
    void readConfig();
 
86
    void checkShowMore(RemoteActivatable *);
 
87
    void uncheckShowMore(RemoteActivatable *);
 
88
    void refresh();
 
89
    void showInterfaceDetails(const QString & uni);
 
90
 
 
91
private:
 
92
    void addInterfaceInternal(Solid::Control::NetworkInterfaceNm09 *);
 
93
    void addVpnInterface();
 
94
    void updateHasWireless(bool checked = true);
 
95
    void updateHasWwan();
 
96
 
 
97
    RemoteActivatableList* m_activatables;
 
98
    bool m_hasWirelessInterface;
 
99
    bool m_showMoreChecked, m_oldShowMoreChecked;
 
100
    int wicCount;
 
101
    QGraphicsWidget* m_widget;
 
102
    QGraphicsGridLayout* m_mainLayout;
 
103
    // Interfaces label
 
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;
 
111
 
 
112
    InterfaceDetailsWidget* m_interfaceDetailsWidget;
 
113
 
 
114
    // Connections Label
 
115
    Plasma::Label* m_rightLabel;
 
116
    // Container for connection List
 
117
    QGraphicsWidget* m_rightWidget;
 
118
 
 
119
    QGraphicsLinearLayout* m_rightLayout;
 
120
 
 
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;
 
126
 
 
127
    ActivatableListWidget* m_connectionList;
 
128
    VpnInterfaceItem* m_vpnItem;
 
129
};
 
130
 
 
131
#endif // NMPOPUP_H