Changeset View
Changeset View
Standalone View
Standalone View
applet/contents/ui/Toolbar.qml
Show First 20 Lines • Show All 88 Lines • ▼ Show 20 Line(s) | 80 | SwitchButton { | |||
---|---|---|---|---|---|
89 | onClicked: { | 89 | onClicked: { | ||
90 | handler.enableWwan(checked); | 90 | handler.enableWwan(checked); | ||
91 | } | 91 | } | ||
92 | } | 92 | } | ||
93 | 93 | | |||
94 | SwitchButton { | 94 | SwitchButton { | ||
95 | id: planeModeSwitchButton | 95 | id: planeModeSwitchButton | ||
96 | 96 | | |||
97 | property bool initialized: false | ||||
97 | property bool airplaneModeEnabled: false | 98 | property bool airplaneModeEnabled: false | ||
98 | 99 | | |||
99 | checked: airplaneModeEnabled | 100 | checked: airplaneModeEnabled | ||
100 | tooltip: i18n("Enable airplane mode") | 101 | tooltip: i18n("Enable airplane mode") | ||
101 | icon: airplaneModeEnabled ? "network-flightmode-on" : "network-flightmode-off" | 102 | icon: airplaneModeEnabled ? "network-flightmode-on" : "network-flightmode-off" | ||
103 | visible: availableDevices.modemDeviceAvailable || availableDevices.wirelessDeviceAvailable | ||||
102 | 104 | | |||
103 | onClicked: { | 105 | onClicked: { | ||
104 | handler.enableAirplaneMode(checked); | 106 | handler.enableAirplaneMode(checked); | ||
105 | airplaneModeEnabled = !airplaneModeEnabled; | 107 | airplaneModeEnabled = !airplaneModeEnabled; | ||
106 | } | 108 | } | ||
107 | 109 | | |||
108 | Binding { | 110 | Binding { | ||
109 | target: connectionIconProvider | 111 | target: configuration | ||
110 | property: "airplaneMode" | 112 | property: "airplaneModeEnabled" | ||
111 | value: planeModeSwitchButton.airplaneModeEnabled | 113 | value: planeModeSwitchButton.airplaneModeEnabled | ||
114 | when: planeModeSwitchButton.initialized | ||||
115 | } | ||||
116 | | ||||
117 | Component.onCompleted: { | ||||
118 | airplaneModeEnabled = configuration.airplaneModeEnabled | ||||
119 | initialized = true | ||||
112 | } | 120 | } | ||
113 | } | 121 | } | ||
114 | } | 122 | } | ||
115 | 123 | | |||
116 | Row { | 124 | Row { | ||
117 | Layout.column: 1 | 125 | Layout.column: 1 | ||
118 | 126 | | |||
119 | PlasmaComponents.ToolButton { | 127 | PlasmaComponents.ToolButton { | ||
▲ Show 20 Lines • Show All 52 Lines • Show Last 20 Lines |