2
Copyright 2013-2014 Jan Grulich <jgrulich@redhat.com>
4
This library is free software; you can redistribute it and/or
5
modify it under the terms of the GNU Lesser General Public
6
License as published by the Free Software Foundation; either
7
version 2.1 of the License, or (at your option) version 3, or any
8
later version accepted by the membership of KDE e.V. (or its
9
successor approved by the membership of KDE e.V.), which shall
10
act as a proxy defined in Section 6 of version 3 of the license.
12
This library 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 GNU
15
Lesser General Public License for more details.
17
You should have received a copy of the GNU Lesser General Public
18
License along with this library. If not, see <http://www.gnu.org/licenses/>.
22
import org.kde.plasma.components 2.0 as PlasmaComponents
23
import org.kde.plasma.core 2.0 as PlasmaCore
24
import org.kde.plasma.networkmanagement 0.2 as PlasmaNM
29
height: wifiSwitchButton.height;
31
PlasmaNM.EnabledConnections {
32
id: enabledConnections;
35
PlasmaNM.AvailableDevices {
41
imagePath: "widgets/line";
46
bottom: parent.bottom;
54
checked: enabled && enabledConnections.wirelessEnabled;
55
enabled: enabledConnections.wirelessHwEnabled && availableDevices.wirelessDeviceAvailable && !planeModeSwitchButton.airplaneModeEnabled;
56
icon: enabled ? "network-wireless-on" : "network-wireless-off";
57
visible: availableDevices.wirelessDeviceAvailable;
60
handler.enableWireless(checked);
67
checked: enabled && enabledConnections.wwanEnabled;
68
enabled: enabledConnections.wwanHwEnabled && availableDevices.modemDeviceAvailable && !planeModeSwitchButton.airplaneModeEnabled;
69
icon: enabled ? "network-mobile-on" : "network-mobile-off";
70
visible: availableDevices.modemDeviceAvailable;
73
handler.enableWwan(checked);
78
id: planeModeSwitchButton;
80
property bool airplaneModeEnabled: false;
82
checked: airplaneModeEnabled;
83
icon: airplaneModeEnabled ? "flightmode-on" : "flightmode-off";
86
handler.enableAirplaneMode(checked);
87
airplaneModeEnabled = !airplaneModeEnabled;
88
console.log(airplaneModeEnabled);
93
PlasmaComponents.ToolButton {
98
rightMargin: Math.round(units.gridUnit / 2);
99
verticalCenter: parent.verticalCenter;
102
iconSource: "configure";
105
handler.openEditor();