Merge lp:~julia-segal/cdts/ui_work into lp:cdts

Proposed by Julia Segal
Status: Merged
Merged at revision: 2233
Proposed branch: lp:~julia-segal/cdts/ui_work
Merge into: lp:cdts
Diff against target: 2069 lines (+1380/-307)
20 files modified
plainbox-gui/gui-ihv/gui-ihv.pro (+6/-1)
plainbox-gui/gui-ihv/listmodel.h (+1/-1)
plainbox-gui/gui-ihv/main.cpp (+8/-8)
plainbox-gui/gui-ihv/qml/outline/RunManagerButtons.qml (+56/-0)
plainbox-gui/gui-ihv/qml/outline/RunManagerListView.qml (+182/-0)
plainbox-gui/gui-ihv/qml/outline/RunManagerTestDelegate.qml (+117/-0)
plainbox-gui/gui-ihv/qml/outline/RunManagerView.qml (+73/-0)
plainbox-gui/gui-ihv/qml/outline/SuiteSelectionDelegate.qml (+60/-0)
plainbox-gui/gui-ihv/qml/outline/SuiteSelectionView.qml (+102/-0)
plainbox-gui/gui-ihv/qml/outline/TestSelectionButtons.qml (+1/-3)
plainbox-gui/gui-ihv/qml/outline/TestSelectionDetails.qml (+211/-85)
plainbox-gui/gui-ihv/qml/outline/TestSelectionListView.qml (+120/-162)
plainbox-gui/gui-ihv/qml/outline/TestSelectionSuiteDelegate.qml (+114/-0)
plainbox-gui/gui-ihv/qml/outline/TestSelectionSummary.qml (+72/-0)
plainbox-gui/gui-ihv/qml/outline/TestSelectionTestDelegate.qml (+129/-0)
plainbox-gui/gui-ihv/qml/outline/TestSelectionView.qml (+75/-31)
plainbox-gui/gui-ihv/qml/outline/WelcomeView.qml (+3/-6)
plainbox-gui/gui-ihv/qml/outline/gui-ihv.qml (+12/-4)
plainbox-gui/gui-ihv/testsuiteitem.cpp (+22/-3)
plainbox-gui/gui-ihv/testsuiteitem.h (+16/-3)
To merge this branch: bzr merge lp:~julia-segal/cdts/ui_work
Reviewer Review Type Date Requested Status
Daniel Manrique (community) Approve
Review via email: mp+175524@code.launchpad.net

Description of the change

Added the following views:
Suite Selection
Test Run Manager (skeleton only)
Test Selection - added Open/Close groups, Details

Fixed: png files are now added to project, paths using them will access them via the /artwork/. path. Note, png files have the @ for Resolution Independence:
http://askubuntu.com/questions/265473/what-is-the-sign-added-as-a-suffix-to-images-used-for-apps-based-in-the-ubuntu

The current arrow png files are a modification of the Ubuntu Components progress icon

To post a comment you must log in.
Revision history for this message
Daniel Manrique (roadmr) wrote :

Hi!

When you update a branch, you don't necessarily need to submit another merge request. E.g. if you push rev 2231, you get a Needs Fixing comment, then you implement the fixes in rev 2232, you can simply bzr push your branch (updating the code on launchpad to rev 2232) and then add a comment to the existing merge proposal, changing the "Review" to "Resubmit" (a dropdown right below the comment box). That'll signal to reviewers that the branch was simply updated and needs reviewing again.

This looks good, I'll merge it, some tweaks may be needed but they can be done on top of this work. Thanks!

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'plainbox-gui/gui-ihv/gui-ihv.pro'
2--- plainbox-gui/gui-ihv/gui-ihv.pro 2013-07-15 09:47:30 +0000
3+++ plainbox-gui/gui-ihv/gui-ihv.pro 2013-07-18 10:47:25 +0000
4@@ -43,5 +43,10 @@
5 qml/outline/TestSelectionButtons.qml \
6 qml/outline/TestSelectionView.qml \
7 qml/outline/OldMainButtons.qml \
8- qml/outline/TestSelectionListView.qml
9+ qml/outline/TestSelectionListView.qml \
10+ qml/outline/TestSelectionSuiteDelegate.qml \
11+ qml/outline/TestSelectionTestDelegate.qml \
12+ qml/outline/SuiteSelectionDelegate.qml \
13+ qml/outline/SuiteSelectionView.qml \
14+ qml/outline/RunManagerView.qml
15
16
17=== modified file 'plainbox-gui/gui-ihv/listmodel.h'
18--- plainbox-gui/gui-ihv/listmodel.h 2013-07-12 14:18:25 +0000
19+++ plainbox-gui/gui-ihv/listmodel.h 2013-07-18 10:47:25 +0000
20@@ -69,7 +69,7 @@
21 private slots:
22 void handleItemChange();
23
24-private:
25+protected:
26 ListItem* m_prototype;
27 QList<ListItem*> m_list;
28 int count;
29
30=== modified file 'plainbox-gui/gui-ihv/main.cpp'
31--- plainbox-gui/gui-ihv/main.cpp 2013-07-12 14:18:25 +0000
32+++ plainbox-gui/gui-ihv/main.cpp 2013-07-18 10:47:25 +0000
33@@ -33,14 +33,14 @@
34 ListModel* CreateTestSuiteModel(){
35 //QList<QObject*> list;
36 ListModel *model = new ListModel(new TestSuiteItem, qApp);
37- model->appendRow(new TestSuiteItem("Informational tests", "SATA/IDE devive information.", model));
38- model->appendRow(new TestSuiteItem("Hibernation tests", "power-management/hibernate_advanced", model));
39- model->appendRow(new TestSuiteItem("Wireless networking tests", "wireless/wireless_scanning", model));
40- model->appendRow(new TestSuiteItem("Wireless networking tests", "wireless/wireless_connection", model));
41- model->appendRow(new TestSuiteItem("LED tests", "led/wireless", model));
42- model->appendRow(new TestSuiteItem("Benchmarks tests", "benchmarks/network/network-loopback", model));
43- model->appendRow(new TestSuiteItem("Suspend tests", "suspend/led_after_suspend/wireless", model));
44- model->appendRow(new TestSuiteItem("Suspend tests", "suspend/wireless_after_suspenspeded", model));
45+ model->appendRow(new TestSuiteItem("Informational tests", "SATA/IDE devive information.", 60, "Automatic", model));
46+ model->appendRow(new TestSuiteItem("Hibernation tests", "power-management/hibernate_advanced", 22, "Manual", model));
47+ model->appendRow(new TestSuiteItem("Wireless networking tests", "wireless/wireless_scanning", 360, "Automatic", model));
48+ model->appendRow(new TestSuiteItem("Wireless networking tests", "wireless/wireless_connection", 600, "Automatic", model));
49+ model->appendRow(new TestSuiteItem("LED tests", "led/wireless", 200, "Manual",model));
50+ model->appendRow(new TestSuiteItem("Benchmarks tests", "benchmarks/network/network-loopback", 100, "Manual",model));
51+ model->appendRow(new TestSuiteItem("Suspend tests", "suspend/led_after_suspend/wireless", 1, "Manual",model));
52+ model->appendRow(new TestSuiteItem("Suspend tests", "suspend/wireless_after_suspenspeded", 2, "Manual",model));
53
54 return model;
55 }
56
57=== added file 'plainbox-gui/gui-ihv/qml/outline/RunManagerButtons.qml'
58--- plainbox-gui/gui-ihv/qml/outline/RunManagerButtons.qml 1970-01-01 00:00:00 +0000
59+++ plainbox-gui/gui-ihv/qml/outline/RunManagerButtons.qml 2013-07-18 10:47:25 +0000
60@@ -0,0 +1,56 @@
61+/*
62+ * This file is part of plainbox-gui
63+ *
64+ * Copyright 2013 Canonical Ltd.
65+ *
66+ * Authors:
67+ * - Julia Segal <julia.segal@cellsoftware.co.uk>
68+ *
69+ * This program is free software; you can redistribute it and/or modify
70+ * it under the terms of the GNU General Public License as published by
71+ * the Free Software Foundation; version 3.
72+ *
73+ * This program is distributed in the hope that it will be useful,
74+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
75+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
76+ * GNU General Public License for more details.
77+ *
78+ * You should have received a copy of the GNU General Public License
79+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
80+ */
81+
82+import QtQuick 2.0
83+import Ubuntu.Components 0.1
84+
85+
86+
87+Row {
88+ id: bottombuttons
89+ spacing: units.gu(12)
90+
91+ signal cancel
92+ signal pauseTest
93+
94+
95+ Button {
96+ id:cancelButton
97+ text: i18n.tr("Cancel")
98+ color: UbuntuColors.warmGrey
99+ width: units.gu(18)
100+ onClicked: {
101+ bottombuttons.cancel();
102+ }
103+ }
104+
105+ Button {
106+ id: pauseButton
107+ text: i18n.tr("Pause")
108+ color: UbuntuColors.lightAubergine
109+ width: units.gu(18)
110+ onClicked:{
111+ bottombuttons.pauseTest();
112+ }
113+ }
114+
115+
116+}
117
118=== added file 'plainbox-gui/gui-ihv/qml/outline/RunManagerListView.qml'
119--- plainbox-gui/gui-ihv/qml/outline/RunManagerListView.qml 1970-01-01 00:00:00 +0000
120+++ plainbox-gui/gui-ihv/qml/outline/RunManagerListView.qml 2013-07-18 10:47:25 +0000
121@@ -0,0 +1,182 @@
122+/*
123+ * This file is part of plainbox-gui
124+ *
125+ * Copyright 2013 Canonical Ltd.
126+ *
127+ * Authors:
128+ * - Julia Segal <julia.segal@cellsoftware.co.uk>
129+ *
130+ * This program is free software; you can redistribute it and/or modify
131+ * it under the terms of the GNU General Public License as published by
132+ * the Free Software Foundation; version 3.
133+ *
134+ * This program is distributed in the hope that it will be useful,
135+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
136+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
137+ * GNU General Public License for more details.
138+ *
139+ * You should have received a copy of the GNU General Public License
140+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
141+ */
142+
143+
144+import QtQuick 2.0
145+import Ubuntu.Components 0.1
146+import Ubuntu.Components.ListItems 0.1 as ListItem
147+import "."
148+
149+
150+
151+Rectangle {
152+ id: runmanagerrect
153+ color: "white"
154+ height: parent.height
155+ width: parent.width
156+
157+
158+ Flickable {
159+ id: listflick
160+ anchors.fill: parent
161+ height: parent.height
162+
163+ clip: true
164+ contentHeight: groupedList.height
165+ boundsBehavior : Flickable.StopAtBounds
166+
167+ Component {
168+ id: highlight
169+ Rectangle {
170+ width: groupedList.width
171+ height: units.gu(7)
172+ color: "lightsteelblue";
173+ radius: 5
174+ }
175+ }
176+
177+
178+
179+ ListView {
180+ id: groupedList
181+ width: parent.width
182+ height: units.gu(12) * groupedList.count + units.gu(1)
183+ interactive: false
184+ model: testSuiteModel
185+
186+ delegate: RunManagerTestDelegate {}
187+
188+ section {
189+ property: "group"
190+ criteria: ViewSection.FullString
191+ delegate: TestSelectionSuiteDelegate{}
192+ }
193+
194+ highlight: highlight
195+ highlightFollowsCurrentItem: true
196+
197+
198+
199+
200+ // when a group item is checked/unchecked the subitems are checked/unchecked
201+ function selectGroup(groupName, sel){
202+ for (var i = testSuiteModel.count - 1; i >=0; i--){
203+ var item = testSuiteModel.get(i);
204+ if (item.group === groupName)
205+ testSuiteModel.setProperty(i, "check", sel);
206+ }
207+
208+ // this is to select the group items and to make sure data is updated
209+ var oldCurrent = currentIndex
210+ currentIndex = -1
211+ for (var i = 0; i < groupedList.contentItem.children.length; i++)
212+ {
213+ var curItem = groupedList.contentItem.children[i];
214+ //console.log(i,": ", curItem, "=", curItem.groupname);
215+
216+ if (curItem.groupname === groupName)
217+ curItem.checked = sel;
218+ }
219+ currentIndex = oldCurrent
220+ }
221+
222+ // determines if one or more subitems are checked
223+ // if at least one subitem is checked, the group is checked
224+ function setGroupCheck(groupName){
225+ var oldCurrent = currentIndex
226+ currentIndex = -1
227+ var setCheck = false
228+ var i = groupedList.contentItem.children.length - 1
229+
230+ for (;i >= 0 && setCheck === false; i--)
231+ {
232+ var curItem = groupedList.contentItem.children[i];
233+
234+ // determine if subitem is checked
235+ if (curItem.groupname === groupName && curItem.labelname !== groupName)
236+ if (curItem.checked === true)
237+ setCheck = true;
238+
239+ }
240+
241+ for (i = groupedList.contentItem.children.length - 1; i >= 0; i--)
242+ {
243+ curItem = groupedList.contentItem.children[i];
244+ if (curItem.labelname === groupName)
245+ curItem.checked = setCheck
246+ }
247+
248+ currentIndex = oldCurrent;
249+ }
250+
251+ // If any subitems are selected, group should be selected.
252+ function isGroupSelected(section){
253+ var isSel = false;
254+ for (var i = testSuiteModel.count - 1; i >=0 && isSel === false; i--)
255+ {
256+ var curItem = testSuiteModel.get(i);
257+ //console.log("Section: ", section, " ", i,": ", curItem, "=", curItem.group, " check:", curItem.check);
258+
259+ if (curItem.group === section && curItem.check === "true"){
260+ isSel = true;
261+ }
262+ }
263+ return isSel;
264+ }
265+
266+ // Open/Close gruops
267+ function openShutSubgroup(groupName, sel){
268+ var oldCurrent = currentIndex;
269+ currentIndex = -1
270+ for (var i = 0; i < groupedList.contentItem.children.length; i++)
271+ {
272+ var curItem = groupedList.contentItem.children[i];
273+ //console.log(i,": ", curItem, "=", curItem.groupname);
274+ //console.log(i,": ", sel, "=", sel, " height = ", curItem.height);
275+
276+ if (curItem.groupname === groupName && curItem.labelname !== groupName){
277+ curItem.height = sel? units.gu(7):units.gu(0);
278+ curItem.visible = sel;
279+ groupedList.height += sel?units.gu(7):-units.gu(7)
280+ }
281+ }
282+ currentIndex = oldCurrent;
283+ }
284+
285+ // functions to do something across the whole list
286+ function getEstimatedTime(section){
287+ return "";
288+ }
289+ }
290+
291+
292+
293+
294+ }
295+
296+ Scrollbar {
297+ flickableItem: listflick
298+ align: Qt.AlignTrailing
299+ }
300+}
301+
302+
303+
304
305=== added file 'plainbox-gui/gui-ihv/qml/outline/RunManagerTestDelegate.qml'
306--- plainbox-gui/gui-ihv/qml/outline/RunManagerTestDelegate.qml 1970-01-01 00:00:00 +0000
307+++ plainbox-gui/gui-ihv/qml/outline/RunManagerTestDelegate.qml 2013-07-18 10:47:25 +0000
308@@ -0,0 +1,117 @@
309+/*
310+ * This file is part of plainbox-gui
311+ *
312+ * Copyright 2013 Canonical Ltd.
313+ *
314+ * Authors:
315+ * - Julia Segal <julia.segal@cellsoftware.co.uk>
316+ *
317+ * This program is free software; you can redistribute it and/or modify
318+ * it under the terms of the GNU General Public License as published by
319+ * the Free Software Foundation; version 3.
320+ *
321+ * This program is distributed in the hope that it will be useful,
322+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
323+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
324+ * GNU General Public License for more details.
325+ *
326+ * You should have received a copy of the GNU General Public License
327+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
328+ */
329+
330+
331+import QtQuick 2.0
332+import Ubuntu.Components 0.1
333+import Ubuntu.Components.ListItems 0.1 as ListItem
334+import "./artwork"
335+
336+Component {
337+ id: testDelegate
338+
339+ Item{
340+ id: testitem
341+ width: parent.width
342+ height: units.gu(7)
343+ property string groupname: group
344+ property alias checked: itemcheckbox.checked
345+ property string labelname: testname
346+
347+
348+ MouseArea {
349+ width: parent.width - itemcheckbox.width
350+ height: parent.height
351+ anchors.right: parent.right
352+
353+ onClicked: {
354+ testdetails.testItem = testSuiteModel.get(index);
355+ groupedList.currentIndex = index;
356+ }
357+ }
358+
359+ Item {
360+ anchors.fill: parent
361+
362+ Item {
363+ id: filler
364+ width: itemcheckbox.width
365+ }
366+
367+ CheckBox {
368+ id: itemcheckbox
369+ anchors.verticalCenter: parent.verticalCenter
370+ anchors.left: filler.right
371+ anchors.leftMargin: units.gu(2)
372+ checked: check
373+ onClicked: {
374+ testSuiteModel.setProperty(index, "check", checked);
375+ groupedList.setGroupCheck(group)
376+ }
377+ }
378+
379+
380+ Text {
381+ id: nameLabel
382+ text: testname
383+ width: units.gu(40)
384+ anchors.verticalCenter: parent.verticalCenter
385+ anchors.left: itemcheckbox.right
386+ anchors.leftMargin: units.gu(1)
387+ }
388+
389+ Item {
390+ id: typefiller
391+ width: units.gu(2)
392+ anchors.left: nameLabel.right
393+ }
394+
395+ Text {
396+ id: typelabel
397+ text: ""//type
398+ width: units.gu(10)
399+ anchors.left: typefiller.right
400+ anchors.verticalCenter: parent.verticalCenter
401+ horizontalAlignment: Text.AlignHCenter
402+
403+ }
404+
405+ Item {
406+ id: descfiller
407+ width: units.gu(20)
408+ anchors.left: typelabel.right
409+ }
410+
411+ Text {
412+ id: descLabel
413+ text: ""
414+ width: units.gu(10)
415+ anchors.left: descfiller.right
416+ anchors.verticalCenter: parent.verticalCenter
417+ horizontalAlignment: Text.AlignHCenter
418+
419+ }
420+
421+
422+ }
423+ ListItem.ThinDivider {}
424+ }
425+}
426
427=== added file 'plainbox-gui/gui-ihv/qml/outline/RunManagerView.qml'
428--- plainbox-gui/gui-ihv/qml/outline/RunManagerView.qml 1970-01-01 00:00:00 +0000
429+++ plainbox-gui/gui-ihv/qml/outline/RunManagerView.qml 2013-07-18 10:47:25 +0000
430@@ -0,0 +1,73 @@
431+/*
432+ * This file is part of plainbox-gui
433+ *
434+ * Copyright 2013 Canonical Ltd.
435+ *
436+ * Authors:
437+ * - Julia Segal <julia.segal@cellsoftware.co.uk>
438+ *
439+ * This program is free software; you can redistribute it and/or modify
440+ * it under the terms of the GNU General Public License as published by
441+ * the Free Software Foundation; version 3.
442+ *
443+ * This program is distributed in the hope that it will be useful,
444+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
445+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
446+ * GNU General Public License for more details.
447+ *
448+ * You should have received a copy of the GNU General Public License
449+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
450+ */
451+
452+
453+import QtQuick 2.0
454+import Ubuntu.Components 0.1
455+import "."
456+
457+
458+
459+
460+
461+Page {
462+ title: i18n.tr("Run Manager")
463+
464+ Item {
465+ id: filler
466+ height: units.gu(0)
467+ }
468+
469+
470+
471+ RunManagerListView {
472+ id: testsuitelist
473+
474+ width: parent.width - units.gu(4)
475+
476+ anchors{
477+ horizontalCenter: parent.horizontalCenter
478+ top: filler.bottom
479+ bottom: runbuttons.top
480+ margins: units.gu(2)
481+ }
482+ }
483+
484+
485+ RunManagerButtons {
486+ id: runbuttons
487+
488+ anchors{
489+ horizontalCenter: parent.horizontalCenter
490+ bottom: parent.bottom
491+ margins: units.gu(2)
492+ }
493+
494+ onCancel:{
495+ console.log("On Cancel")
496+ }
497+
498+ onPauseTest: {
499+ console.log("Pause")
500+ }
501+ }
502+
503+}
504
505=== added file 'plainbox-gui/gui-ihv/qml/outline/SuiteSelectionDelegate.qml'
506--- plainbox-gui/gui-ihv/qml/outline/SuiteSelectionDelegate.qml 1970-01-01 00:00:00 +0000
507+++ plainbox-gui/gui-ihv/qml/outline/SuiteSelectionDelegate.qml 2013-07-18 10:47:25 +0000
508@@ -0,0 +1,60 @@
509+/*
510+ * This file is part of plainbox-gui
511+ *
512+ * Copyright 2013 Canonical Ltd.
513+ *
514+ * Authors:
515+ * - Julia Segal <julia.segal@cellsoftware.co.uk>
516+ *
517+ * This program is free software; you can redistribute it and/or modify
518+ * it under the terms of the GNU General Public License as published by
519+ * the Free Software Foundation; version 3.
520+ *
521+ * This program is distributed in the hope that it will be useful,
522+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
523+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
524+ * GNU General Public License for more details.
525+ *
526+ * You should have received a copy of the GNU General Public License
527+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
528+ */
529+
530+
531+import QtQuick 2.0
532+import Ubuntu.Components 0.1
533+import Ubuntu.Components.ListItems 0.1 as ListItem
534+import "./artwork"
535+
536+
537+ Item {
538+ id: itemdelegate
539+ width: parent.width
540+ height: units.gu(7)
541+
542+ signal selectSuite(string suite, bool sel)
543+
544+ Item {
545+ id: suitefiller
546+ width: units.gu(1)
547+ }
548+
549+ CheckBox {
550+ id: suitecheckbox
551+ anchors.verticalCenter: parent.verticalCenter
552+ anchors.left: suitefiller.right
553+ checked: true
554+ onClicked: {
555+ itemdelegate.selectSuite(section, checked);
556+ }
557+ }
558+
559+
560+ Text {
561+ id: suitetext
562+ text: section
563+ anchors.verticalCenter: parent.verticalCenter
564+ anchors.left: suitecheckbox.right
565+ anchors.leftMargin: units.gu(1)
566+ }
567+ ListItem.ThinDivider {}
568+ }
569
570=== added file 'plainbox-gui/gui-ihv/qml/outline/SuiteSelectionView.qml'
571--- plainbox-gui/gui-ihv/qml/outline/SuiteSelectionView.qml 1970-01-01 00:00:00 +0000
572+++ plainbox-gui/gui-ihv/qml/outline/SuiteSelectionView.qml 2013-07-18 10:47:25 +0000
573@@ -0,0 +1,102 @@
574+/*
575+ * This file is part of plainbox-gui
576+ *
577+ * Copyright 2013 Canonical Ltd.
578+ *
579+ * Authors:
580+ * - Julia Segal <julia.segal@cellsoftware.co.uk>
581+ *
582+ * This program is free software; you can redistribute it and/or modify
583+ * it under the terms of the GNU General Public License as published by
584+ * the Free Software Foundation; version 3.
585+ *
586+ * This program is distributed in the hope that it will be useful,
587+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
588+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
589+ * GNU General Public License for more details.
590+ *
591+ * You should have received a copy of the GNU General Public License
592+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
593+ */
594+
595+
596+import QtQuick 2.0
597+import Ubuntu.Components 0.1
598+import Ubuntu.Components.ListItems 0.1 as ListItem
599+import "."
600+
601+
602+
603+
604+Page {
605+ title: i18n.tr("Suite Selection")
606+
607+ Item {
608+ id: filler
609+ height: units.gu(4)
610+ }
611+
612+ Rectangle {
613+ id: suitelist
614+ width: parent.width - units.gu(4)
615+ color: "white"
616+ height: parent.height - filler.height - okbutton.height - units.gu(6)
617+ anchors{
618+ horizontalCenter: parent.horizontalCenter
619+ top: filler.bottom
620+ }
621+
622+ ListView {
623+ id: testselection
624+ height: parent.height
625+ width: parent.width
626+ anchors.fill: parent
627+ contentHeight: units.gu(12) * testSuiteModel.count
628+ interactive: true
629+ clip: true
630+ boundsBehavior : Flickable.StopAtBounds
631+ model: testSuiteModel
632+
633+ delegate: Item {}
634+
635+ section {
636+ property: "group"
637+ criteria: ViewSection.FullString
638+ delegate: SuiteSelectionDelegate{
639+
640+ onSelectSuite: {
641+ // This is using the prototype list,
642+ // In the model, select all tests in the suite
643+ for (var i = testSuiteModel.count - 1; i >= 0; i--){
644+ var item = testSuiteModel.get(i);
645+ if (item.group === suite)
646+ testSuiteModel.setProperty(i, "check", sel);
647+ }
648+ }
649+ }
650+ }
651+ }
652+ Scrollbar {
653+ flickableItem: testselection
654+ align: Qt.AlignTrailing
655+ }
656+ }
657+
658+
659+ Button {
660+ id: okbutton
661+ width: units.gu(20)
662+ anchors {
663+ horizontalCenter:parent.horizontalCenter
664+ bottom: parent.bottom
665+ margins: units.gu(2)
666+ }
667+ text: i18n.tr("OK")
668+ color: UbuntuColors.lightAubergine
669+ onClicked: {
670+ // NOTE: When the user is done, this is where to load up the TestSelection list
671+ mainView.state = "TESTSELECTION"
672+ }
673+ }
674+
675+}
676
677=== modified file 'plainbox-gui/gui-ihv/qml/outline/TestSelectionButtons.qml'
678--- plainbox-gui/gui-ihv/qml/outline/TestSelectionButtons.qml 2013-07-12 14:18:25 +0000
679+++ plainbox-gui/gui-ihv/qml/outline/TestSelectionButtons.qml 2013-07-18 10:47:25 +0000
680@@ -31,9 +31,7 @@
681 signal deselectAll
682 signal startTesting
683
684-
685- width: parent.width - units.gu(20)
686- spacing: (parent.width - (units.gu(18)*3))/3
687+ spacing: units.gu(12)
688
689 Button {
690 id:selectButton
691
692=== modified file 'plainbox-gui/gui-ihv/qml/outline/TestSelectionDetails.qml'
693--- plainbox-gui/gui-ihv/qml/outline/TestSelectionDetails.qml 2013-07-15 09:54:32 +0000
694+++ plainbox-gui/gui-ihv/qml/outline/TestSelectionDetails.qml 2013-07-18 10:47:25 +0000
695@@ -25,6 +25,8 @@
696 Item {
697 id: testseldetails
698 property var testItem;
699+ property bool showDetails;
700+ property int openHeight: units.gu(18)
701
702
703 onTestItemChanged: {
704@@ -32,102 +34,226 @@
705 nameText.text = testItem.testname;
706 }
707
708- Rectangle {
709- anchors.fill: parent
710- color: Theme.palette.normal.overlay
711- border.color: "black"
712- border.width: 1
713-
714- Text {
715- anchors.centerIn: parent
716- text: i18n.tr("Test details")
717- }
718-
719- // Left side of the details
720- Rectangle {
721- id: leftRect
722- height: parent.height
723- width: parent.width - rightRect.width
724+ onShowDetailsChanged:{
725+ if (showDetails){
726+ progressIcon.source = "artwork/DownArrow.png";
727+ detailsFlick.height = openHeight
728+ testsuitelist.height -= openHeight
729+ }
730+ else{
731+ progressIcon.source = "artwork/RightArrow.png";
732+ detailsFlick.height = 0
733+ testsuitelist.height += openHeight
734+ }
735+ }
736+
737+ // Open/Shut label + icon
738+ Item {
739+ id: detailsItem
740+ height: parent.height
741+ width: detailsLabel.width + progressIcon.width + units.gu(2)
742+
743+ Label {
744+ id: detailsLabel
745+ text: i18n.tr("Test Details")
746 anchors {
747 left: parent.left
748 top: parent.top
749- bottom: parent.bottom
750- }
751- color: Theme.palette.normal.overlay
752-
753- Column {
754- anchors.horizontalCenter: leftRect.horizontalCenter
755-
756- spacing: units.gu(1)
757-
758- Text {
759- anchors.horizontalCenter: parent.horizontalCenter
760- text: i18n.tr("Test Details: ")
761- }
762- Text {
763- anchors.horizontalCenter: parent.horizontalCenter
764- text: i18n.tr("Test Run Time")
765- }
766- Text {
767- id: testTimeRunText
768- anchors.horizontalCenter: parent.horizontalCenter
769- color: "green"
770- text: i18n.tr("< 1 min")
771- }
772- Text {
773- anchors.horizontalCenter: parent.horizontalCenter
774- text: i18n.tr("Suite Time Run")
775- }
776- Text {
777- id: suiteTimeRunText
778- anchors.horizontalCenter: parent.horizontalCenter
779- color: "green"
780- text: i18n.tr("90 minutes")
781- }
782- }
783- }
784-
785-
786-
787- // Right side of the details
788+ margins: units.gu(1)
789+ }
790+ }
791+
792+ Image {
793+ id: progressIcon
794+ source: "artwork/RightArrow.png"
795+ anchors {
796+ left: detailsLabel.right
797+ top: parent.top
798+ margins: units.gu(1)
799+ }
800+
801+ opacity: enabled ? 1.0 : 0.5
802+
803+ }
804+ MouseArea {
805+ anchors.fill: detailsItem
806+ onClicked: {showDetails = !showDetails}
807+ }
808+ }
809+
810+
811+
812+ // Right side of the details
813+ Flickable {
814+ id: detailsFlick
815+ anchors.left: detailsItem.right
816+ anchors.top: parent.top
817+ anchors.leftMargin: units.gu(2)
818+ width: parent.width - detailsItem.width - units.gu(2)
819+ height: 0 // initialize to closed
820+ contentHeight: detailsblock.height
821+ clip: true
822+ boundsBehavior : Flickable.StopAtBounds
823
824 Rectangle {
825 id: rightRect
826 anchors.right: parent.right
827 anchors.top: parent.top
828
829- height: parent.height
830- width: parent.width - units.gu(20)
831- color: Theme.palette.normal.overlay
832- border.color: "black"
833- border.width: 1
834-
835- Label {
836- id: nameLabel
837- text: i18n.tr("name: ")
838- anchors.left: parent.left
839- anchors.top: parent.top
840- anchors.margins: units.gu(2)
841- }
842-
843- Rectangle {
844- id: nameRect
845- height: units.gu(4)
846- border.color: UbuntuColors.warmGrey
847- border.width: 1
848- anchors.left: nameLabel.right
849- anchors.right: parent.right
850- anchors.top: parent.top
851- anchors.margins: units.gu(1)
852- }
853- Text {
854- id: nameText
855- anchors.fill: nameRect
856- anchors.margins: units.gu(1)
857- text:""
858- }
859+ height: detailsblock.height
860+ width: parent.width
861+ border{
862+ color: "black"
863+ width: 1
864+ }
865+
866+ Item{
867+ id: detailsblock
868+ anchors.fill: parent
869+ height: units.gu(24)
870+
871+ Label {
872+ id: nameLabel
873+ text: i18n.tr(" name: ")
874+ anchors {
875+ left: parent.left
876+ top: parent.top
877+ margins: units.gu(2)
878+ }
879+ }
880+
881+ Rectangle {
882+ id: nameRect
883+ height: units.gu(4)
884+ border{
885+ color: UbuntuColors.warmGrey
886+ width: 1
887+ }
888+ anchors {
889+ left: nameLabel.right
890+ right: parent.right
891+ top: parent.top
892+ margins: units.gu(1)
893+ }
894+ }
895+ Text {
896+ id: nameText
897+
898+ anchors{
899+ fill: nameRect
900+ margins: units.gu(1)
901+ }
902+ text:""
903+ }
904+
905+ Label {
906+ id: dependsLabel
907+ text: i18n.tr("depends: ")
908+ anchors{
909+ left: parent.left
910+ top: nameRect.bottom
911+ margins: units.gu(2)
912+ }
913+ }
914+
915+ Rectangle {
916+ id: dependsRect
917+ height: units.gu(4)
918+ border{
919+ color: UbuntuColors.warmGrey
920+ width: 1
921+ }
922+ anchors{
923+ left: dependsLabel.right
924+ right: parent.right
925+ top: nameRect.bottom
926+ margins: units.gu(1)
927+ }
928+ }
929+ Text {
930+ id: dependsText
931+ anchors{
932+ fill: dependsRect
933+ margins: units.gu(1)
934+ top: nameRect.bottom
935+ }
936+ text:""
937+ }
938+ Label {
939+ id: requiresLabel
940+ text: i18n.tr(" requires: ")
941+ anchors{
942+ left: parent.left
943+ top: dependsRect.bottom
944+ margins: units.gu(2)
945+ }
946+ }
947+
948+ Rectangle {
949+ id: requiresRect
950+ height: units.gu(4)
951+ border{
952+ color: UbuntuColors.warmGrey
953+ width: 1
954+ }
955+ anchors {
956+ left: requiresLabel.right
957+ right: parent.right
958+ top: dependsRect.bottom
959+ margins: units.gu(1)
960+ }
961+ }
962+ Text {
963+ id: requiresText
964+ anchors{
965+ fill: requiresRect
966+ margins: units.gu(1)
967+ top: dependsRect.bottom
968+ }
969+ text:""
970+ }
971+
972+ Label {
973+ id: otherLabel
974+ text: i18n.tr(" other: ")
975+ anchors{
976+ left: parent.left
977+ top: requiresRect.bottom
978+ margins: units.gu(2)
979+ }
980+ }
981+
982+ Rectangle {
983+ id: otherRect
984+ height: units.gu(4)
985+ border{
986+ color: UbuntuColors.warmGrey
987+ width: 1
988+ }
989+ anchors{
990+ left: requiresLabel.right
991+ right: parent.right
992+ top: requiresRect.bottom
993+ margins: units.gu(1)
994+ }
995+ }
996+ Text {
997+ id: otherText
998+ anchors{
999+ fill: requiresRect
1000+ margins: units.gu(1)
1001+ top: requiresRect.bottom
1002+ }
1003+ text:""
1004+ }
1005+ }
1006+
1007 }
1008
1009 }
1010+ Scrollbar {
1011+ flickableItem: detailsFlick
1012+ align: Qt.AlignTrailing
1013+ }
1014 }
1015
1016
1017=== modified file 'plainbox-gui/gui-ihv/qml/outline/TestSelectionListView.qml'
1018--- plainbox-gui/gui-ihv/qml/outline/TestSelectionListView.qml 2013-07-15 09:47:30 +0000
1019+++ plainbox-gui/gui-ihv/qml/outline/TestSelectionListView.qml 2013-07-18 10:47:25 +0000
1020@@ -28,8 +28,10 @@
1021
1022
1023 Rectangle {
1024+ id: suitetestlist
1025 color: "white"
1026 height: parent.height
1027+ width: parent.width
1028
1029
1030 function selectAll(sel) {
1031@@ -40,180 +42,71 @@
1032 id: listflick
1033 anchors.fill: parent
1034 height: parent.height
1035- width: parent.width
1036+
1037 clip: true
1038 contentHeight: groupedList.height
1039 boundsBehavior : Flickable.StopAtBounds
1040
1041+ Component {
1042+ id: highlight
1043+ Rectangle {
1044+ width: groupedList.width
1045+ height: units.gu(7)
1046+ color: "lightsteelblue";
1047+ radius: 5
1048+ }
1049+ }
1050+
1051+
1052
1053 ListView {
1054 id: groupedList
1055 width: parent.width
1056- height: units.gu(12) * groupedList.count
1057+ height: units.gu(12) * groupedList.count + units.gu(1)
1058 interactive: false
1059 model: testSuiteModel
1060
1061-
1062- delegate: Item{
1063- width: parent.width
1064- height: units.gu(7)
1065- property string groupname: group
1066- property alias checked: itemcheckbox.checked
1067- property string labelname: testname
1068-
1069-
1070- MouseArea {
1071- width: parent.width - itemcheckbox.width
1072- height: parent.height
1073- anchors.right: parent.right
1074-
1075- onClicked: {
1076- testdetails.testItem = testSuiteModel.get(index);
1077- }
1078- }
1079-
1080- Item {
1081- anchors.fill: parent
1082-
1083- Item {
1084- id: filler
1085- width: units.gu(4)
1086- }
1087-
1088- CheckBox {
1089- id: itemcheckbox
1090- anchors.verticalCenter: parent.verticalCenter
1091- anchors.left: filler.right
1092- anchors.leftMargin: units.gu(2)
1093- checked: check
1094- onClicked: {
1095- testSuiteModel.setProperty(index, "check", checked);
1096- // only do this if we have a tri-state checkbox
1097- //if (checked == false)
1098- // groupedList.turnGroupOff(group)
1099- }
1100- }
1101-
1102-
1103- Text {
1104- id: nameLabel
1105- text: testname
1106- width: units.gu(40)
1107- anchors.verticalCenter: parent.verticalCenter
1108- anchors.left: itemcheckbox.right
1109- anchors.leftMargin: units.gu(1)
1110-
1111- }
1112-
1113- Item {
1114- id: typefiller
1115- width: units.gu(2)
1116- anchors.left: nameLabel.right
1117- }
1118-
1119- Text {
1120- id: typelabel
1121- text: "Automated" //type
1122- width: units.gu(30)
1123- anchors.left: typefiller.right
1124- anchors.verticalCenter: parent.verticalCenter
1125-
1126- }
1127-
1128- Item {
1129- id: descfiller
1130- width: units.gu(6)
1131- anchors.left: typelabel.right
1132-
1133-
1134- }
1135-
1136- Text {
1137- id: descLabel
1138- text: "" //description
1139- width: units.gu(8)
1140- anchors.left: descfiller.right
1141- anchors.verticalCenter: parent.verticalCenter
1142- }
1143-
1144-
1145- Image {
1146- id: progressIcon
1147- source: "ListItemProgressionArrow.png"
1148- anchors {
1149- verticalCenter: parent.verticalCenter
1150- right: parent.right
1151- }
1152-
1153- opacity: enabled ? 1.0 : 0.5
1154- }
1155- }
1156- ListItem.ThinDivider {}
1157- }
1158-
1159- section.property: "group"
1160- section.criteria: ViewSection.FullString
1161- section.delegate: Item {
1162- id: itemdelegate
1163- width: parent.width
1164- height: units.gu(7)
1165- property string groupname: section
1166- property alias checked: groupcheckbox.checked
1167- property string labelname: section
1168- property bool open: true
1169-
1170- MouseArea {
1171- width: parent.width - groupcheckbox.width
1172- height: parent.height
1173- anchors.right: parent.right
1174-
1175- onClicked: {
1176- itemdelegate.open = !itemdelegate.open
1177- groupedList.openShutSubgroup(section, itemdelegate.open)
1178- console.log("Open/Shut items below")
1179- }
1180- }
1181-
1182- Label {
1183- id: groupfiller
1184- text: " "
1185- }
1186-
1187- CheckBox {
1188- id: groupcheckbox
1189- anchors.verticalCenter: parent.verticalCenter
1190- anchors.left: groupfiller.right
1191- anchors.leftMargin: units.gu(1)
1192- checked: true
1193- onClicked: {
1194- groupedList.selectGroup(section, checked)
1195- }
1196- }
1197-
1198-
1199- Text {
1200- id: grouptext
1201- text: section
1202- anchors.verticalCenter: parent.verticalCenter
1203- anchors.left: groupcheckbox.right
1204- anchors.leftMargin: units.gu(1)
1205- }
1206- ListItem.ThinDivider {}
1207- }
1208-
1209+ delegate: TestSelectionTestDelegate {}
1210+
1211+ section {
1212+ property: "group"
1213+ criteria: ViewSection.FullString
1214+ delegate: TestSelectionSuiteDelegate{}
1215+ }
1216+
1217+ highlight: highlight
1218+ highlightFollowsCurrentItem: true
1219+
1220+ Component.onCompleted: testdetails.testItem = testSuiteModel.get(currentItem);
1221
1222 // functions to do something across the whole list
1223+
1224+ // select/deselect all items in the list
1225 function selectAll(sel){
1226+ for (var i = testSuiteModel.count - 1; i >=0; i--)
1227+ testSuiteModel.setProperty(i, "check", sel);
1228+
1229+ // this is to select the group items and to make sure data is updated
1230+ var oldCurrent = currentIndex
1231 currentIndex = -1
1232- for (var i = 0; i < groupedList.contentItem.children.length; i++)
1233- {
1234- var curItem = groupedList.contentItem.children[i];
1235- //console.log(i,": ", curItem, "=", curItem.text);
1236+ for (var j = 0; j < groupedList.contentItem.children.length; j++){
1237+ var curItem = groupedList.contentItem.children[j];
1238 curItem.checked = sel;
1239 }
1240+ currentIndex = oldCurrent
1241 }
1242
1243+
1244+ // when a group item is checked/unchecked the subitems are checked/unchecked
1245 function selectGroup(groupName, sel){
1246+ for (var i = testSuiteModel.count - 1; i >=0; i--){
1247+ var item = testSuiteModel.get(i);
1248+ if (item.group === groupName)
1249+ testSuiteModel.setProperty(i, "check", sel);
1250+ }
1251+
1252+ // this is to select the group items and to make sure data is updated
1253+ var oldCurrent = currentIndex
1254 currentIndex = -1
1255 for (var i = 0; i < groupedList.contentItem.children.length; i++)
1256 {
1257@@ -223,21 +116,84 @@
1258 if (curItem.groupname === groupName)
1259 curItem.checked = sel;
1260 }
1261+ currentIndex = oldCurrent
1262 }
1263
1264- function turnGroupOff(groupName){
1265+ // determines if one or more subitems are checked
1266+ // if at least one subitem is checked, the group is checked
1267+ function setGroupCheck(groupName){
1268+ var oldCurrent = currentIndex
1269 currentIndex = -1
1270- for (var i = 0; i < groupedList.contentItem.children.length; i++)
1271+ var setCheck = false
1272+ var i = groupedList.contentItem.children.length - 1
1273+
1274+ for (;i >= 0 && setCheck === false; i--)
1275 {
1276 var curItem = groupedList.contentItem.children[i];
1277- //console.log(i,": ", curItem, "=", curItem.text);
1278-
1279+
1280+ // determine if subitem is checked
1281+ if (curItem.groupname === groupName && curItem.labelname !== groupName)
1282+ if (curItem.checked === true)
1283+ setCheck = true;
1284+
1285+ }
1286+
1287+ for (i = groupedList.contentItem.children.length - 1; i >= 0; i--)
1288+ {
1289+ curItem = groupedList.contentItem.children[i];
1290 if (curItem.labelname === groupName)
1291- curItem.checked = false;
1292- }
1293- }
1294-
1295+ curItem.checked = setCheck
1296+
1297+ }
1298+
1299+ currentIndex = oldCurrent;
1300+ }
1301+
1302+ // If any subitems are selected, group should be selected.
1303+ function isGroupSelected(section){
1304+ var isSel = false;
1305+ for (var i = testSuiteModel.count - 1; i >=0 && isSel === false; i--)
1306+ {
1307+ var curItem = testSuiteModel.get(i);
1308+ //console.log("Section: ", section, " ", i,": ", curItem, "=", curItem.group, " check:", curItem.check);
1309+
1310+ if (curItem.group === section && curItem.check === "true"){
1311+ isSel = true;
1312+ }
1313+ }
1314+ return isSel;
1315+ }
1316+
1317+ // Add up all the selected tests in a group
1318+ function getEstimatedTime(section){
1319+ var estTimeStr = "";
1320+ var estTimeInt=0;
1321+
1322+ for (var i = testSuiteModel.count - 1; i >=0; i--)
1323+ {
1324+ var curItem = testSuiteModel.get(i);
1325+
1326+ //console.log("curItem.group:", curItem.group, "check", curItem.check)
1327+ if (curItem.group === section && curItem.check === "true")
1328+ estTimeInt = parseInt(curItem.duration) + parseInt(estTimeInt);
1329+
1330+ }
1331+ if (estTimeInt == 0)
1332+ estTimeStr = "";
1333+ else if (estTimeInt/60 < 1)
1334+ estTimeStr = i18n.tr("< 1 minute");
1335+ else {
1336+ var durMinutes = Math.round(estTimeInt/60);
1337+ estTimeStr = durMinutes.toString() + i18n.tr(" minute");
1338+ if (durMinutes > 1)
1339+ estTimeStr += 's';
1340+ }
1341+ return estTimeStr;
1342+ }
1343+
1344+ // Open/Close gruops
1345 function openShutSubgroup(groupName, sel){
1346+ var oldCurrent = currentIndex;
1347 currentIndex = -1
1348 for (var i = 0; i < groupedList.contentItem.children.length; i++)
1349 {
1350@@ -248,8 +204,10 @@
1351 if (curItem.groupname === groupName && curItem.labelname !== groupName){
1352 curItem.height = sel? units.gu(7):units.gu(0);
1353 curItem.visible = sel;
1354+ groupedList.height += sel?units.gu(7):-units.gu(7)
1355 }
1356 }
1357+ currentIndex = oldCurrent;
1358 }
1359
1360 }
1361
1362=== added file 'plainbox-gui/gui-ihv/qml/outline/TestSelectionSuiteDelegate.qml'
1363--- plainbox-gui/gui-ihv/qml/outline/TestSelectionSuiteDelegate.qml 1970-01-01 00:00:00 +0000
1364+++ plainbox-gui/gui-ihv/qml/outline/TestSelectionSuiteDelegate.qml 2013-07-18 10:47:25 +0000
1365@@ -0,0 +1,114 @@
1366+/*
1367+ * This file is part of plainbox-gui
1368+ *
1369+ * Copyright 2013 Canonical Ltd.
1370+ *
1371+ * Authors:
1372+ * - Julia Segal <julia.segal@cellsoftware.co.uk>
1373+ *
1374+ * This program is free software; you can redistribute it and/or modify
1375+ * it under the terms of the GNU General Public License as published by
1376+ * the Free Software Foundation; version 3.
1377+ *
1378+ * This program is distributed in the hope that it will be useful,
1379+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
1380+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1381+ * GNU General Public License for more details.
1382+ *
1383+ * You should have received a copy of the GNU General Public License
1384+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
1385+ */
1386+
1387+
1388+import QtQuick 2.0
1389+import Ubuntu.Components 0.1
1390+import Ubuntu.Components.ListItems 0.1 as ListItem
1391+import "."
1392+
1393+Component {
1394+ id: groupDelegate
1395+
1396+
1397+ Item {
1398+ id: itemdelegate
1399+ width: parent.width
1400+ height: units.gu(7)
1401+
1402+ property string groupname: section
1403+ property alias checked: groupcheckbox.checked
1404+ property string labelname: section
1405+ property bool open: true
1406+
1407+ onOpenChanged: {
1408+ open?progressIcon.source = "artwork/DownArrow.png":progressIcon.source = "artwork/RightArrow.png"
1409+ }
1410+
1411+ MouseArea {
1412+ width: parent.width - groupcheckbox.width
1413+ height: parent.height
1414+ anchors.right: parent.right
1415+
1416+ onClicked: {
1417+ itemdelegate.open = !itemdelegate.open
1418+ groupedList.openShutSubgroup(section, itemdelegate.open)
1419+ //console.log("Open/Shut items below")
1420+ }
1421+ }
1422+
1423+ Item {
1424+ id: groupfiller
1425+ width: units.gu(1)
1426+ }
1427+
1428+ CheckBox {
1429+ id: groupcheckbox
1430+ anchors.verticalCenter: parent.verticalCenter
1431+ anchors.left: groupfiller.right
1432+ anchors.leftMargin: units.gu(1)
1433+ checked: groupedList.isGroupSelected(section)
1434+ onClicked: groupedList.selectGroup(section, checked)
1435+ }
1436+
1437+
1438+ Text {
1439+ id: grouptext
1440+ text: section
1441+ width: units.gu(20)
1442+ anchors.verticalCenter: parent.verticalCenter
1443+ anchors.left: groupcheckbox.right
1444+ anchors.leftMargin: units.gu(1)
1445+ }
1446+
1447+ Item {
1448+ id: estfiller
1449+ width: units.gu(55)
1450+ anchors.left: grouptext.right
1451+ }
1452+
1453+ Text {
1454+ id: estimatedTimeText
1455+ text: groupedList.getEstimatedTime(section)
1456+ width: units.gu(12)
1457+ anchors.left: estfiller.right
1458+ anchors.verticalCenter: parent.verticalCenter
1459+ horizontalAlignment: Text.AlignHCenter
1460+ color: "green"
1461+ font.bold : true
1462+ }
1463+
1464+ Image {
1465+ id: progressIcon
1466+ source: "artwork/DownArrow.png"
1467+ anchors {
1468+ verticalCenter: parent.verticalCenter
1469+ right: parent.right
1470+ rightMargin: units.gu(1)
1471+ }
1472+
1473+ opacity: enabled ? 1.0 : 0.5
1474+ }
1475+
1476+ ListItem.ThinDivider {}
1477+ }
1478+}
1479+
1480
1481=== added file 'plainbox-gui/gui-ihv/qml/outline/TestSelectionSummary.qml'
1482--- plainbox-gui/gui-ihv/qml/outline/TestSelectionSummary.qml 1970-01-01 00:00:00 +0000
1483+++ plainbox-gui/gui-ihv/qml/outline/TestSelectionSummary.qml 2013-07-18 10:47:25 +0000
1484@@ -0,0 +1,72 @@
1485+/*
1486+ * This file is part of plainbox-gui
1487+ *
1488+ * Copyright 2013 Canonical Ltd.
1489+ *
1490+ * Authors:
1491+ * - Julia Segal <julia.segal@cellsoftware.co.uk>
1492+ *
1493+ * This program is free software; you can redistribute it and/or modify
1494+ * it under the terms of the GNU General Public License as published by
1495+ * the Free Software Foundation; version 3.
1496+ *
1497+ * This program is distributed in the hope that it will be useful,
1498+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
1499+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1500+ * GNU General Public License for more details.
1501+ *
1502+ * You should have received a copy of the GNU General Public License
1503+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
1504+ */
1505+
1506+
1507+import QtQuick 2.0
1508+import Ubuntu.Components 0.1
1509+
1510+Rectangle {
1511+ id: summary
1512+
1513+ property string totalTimeStr: "26 minutes"
1514+ property int totalTests: 6
1515+ property int totalManualTests: 2
1516+
1517+ height: units.gu(3)
1518+ color: "lightsteelblue"
1519+ border {
1520+ color: UbuntuColors.warmGrey
1521+ width: 1
1522+ }
1523+
1524+ Text {
1525+ id: estimatedTimeText
1526+ text: i18n.tr("Total time: [~" + summary.totalTimeStr + "]")
1527+ color: "darkslateblue"
1528+ anchors{
1529+ verticalCenter: parent.verticalCenter
1530+ left: parent.left
1531+ leftMargin: units.gu(1)
1532+ }
1533+ }
1534+
1535+ Text {
1536+ id: totalTestsText
1537+ text: i18n.tr("Tests: [" + summary.totalTests + "]")
1538+ color:"darkslateblue"
1539+ anchors{
1540+ verticalCenter: parent.verticalCenter
1541+ left: estimatedTimeText.right
1542+ leftMargin: units.gu(10)
1543+ }
1544+ }
1545+
1546+ Text {
1547+ id: manualTestsText
1548+ text: i18n.tr("Manual tests: [" + summary.totalManualTests + "]")
1549+ color: "darkslateblue"
1550+ anchors{
1551+ verticalCenter: parent.verticalCenter
1552+ left: totalTestsText.right
1553+ leftMargin: units.gu(10)
1554+ }
1555+ }
1556+}
1557
1558=== added file 'plainbox-gui/gui-ihv/qml/outline/TestSelectionTestDelegate.qml'
1559--- plainbox-gui/gui-ihv/qml/outline/TestSelectionTestDelegate.qml 1970-01-01 00:00:00 +0000
1560+++ plainbox-gui/gui-ihv/qml/outline/TestSelectionTestDelegate.qml 2013-07-18 10:47:25 +0000
1561@@ -0,0 +1,129 @@
1562+/*
1563+ * This file is part of plainbox-gui
1564+ *
1565+ * Copyright 2013 Canonical Ltd.
1566+ *
1567+ * Authors:
1568+ * - Julia Segal <julia.segal@cellsoftware.co.uk>
1569+ *
1570+ * This program is free software; you can redistribute it and/or modify
1571+ * it under the terms of the GNU General Public License as published by
1572+ * the Free Software Foundation; version 3.
1573+ *
1574+ * This program is distributed in the hope that it will be useful,
1575+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
1576+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1577+ * GNU General Public License for more details.
1578+ *
1579+ * You should have received a copy of the GNU General Public License
1580+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
1581+ */
1582+
1583+
1584+import QtQuick 2.0
1585+import Ubuntu.Components 0.1
1586+import Ubuntu.Components.ListItems 0.1 as ListItem
1587+import "./artwork"
1588+
1589+Component {
1590+ id: testDelegate
1591+
1592+ Item{
1593+ id: testitem
1594+ width: parent.width
1595+ height: units.gu(7)
1596+ property string groupname: group
1597+ property alias checked: itemcheckbox.checked
1598+ property string labelname: testname
1599+
1600+
1601+ MouseArea {
1602+ width: parent.width - itemcheckbox.width
1603+ height: parent.height
1604+ anchors.right: parent.right
1605+
1606+ onClicked: {
1607+ testdetails.testItem = testSuiteModel.get(index);
1608+ groupedList.currentIndex = index; // sets selection
1609+ }
1610+ }
1611+
1612+ Item {
1613+ anchors.fill: parent
1614+
1615+ Item {
1616+ id: filler
1617+ width: itemcheckbox.width
1618+ }
1619+
1620+ CheckBox {
1621+ id: itemcheckbox
1622+ anchors.verticalCenter: parent.verticalCenter
1623+ anchors.left: filler.right
1624+ anchors.leftMargin: units.gu(2)
1625+ checked: check
1626+ onClicked: {
1627+ testSuiteModel.setProperty(index, "check", checked);
1628+ groupedList.setGroupCheck(group)
1629+ }
1630+ }
1631+
1632+
1633+ Text {
1634+ id: nameLabel
1635+ text: testname
1636+ width: units.gu(40)
1637+ anchors.verticalCenter: parent.verticalCenter
1638+ anchors.left: itemcheckbox.right
1639+ anchors.leftMargin: units.gu(1)
1640+ }
1641+
1642+ Item {
1643+ id: typefiller
1644+ width: units.gu(2)
1645+ anchors.left: nameLabel.right
1646+ }
1647+
1648+ Text {
1649+ id: typelabel
1650+ text: type
1651+ width: units.gu(10)
1652+ anchors.left: typefiller.right
1653+ anchors.verticalCenter: parent.verticalCenter
1654+ horizontalAlignment: Text.AlignHCenter
1655+
1656+ }
1657+
1658+ Item {
1659+ id: descfiller
1660+ width: units.gu(20)
1661+ anchors.left: typelabel.right
1662+ }
1663+
1664+ Text {
1665+ id: descLabel
1666+ text: convertToText(duration)
1667+ width: units.gu(10)
1668+ anchors.left: descfiller.right
1669+ anchors.verticalCenter: parent.verticalCenter
1670+ horizontalAlignment: Text.AlignHCenter
1671+
1672+ function convertToText(durationTime){
1673+ var timeStr = "";
1674+ if (durationTime/60 < 1)
1675+ timeStr = i18n.tr("< 1 minute");
1676+ else {
1677+ var durMinutes = Math.round(duration/60);
1678+ timeStr = durMinutes.toString() + i18n.tr(" minute");
1679+ if (durMinutes > 1)
1680+ timeStr += 's';
1681+ }
1682+ return timeStr;
1683+ }
1684+ }
1685+
1686+
1687+ }
1688+ ListItem.ThinDivider {}
1689+ }
1690+}
1691
1692=== modified file 'plainbox-gui/gui-ihv/qml/outline/TestSelectionView.qml'
1693--- plainbox-gui/gui-ihv/qml/outline/TestSelectionView.qml 2013-07-15 09:47:30 +0000
1694+++ plainbox-gui/gui-ihv/qml/outline/TestSelectionView.qml 2013-07-18 10:47:25 +0000
1695@@ -31,65 +31,100 @@
1696 Page {
1697 title: i18n.tr("Choose tests to run on your system:")
1698
1699- Label {
1700- id: testselectionlabel
1701- width: parent.width
1702- anchors.left: parent.left
1703- anchors.leftMargin: units.gu(2)
1704- anchors.topMargin: units.gu(4)
1705+
1706+ Item { // puts a space at the top
1707+ id: filler
1708+ height: units.gu(0)
1709+ anchors {
1710+ left: parent.left
1711+ top: parent.top
1712+ }
1713 }
1714
1715 Item {
1716 id: testlistheaders
1717 width: parent.width - units.gu(4)
1718 height: units.gu(3)
1719- anchors.horizontalCenter: parent.horizontalCenter
1720- anchors.top: testselectionlabel.bottom
1721- anchors.margins: units.gu(2)
1722-
1723+
1724+ anchors {
1725+ horizontalCenter: parent.horizontalCenter
1726+ top: filler.bottom
1727+ margins: units.gu(2)
1728+ }
1729+
1730+ Item {
1731+ id: compfiller
1732+ width: units.gu(6)
1733+ anchors.left: parent.left
1734+ }
1735 Text {
1736 id: complabel
1737- anchors.left: parent.left
1738- anchors.leftMargin: units.gu(6)
1739+ width: units.gu(12)
1740 text: i18n.tr("Components")
1741- }
1742+ anchors.left: compfiller.right
1743+ }
1744+ Item {
1745+ id: typefiller
1746+ width: units.gu(28)
1747+ anchors.left: complabel.right
1748+ }
1749+
1750 Text {
1751 id: typelabel
1752- anchors.left: complabel.right
1753- anchors.leftMargin: units.gu(40)
1754 text: i18n.tr("Type")
1755+ anchors.left: typefiller.right
1756+ anchors.leftMargin: units.gu(10)
1757+ horizontalAlignment: Text.AlignHCenter
1758+ }
1759+
1760+ Item {
1761+ id: descfiller
1762+ width: units.gu(24)
1763+ anchors.left: typelabel.right
1764 }
1765 Text {
1766 id: descriptionlabel
1767- anchors.left: typelabel.right
1768- anchors.leftMargin: units.gu(30)
1769+ width: units.gu(10)
1770 text: i18n.tr("Description")
1771+ horizontalAlignment: Text.AlignHCenter
1772+ anchors.left: descfiller.right
1773 }
1774 }
1775
1776 TestSelectionListView {
1777 id: testsuitelist
1778- height: units.gu(56)
1779- width: parent.width - units.gu(4)
1780-
1781- anchors.horizontalCenter: parent.horizontalCenter
1782- anchors.top: testlistheaders.bottom
1783+ height: parent.height - filler.height - testlistheaders.height - summary.height - testbuttons.height - units.gu(12)
1784+
1785+ width: testlistheaders.width
1786+
1787+ anchors{
1788+ horizontalCenter: parent.horizontalCenter
1789+ top: testlistheaders.bottom
1790+ }
1791 }
1792
1793+
1794+
1795 TestSelectionDetails {
1796 id: testdetails
1797- height: units.gu(20)
1798- width: parent.width - units.gu(4)
1799- anchors.horizontalCenter: parent.horizontalCenter
1800- anchors.top: testsuitelist.bottom
1801- anchors.topMargin: units.gu(2)
1802+ height: units.gu(4)
1803+ width: testlistheaders.width
1804+
1805+ anchors{
1806+ horizontalCenter: parent.horizontalCenter
1807+ top: testsuitelist.bottom
1808+ topMargin: units.gu(1)
1809+ }
1810 }
1811
1812
1813 TestSelectionButtons {
1814- anchors.horizontalCenter: parent.horizontalCenter
1815- anchors.top: testdetails.bottom
1816- anchors.topMargin: units.gu(5)
1817+ id: testbuttons
1818+ anchors{
1819+ horizontalCenter: parent.horizontalCenter
1820+ bottom: parent.bottom
1821+ bottomMargin: units.gu(4)
1822+ }
1823
1824 onSelectAll:{
1825 testsuitelist.selectAll(true);
1826@@ -101,10 +136,19 @@
1827
1828 onStartTesting: {
1829 // CHANGE THIS TO NEXT PAGE TO BRING UP
1830- mainView.state = "DEMOWARNINGS"
1831+ mainView.state = "RUNMANAGER"
1832 console.log("Start Testing")
1833 }
1834 }
1835+
1836+ TestSelectionSummary{
1837+ id: summary
1838+ width: parent.width
1839+ anchors {
1840+ horizontalCenter: parent.horizontalCenter
1841+ bottom: parent.bottom
1842+ }
1843+ }
1844 }
1845
1846
1847
1848=== modified file 'plainbox-gui/gui-ihv/qml/outline/WelcomeView.qml'
1849--- plainbox-gui/gui-ihv/qml/outline/WelcomeView.qml 2013-07-12 14:18:25 +0000
1850+++ plainbox-gui/gui-ihv/qml/outline/WelcomeView.qml 2013-07-18 10:47:25 +0000
1851@@ -22,13 +22,10 @@
1852
1853 import QtQuick 2.0
1854 import Ubuntu.Components 0.1
1855- import Ubuntu.Components.ListItems 0.1 as ListItem
1856-
1857-
1858
1859
1860 Page {
1861- title: "Welcome!"
1862+ title: i18n.tr("Welcome!")
1863
1864
1865
1866@@ -37,8 +34,8 @@
1867 anchors.right: parent.right
1868 anchors.bottom: parent.bottom
1869 anchors.margins: units.gu(2)
1870- text: i18n.tr("Move on to Test Selection")
1871+ text: i18n.tr("OK")
1872 color: UbuntuColors.lightAubergine
1873- onClicked: {mainView.state = "TESTSELECTION"}
1874+ onClicked: {mainView.state = "SUITESELECTION"}
1875 }
1876 }
1877
1878=== added directory 'plainbox-gui/gui-ihv/qml/outline/artwork'
1879=== added file 'plainbox-gui/gui-ihv/qml/outline/artwork/DownArrow@8.png'
1880Binary files plainbox-gui/gui-ihv/qml/outline/artwork/DownArrow@8.png 1970-01-01 00:00:00 +0000 and plainbox-gui/gui-ihv/qml/outline/artwork/DownArrow@8.png 2013-07-18 10:47:25 +0000 differ
1881=== added file 'plainbox-gui/gui-ihv/qml/outline/artwork/LeftArrow@8.png'
1882Binary files plainbox-gui/gui-ihv/qml/outline/artwork/LeftArrow@8.png 1970-01-01 00:00:00 +0000 and plainbox-gui/gui-ihv/qml/outline/artwork/LeftArrow@8.png 2013-07-18 10:47:25 +0000 differ
1883=== added file 'plainbox-gui/gui-ihv/qml/outline/artwork/ListItemProgressionArrow@8.png'
1884Binary files plainbox-gui/gui-ihv/qml/outline/artwork/ListItemProgressionArrow@8.png 1970-01-01 00:00:00 +0000 and plainbox-gui/gui-ihv/qml/outline/artwork/ListItemProgressionArrow@8.png 2013-07-18 10:47:25 +0000 differ
1885=== added file 'plainbox-gui/gui-ihv/qml/outline/artwork/RightArrow@8.png'
1886Binary files plainbox-gui/gui-ihv/qml/outline/artwork/RightArrow@8.png 1970-01-01 00:00:00 +0000 and plainbox-gui/gui-ihv/qml/outline/artwork/RightArrow@8.png 2013-07-18 10:47:25 +0000 differ
1887=== added file 'plainbox-gui/gui-ihv/qml/outline/artwork/UpArrow@8.png'
1888Binary files plainbox-gui/gui-ihv/qml/outline/artwork/UpArrow@8.png 1970-01-01 00:00:00 +0000 and plainbox-gui/gui-ihv/qml/outline/artwork/UpArrow@8.png 2013-07-18 10:47:25 +0000 differ
1889=== modified file 'plainbox-gui/gui-ihv/qml/outline/gui-ihv.qml'
1890--- plainbox-gui/gui-ihv/qml/outline/gui-ihv.qml 2013-07-15 09:47:30 +0000
1891+++ plainbox-gui/gui-ihv/qml/outline/gui-ihv.qml 2013-07-18 10:47:25 +0000
1892@@ -20,7 +20,7 @@
1893 */
1894
1895 import QtQuick 2.0
1896-import GuiEngine 1.0
1897+//import GuiEngine 1.0
1898 import Ubuntu.Components 0.1
1899 import Ubuntu.Components.Popups 0.1
1900 import "."
1901@@ -29,13 +29,13 @@
1902 MainView {
1903 id: mainView
1904 width: units.gu(120)
1905- height: units.gu(110)
1906+ height: units.gu(100)
1907
1908
1909 PageStack {
1910 id: pageStack
1911 state: "WELCOME"
1912- property string pageName: "DemoWarnings.qml"
1913+ property string pageName: "DemoWarnings.qml" // initial state
1914
1915 Component.onCompleted: {
1916 push(Qt.resolvedUrl(pageName))
1917@@ -48,7 +48,7 @@
1918 }
1919
1920 // Fill in states for all the pages.
1921- // The pages/views will set the state to the next one when it is dones
1922+ // The pages/views will set the state to the next one when it is done
1923 // like this: onClicked: {mainView.state = "TESTSELECTION"}
1924 states: [
1925 State {
1926@@ -56,12 +56,20 @@
1927 PropertyChanges { target: pageStack; pageName: "WelcomeView.qml"}
1928 },
1929 State {
1930+ name: "SUITESELECTION"
1931+ PropertyChanges { target: pageStack; pageName: "SuiteSelectionView.qml"}
1932+ },
1933+ State {
1934 name: "DEMOWARNINGS"
1935 PropertyChanges { target: pageStack; pageName: "DemoWarnings.qml"}
1936 },
1937 State {
1938 name: "TESTSELECTION"
1939 PropertyChanges { target: pageStack; pageName: "TestSelectionView.qml"}
1940+ },
1941+ State {
1942+ name: "RUNMANAGER"
1943+ PropertyChanges {target: pageStack; pageName: "RunManagerView.qml"}
1944 }
1945
1946 ]
1947
1948=== modified file 'plainbox-gui/gui-ihv/testsuiteitem.cpp'
1949--- plainbox-gui/gui-ihv/testsuiteitem.cpp 2013-07-12 14:18:25 +0000
1950+++ plainbox-gui/gui-ihv/testsuiteitem.cpp 2013-07-18 10:47:25 +0000
1951@@ -22,11 +22,14 @@
1952 #include <qdebug.h>
1953 #include "testsuiteitem.h"
1954
1955-TestSuiteItem::TestSuiteItem(const QString &groupName, const QString &testName, QObject * parent ) :
1956+
1957+TestSuiteItem::TestSuiteItem(const QString &groupName, const QString &testName, int duration, const QString &type, QObject * parent ) :
1958 ListItem( parent ),
1959 m_group(groupName),
1960 m_testName(testName),
1961- m_check(true)
1962+ m_check(true),
1963+ m_duration(duration),
1964+ m_type(type)
1965 {
1966 }
1967
1968@@ -37,6 +40,8 @@
1969 names[GroupRole] = "group";
1970 names[TestNameRole] = "testname";
1971 names[CheckRole] = "check";
1972+ names[DurationRole] = "duration";
1973+ names[TypeRole] = "type";
1974 return names;
1975 }
1976
1977@@ -49,6 +54,10 @@
1978 return testname();
1979 case CheckRole:
1980 return check();
1981+ case DurationRole:
1982+ return duration();
1983+ case TypeRole:
1984+ return type();
1985 default:
1986 return QVariant();
1987 }
1988@@ -65,6 +74,9 @@
1989 case CheckRole:
1990 setCheck(value.toBool());
1991 break;
1992+ case DurationRole:
1993+ setDuration(value.toInt());
1994+ break;
1995 }
1996
1997 }
1998@@ -93,8 +105,15 @@
1999 m_check = check;
2000 emit checkChanged();
2001 emit dataChanged();
2002- //qDebug() << "Check changed to" << check;
2003+ //qDebug() << m_testName << "check changed to" << check;
2004 }
2005 }
2006
2007+void TestSuiteItem::setDuration(int duration){
2008+ if (duration != m_duration){
2009+ m_duration = duration;
2010+ emit durationChanged();
2011+ emit dataChanged();
2012+ }
2013+}
2014
2015
2016=== modified file 'plainbox-gui/gui-ihv/testsuiteitem.h'
2017--- plainbox-gui/gui-ihv/testsuiteitem.h 2013-07-12 14:18:25 +0000
2018+++ plainbox-gui/gui-ihv/testsuiteitem.h 2013-07-18 10:47:25 +0000
2019@@ -29,23 +29,30 @@
2020 Q_PROPERTY(QString group READ group WRITE setGroup NOTIFY groupChanged)
2021 Q_PROPERTY(QString testname READ testname WRITE setTestname NOTIFY testnameChanged)
2022 Q_PROPERTY(bool check READ check WRITE setCheck NOTIFY checkChanged)
2023+ Q_PROPERTY(int duration READ duration WRITE setDuration NOTIFY durationChanged)
2024+ Q_PROPERTY(QString type READ type)
2025+
2026+
2027
2028 signals:
2029 void groupChanged();
2030 void testnameChanged();
2031 void checkChanged();
2032+ void durationChanged();
2033
2034 public:
2035 enum Roles {
2036 GroupRole = Qt::UserRole+1,
2037 TestNameRole,
2038- CheckRole
2039+ CheckRole,
2040+ DurationRole,
2041+ TypeRole
2042 };
2043
2044
2045 public:
2046 TestSuiteItem(QObject * parent = 0 ) : ListItem(parent), m_check(true){}
2047- TestSuiteItem(const QString &groupName, const QString &testname, QObject * parent = 0 );
2048+ TestSuiteItem(const QString &groupName, const QString &testname, int durationInSeconds, const QString &type, QObject * parent = 0 );
2049
2050 QVariant data(int role) const;
2051 void setData(const QVariant & value, int role);
2052@@ -62,12 +69,18 @@
2053 inline bool check() const { return m_check; }
2054 void setCheck(bool check);
2055
2056+ inline int duration() const { return m_duration; }
2057+ void setDuration(int duration);
2058+
2059+ inline QString type() const {return m_type; }
2060+
2061
2062 private:
2063 QString m_group;
2064 QString m_testName;
2065 bool m_check;
2066-
2067+ int m_duration;
2068+ QString m_type;
2069 };
2070
2071

Subscribers

People subscribed via source and target branches