Merge lp:~kissiel/checkbox/rework-dialogs-in-converged into lp:checkbox
- rework-dialogs-in-converged
- Merge into trunk
Status: | Merged |
---|---|
Approved by: | Maciej Kisielewski |
Approved revision: | 4453 |
Merged at revision: | 4453 |
Proposed branch: | lp:~kissiel/checkbox/rework-dialogs-in-converged |
Merge into: | lp:checkbox |
Diff against target: |
635 lines (+119/-110) 23 files modified
checkbox-touch/checkbox-touch.qml (+16/-16) checkbox-touch/components/CbtDialog.qml (+4/-4) checkbox-touch/components/CbtDialogLogic.js (+0/-8) checkbox-touch/components/CheckboxTouchApplication.qml (+3/-5) checkbox-touch/components/CommandOutputPage.qml (+1/-1) checkbox-touch/components/CommentsDialog.qml (+3/-3) checkbox-touch/components/ConfirmationDialog.qml (+1/-1) checkbox-touch/components/ConfirmationLogic.js (+0/-27) checkbox-touch/components/DialogMgr.qml (+68/-0) checkbox-touch/components/ErrorDialog.qml (+4/-5) checkbox-touch/components/ErrorLogic.js (+0/-19) checkbox-touch/components/InputDialog.qml (+3/-3) checkbox-touch/components/InteractIntroPage.qml (+1/-1) checkbox-touch/components/ManualIntroPage.qml (+1/-1) checkbox-touch/components/PasswordDialog.qml (+3/-3) checkbox-touch/components/QmlConfinedPage.qml (+1/-1) checkbox-touch/components/QmlNativePage.qml (+1/-1) checkbox-touch/components/ResumeSessionPage.qml (+1/-2) checkbox-touch/components/TestPageBody.qml (+1/-1) checkbox-touch/components/TestVerificationPage.qml (+1/-1) checkbox-touch/components/UserInteractSummaryPage.qml (+1/-1) checkbox-touch/components/actions/AddCommentAction.qml (+2/-2) checkbox-touch/components/actions/SkipAction.qml (+3/-4) |
To merge this branch: | bzr merge lp:~kissiel/checkbox/rework-dialogs-in-converged |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Maciej Kisielewski | Approve | ||
Review via email: mp+300790@code.launchpad.net |
Commit message
Description of the change
This MR introduces new way of showing dialogs in checkbox-converged.
With the incoming changes to ubuntuuitoolkit, current way of doing popups would not work.
Also it somewhat reduces the complexity and code footprint.
To test it, run a standard build of checkbox-converged and/or run autopilot.
All popups should work as they did previously.
59358d2 converged: use consistent naming in dialog i-faces
03ff6c0 converged: update to Popups 1.3
1bcd71f converged: add DialogMgr that replaces pure JS api
7361c2c converged: migrate to DialogMgr
- 4446. By Maciej Kisielewski
-
checkbox-ng: use SECURE_ID_PATTERN from plainbox
Instead of defining it locally and using it.
Signed-off-by: Maciej Kisielewski <email address hidden>
- 4447. By Maciej Kisielewski
-
move launcher-related classes to plainbox
Reasons:
1) Launchers are designed to be shared between different *box front-ends. So
having them defined in checkbox-ng means any other front-end wanting to use
launchers would have to depend on checkbox-ng.
2) There is nothing in launchers that's related to checkbox-ng.
3) Launchers are kinds of PlainboxConfigsSigned-off-by: Maciej Kisielewski <email address hidden>
- 4448. By Maciej Kisielewski
-
checkbox-
ng:checkbox- cli: sort imports Signed-off-by: Maciej Kisielewski <email address hidden>
- 4449. By Maciej Kisielewski
-
checkbox-ng: remove InvalidSecureID
Error from checkbox-ng And use the one from plainbox.
Signed-off-by: Maciej Kisielewski <email address hidden>
- 4450. By Maciej Kisielewski
-
converged: use consistent naming in dialog i-faces
Signed-off-by: Maciej Kisielewski <email address hidden>
- 4451. By Maciej Kisielewski
-
converged: update to Popups 1.3
Signed-off-by: Maciej Kisielewski <email address hidden>
- 4452. By Maciej Kisielewski
-
converged: add DialogMgr that replaces pure JS api
When creating components in plain JS (.js) the Component wasn't attached. Doing
the same in a function defined as a part of a QML components does that ok.This patch is a first step to migrate to the latter.
Signed-off-by: Maciej Kisielewski <email address hidden>
- 4453. By Maciej Kisielewski
-
converged: migrate to DialogMgr
Signed-off-by: Maciej Kisielewski <email address hidden>
Preview Diff
1 | === modified file 'checkbox-touch/checkbox-touch.qml' |
2 | --- checkbox-touch/checkbox-touch.qml 2016-07-11 12:39:35 +0000 |
3 | +++ checkbox-touch/checkbox-touch.qml 2016-07-21 16:41:03 +0000 |
4 | @@ -21,13 +21,10 @@ |
5 | */ |
6 | import QtQuick 2.0 |
7 | import Ubuntu.Components 1.3 |
8 | -import Ubuntu.Components.Popups 0.1 |
9 | +import Ubuntu.Components.Popups 1.3 |
10 | import QtQuick.Layouts 1.1 |
11 | import io.thp.pyotherside 1.4 |
12 | import "components" |
13 | -import "components/ErrorLogic.js" as ErrorLogic |
14 | -import "components/CbtDialogLogic.js" as CbtDialogLogic |
15 | - |
16 | |
17 | /*! |
18 | \brief MainView with a Label and Button elements. |
19 | @@ -154,7 +151,7 @@ |
20 | |
21 | onError: { |
22 | console.error("python error: " + traceback); |
23 | - ErrorLogic.showError(mainView, "python error: " + traceback, Qt.quit); |
24 | + dialogMgr.showError(mainView, "python error: " + traceback, Qt.quit); |
25 | } |
26 | onReceived: console.log("pyotherside.send: " + data) |
27 | } |
28 | @@ -334,7 +331,7 @@ |
29 | |
30 | function setup(testplan_info_list) { |
31 | if (testplan_info_list.length<1) { |
32 | - ErrorLogic.showError(mainView, "Test plan missing", Qt.quit); |
33 | + dialogMgr.showError(mainView, "Test plan missing", Qt.quit); |
34 | } |
35 | |
36 | model.clear(); |
37 | @@ -465,6 +462,9 @@ |
38 | PasswordDialog { |
39 | id: passwordDialog |
40 | } |
41 | + DialogMgr { |
42 | + id: dialogMgr |
43 | + } |
44 | |
45 | CommandOutputPage { |
46 | id: commandOutputPage |
47 | @@ -480,7 +480,7 @@ |
48 | if (pageComponent.status == Component.Error) { |
49 | var msg = i18n.tr("Could not create component '%1'\n").arg(url) + pageComponent.errorString(); |
50 | console.error(msg); |
51 | - ErrorLogic.showError(mainView, msg, Qt.quit, i18n.tr("Quit")); |
52 | + dialogMgr.showError(mainView, msg, Qt.quit, i18n.tr("Quit")); |
53 | } else { |
54 | var pageObject = pageComponent.createObject(); |
55 | if (test) { |
56 | @@ -502,7 +502,7 @@ |
57 | } |
58 | } else { |
59 | if (result.errors_encountered) { |
60 | - ErrorLogic.showError(mainView, i18n.tr("Could not resume session."), |
61 | + dialogMgr.showError(mainView, i18n.tr("Could not resume session."), |
62 | gcAndStartSession(), |
63 | i18n.tr("Start new session")); |
64 | } else { |
65 | @@ -537,7 +537,7 @@ |
66 | }; |
67 | passwordDialog.passwordEntered.connect(rememberContinuation); |
68 | passwordDialog.dialogCancelled.connect(cancelContinuation); |
69 | - PopupUtils.open(passwordDialog.dialogComponent); |
70 | + PopupUtils.open(passwordDialog.dialog); |
71 | return; |
72 | } |
73 | } |
74 | @@ -599,7 +599,7 @@ |
75 | if (appSettings["launcher"]) { |
76 | app.exportResultsWithLauncherSettings(function(uri) { |
77 | var htmlReportUrl = uri; |
78 | - CbtDialogLogic.showDialog(mainView, i18n.tr("Reports have been saved to your Documents folder"), |
79 | + dialogMgr.showDialog(mainView, i18n.tr("Reports have been saved to your Documents folder"), |
80 | [{ "text": i18n.tr("OK"), "color": UbuntuColors.green}, {"text": i18n.tr("View Report"), "color": UbuntuColors.green, "onClicked": function(uri) { |
81 | var webviewer = Qt.createComponent(Qt.resolvedUrl("components/WebViewer.qml")).createObject(); |
82 | webviewer.uri = htmlReportUrl; |
83 | @@ -610,7 +610,7 @@ |
84 | app.exportResults('2013.com.canonical.plainbox::html', [], function(uri) { |
85 | var htmlReportUrl = uri; |
86 | app.exportResults('2013.com.canonical.plainbox::xlsx', ["with-sys-info", "with-summary", "with-job-description", "with-text-attachments", "with-unit-categories"], function(uri) { |
87 | - CbtDialogLogic.showDialog(mainView, i18n.tr("Reports have been saved to your Documents folder"), |
88 | + dialogMgr.showDialog(mainView, i18n.tr("Reports have been saved to your Documents folder"), |
89 | [{ "text": i18n.tr("OK"), "color": UbuntuColors.green}, {"text": i18n.tr("View Report"), "color": UbuntuColors.green, "onClicked": function(uri) { |
90 | var webviewer = Qt.createComponent(Qt.resolvedUrl("components/WebViewer.qml")).createObject(); |
91 | webviewer.uri = htmlReportUrl; |
92 | @@ -642,12 +642,12 @@ |
93 | } |
94 | } |
95 | buttons.push({"text": i18n.tr("OK"), "color": UbuntuColors.green}); |
96 | - CbtDialogLogic.showDialog( |
97 | + dialogMgr.showDialog( |
98 | resultsPage, |
99 | i18n.tr("Report has been submitted.\n" + s), buttons); |
100 | }, |
101 | function(error) { |
102 | - ErrorLogic.showError(mainView, |
103 | + dialogMgr.showError(mainView, |
104 | i18n.tr("Could not submit results. Reason:\n" + error), |
105 | function(){}, |
106 | i18n.tr("OK")); |
107 | @@ -776,7 +776,7 @@ |
108 | test["comments"] = comment; |
109 | completeTest(test); |
110 | }); |
111 | - PopupUtils.open(commentsDialog.dialogComponent); |
112 | + PopupUtils.open(commentsDialog.dialog); |
113 | } else { |
114 | completeTest(test); |
115 | } |
116 | @@ -800,7 +800,7 @@ |
117 | } |
118 | continuation(); |
119 | }); |
120 | - PopupUtils.open(dlg.dialogComponent); |
121 | + PopupUtils.open(dlg.dialog); |
122 | return; // inputForm gets precedence over input |
123 | } |
124 | |
125 | @@ -826,7 +826,7 @@ |
126 | cancelContinuation(); |
127 | return; |
128 | }); |
129 | - PopupUtils.open(dlg.dialogComponent); |
130 | + PopupUtils.open(dlg.dialog); |
131 | return; |
132 | } |
133 | continuation(); |
134 | |
135 | === modified file 'checkbox-touch/components/CbtDialog.qml' |
136 | --- checkbox-touch/components/CbtDialog.qml 2016-06-30 12:19:17 +0000 |
137 | +++ checkbox-touch/components/CbtDialog.qml 2016-07-21 16:41:03 +0000 |
138 | @@ -20,19 +20,19 @@ |
139 | */ |
140 | import QtQuick 2.0 |
141 | import Ubuntu.Components 1.3 |
142 | -import Ubuntu.Components.Popups 0.1 |
143 | +import Ubuntu.Components.Popups 1.3 |
144 | import QtQuick.Layouts 1.1 |
145 | |
146 | /*! \brief Common dialog popup. |
147 | \inherits Item |
148 | |
149 | This component is a general purpose message+buttons dialog. |
150 | - It should be used through API in CbtDialogLogic.js. |
151 | + It should be used through DialogMgr object. |
152 | By default every button in the dialog will close it. |
153 | |
154 | Typical usage: |
155 | - CbtDialog.showDialog(main, i18n.tr("Operation succedded")); |
156 | - CbtDialog.showDialog(main, i18n.tr("Do you want to proceed"), [ |
157 | + dialogMgr.showDialog(main, i18n.tr("Operation succedded")); |
158 | + dialogMgr.showDialog(main, i18n.tr("Do you want to proceed"), [ |
159 | {"text": i18n.tr("OK"), "color": "green", "onClicked": function() {console.log("Clicked OK");} }, |
160 | {"text": i18n.tr("Cancel"), "color": "red", "onClicked": function() {console.log("Clicked cancel");} }, |
161 | ]); |
162 | |
163 | === removed file 'checkbox-touch/components/CbtDialogLogic.js' |
164 | --- checkbox-touch/components/CbtDialogLogic.js 2014-12-09 22:57:15 +0000 |
165 | +++ checkbox-touch/components/CbtDialogLogic.js 1970-01-01 00:00:00 +0000 |
166 | @@ -1,8 +0,0 @@ |
167 | -.import Ubuntu.Components.Popups 1.0 as Popups |
168 | - |
169 | -function showDialog(caller, message, buttons) { |
170 | - var p = Qt.createComponent(Qt.resolvedUrl("CbtDialog.qml")).createObject(caller); |
171 | - p.buttons = buttons || [{ "text": i18n.tr("OK"), "color": "UbuntuColors.green"}]; |
172 | - p.label = message; |
173 | - Popups.PopupUtils.open(p.dialog); |
174 | -} |
175 | |
176 | === modified file 'checkbox-touch/components/CheckboxTouchApplication.qml' |
177 | --- checkbox-touch/components/CheckboxTouchApplication.qml 2016-07-04 13:37:03 +0000 |
178 | +++ checkbox-touch/components/CheckboxTouchApplication.qml 2016-07-21 16:41:03 +0000 |
179 | @@ -21,8 +21,6 @@ |
180 | */ |
181 | |
182 | import QtQuick 2.0 |
183 | -import "ErrorLogic.js" as ErrorLogic |
184 | - |
185 | |
186 | PythonObjectRef { |
187 | id: app |
188 | @@ -50,7 +48,7 @@ |
189 | sessionReady(); |
190 | }, function(error) { |
191 | console.error("Unable to start session: " + error); |
192 | - ErrorLogic.showError(mainView, |
193 | + dialogMgr.showError(mainView, |
194 | i18n.tr("Could not start a session. Reason:\n" + error), |
195 | Qt.quit, |
196 | i18n.tr("Quit")); |
197 | @@ -60,7 +58,7 @@ |
198 | request("resume_session", [rerunLastTest, outcome], function(result) { |
199 | if (!result["session_id"]) { |
200 | pageStack.pop(); |
201 | - ErrorLogic.showError(mainView, |
202 | + dialogMgr.showError(mainView, |
203 | i18n.tr("Could not resume session"), |
204 | function() { |
205 | startSession(); |
206 | @@ -243,7 +241,7 @@ |
207 | |
208 | }, function(error) { |
209 | console.error("Unable to load providers: " + error); |
210 | - ErrorLogic.showError(mainView, i18n.tr("No providers available!"), Qt.quit); |
211 | + dialogMgr.showError(mainView, i18n.tr("No providers available!"), Qt.quit); |
212 | }); |
213 | } |
214 | } |
215 | |
216 | === modified file 'checkbox-touch/components/CommandOutputPage.qml' |
217 | --- checkbox-touch/components/CommandOutputPage.qml 2016-06-30 12:19:17 +0000 |
218 | +++ checkbox-touch/components/CommandOutputPage.qml 2016-07-21 16:41:03 +0000 |
219 | @@ -25,7 +25,7 @@ |
220 | |
221 | import QtQuick 2.0 |
222 | import Ubuntu.Components 1.3 |
223 | -import Ubuntu.Components.Popups 0.1 |
224 | +import Ubuntu.Components.Popups 1.3 |
225 | import QtQuick.Layouts 1.1 |
226 | |
227 | Page { |
228 | |
229 | === modified file 'checkbox-touch/components/CommentsDialog.qml' |
230 | --- checkbox-touch/components/CommentsDialog.qml 2016-06-30 12:19:17 +0000 |
231 | +++ checkbox-touch/components/CommentsDialog.qml 2016-07-21 16:41:03 +0000 |
232 | @@ -20,7 +20,7 @@ |
233 | */ |
234 | import QtQuick 2.0 |
235 | import Ubuntu.Components 1.3 |
236 | -import Ubuntu.Components.Popups 0.1 |
237 | +import Ubuntu.Components.Popups 1.3 |
238 | |
239 | /*! \brief Comment addition dialog. |
240 | \inherits Item |
241 | @@ -31,9 +31,9 @@ |
242 | Item { |
243 | id: commentsDialog |
244 | /*! |
245 | - `dialogComponent` alias shortens the code that launches this dialog |
246 | + `dialog` alias shortens the code that launches this dialog |
247 | */ |
248 | - property alias dialogComponent: component |
249 | + property alias dialog: component |
250 | |
251 | /*! |
252 | Use this property to populate the textArea that the user will write in. |
253 | |
254 | === modified file 'checkbox-touch/components/ConfirmationDialog.qml' |
255 | --- checkbox-touch/components/ConfirmationDialog.qml 2016-07-11 12:39:35 +0000 |
256 | +++ checkbox-touch/components/ConfirmationDialog.qml 2016-07-21 16:41:03 +0000 |
257 | @@ -20,7 +20,7 @@ |
258 | */ |
259 | import QtQuick 2.0 |
260 | import Ubuntu.Components 1.3 |
261 | -import Ubuntu.Components.Popups 0.1 |
262 | +import Ubuntu.Components.Popups 1.3 |
263 | |
264 | /*! \brief Skip-confirmation dialog. |
265 | \inherits Item |
266 | |
267 | === removed file 'checkbox-touch/components/ConfirmationLogic.js' |
268 | --- checkbox-touch/components/ConfirmationLogic.js 2016-07-11 12:39:35 +0000 |
269 | +++ checkbox-touch/components/ConfirmationLogic.js 1970-01-01 00:00:00 +0000 |
270 | @@ -1,27 +0,0 @@ |
271 | -.import Ubuntu.Components.Popups 1.0 as Popups |
272 | - |
273 | -.import QtQuick 2.0 as QtQuick |
274 | - |
275 | -function confirmRequest(caller, options, continuation) { |
276 | - // if the question was answered before and user selected to |
277 | - // remember their selection - 'returning' true |
278 | - if (mainView.appSettings[options.question]) { |
279 | - continuation(true); |
280 | - return; |
281 | - } |
282 | - var component = Qt.createComponent(Qt.resolvedUrl("ConfirmationDialog.qml")); |
283 | - if (component.status == QtQuick.Component.Error) { |
284 | - var msg = i18n.tr("could not create ConfirmationDialog component\n'") + component.errorString(); |
285 | - console.error(msg); |
286 | - ErrorLogic.showError(mainView, msg, Qt.quit, i18n.tr("Quit")); |
287 | - } |
288 | - var popup = component.createObject(caller); |
289 | - |
290 | - popup.withRemember = options.remember; |
291 | - popup.question = options.question; |
292 | - popup.answer.connect(function(result, remember) { |
293 | - mainView.appSettings[options.question] = remember; |
294 | - continuation(result); |
295 | - }); |
296 | - Popups.PopupUtils.open(popup.dialog); |
297 | -} |
298 | |
299 | === added file 'checkbox-touch/components/DialogMgr.qml' |
300 | --- checkbox-touch/components/DialogMgr.qml 1970-01-01 00:00:00 +0000 |
301 | +++ checkbox-touch/components/DialogMgr.qml 2016-07-21 16:41:03 +0000 |
302 | @@ -0,0 +1,68 @@ |
303 | +/* |
304 | + * This file is part of Checkbox |
305 | + * |
306 | + * Copyright 2016 Canonical Ltd. |
307 | + * |
308 | + * Authors: |
309 | + * - Maciej Kisielewski <maciej.kisielewski@canonical.com> |
310 | + * |
311 | + * This program is free software; you can redistribute it and/or modify |
312 | + * it under the terms of the GNU General Public License as published by |
313 | + * the Free Software Foundation; version 3. |
314 | + * |
315 | + * This program is distributed in the hope that it will be useful, |
316 | + * but WITHOUT ANY WARRANTY; without even the implied warranty of |
317 | + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
318 | + * GNU General Public License for more details. |
319 | + * |
320 | + * You should have received a copy of the GNU General Public License |
321 | + * along with this program. If not, see <http://www.gnu.org/licenses/>. |
322 | + */ |
323 | +import QtQuick 2.0 |
324 | +import Ubuntu.Components 1.3 |
325 | +import Ubuntu.Components.Popups 1.3 |
326 | + |
327 | +Item { |
328 | + function showDialog(caller, message, buttons) { |
329 | + var p = Qt.createComponent(Qt.resolvedUrl("CbtDialog.qml")).createObject(caller); |
330 | + p.buttons = buttons || [{ "text": i18n.tr("OK"), "color": "UbuntuColors.green"}]; |
331 | + p.label = message; |
332 | + PopupUtils.open(p.dialog); |
333 | + } |
334 | + |
335 | + function confirmRequest(caller, options, continuation) { |
336 | + // if the question was answered before and user selected to |
337 | + // remember their selection - 'returning' true |
338 | + if (mainView.appSettings[options.question]) { |
339 | + continuation(true); |
340 | + return; |
341 | + } |
342 | + var p = Qt.createComponent(Qt.resolvedUrl("ConfirmationDialog.qml")).createObject(caller); |
343 | + p.withRemember = options.remember; |
344 | + p.question = options.question; |
345 | + p.answer.connect(function(result, remember) { |
346 | + mainView.appSettings[options.question] = remember; |
347 | + continuation(result); |
348 | + }); |
349 | + PopupUtils.open(p.dialog); |
350 | + } |
351 | + |
352 | + function showError(caller, errorMessage, continuation, finalLabel) { |
353 | + // stackDepth keeps track of how many popups are stacked on the screen |
354 | + // we need this so continuation is called only if the last (the bottom one) popup |
355 | + // is closed |
356 | + showError.stackDepth = ++showError.stackDepth || 1; |
357 | + var p = Qt.createComponent(Qt.resolvedUrl("ErrorDialog.qml")).createObject(caller); |
358 | + p.errorMessage = errorMessage; |
359 | + if (showError.stackDepth > 1) { |
360 | + p.buttonLabel = i18n.tr("Continue") |
361 | + } else { |
362 | + p.buttonLabel = finalLabel || i18n.tr("Quit") |
363 | + p.done.connect(function() { |
364 | + continuation(); |
365 | + }); |
366 | + } |
367 | + PopupUtils.open(p.dialog); |
368 | + } |
369 | + |
370 | +} |
371 | |
372 | === modified file 'checkbox-touch/components/ErrorDialog.qml' |
373 | --- checkbox-touch/components/ErrorDialog.qml 2016-06-30 12:19:17 +0000 |
374 | +++ checkbox-touch/components/ErrorDialog.qml 2016-07-21 16:41:03 +0000 |
375 | @@ -20,17 +20,16 @@ |
376 | */ |
377 | import QtQuick 2.0 |
378 | import Ubuntu.Components 1.3 |
379 | -import Ubuntu.Components.Popups 0.1 |
380 | +import Ubuntu.Components.Popups 1.3 |
381 | |
382 | /*! \brief Error message popup. |
383 | \inherits Item |
384 | |
385 | This component is an error reporting dialog. |
386 | - To use this component call showError() from ErrorLogic.js |
387 | + |
388 | + To use this component call showError() from DialogMgr object. |
389 | Typical usage is: |
390 | - import "components/ErrorLogic.js" as ErrorLogic |
391 | - (...) |
392 | - ErrorLogic.showError(mainView, "There was something wrong", Qt.quit) |
393 | + dialogMgr.showError(mainView, "There was something wrong", Qt.quit) |
394 | */ |
395 | |
396 | Item { |
397 | |
398 | === removed file 'checkbox-touch/components/ErrorLogic.js' |
399 | --- checkbox-touch/components/ErrorLogic.js 2014-11-27 18:33:02 +0000 |
400 | +++ checkbox-touch/components/ErrorLogic.js 1970-01-01 00:00:00 +0000 |
401 | @@ -1,19 +0,0 @@ |
402 | -.import Ubuntu.Components.Popups 1.0 as Popups |
403 | - |
404 | -function showError(caller, errorMessage, continuation, finalLabel) { |
405 | - // stackDepth keeps track of how many popups are stacked on the screen |
406 | - // we need this so continuation is called only if the last (the bottom one) popup |
407 | - // is closed |
408 | - showError.stackDepth = ++showError.stackDepth || 1; |
409 | - var popup = Qt.createComponent(Qt.resolvedUrl("ErrorDialog.qml")).createObject(caller); |
410 | - popup.errorMessage = errorMessage; |
411 | - if (showError.stackDepth > 1) { |
412 | - popup.buttonLabel = i18n.tr("Continue") |
413 | - } else { |
414 | - popup.buttonLabel = finalLabel || i18n.tr("Quit") |
415 | - popup.done.connect(function() { |
416 | - continuation(); |
417 | - }); |
418 | - } |
419 | - Popups.PopupUtils.open(popup.dialog); |
420 | -} |
421 | |
422 | === modified file 'checkbox-touch/components/InputDialog.qml' |
423 | --- checkbox-touch/components/InputDialog.qml 2016-06-30 12:19:17 +0000 |
424 | +++ checkbox-touch/components/InputDialog.qml 2016-07-21 16:41:03 +0000 |
425 | @@ -20,7 +20,7 @@ |
426 | */ |
427 | import QtQuick 2.0 |
428 | import Ubuntu.Components 1.3 |
429 | -import Ubuntu.Components.Popups 0.1 |
430 | +import Ubuntu.Components.Popups 1.3 |
431 | |
432 | /*! \brief Simple input dialog. |
433 | \inherits Item |
434 | @@ -30,9 +30,9 @@ |
435 | |
436 | /*! |
437 | This alias aids the process of popping up the dialog. |
438 | - Usage: PopupUtils.open(inputDialog.dialogComponent); |
439 | + Usage: PopupUtils.open(inputDialog.dialog); |
440 | */ |
441 | - property alias dialogComponent: component |
442 | + property alias dialog: component |
443 | |
444 | property string prompt: "" |
445 | |
446 | |
447 | === modified file 'checkbox-touch/components/InteractIntroPage.qml' |
448 | --- checkbox-touch/components/InteractIntroPage.qml 2016-07-11 12:39:35 +0000 |
449 | +++ checkbox-touch/components/InteractIntroPage.qml 2016-07-21 16:41:03 +0000 |
450 | @@ -28,7 +28,7 @@ |
451 | |
452 | import QtQuick 2.0 |
453 | import Ubuntu.Components 1.3 |
454 | -import Ubuntu.Components.Popups 0.1 |
455 | +import Ubuntu.Components.Popups 1.3 |
456 | import QtQuick.Layouts 1.1 |
457 | import "actions" |
458 | |
459 | |
460 | === modified file 'checkbox-touch/components/ManualIntroPage.qml' |
461 | --- checkbox-touch/components/ManualIntroPage.qml 2016-07-11 12:39:35 +0000 |
462 | +++ checkbox-touch/components/ManualIntroPage.qml 2016-07-21 16:41:03 +0000 |
463 | @@ -28,7 +28,7 @@ |
464 | import QtQuick 2.0 |
465 | import Ubuntu.Components 1.3 |
466 | import QtQuick.Layouts 1.1 |
467 | -import Ubuntu.Components.Popups 0.1 |
468 | +import Ubuntu.Components.Popups 1.3 |
469 | import "actions" |
470 | |
471 | Page { |
472 | |
473 | === modified file 'checkbox-touch/components/PasswordDialog.qml' |
474 | --- checkbox-touch/components/PasswordDialog.qml 2016-06-30 12:19:17 +0000 |
475 | +++ checkbox-touch/components/PasswordDialog.qml 2016-07-21 16:41:03 +0000 |
476 | @@ -20,7 +20,7 @@ |
477 | */ |
478 | import QtQuick 2.0 |
479 | import Ubuntu.Components 1.3 |
480 | -import Ubuntu.Components.Popups 0.1 |
481 | +import Ubuntu.Components.Popups 1.3 |
482 | |
483 | /*! \brief Password prompt dialog. |
484 | \inherits Item |
485 | @@ -32,9 +32,9 @@ |
486 | |
487 | /*! |
488 | This alias aids the process of popping up the dialog. |
489 | - Usage: PopupUtils.open(passwordDialog.dialogComponent); |
490 | + Usage: PopupUtils.open(passwordDialog.dialog); |
491 | */ |
492 | - property alias dialogComponent: component |
493 | + property alias dialog: component |
494 | |
495 | signal passwordEntered(string password) |
496 | signal dialogCancelled |
497 | |
498 | === modified file 'checkbox-touch/components/QmlConfinedPage.qml' |
499 | --- checkbox-touch/components/QmlConfinedPage.qml 2016-07-11 12:39:35 +0000 |
500 | +++ checkbox-touch/components/QmlConfinedPage.qml 2016-07-21 16:41:03 +0000 |
501 | @@ -24,7 +24,7 @@ |
502 | |
503 | import QtQuick 2.0 |
504 | import Ubuntu.Components 1.3 |
505 | -import Ubuntu.Components.Popups 0.1 |
506 | +import Ubuntu.Components.Popups 1.3 |
507 | import QtQuick.Layouts 1.1 |
508 | import Ubuntu.Content 1.1 |
509 | import "actions" |
510 | |
511 | === modified file 'checkbox-touch/components/QmlNativePage.qml' |
512 | --- checkbox-touch/components/QmlNativePage.qml 2016-07-11 12:39:35 +0000 |
513 | +++ checkbox-touch/components/QmlNativePage.qml 2016-07-21 16:41:03 +0000 |
514 | @@ -24,7 +24,7 @@ |
515 | |
516 | import QtQuick 2.0 |
517 | import Ubuntu.Components 1.3 |
518 | -import Ubuntu.Components.Popups 0.1 |
519 | +import Ubuntu.Components.Popups 1.3 |
520 | import QtQuick.Layouts 1.1 |
521 | import "actions" |
522 | |
523 | |
524 | === modified file 'checkbox-touch/components/ResumeSessionPage.qml' |
525 | --- checkbox-touch/components/ResumeSessionPage.qml 2016-07-04 13:37:03 +0000 |
526 | +++ checkbox-touch/components/ResumeSessionPage.qml 2016-07-21 16:41:03 +0000 |
527 | @@ -28,7 +28,6 @@ |
528 | import QtQuick 2.0 |
529 | import Ubuntu.Components 1.3 |
530 | import QtQuick.Layouts 1.1 |
531 | -import "CbtDialogLogic.js" as CbtDialog |
532 | |
533 | Page { |
534 | id: root |
535 | @@ -124,7 +123,7 @@ |
536 | } |
537 | onLatchedClicked: { |
538 | columnLayout.latchGroup(); |
539 | - CbtDialog.showDialog(root, i18n.tr('What to do with the last job?'), [ |
540 | + dialogMgr.showDialog(root, i18n.tr('What to do with the last job?'), [ |
541 | { |
542 | 'text': i18n.tr('Pass'), |
543 | 'objectName': 'passBtn', |
544 | |
545 | === modified file 'checkbox-touch/components/TestPageBody.qml' |
546 | --- checkbox-touch/components/TestPageBody.qml 2016-06-30 12:19:17 +0000 |
547 | +++ checkbox-touch/components/TestPageBody.qml 2016-07-21 16:41:03 +0000 |
548 | @@ -26,7 +26,7 @@ |
549 | import QtQuick 2.0 |
550 | import QtQuick.Layouts 1.1 |
551 | import Ubuntu.Components 1.3 |
552 | -import Ubuntu.Components.Popups 0.1 |
553 | +import Ubuntu.Components.Popups 1.3 |
554 | |
555 | ColumnLayout { |
556 | /* this property is the text to be shown in the top label */ |
557 | |
558 | === modified file 'checkbox-touch/components/TestVerificationPage.qml' |
559 | --- checkbox-touch/components/TestVerificationPage.qml 2016-07-11 12:39:35 +0000 |
560 | +++ checkbox-touch/components/TestVerificationPage.qml 2016-07-21 16:41:03 +0000 |
561 | @@ -28,7 +28,7 @@ |
562 | import QtQuick 2.0 |
563 | import Ubuntu.Components 1.3 |
564 | import QtQuick.Layouts 1.1 |
565 | -import Ubuntu.Components.Popups 0.1 |
566 | +import Ubuntu.Components.Popups 1.3 |
567 | import "actions" |
568 | |
569 | Page { |
570 | |
571 | === modified file 'checkbox-touch/components/UserInteractSummaryPage.qml' |
572 | --- checkbox-touch/components/UserInteractSummaryPage.qml 2016-07-11 12:39:35 +0000 |
573 | +++ checkbox-touch/components/UserInteractSummaryPage.qml 2016-07-21 16:41:03 +0000 |
574 | @@ -27,7 +27,7 @@ |
575 | |
576 | import QtQuick 2.0 |
577 | import Ubuntu.Components 1.3 |
578 | -import Ubuntu.Components.Popups 0.1 |
579 | +import Ubuntu.Components.Popups 1.3 |
580 | import QtQuick.Layouts 1.1 |
581 | import "actions" |
582 | |
583 | |
584 | === modified file 'checkbox-touch/components/actions/AddCommentAction.qml' |
585 | --- checkbox-touch/components/actions/AddCommentAction.qml 2016-06-30 12:19:17 +0000 |
586 | +++ checkbox-touch/components/actions/AddCommentAction.qml 2016-07-21 16:41:03 +0000 |
587 | @@ -23,7 +23,7 @@ |
588 | |
589 | import QtQuick 2.0 |
590 | import Ubuntu.Components 1.3 |
591 | -import Ubuntu.Components.Popups 0.1 |
592 | +import Ubuntu.Components.Popups 1.3 |
593 | |
594 | Action { |
595 | id: addCommentAction |
596 | @@ -34,6 +34,6 @@ |
597 | commentsDialog.commentAdded.connect(function(comment) { |
598 | test["comments"] = comment; |
599 | }); |
600 | - PopupUtils.open(commentsDialog.dialogComponent); |
601 | + PopupUtils.open(commentsDialog.dialog); |
602 | } |
603 | } |
604 | |
605 | === modified file 'checkbox-touch/components/actions/SkipAction.qml' |
606 | --- checkbox-touch/components/actions/SkipAction.qml 2016-06-30 12:19:17 +0000 |
607 | +++ checkbox-touch/components/actions/SkipAction.qml 2016-07-21 16:41:03 +0000 |
608 | @@ -23,8 +23,7 @@ |
609 | |
610 | import QtQuick 2.0 |
611 | import Ubuntu.Components 1.3 |
612 | -import Ubuntu.Components.Popups 0.1 |
613 | -import "../ConfirmationLogic.js" as ConfirmationLogic |
614 | +import Ubuntu.Components.Popups 1.3 |
615 | |
616 | Action { |
617 | id: skipAction |
618 | @@ -36,7 +35,7 @@ |
619 | question : i18n.tr("Do you really want to skip this test?"), |
620 | remember : true, |
621 | } |
622 | - ConfirmationLogic.confirmRequest(mainView, |
623 | + dialogMgr.confirmRequest(mainView, |
624 | confirmationOptions, function(res) { |
625 | var currentTest = test; |
626 | if (res) { |
627 | @@ -48,7 +47,7 @@ |
628 | testDone(currentTest); |
629 | }; |
630 | commentsDialog.commentAdded.connect(handler); |
631 | - PopupUtils.open(commentsDialog.dialogComponent); |
632 | + PopupUtils.open(commentsDialog.dialog); |
633 | } |
634 | }); |
635 | } |
It's been long enough for me to forget what I wrote there and be able to review it.
Still seems good.
Self-approving.