Merge lp:~larryprice/libertine/operation-details into lp:libertine
- operation-details
- Merge into devel
Status: | Merged |
---|---|
Approved by: | Christopher Townsend |
Approved revision: | 246 |
Merged at revision: | 242 |
Proposed branch: | lp:~larryprice/libertine/operation-details |
Merge into: | lp:libertine |
Diff against target: |
625 lines (+202/-71) 9 files modified
libertine/ContainerManager.cpp (+28/-3) libertine/ContainerManager.h (+2/-2) libertine/qml/ContainerInfoView.qml (+52/-2) libertine/qml/ContainerPasswordDialog.qml (+5/-0) libertine/qml/ContainersView.qml (+2/-3) libertine/qml/HomeView.qml (+5/-5) libertine/qml/ManageContainer.qml (+28/-21) libertine/qml/PackageInfoView.qml (+28/-8) libertine/qml/libertine.qml (+52/-27) |
To merge this branch: | bzr merge lp:~larryprice/libertine/operation-details |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Christopher Townsend (community) | Approve | ||
Libertine CI Bot | continuous-integration | Approve | |
Review via email:
|
Commit message
Show operation details for create container, update container, enable multiarch, install package, and remove package.
Description of the change
Show operation details for create container, update container, enable multiarch, install package, and remove package.
I briefly added "destroy" but there isn't any interesting output and it always seems to be quite fast right now.
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Libertine CI Bot (libertine-ci-bot) wrote : | # |
- 244. By Larry Price
-
Show/Hide button should be disabled instead of hidden when no details available
- 245. By Larry Price
-
Try to display error on container creation
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Libertine CI Bot (libertine-ci-bot) wrote : | # |
PASSED: Continuous integration, rev:244
https:/
Executed test runs:
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
None: https:/
Click here to trigger a rebuild:
https:/
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Libertine CI Bot (libertine-ci-bot) wrote : | # |
PASSED: Continuous integration, rev:245
https:/
Executed test runs:
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
None: https:/
Click here to trigger a rebuild:
https:/
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Christopher Townsend (townsend) wrote : | # |
Hmm, the Package Information view still has an active Show/Hide button even when no operation is going on.
Also, when I'm trying to enter the password for creating a container, there is a problem:
libertine/
Let's get these fixed and I'll review again:)
- 246. By Larry Price
-
fix copy-pasta errors
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Libertine CI Bot (libertine-ci-bot) wrote : | # |
PASSED: Continuous integration, rev:246
https:/
Executed test runs:
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
None: https:/
Click here to trigger a rebuild:
https:/
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Christopher Townsend (townsend) wrote : | # |
Ok, works fine now. Thanks!
Preview Diff
1 | === modified file 'libertine/ContainerManager.cpp' |
2 | --- libertine/ContainerManager.cpp 2016-06-07 15:37:12 +0000 |
3 | +++ libertine/ContainerManager.cpp 2016-06-10 13:23:18 +0000 |
4 | @@ -80,12 +80,20 @@ |
5 | void ContainerManagerWorker:: |
6 | createContainer(const QString& id, const QString& name, const QString& distro, bool multiarch, const QString& password) |
7 | { |
8 | + connect(&process_, &QProcess::readyRead, [=](){ |
9 | + auto output = process_.readAllStandardOutput(); |
10 | + if (!output.isEmpty()) |
11 | + { |
12 | + emit updateOperationDetails(id, "", output); |
13 | + } |
14 | + }); |
15 | connect(&process_, static_cast<void(QProcess::*)(int, QProcess::ExitStatus)>(&QProcess::finished), |
16 | [=](int exitCode, QProcess::ExitStatus){ |
17 | if (exitCode != 0) |
18 | { |
19 | emit error(CONTAINER_CREATE_FAILED.arg(id), process_.readAllStandardError()); |
20 | } |
21 | + emit operationFinished(id, ""); |
22 | }); |
23 | connect(&process_, &QProcess::started, [=]() { |
24 | process_.write(password.toUtf8()); |
25 | @@ -134,7 +142,7 @@ |
26 | auto output = process_.readAllStandardOutput(); |
27 | if (!output.isEmpty()) |
28 | { |
29 | - emit updatePackageOperationDetails(container_id, package_name, output); |
30 | + emit updateOperationDetails(container_id, package_name, output); |
31 | process_output_ += output; |
32 | } |
33 | }); |
34 | @@ -145,7 +153,7 @@ |
35 | auto stderr = process_.readAllStandardError(); |
36 | emit error(PACKAGE_INSTALLATION_FAILED.arg(package_name), stderr.isEmpty() ? process_output_ : stderr); |
37 | } |
38 | - emit packageOperationFinished(container_id, package_name); |
39 | + emit operationFinished(container_id, package_name); |
40 | }); |
41 | |
42 | process_.start(libertine_container_manager_tool, QStringList{"install-package", "-i", container_id, "-p", package_name, "-r"}); |
43 | @@ -159,7 +167,7 @@ |
44 | auto output = process_.readAllStandardOutput(); |
45 | if (!output.isEmpty()) |
46 | { |
47 | - emit updatePackageOperationDetails(container_id, package_name, output); |
48 | + emit updateOperationDetails(container_id, package_name, output); |
49 | process_output_ += output; |
50 | } |
51 | }); |
52 | @@ -169,6 +177,7 @@ |
53 | { |
54 | emit error(PACKAGE_INSTALLATION_FAILED.arg(package_name), process_output_.isEmpty() ? process_.readAllStandardError() : process_output_); |
55 | } |
56 | + emit operationFinished(container_id, package_name); |
57 | }); |
58 | |
59 | process_.start(libertine_container_manager_tool, QStringList{"remove-package", "-i", container_id, "-p", package_name, "-r"}); |
60 | @@ -212,12 +221,20 @@ |
61 | void ContainerManagerWorker:: |
62 | updateContainer(const QString& container_id, const QString& container_name) |
63 | { |
64 | + connect(&process_, &QProcess::readyRead, [=](){ |
65 | + auto output = process_.readAllStandardOutput(); |
66 | + if (!output.isEmpty()) |
67 | + { |
68 | + emit updateOperationDetails(container_id, "", output); |
69 | + } |
70 | + }); |
71 | connect(&process_, static_cast<void(QProcess::*)(int, QProcess::ExitStatus)>(&QProcess::finished), |
72 | [=](int exitCode, QProcess::ExitStatus){ |
73 | if (exitCode != 0) |
74 | { |
75 | emit error(CONTAINER_UPDATE_FAILED.arg(container_name), readAllStdOutOrStdErr(process_)); |
76 | } |
77 | + emit operationFinished(container_id, ""); |
78 | }); |
79 | |
80 | process_.start(libertine_container_manager_tool, QStringList{"update", "-i", container_id}); |
81 | @@ -246,6 +263,13 @@ |
82 | void ContainerManagerWorker:: |
83 | configureContainer(const QString& container_id, const QString& container_name, const QStringList& configure_command) |
84 | { |
85 | + connect(&process_, &QProcess::readyRead, [=](){ |
86 | + auto output = process_.readAllStandardOutput(); |
87 | + if (!output.isEmpty()) |
88 | + { |
89 | + emit updateOperationDetails(container_id, "", output); |
90 | + } |
91 | + }); |
92 | connect(&process_, static_cast<void(QProcess::*)(int, QProcess::ExitStatus)>(&QProcess::finished), |
93 | [=](int exitCode, QProcess::ExitStatus){ |
94 | if (exitCode != 0) |
95 | @@ -256,6 +280,7 @@ |
96 | { |
97 | emit finishedConfigure(); |
98 | } |
99 | + emit operationFinished(container_id, ""); |
100 | }); |
101 | |
102 | QStringList args{"configure", "-i", container_id}; |
103 | |
104 | === modified file 'libertine/ContainerManager.h' |
105 | --- libertine/ContainerManager.h 2016-06-07 15:37:12 +0000 |
106 | +++ libertine/ContainerManager.h 2016-06-10 13:23:18 +0000 |
107 | @@ -66,8 +66,8 @@ |
108 | void finishedSearch(QList<QString> packageList); |
109 | void finishedCommand(QString const& command_output); |
110 | void finishedConfigure(); |
111 | - void updatePackageOperationDetails(const QString& container_id, const QString& package_name, const QString& details); |
112 | - void packageOperationFinished(const QString& container_id, const QString& package_name); |
113 | + void updateOperationDetails(const QString& container_id, const QString& package_name, const QString& details); |
114 | + void operationFinished(const QString& container_id, const QString& package_name); |
115 | |
116 | void error(const QString& short_description, const QString& details); |
117 | }; |
118 | |
119 | === modified file 'libertine/qml/ContainerInfoView.qml' |
120 | --- libertine/qml/ContainerInfoView.qml 2016-05-06 21:13:01 +0000 |
121 | +++ libertine/qml/ContainerInfoView.qml 2016-06-10 13:23:18 +0000 |
122 | @@ -27,14 +27,16 @@ |
123 | id: containerInfoView |
124 | header: PageHeader { |
125 | id: pageHeader |
126 | - title: i18n.tr("Container information for %1").arg(containerConfigList.getContainerName(mainView.currentContainer)) |
127 | + title: i18n.tr("Container information for %1").arg(containerConfigList.getContainerName(currentContainer)) |
128 | } |
129 | |
130 | - property string currentContainer: mainView.currentContainer |
131 | + property string currentContainer: null |
132 | property string containerDistroText: containerConfigList.getContainerDistro(currentContainer) |
133 | property string containerNameText: containerConfigList.getContainerName(currentContainer) |
134 | property string containerIdText: currentContainer |
135 | property var statusText: containerConfigList.getContainerStatus(currentContainer) |
136 | + property bool showDetails: false |
137 | + property string operationDetails: "" |
138 | |
139 | Flickable { |
140 | anchors { |
141 | @@ -50,6 +52,7 @@ |
142 | anchors.right: parent.right |
143 | |
144 | ListItem.Standard { |
145 | + id: idView |
146 | text: i18n.tr("ID") |
147 | control: Label { |
148 | text: containerIdText |
149 | @@ -57,6 +60,7 @@ |
150 | } |
151 | |
152 | ListItem.Standard { |
153 | + id: nameView |
154 | text: i18n.tr("Name") |
155 | control: Label { |
156 | text: containerNameText |
157 | @@ -64,6 +68,7 @@ |
158 | } |
159 | |
160 | ListItem.Standard { |
161 | + id: distroView |
162 | text: i18n.tr("Distribution") |
163 | control: Label { |
164 | text: containerDistroText |
165 | @@ -71,22 +76,67 @@ |
166 | } |
167 | |
168 | ListItem.Standard { |
169 | + id: statusView |
170 | text: i18n.tr("Status") |
171 | control: Label { |
172 | text: statusText |
173 | } |
174 | } |
175 | + |
176 | + ListItem.Standard { |
177 | + id: showDetailsView |
178 | + control: Button { |
179 | + text: enabled ? |
180 | + showDetails ? i18n.tr('Hide') : i18n.tr('Show') |
181 | + : i18n.tr('None') |
182 | + enabled: operationDetails != "" |
183 | + onClicked: { |
184 | + showDetails = !showDetails |
185 | + } |
186 | + } |
187 | + text: i18n.tr("Operation details") |
188 | + } |
189 | + |
190 | + TextArea { |
191 | + id: operationDetailsView |
192 | + visible: showDetails |
193 | + anchors.left: parent.left |
194 | + anchors.right: parent.right |
195 | + height: Math.max(containerInfoView.height - pageHeader.height - idView.height - nameView.height - distroView.height |
196 | + - statusView.height - showDetailsView.height, |
197 | + units.gu(35)) |
198 | + readOnly: true |
199 | + text: operationDetails |
200 | + } |
201 | } |
202 | } |
203 | |
204 | Component.onCompleted: { |
205 | containerConfigList.configChanged.connect(reloadStatus) |
206 | + |
207 | + var worker = Qt.createComponent("ContainerManager.qml").createObject(mainView) |
208 | + |
209 | + operationDetails = mainView.getOperationDetails(currentContainer) |
210 | + operationDetailsView.cursorPosition = operationDetailsView.length |
211 | + if (operationDetails != "") { |
212 | + showDetails = !showDetails |
213 | + } |
214 | + |
215 | + mainView.operationDetailsUpdated.connect(updateDetails) |
216 | } |
217 | |
218 | Component.onDestruction: { |
219 | + mainView.operationDetailsUpdated.disconnect(updateDetails) |
220 | containerConfigList.configChanged.disconnect(reloadStatus) |
221 | } |
222 | |
223 | + function updateDetails(container_id, package_name, details) { |
224 | + if (container_id === currentContainer && package_name === "") { |
225 | + operationDetails += details |
226 | + operationDetailsView.cursorPosition = operationDetailsView.length |
227 | + } |
228 | + } |
229 | + |
230 | function reloadStatus() { |
231 | statusText = containerConfigList.getContainerStatus(currentContainer) |
232 | if (!statusText) { |
233 | |
234 | === modified file 'libertine/qml/ContainerPasswordDialog.qml' |
235 | --- libertine/qml/ContainerPasswordDialog.qml 2016-05-19 17:56:43 +0000 |
236 | +++ libertine/qml/ContainerPasswordDialog.qml 2016-06-10 13:23:18 +0000 |
237 | @@ -87,6 +87,11 @@ |
238 | var container_id = containerConfigList.addNewContainer("lxc", containerName) |
239 | var comp = Qt.createComponent("ContainerManager.qml") |
240 | var worker = comp.createObject(mainView) |
241 | + |
242 | + worker.updateOperationDetails.connect(mainView.updateOperationDetails) |
243 | + worker.operationFinished.connect(mainView.resetOperationDetails) |
244 | + worker.error.connect(mainView.error) |
245 | + |
246 | worker.createContainer(container_id, containerConfigList.getContainerName(container_id), |
247 | containerConfigList.getContainerDistro(container_id), enableMultiarch, password) |
248 | } |
249 | |
250 | === modified file 'libertine/qml/ContainersView.qml' |
251 | --- libertine/qml/ContainersView.qml 2016-05-19 17:56:43 +0000 |
252 | +++ libertine/qml/ContainersView.qml 2016-06-10 13:23:18 +0000 |
253 | @@ -92,8 +92,7 @@ |
254 | text: i18n.tr("delete") |
255 | description: i18n.tr("Delete Container") |
256 | onTriggered: { |
257 | - var comp = Qt.createComponent("ContainerManager.qml") |
258 | - var worker = comp.createObject(mainView) |
259 | + var worker = Qt.createComponent("ContainerManager.qml").createObject(mainView) |
260 | worker.destroyContainer(containerId) |
261 | mainView.currentContainer = containerId |
262 | } |
263 | @@ -109,7 +108,7 @@ |
264 | description: i18n.tr("Container Info") |
265 | onTriggered: { |
266 | mainView.currentContainer = containerId |
267 | - pageStack.push(Qt.resolvedUrl("ContainerInfoView.qml")) |
268 | + pageStack.push(Qt.resolvedUrl("ContainerInfoView.qml"), {currentContainer: containerId}) |
269 | } |
270 | }, |
271 | Action { |
272 | |
273 | === modified file 'libertine/qml/HomeView.qml' |
274 | --- libertine/qml/HomeView.qml 2016-05-19 18:49:06 +0000 |
275 | +++ libertine/qml/HomeView.qml 2016-06-10 13:23:18 +0000 |
276 | @@ -39,7 +39,7 @@ |
277 | } |
278 | ] |
279 | } |
280 | - property var currentContainer: null |
281 | + property string currentContainer: null |
282 | |
283 | Component { |
284 | id: enterPackagePopup |
285 | @@ -103,13 +103,13 @@ |
286 | Action { |
287 | text: i18n.tr("Manage Container") |
288 | onTriggered: { |
289 | - pageStack.push(Qt.resolvedUrl("ManageContainer.qml")) |
290 | + pageStack.push(Qt.resolvedUrl("ManageContainer.qml"), {currentContainer: currentContainer}) |
291 | } |
292 | } |
293 | Action { |
294 | text: i18n.tr("Container Information") |
295 | onTriggered: { |
296 | - pageStack.push(Qt.resolvedUrl("ContainerInfoView.qml")) |
297 | + pageStack.push(Qt.resolvedUrl("ContainerInfoView.qml"), {currentContainer: currentContainer}) |
298 | } |
299 | } |
300 | Action { |
301 | @@ -244,9 +244,9 @@ |
302 | var comp = Qt.createComponent("ContainerManager.qml") |
303 | var worker = comp.createObject(mainView) |
304 | worker.error.connect(mainView.error) |
305 | - worker.updatePackageOperationDetails.connect(mainView.updatePackageOperationDetails) |
306 | + worker.updateOperationDetails.connect(mainView.updateOperationDetails) |
307 | mainView.packageOperationInteraction.connect(worker.packageOperationInteraction) |
308 | - worker.packageOperationFinished.connect(mainView.resetPackageDetails) |
309 | + worker.operationFinished.connect(mainView.resetOperationDetails) |
310 | return worker |
311 | } |
312 | |
313 | |
314 | === modified file 'libertine/qml/ManageContainer.qml' |
315 | --- libertine/qml/ManageContainer.qml 2016-06-07 18:23:48 +0000 |
316 | +++ libertine/qml/ManageContainer.qml 2016-06-10 13:23:18 +0000 |
317 | @@ -26,10 +26,11 @@ |
318 | id: manageView |
319 | header: PageHeader { |
320 | id: pageHeader |
321 | - title: i18n.tr("Manage %1").arg(containerConfigList.getContainerName(mainView.currentContainer)) |
322 | + title: i18n.tr("Manage %1").arg(containerConfigList.getContainerName(currentContainer)) |
323 | } |
324 | property bool isDefaultContainer: null |
325 | property bool isMultiarchEnabled: null |
326 | + property string currentContainer: null |
327 | |
328 | Flickable { |
329 | anchors { |
330 | @@ -49,16 +50,19 @@ |
331 | control: CheckBox { |
332 | checked: isMultiarchEnabled |
333 | onClicked: { |
334 | - var comp = Qt.createComponent("ContainerManager.qml") |
335 | + var worker = Qt.createComponent("ContainerManager.qml").createObject(mainView) |
336 | + |
337 | + worker.updateOperationDetails.connect(mainView.updateOperationDetails) |
338 | + worker.operationFinished.connect(mainView.resetOperationDetails) |
339 | + |
340 | if (checked) { |
341 | - comp.createObject(mainView).configureContainer(mainView.currentContainer, |
342 | - containerConfigList.getContainerName(mainView.currentContainer), |
343 | - ["--multiarch", "enable"]) |
344 | - } |
345 | - else { |
346 | - comp.createObject(mainView).configureContainer(mainView.currentContainer, |
347 | - containerConfigList.getContainerName(mainView.currentContainer), |
348 | - ["--multiarch", "disable"]) |
349 | + worker.configureContainer(currentContainer, |
350 | + containerConfigList.getContainerName(currentContainer), |
351 | + ["--multiarch", "enable"]) |
352 | + } else { |
353 | + worker.configureContainer(currentContainer, |
354 | + containerConfigList.getContainerName(currentContainer), |
355 | + ["--multiarch", "disable"]) |
356 | } |
357 | } |
358 | } |
359 | @@ -69,7 +73,7 @@ |
360 | text: i18n.tr("Additional archives and PPAs") |
361 | progression: true |
362 | onClicked: { |
363 | - containerArchivesList.setContainerArchives(mainView.currentContainer) |
364 | + containerArchivesList.setContainerArchives(currentContainer) |
365 | pageStack.push(Qt.resolvedUrl("ExtraArchivesView.qml")) |
366 | } |
367 | } |
368 | @@ -78,7 +82,7 @@ |
369 | control: Button { |
370 | id: updateButton |
371 | text: i18n.tr("Update…") |
372 | - visible: (containerConfigList.getContainerStatus(mainView.currentContainer) === i18n.tr("ready")) ? true : false |
373 | + visible: (containerConfigList.getContainerStatus(currentContainer) === i18n.tr("ready")) ? true : false |
374 | onClicked: { |
375 | updateContainer() |
376 | } |
377 | @@ -90,7 +94,7 @@ |
378 | right: parent.right |
379 | rightMargin: units.gu(2) |
380 | } |
381 | - visible: (containerConfigList.getContainerStatus(mainView.currentContainer) === i18n.tr("updating")) ? true : false |
382 | + visible: (containerConfigList.getContainerStatus(currentContainer) === i18n.tr("updating")) ? true : false |
383 | running: updateActivity.visible |
384 | } |
385 | text: i18n.tr("Update container") |
386 | @@ -107,7 +111,7 @@ |
387 | worker.error.connect(function() { |
388 | checked = fallback |
389 | }) |
390 | - worker.setDefaultContainer(mainView.currentContainer, !checked) |
391 | + worker.setDefaultContainer(currentContainer, !checked) |
392 | } |
393 | } |
394 | text: i18n.tr("Default container") |
395 | @@ -125,24 +129,27 @@ |
396 | } |
397 | |
398 | function updateContainer() { |
399 | - var comp = Qt.createComponent("ContainerManager.qml") |
400 | - var worker = comp.createObject(mainView) |
401 | + var worker = Qt.createComponent("ContainerManager.qml").createObject(mainView) |
402 | worker.error.connect(mainView.error); |
403 | - worker.updateContainer(mainView.currentContainer, containerConfigList.getContainerName(mainView.currentContainer)) |
404 | + |
405 | + worker.updateOperationDetails.connect(mainView.updateOperationDetails) |
406 | + worker.operationFinished.connect(mainView.resetOperationDetails) |
407 | + |
408 | + worker.updateContainer(currentContainer, containerConfigList.getContainerName(currentContainer)) |
409 | } |
410 | |
411 | function updateContainerInfo() { |
412 | updateStatus() |
413 | - isDefaultContainer = containerConfigList.defaultContainerId === mainView.currentContainer |
414 | - isMultiarchEnabled = containerConfigList.getContainerMultiarchSupport(mainView.currentContainer) === 'enabled' |
415 | + isDefaultContainer = containerConfigList.defaultContainerId === currentContainer |
416 | + isMultiarchEnabled = containerConfigList.getContainerMultiarchSupport(currentContainer) === 'enabled' |
417 | } |
418 | |
419 | function updateStatus() { |
420 | - if (containerConfigList.getContainerStatus(mainView.currentContainer) === i18n.tr("updating")) { |
421 | + if (containerConfigList.getContainerStatus(currentContainer) === i18n.tr("updating")) { |
422 | updateButton.visible = false |
423 | updateActivity.visible = true |
424 | } |
425 | - else if (containerConfigList.getContainerStatus(mainView.currentContainer) === i18n.tr("ready")) { |
426 | + else if (containerConfigList.getContainerStatus(currentContainer) === i18n.tr("ready")) { |
427 | updateButton.visible = true |
428 | updateActivity.visible = false |
429 | } |
430 | |
431 | === modified file 'libertine/qml/PackageInfoView.qml' |
432 | --- libertine/qml/PackageInfoView.qml 2016-06-07 17:48:12 +0000 |
433 | +++ libertine/qml/PackageInfoView.qml 2016-06-10 13:23:18 +0000 |
434 | @@ -35,6 +35,7 @@ |
435 | property var packageVersionText: i18n.tr("Obtaining package version…") |
436 | property string packageOperationDetails: "" |
437 | property var worker: null |
438 | + property bool showDetails: false |
439 | |
440 | signal sendOperationInteraction(string text) |
441 | |
442 | @@ -70,18 +71,33 @@ |
443 | } |
444 | } |
445 | |
446 | + ListItem.Standard { |
447 | + id: showDetailsView |
448 | + control: Button { |
449 | + text: enabled ? |
450 | + showDetails ? i18n.tr('Hide') : i18n.tr('Show') |
451 | + : i18n.tr('None') |
452 | + enabled: packageOperationDetails != "" |
453 | + onClicked: { |
454 | + showDetails = !showDetails |
455 | + } |
456 | + } |
457 | + text: i18n.tr("Operation details") |
458 | + } |
459 | + |
460 | TextArea { |
461 | id: packageDetailsView |
462 | - visible: text !== "" |
463 | + visible: showDetails |
464 | anchors.left: parent.left |
465 | anchors.right: parent.right |
466 | - height: Math.max(packageInfoView.height - pageHeader.height - packageListItem.height - statusListItem.height - 35, units.gu(35)) |
467 | + height: Math.max(packageInfoView.height - pageHeader.height - packageListItem.height - showDetailsView.height - statusListItem.height - 35, units.gu(35)) |
468 | readOnly: true |
469 | text: packageOperationDetails |
470 | } |
471 | |
472 | TextField { |
473 | - visible: packageDetailsView.visible && (statusText === "installing" || statusText === "removing") |
474 | + id: packageInputField |
475 | + visible: showDetails && (statusText === "installing" || statusText === "removing") |
476 | anchors.left: parent.left |
477 | anchors.right: parent.right |
478 | text: "" |
479 | @@ -99,20 +115,22 @@ |
480 | var worker = Qt.createComponent("ContainerManager.qml").createObject(mainView) |
481 | worker.finishedCommand.connect(getPackageVersion) |
482 | |
483 | - packageOperationDetails = mainView.getPackageOperationDetails(currentContainer, currentPackage) |
484 | + packageOperationDetails = mainView.getOperationDetails(currentContainer, currentPackage) |
485 | packageDetailsView.cursorPosition = packageDetailsView.length |
486 | + if (packageOperationDetails != "") { |
487 | + showDetails = !showDetails |
488 | + } |
489 | |
490 | - mainView.updatePackageDetails.connect(updatePackageDetails) |
491 | + mainView.operationDetailsUpdated.connect(updatePackageDetails) |
492 | sendOperationInteraction.connect(mainView.packageOperationInteraction) |
493 | |
494 | - worker.error.connect(mainView.error) |
495 | worker.error.connect(onError) |
496 | worker.runCommand(currentContainer, containerConfigList.getContainerName(currentContainer), command) |
497 | } |
498 | |
499 | Component.onDestruction: { |
500 | containerConfigList.configChanged.disconnect(reloadStatus) |
501 | - mainView.updatePackageDetails.disconnect(updatePackageDetails) |
502 | + mainView.operationDetailsUpdated.disconnect(updatePackageDetails) |
503 | sendOperationInteraction.disconnect(mainView.packageOperationInteraction) |
504 | } |
505 | |
506 | @@ -132,7 +150,9 @@ |
507 | } |
508 | |
509 | function getPackageVersion(command_output) { |
510 | - packageVersionText = containerConfigList.getAppVersion(command_output, statusText === "installed") |
511 | + if (packageInfoView) { |
512 | + packageVersionText = containerConfigList.getAppVersion(command_output, statusText === "installed") |
513 | + } |
514 | } |
515 | |
516 | function onError() { |
517 | |
518 | === modified file 'libertine/qml/libertine.qml' |
519 | --- libertine/qml/libertine.qml 2016-06-02 18:02:50 +0000 |
520 | +++ libertine/qml/libertine.qml 2016-06-10 13:23:18 +0000 |
521 | @@ -29,10 +29,10 @@ |
522 | width: units.gu(90) |
523 | height: units.gu(75) |
524 | property var currentContainer: undefined |
525 | - property var packageOperationDetails: undefined |
526 | + property var operationDetails: undefined |
527 | |
528 | signal error(string short_description, string details) |
529 | - signal updatePackageDetails(string container_id, string package_name, string details) |
530 | + signal operationDetailsUpdated(string container_id, string package_name, string details) |
531 | signal packageOperationInteraction(string data) |
532 | |
533 | PageStack { |
534 | @@ -48,7 +48,7 @@ |
535 | pageStack.push(Qt.resolvedUrl("ContainersView.qml")) |
536 | if (mainView.currentContainer) { |
537 | containerAppsList.setContainerApps(mainView.currentContainer) |
538 | - pageStack.push(Qt.resolvedUrl("HomeView.qml"), {"currentContainer": mainView.currentContainer}) |
539 | + pageStack.push(Qt.resolvedUrl("HomeView.qml"), {currentContainer: mainView.currentContainer}) |
540 | } |
541 | } |
542 | else { |
543 | @@ -61,33 +61,58 @@ |
544 | {"short_description": short_description, "details": details}) |
545 | } |
546 | |
547 | - function updatePackageOperationDetails(container_id, package_name, details) { |
548 | + function initializeDetails(container_id, package_name) { |
549 | + if (!operationDetails) { |
550 | + operationDetails = {} |
551 | + } |
552 | + if (!operationDetails[container_id]) { |
553 | + operationDetails[container_id] = {packages: {}, details: ""} |
554 | + } |
555 | + if (!operationDetails[container_id].details) { |
556 | + operationDetails[container_id].details = "" |
557 | + } |
558 | + if (package_name && !operationDetails[container_id].packages[package_name]) { |
559 | + operationDetails[container_id].packages[package_name] = "" |
560 | + } |
561 | + } |
562 | + |
563 | + function updateOperationDetails(container_id, package_name, details) { |
564 | if (!mainView) { |
565 | return |
566 | } |
567 | - if (!packageOperationDetails) { |
568 | - packageOperationDetails = {} |
569 | - } |
570 | - if (!packageOperationDetails[container_id]) { |
571 | - packageOperationDetails[container_id] = {} |
572 | - } |
573 | - if (!packageOperationDetails[container_id][package_name]) { |
574 | - packageOperationDetails[container_id][package_name] = "" |
575 | - } |
576 | - packageOperationDetails[container_id][package_name] += details |
577 | - |
578 | - updatePackageDetails(container_id, package_name, details) |
579 | - } |
580 | - |
581 | - function resetPackageDetails(container_id, package_name) { |
582 | - if (mainView && packageOperationDetails && packageOperationDetails[container_id] && packageOperationDetails[container_id][package_name]) { |
583 | - delete packageOperationDetails[container_id][package_name] |
584 | - } |
585 | - } |
586 | - |
587 | - function getPackageOperationDetails(container_id, package_name) { |
588 | - if (packageOperationDetails && packageOperationDetails[container_id] && packageOperationDetails[container_id][package_name]) { |
589 | - return packageOperationDetails[container_id][package_name] |
590 | + |
591 | + initializeDetails(container_id, package_name) |
592 | + |
593 | + if (package_name) { |
594 | + operationDetails[container_id].packages[package_name] += details |
595 | + } else { |
596 | + operationDetails[container_id].details += details |
597 | + } |
598 | + |
599 | + operationDetailsUpdated(container_id, package_name, details) |
600 | + } |
601 | + |
602 | + function resetOperationDetails(container_id, package_name) { |
603 | + if (mainView && operationDetails && operationDetails[container_id]) { |
604 | + if (package_name) { |
605 | + if (operationDetails[container_id].packages[package_name]) { |
606 | + delete operationDetails[container_id].packages[package_name] |
607 | + } |
608 | + } else { |
609 | + delete operationDetails[container_id].details |
610 | + } |
611 | + } |
612 | + } |
613 | + |
614 | + function getOperationDetails(container_id, package_name) { |
615 | + if (operationDetails && operationDetails[container_id]) { |
616 | + if (package_name) { |
617 | + if (operationDetails[container_id].packages[package_name]) { |
618 | + return operationDetails[container_id].packages[package_name] |
619 | + } |
620 | + } else if (operationDetails[container_id].details) { |
621 | + return operationDetails[container_id].details |
622 | + } |
623 | } |
624 | return "" |
625 | } |
PASSED: Continuous integration, rev:243 /jenkins. canonical. com/libertine/ job/libertine- ci-verify- mp/252/ /jenkins. canonical. com/libertine/ job/generic- ci-generate- dsc/255 /jenkins. canonical. com/libertine/ job/libertine- ci-build- and-test- dsc/architectur e=amd64, distribution= vivid,label_ exp=jenkins- slave-0% 20%7C%7C% 20jenkins- slave-2/ 214 /jenkins. canonical. com/libertine/ job/libertine- ci-build- and-test- dsc/architectur e=amd64, distribution= xenial, label_exp= jenkins- slave-0% 20%7C%7C% 20jenkins- slave-2/ 214 /jenkins. canonical. com/libertine/ job/libertine- ci-build- and-test- dsc/architectur e=i386, distribution= vivid,label_ exp=jenkins- slave-0% 20%7C%7C% 20jenkins- slave-2/ 214 /jenkins. canonical. com/libertine/ job/libertine- ci-build- and-test- dsc/architectur e=i386, distribution= xenial, label_exp= jenkins- slave-0% 20%7C%7C% 20jenkins- slave-2/ 214 /jenkins. canonical. com/libertine/ job/libertine- ci-update- mp/1150/ console
https:/
Executed test runs:
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
None: https:/
Click here to trigger a rebuild: /jenkins. canonical. com/libertine/ job/libertine- ci-verify- mp/252/ rebuild
https:/