Changeset View
Changeset View
Standalone View
Standalone View
applets/devicenotifier/package/contents/ui/FullRepresentation.qml
Show First 20 Lines • Show All 104 Lines • ▼ Show 20 Line(s) | 104 | Connections { | |||
---|---|---|---|---|---|
105 | target: plasmoid | 105 | target: plasmoid | ||
106 | onExpandedChanged: { | 106 | onExpandedChanged: { | ||
107 | if (!plasmoid.expanded) { | 107 | if (!plasmoid.expanded) { | ||
108 | statusSource.clearMessage() | 108 | statusSource.clearMessage() | ||
109 | } | 109 | } | ||
110 | } | 110 | } | ||
111 | } | 111 | } | ||
112 | 112 | | |||
113 | ColumnLayout { | 113 | Item { | ||
broulik: Why this change? `ColumnLayout` should layout everything automatically without the need for… | |||||
broulik: Can you please investigate this change? | |||||
I do not manage to get the layout I want with ColumnLayout: I need to align that ScrollArea to the same level than the 'unmountAll' button thsurrel: I do not manage to get the layout I want with ColumnLayout: I need to align that ScrollArea to… | |||||
How about adding the following to the button: Layout.alignment: Qt.AlignRight Layout.preferredWidth: minimumWidth broulik: How about adding the following to the button:
```
Layout.alignment: Qt.AlignRight
Layout. | |||||
That does not seem to do the trick. thsurrel: That does not seem to do the trick.
I am trying to have the button at a fix location at the top… | |||||
broulik: Ah, I see. Confused over and on top :) I see what you mean now. | |||||
114 | anchors.fill: parent | 114 | anchors.fill: parent | ||
115 | 115 | | |||
116 | PlasmaComponents.ToolButton { | ||||
117 | id: unmountAll | ||||
118 | enabled: true | ||||
broulik: This is the default value anyway | |||||
119 | visible: devicenotifier.mountedRemouvables.length > 0; | ||||
What do you think about changing this to > 1? It seems kind of redundant to have an "unmount all" button when there's only one item. ngraham: What do you think about changing this to `> 1`? It seems kind of redundant to have an "unmount… | |||||
120 | anchors.right: parent.right | ||||
121 | iconSource: "media-eject" | ||||
122 | tooltip: i18n("Click to safely remove all devices") | ||||
123 | text: i18n("Remove all") | ||||
124 | } | ||||
125 | | ||||
116 | PlasmaExtras.ScrollArea { | 126 | PlasmaExtras.ScrollArea { | ||
117 | Layout.fillWidth: true | 127 | anchors.fill: parent | ||
118 | Layout.fillHeight: true | 128 | anchors.top: unmountAll.top | ||
119 | 129 | | |||
120 | ListView { | 130 | ListView { | ||
121 | id: notifierDialog | 131 | id: notifierDialog | ||
122 | focus: true | 132 | focus: true | ||
123 | boundsBehavior: Flickable.StopAtBounds | 133 | boundsBehavior: Flickable.StopAtBounds | ||
124 | 134 | | |||
125 | model: filterModel | 135 | model: filterModel | ||
126 | 136 | | |||
▲ Show 20 Lines • Show All 56 Lines • ▼ Show 20 Line(s) | 189 | actionToolTip: { | |||
183 | } else if (types && types.indexOf("OpticalDisc") != -1) { | 193 | } else if (types && types.indexOf("OpticalDisc") != -1) { | ||
184 | return i18n("Click to eject this disc.") | 194 | return i18n("Click to eject this disc.") | ||
185 | } else { | 195 | } else { | ||
186 | return i18n("Click to safely remove this device.") | 196 | return i18n("Click to safely remove this device.") | ||
187 | } | 197 | } | ||
188 | } | 198 | } | ||
189 | mounted: devicenotifier.isMounted(udi) | 199 | mounted: devicenotifier.isMounted(udi) | ||
190 | 200 | | |||
201 | onMountedChanged: { | ||||
202 | var index = devicenotifier.mountedRemouvables.indexOf(udi); | ||||
203 | if (mounted && sdSource.data[udi] && sdSource.data[udi]["Removable"] && index < 0) { | ||||
Check index first to avoid potentially heavy access on data in case the condition isn't met broulik: Check `index` first to avoid potentially heavy access on `data` in case the condition isn't met | |||||
204 | devicenotifier.mountedRemouvables.push(udi); | ||||
205 | devicenotifier.mountedRemouvables = devicenotifier.mountedRemouvables; | ||||
206 | } else if (!mounted && index >= 0) { | ||||
207 | devicenotifier.mountedRemouvables.splice(index, 1); | ||||
208 | devicenotifier.mountedRemouvables = devicenotifier.mountedRemouvables; | ||||
209 | } | ||||
210 | } | ||||
211 | | ||||
191 | onActionTriggered: { | 212 | onActionTriggered: { | ||
192 | var operationName = mounted ? "unmount" : "mount"; | 213 | var operationName = mounted ? "unmount" : "mount"; | ||
193 | var service = sdSource.serviceForSource(udi); | 214 | var service = sdSource.serviceForSource(udi); | ||
194 | var operation = service.operationDescription(operationName); | 215 | var operation = service.operationDescription(operationName); | ||
195 | service.startOperationCall(operation); | 216 | service.startOperationCall(operation); | ||
196 | } | 217 | } | ||
197 | property int operationResult: (model["Operation result"]) | 218 | property int operationResult: (model["Operation result"]) | ||
198 | 219 | | |||
Show All 13 Lines |
Why this change? ColumnLayout should layout everything automatically without the need for nachors