Changeset View
Changeset View
Standalone View
Standalone View
applets/devicenotifier/package/contents/ui/DeviceItem.qml
Show First 20 Lines • Show All 113 Lines • ▼ Show 20 Line(s) | 113 | onTriggered: { | |||
---|---|---|---|---|---|
114 | deviceItem.ListView.delayRemove = false | 114 | deviceItem.ListView.delayRemove = false | ||
115 | // otherwise the last message will show again when this device reappears | 115 | // otherwise the last message will show again when this device reappears | ||
116 | statusSource.clearMessage() | 116 | statusSource.clearMessage() | ||
117 | 117 | | |||
118 | --devicenotifier.pendingDelegateRemoval // QTBUG-50380 | 118 | --devicenotifier.pendingDelegateRemoval // QTBUG-50380 | ||
119 | } | 119 | } | ||
120 | } | 120 | } | ||
121 | 121 | | |||
122 | Timer { | ||||
123 | id: updateStorageSpaceTimer | ||||
124 | interval: 5000 | ||||
125 | repeat: true | ||||
126 | running: mounted && plasmoid.expanded | ||||
127 | triggeredOnStart: true // Update the storage space as soon as we open the plasmoid | ||||
128 | onTriggered: { | ||||
129 | var service = sdSource.serviceForSource(udi); | ||||
130 | var operation = service.operationDescription("updateFreespace"); | ||||
131 | service.startOperationCall(operation); | ||||
132 | } | ||||
133 | } | ||||
134 | | ||||
122 | RowLayout { | 135 | RowLayout { | ||
123 | id: row | 136 | id: row | ||
124 | anchors.horizontalCenter: parent.horizontalCenter | 137 | anchors.horizontalCenter: parent.horizontalCenter | ||
125 | y: units.smallSpacing | 138 | y: units.smallSpacing | ||
126 | width: parent.width - 2 * units.smallSpacing | 139 | width: parent.width - 2 * units.smallSpacing | ||
127 | spacing: units.smallSpacing | 140 | spacing: units.smallSpacing | ||
128 | 141 | | |||
129 | // FIXME: Device item loses focus on mounting/unmounting it, | 142 | // FIXME: Device item loses focus on mounting/unmounting it, | ||
▲ Show 20 Lines • Show All 104 Lines • ▼ Show 20 Line(s) | 200 | Column { | |||
234 | PlasmaComponents.Label { | 247 | PlasmaComponents.Label { | ||
235 | id: actionMessage | 248 | id: actionMessage | ||
236 | width: parent.width | 249 | width: parent.width | ||
237 | height: undefined | 250 | height: undefined | ||
238 | opacity: 0.6 | 251 | opacity: 0.6 | ||
239 | font.pointSize: theme.smallestFont.pointSize | 252 | font.pointSize: theme.smallestFont.pointSize | ||
240 | visible: deviceItem.state != 0 || (!actionsList.visible && !deviceItem.hasMessage) | 253 | visible: deviceItem.state != 0 || (!actionsList.visible && !deviceItem.hasMessage) | ||
241 | text: { | 254 | text: { | ||
242 | // FIXME: state changes do not reach the plasmoid if the | | |||
243 | // device was already attached when the plasmoid was initialized | | |||
244 | if (deviceItem.state == 0) { | 255 | if (deviceItem.state == 0) { | ||
245 | if (!hpSource.data[udi]) { | 256 | if (!hpSource.data[udi]) { | ||
246 | return "" | 257 | return "" | ||
247 | } | 258 | } | ||
248 | 259 | | |||
249 | var actions = hpSource.data[udi].actions | 260 | var actions = hpSource.data[udi].actions | ||
250 | if (actions.length > 1) { | 261 | if (actions.length > 1) { | ||
251 | return i18np("1 action for this device", "%1 actions for this device", actions.length); | 262 | return i18np("1 action for this device", "%1 actions for this device", actions.length); | ||
▲ Show 20 Lines • Show All 71 Lines • Show Last 20 Lines |