Changeset View
Changeset View
Standalone View
Standalone View
applet/contents/ui/Toolbar.qml
Show First 20 Lines • Show All 106 Lines • ▼ Show 20 Line(s) | 106 | Binding { | |||
---|---|---|---|---|---|
107 | target: connectionIconProvider | 107 | target: connectionIconProvider | ||
108 | property: "airplaneMode" | 108 | property: "airplaneMode" | ||
109 | value: planeModeSwitchButton.airplaneModeEnabled | 109 | value: planeModeSwitchButton.airplaneModeEnabled | ||
110 | } | 110 | } | ||
111 | } | 111 | } | ||
112 | } | 112 | } | ||
113 | 113 | | |||
114 | PlasmaComponents.ToolButton { | 114 | PlasmaComponents.ToolButton { | ||
115 | id: wifiRefreshButton | ||||
116 | enabled: false | ||||
broulik: I would do it declaratively:
```
enabled: !coolDownTimer.running
``` | |||||
117 | | ||||
118 | anchors { | ||||
119 | right: openEditorButton.left | ||||
120 | rightMargin: Math.round(units.gridUnit / 2) | ||||
121 | verticalCenter: parent.verticalCenter | ||||
122 | } | ||||
123 | | ||||
124 | tooltip: i18ndc("plasma-nm", "button tooltip", "Scan for new wireless networks") | ||||
ngraham: How about "Scan for new wireless networks"? | |||||
broulik: Why does this need an explicit domain? | |||||
125 | iconSource: "view-refresh" | ||||
126 | visible: enabledConnections.wirelessHwEnabled && availableDevices.wirelessDeviceAvailable && !planeModeSwitchButton.airplaneModeEnabled | ||||
127 | | ||||
128 | onClicked: { | ||||
129 | handler.requestScan() | ||||
130 | enabled = false | ||||
131 | coolDownTimer.start() | ||||
132 | } | ||||
133 | | ||||
134 | Timer { | ||||
135 | id: coolDownTimer | ||||
136 | interval: 2500 | ||||
137 | repeat: false | ||||
138 | running: true | ||||
139 | onTriggered: { | ||||
140 | wifiRefreshButton.enabled = true | ||||
141 | } | ||||
142 | } | ||||
143 | } | ||||
144 | | ||||
145 | PlasmaComponents.ToolButton { | ||||
115 | id: openEditorButton | 146 | id: openEditorButton | ||
116 | 147 | | |||
117 | anchors { | 148 | anchors { | ||
118 | right: parent.right | 149 | right: parent.right | ||
119 | rightMargin: Math.round(units.gridUnit / 2) | 150 | rightMargin: Math.round(units.gridUnit / 2) | ||
120 | verticalCenter: parent.verticalCenter | 151 | verticalCenter: parent.verticalCenter | ||
121 | } | 152 | } | ||
122 | 153 | | |||
Show All 9 Lines |
I would do it declaratively: