Merge lp:~brendan-donegan/checkbox/bug1030871_component_status_table into lp:checkbox

Proposed by Brendan Donegan
Status: Merged
Merged at revision: 1547
Proposed branch: lp:~brendan-donegan/checkbox/bug1030871_component_status_table
Merge into: lp:checkbox
Diff against target: 521 lines (+95/-177)
5 files modified
debian/changelog (+2/-0)
qt/frontend/qtfront.cpp (+25/-35)
qt/frontend/qtfront.h (+2/-2)
qt/frontend/qtfront.ui (+66/-139)
qt/frontend/treemodel.cpp (+0/-1)
To merge this branch: bzr merge lp:~brendan-donegan/checkbox/bug1030871_component_status_table
Reviewer Review Type Date Requested Status
Sylvain Pineau (community) Approve
Brendan Donegan (community) Needs Resubmitting
Review via email: mp+117866@code.launchpad.net

Description of the change

This merge request combines the seperate Component and Status tree view widgets into one widget with a Component column and a Status column.

To post a comment you must log in.
Revision history for this message
Brendan Donegan (brendan-donegan) wrote :

It's probably worth giving this a good vigorous test, including making a submission. My own tests check out but a second opinion would be valuable, as there is a lot of code that depends on the tree views and it's difficult to be sure it was all re-factored properly.

Revision history for this message
Sylvain Pineau (sylvain-pineau) wrote :

I would suppress the Component and status headers and the line separator just below as well. Without two real columns I don't see the need to have them now and it will offer a bigger area to display the test selection.

Talking about the test selection, it's a suggestion not a must have but graying all tests titles once we start is not really user friendly. I would instead only gray out the checkboxes only.

Disabling the select all/deselected all buttons could be also a good idea once tests are started.

Revision history for this message
Brendan Donegan (brendan-donegan) wrote :

1.) I don't agree. A key is always useful for the user and I doubt the extra half a centimeter will be worthwhile

2.) I doubt this is technically possible. Besides it's outside the scope of the enhancement so unless it was straightforward (which is isn't) I don't think we should expend too much effort making it happen.

3.) This can be done, but perhaps should be in a separate merge (since it's outside the scope of this bug). Maybe you can raise a separate issue?

Revision history for this message
Sylvain Pineau (sylvain-pineau) wrote :

1.) It was my feeling and a wish to have nothing but a minimal ui. But your opinion about usability is valid too. So let keep the ui as it is today.

2.) Ok, I will keep that as a nice to have request for the next cycle :-)

3.) Sure.

I will update my review once I get a valid submission.

Revision history for this message
Brendan Donegan (brendan-donegan) wrote :

Number 2 you can probably add to the Qt UI improvements spreadsheet. That might be the best place to track it

Revision history for this message
Daniel Manrique (roadmr) wrote :

OK here's the third opinion:

1) I vote for leaving the headers, it's perfectly clear to us but it will confuse newcomers if we remove them. I'd remove the separator though; the column headers belong with the table and the separator, well, separates them creating a somewhat jarring visual break that feels out of place.

2) Graying out only the checkboxes would be better but if it's technically not so easy, I think what we have is good enough.

3) Graying out the buttons should not be *that* hard to do, but I agree that it would be best handled as a separate improvement.

1546. By Brendan Donegan

Remove line seperating column headers from tree view.

Revision history for this message
Brendan Donegan (brendan-donegan) wrote :

1.) Done!

review: Needs Resubmitting
Revision history for this message
Marc Tardif (cr3) wrote :

1) Thanks, this abides well by the design principle expressed so eloquently by Steve Krug: Keep the noise down to a dull roar.

1547. By Brendan Donegan

Put some padding to the right of the tree view and add super zebra stripe powers.

Revision history for this message
Sylvain Pineau (sylvain-pineau) wrote :

The padding on the right side of the selection window is larger than the left one. It's easier to see when the tests are loading because the scrollbar is not present.

I suggest to allow the widget to take the full width and also to make the scrollbar visible even if there is nothing to scroll.

PS. Zebra rocks !

review: Needs Fixing
1548. By Brendan Donegan

Fix padding of tree view and keep the scroll bar always on.

Revision history for this message
Brendan Donegan (brendan-donegan) wrote :

Done. Now I can haz merge plz? :)

review: Needs Resubmitting
1549. By Brendan Donegan

Merge from trunk

Revision history for this message
Sylvain Pineau (sylvain-pineau) wrote :

Thanks for the fixes, it looks beautiful now.
Approved !

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'debian/changelog'
2--- debian/changelog 2012-08-02 20:09:52 +0000
3+++ debian/changelog 2012-08-03 08:19:21 +0000
4@@ -10,6 +10,8 @@
5 /etc/default/apport (LP: #1029897)
6 * Initially disable the 'Run' tab in the Qt UI, re-enabling it when the
7 'Start Testing' has been clicked (LP: #1029815)
8+ * Put Component and Status into one tree view on the selection screen,
9+ rather than two seperate ones (LP: #1030871)
10
11 [Daniel Manrique]
12 * New version 0.14.3 for Quantal Quetzal development.
13
14=== modified file 'qt/frontend/qtfront.cpp'
15--- qt/frontend/qtfront.cpp 2012-07-30 09:09:23 +0000
16+++ qt/frontend/qtfront.cpp 2012-08-03 08:19:21 +0000
17@@ -71,7 +71,6 @@
18 connect(ui->checkBox, SIGNAL(toggled(bool)), SIGNAL(welcomeCheckboxToggled(bool)));
19 connect(ui->treeView, SIGNAL(collapsed(QModelIndex)), this, SLOT(onJobItemChanged(QModelIndex)));
20 connect(ui->treeView, SIGNAL(expanded(QModelIndex)), this, SLOT(onJobItemChanged(QModelIndex)));
21- connect(ui->treeView->verticalScrollBar(), SIGNAL(valueChanged(int)), ui->statusView->verticalScrollBar(), SLOT(setValue(int)));
22 connect(ui->treeView, SIGNAL(clicked(QModelIndex)), this, SLOT(onTestSelectionChanged()));
23 connect(this, SIGNAL(testSelectionChanged()), this, SLOT(onTestSelectionChanged()));
24 ui->stepsFrame->setFixedHeight(0);
25@@ -382,43 +381,36 @@
26 }
27 }
28
29-void QtFront::updateTestStatus(QStandardItem *item, QString status) {
30+void QtFront::updateTestStatus(QStandardItem *item, QStandardItem *statusItem, QString status) {
31 int numRows = item->rowCount();
32 int done = 0;
33 int inprogress = 0;
34- for(int i=0; i< numRows; i++) {
35- QStandardItem * childItem = item->child(i,0);
36+ for(int i = 0; i < numRows; i++) {
37+ QStandardItem * childItem = item->child(i,1);
38 if (childItem->hasChildren()) {
39- updateTestStatus(childItem, status);
40+ updateTestStatus(childItem, statusItem, status);
41 }
42 if (childItem->data(Qt::UserRole).toString() == m_currentTestName && !status.isEmpty()) {
43 childItem->setText(m_statusStrings[status]);
44 }
45 if (childItem->text() == m_statusStrings[STATUS_PASS]) {
46- childItem->setData(QVariant(Qt::Checked), Qt::CheckStateRole);
47 done++;
48 } else if (childItem->text() == m_statusStrings[STATUS_INPROGRESS]) {
49- childItem->setData(QVariant(Qt::Unchecked), Qt::CheckStateRole);
50 inprogress++;
51- } else if (childItem->text() == m_statusStrings[STATUS_UNINITIATED]) {
52- childItem->setData(QVariant(Qt::Unchecked), Qt::CheckStateRole);
53 }
54 }
55 if (done == item->rowCount() && done != 0) {
56- item->setText(m_statusStrings[STATUS_PASS]);
57- item->setData(QVariant(Qt::Checked), Qt::CheckStateRole);
58+ statusItem->setText(m_statusStrings[STATUS_PASS]);
59 } else if (inprogress != 0 || done != 0) {
60- item->setText(m_statusStrings[STATUS_INPROGRESS]);
61- item->setData(QVariant(Qt::PartiallyChecked), Qt::CheckStateRole);
62+ statusItem->setText(m_statusStrings[STATUS_INPROGRESS]);
63 } else {
64- item->setText(m_statusStrings[STATUS_UNINITIATED]);
65- item->setData(QVariant(Qt::Unchecked), Qt::CheckStateRole);
66+ statusItem->setText(m_statusStrings[STATUS_UNINITIATED]);
67 }
68 }
69
70 void QtFront::updateTestStatus(QString status) {
71- for (int i=0; i < m_statusModel->rowCount(); i++) {
72- updateTestStatus(m_statusModel->item(i,0), status);
73+ for (int i=0; i < m_model->rowCount(); i++) {
74+ updateTestStatus(m_model->item(i,0), m_model->item(i,1), status);
75 }
76 }
77
78@@ -432,11 +424,10 @@
79 void QtFront::buildTree(QVariantMap options,
80 QVariantMap defaults,
81 QString baseIndex,
82- QStandardItem *parentItem,
83- QStandardItem *parentStatusItem) {
84+ QStandardItem *parentItem) {
85 int internalIndex = 1;
86 while (true) {
87- QString index = baseIndex+"."+QString::number(internalIndex);
88+ QString index = baseIndex + "." + QString::number(internalIndex);
89 QVariant value = options.value(index);
90 QVariant defaultValue = defaults.value(index);
91 QDBusArgument arg = value.value<QDBusArgument>();
92@@ -463,19 +454,19 @@
93 }
94
95 testStatusItem->setData(test, Qt::UserRole);
96- testStatusItem->setFlags(Qt::ItemIsUserCheckable | Qt::ItemIsEnabled|Qt::ItemIsTristate);
97- testStatusItem->setData(QVariant(Qt::Unchecked), Qt::CheckStateRole);
98
99 if (parentItem) {
100 // for children nodes
101- parentItem->appendRow(item);
102- parentStatusItem->appendRow(testStatusItem);
103- buildTree(options, defaults, index, item, testStatusItem);
104+ QList<QStandardItem *> itemList;
105+ itemList << item << testStatusItem;
106+ parentItem->appendRow(itemList);
107+ buildTree(options, defaults, index, item);
108 } else {
109 // for root nodes
110- buildTree(options, defaults, index, item, testStatusItem);
111- m_model->appendRow(item);
112- m_statusModel->appendRow(testStatusItem);
113+ buildTree(options, defaults, index, item);
114+ QList<QStandardItem *> itemList;
115+ itemList << item << testStatusItem;
116+ m_model->appendRow(itemList);
117 }
118 }
119 internalIndex++;
120@@ -495,9 +486,11 @@
121 // build the model only once
122 if (!this->m_model) {
123 this->m_model = new TreeModel();
124+ this->m_model->setColumnCount(2);
125 buildTree(options, defaults, "1");
126 ui->treeView->setModel(m_model);
127- ui->statusView->setModel(m_statusModel);
128+ ui->treeView->header()->setResizeMode(0, QHeaderView::Stretch);
129+ ui->treeView->setColumnWidth(1, 150);
130 }
131 this->m_model->deselect_warning = QString(deselect_warning);
132
133@@ -514,20 +507,17 @@
134 if (item->hasChildren()) {
135 int numRows = item->rowCount();
136 for(int i=0; i< numRows; i++) {
137- QStandardItem *childItem = item->child(i, 0);
138+ QStandardItem *childItem = item->child(i, 1);
139 onJobItemChanged(childItem,job, baseIndex);
140 }
141 }
142- if (item->data(Qt::UserRole) == job) {
143- ui->statusView->setExpanded(item->index(), ui->treeView->isExpanded(baseIndex));
144- }
145 }
146
147 void QtFront::onJobItemChanged(QModelIndex index) {
148 QString job = m_model->data(index).toString();
149- int numRows = m_statusModel->rowCount();
150+ int numRows = m_model->rowCount();
151 for(int i=0; i< numRows; i++) {
152- QStandardItem *item = m_statusModel->item(i, 0);
153+ QStandardItem *item = m_model->item(i, 1);
154 onJobItemChanged(item, job, index);
155 }
156 }
157
158=== modified file 'qt/frontend/qtfront.h'
159--- qt/frontend/qtfront.h 2012-06-21 21:02:29 +0000
160+++ qt/frontend/qtfront.h 2012-08-03 08:19:21 +0000
161@@ -76,7 +76,7 @@
162
163 void onJobItemChanged(QModelIndex index);
164 void onJobItemChanged(QStandardItem *item, QString job, QModelIndex baseIndex);
165- void updateTestStatus(QStandardItem *item, QString status);
166+ void updateTestStatus(QStandardItem *item, QStandardItem* statusItem, QString status);
167 void updateTestStatus(QString status = QString());
168 void onClosedFrontend();
169
170@@ -98,7 +98,7 @@
171
172 private:
173 bool registerService();
174- void buildTree(QVariantMap options, QVariantMap defaults, QString baseIndex = "1", QStandardItem *parentItem = 0, QStandardItem *parentStatusItem = 0);
175+ void buildTree(QVariantMap options, QVariantMap defaults, QString baseIndex = "1", QStandardItem *parentItem = 0);
176 void buildTestsToRun(QStandardItem *item, QString baseIndex, QVariantMap &items);
177 Ui_main *ui;
178 QWidget *m_mainWindow;
179
180=== modified file 'qt/frontend/qtfront.ui'
181--- qt/frontend/qtfront.ui 2012-08-03 01:17:41 +0000
182+++ qt/frontend/qtfront.ui 2012-08-03 08:19:21 +0000
183@@ -40,15 +40,15 @@
184 </property>
185 <item>
186 <widget class="QTabWidget" name="tabWidget">
187+ <property name="styleSheet">
188+ <string notr="true">QTabBar::tab {min-height: 0ex;}</string>
189+ </property>
190 <property name="tabPosition">
191 <enum>QTabWidget::North</enum>
192 </property>
193 <property name="tabShape">
194 <enum>QTabWidget::Rounded</enum>
195 </property>
196- <property name="styleSheet">
197- <string notr="true">QTabBar::tab {min-height: 0ex;}</string>
198- </property>
199 <property name="currentIndex">
200 <number>0</number>
201 </property>
202@@ -277,28 +277,28 @@
203 <active>
204 <colorrole role="Button">
205 <brush brushstyle="SolidPattern">
206- <color alpha="255">
207- <red>73</red>
208- <green>73</green>
209- <blue>80</blue>
210+ <color alpha="0">
211+ <red>0</red>
212+ <green>0</green>
213+ <blue>0</blue>
214 </color>
215 </brush>
216 </colorrole>
217 <colorrole role="Base">
218 <brush brushstyle="SolidPattern">
219- <color alpha="255">
220- <red>73</red>
221- <green>73</green>
222- <blue>80</blue>
223+ <color alpha="0">
224+ <red>0</red>
225+ <green>0</green>
226+ <blue>0</blue>
227 </color>
228 </brush>
229 </colorrole>
230 <colorrole role="Window">
231 <brush brushstyle="SolidPattern">
232- <color alpha="255">
233- <red>73</red>
234- <green>73</green>
235- <blue>80</blue>
236+ <color alpha="0">
237+ <red>0</red>
238+ <green>0</green>
239+ <blue>0</blue>
240 </color>
241 </brush>
242 </colorrole>
243@@ -306,28 +306,28 @@
244 <inactive>
245 <colorrole role="Button">
246 <brush brushstyle="SolidPattern">
247- <color alpha="255">
248- <red>73</red>
249- <green>73</green>
250- <blue>80</blue>
251+ <color alpha="0">
252+ <red>0</red>
253+ <green>0</green>
254+ <blue>0</blue>
255 </color>
256 </brush>
257 </colorrole>
258 <colorrole role="Base">
259 <brush brushstyle="SolidPattern">
260- <color alpha="255">
261- <red>73</red>
262- <green>73</green>
263- <blue>80</blue>
264+ <color alpha="0">
265+ <red>0</red>
266+ <green>0</green>
267+ <blue>0</blue>
268 </color>
269 </brush>
270 </colorrole>
271 <colorrole role="Window">
272 <brush brushstyle="SolidPattern">
273- <color alpha="255">
274- <red>73</red>
275- <green>73</green>
276- <blue>80</blue>
277+ <color alpha="0">
278+ <red>0</red>
279+ <green>0</green>
280+ <blue>0</blue>
281 </color>
282 </brush>
283 </colorrole>
284@@ -335,28 +335,28 @@
285 <disabled>
286 <colorrole role="Button">
287 <brush brushstyle="SolidPattern">
288- <color alpha="255">
289- <red>73</red>
290- <green>73</green>
291- <blue>80</blue>
292+ <color alpha="0">
293+ <red>0</red>
294+ <green>0</green>
295+ <blue>0</blue>
296 </color>
297 </brush>
298 </colorrole>
299 <colorrole role="Base">
300 <brush brushstyle="SolidPattern">
301- <color alpha="255">
302- <red>73</red>
303- <green>73</green>
304- <blue>80</blue>
305+ <color alpha="0">
306+ <red>0</red>
307+ <green>0</green>
308+ <blue>0</blue>
309 </color>
310 </brush>
311 </colorrole>
312 <colorrole role="Window">
313 <brush brushstyle="SolidPattern">
314- <color alpha="255">
315- <red>73</red>
316- <green>73</green>
317- <blue>80</blue>
318+ <color alpha="0">
319+ <red>0</red>
320+ <green>0</green>
321+ <blue>0</blue>
322 </color>
323 </brush>
324 </colorrole>
325@@ -509,32 +509,6 @@
326 <string>Choose tests to run on your system:</string>
327 </property>
328 </widget>
329- <widget class="Line" name="line">
330- <property name="geometry">
331- <rect>
332- <x>10</x>
333- <y>60</y>
334- <width>601</width>
335- <height>20</height>
336- </rect>
337- </property>
338- <property name="orientation">
339- <enum>Qt::Horizontal</enum>
340- </property>
341- </widget>
342- <widget class="Line" name="line_2">
343- <property name="geometry">
344- <rect>
345- <x>390</x>
346- <y>40</y>
347- <width>20</width>
348- <height>271</height>
349- </rect>
350- </property>
351- <property name="orientation">
352- <enum>Qt::Vertical</enum>
353- </property>
354- </widget>
355 <widget class="QLabel" name="label_2">
356 <property name="geometry">
357 <rect>
358@@ -551,64 +525,33 @@
359 <widget class="QLabel" name="label_3">
360 <property name="geometry">
361 <rect>
362- <x>410</x>
363+ <x>450</x>
364 <y>50</y>
365 <width>67</width>
366 <height>17</height>
367 </rect>
368 </property>
369+ <property name="frameShape">
370+ <enum>QFrame::NoFrame</enum>
371+ </property>
372+ <property name="frameShadow">
373+ <enum>QFrame::Plain</enum>
374+ </property>
375 <property name="text">
376 <string>Status</string>
377 </property>
378 </widget>
379- <widget class="QTreeView" name="statusView">
380- <property name="enabled">
381- <bool>false</bool>
382- </property>
383+ <widget class="QTreeView" name="treeView">
384 <property name="geometry">
385 <rect>
386- <x>410</x>
387- <y>80</y>
388- <width>201</width>
389- <height>231</height>
390+ <x>10</x>
391+ <y>70</y>
392+ <width>611</width>
393+ <height>241</height>
394 </rect>
395 </property>
396- <property name="palette">
397- <palette>
398- <active>
399- <colorrole role="Base">
400- <brush brushstyle="SolidPattern">
401- <color alpha="255">
402- <red>255</red>
403- <green>255</green>
404- <blue>255</blue>
405- </color>
406- </brush>
407- </colorrole>
408- </active>
409- <inactive>
410- <colorrole role="Base">
411- <brush brushstyle="SolidPattern">
412- <color alpha="255">
413- <red>255</red>
414- <green>255</green>
415- <blue>255</blue>
416- </color>
417- </brush>
418- </colorrole>
419- </inactive>
420- <disabled>
421- <colorrole role="Base">
422- <brush brushstyle="SolidPattern">
423- <color alpha="255">
424- <red>255</red>
425- <green>255</green>
426- <blue>255</blue>
427- </color>
428- </brush>
429- </colorrole>
430- </disabled>
431- </palette>
432+ <property name="styleSheet">
433+ <string notr="true"/>
434 </property>
435 <property name="frameShape">
436 <enum>QFrame::Box</enum>
437@@ -617,42 +560,26 @@
438 <enum>QFrame::Plain</enum>
439 </property>
440 <property name="verticalScrollBarPolicy">
441- <enum>Qt::ScrollBarAlwaysOff</enum>
442- </property>
443- <property name="horizontalScrollBarPolicy">
444- <enum>Qt::ScrollBarAlwaysOff</enum>
445- </property>
446- <property name="headerHidden">
447- <bool>true</bool>
448- </property>
449- <attribute name="headerVisible">
450- <bool>false</bool>
451- </attribute>
452- </widget>
453- <widget class="QTreeView" name="treeView">
454- <property name="geometry">
455- <rect>
456- <x>10</x>
457- <y>80</y>
458- <width>381</width>
459- <height>231</height>
460- </rect>
461- </property>
462- <property name="frameShape">
463- <enum>QFrame::Box</enum>
464- </property>
465- <property name="frameShadow">
466- <enum>QFrame::Plain</enum>
467+ <enum>Qt::ScrollBarAlwaysOn</enum>
468 </property>
469 <property name="showDropIndicator" stdset="0">
470 <bool>false</bool>
471 </property>
472+ <property name="alternatingRowColors">
473+ <bool>true</bool>
474+ </property>
475 <property name="allColumnsShowFocus">
476 <bool>false</bool>
477 </property>
478 <attribute name="headerVisible">
479 <bool>false</bool>
480 </attribute>
481+ <attribute name="headerCascadingSectionResizes">
482+ <bool>false</bool>
483+ </attribute>
484+ <attribute name="headerStretchLastSection">
485+ <bool>false</bool>
486+ </attribute>
487 </widget>
488 <widget class="QPushButton" name="selectAllButton">
489 <property name="enabled">
490@@ -714,7 +641,7 @@
491 <property name="orientation">
492 <enum>Qt::Horizontal</enum>
493 </property>
494- </widget>
495+ </widget>
496 </widget>
497 <widget class="QWidget" name="testing">
498 <property name="enabled">
499@@ -888,8 +815,8 @@
500 <rect>
501 <x>0</x>
502 <y>0</y>
503- <width>62</width>
504- <height>16</height>
505+ <width>100</width>
506+ <height>30</height>
507 </rect>
508 </property>
509 <layout class="QVBoxLayout" name="verticalLayout_4">
510
511=== modified file 'qt/frontend/treemodel.cpp'
512--- qt/frontend/treemodel.cpp 2012-06-21 21:02:29 +0000
513+++ qt/frontend/treemodel.cpp 2012-08-03 08:19:21 +0000
514@@ -28,7 +28,6 @@
515 item->setEnabled(enable);
516 for(int i=0; i < item->rowCount(); i++) {
517 QStandardItem *childItem = item->child(i);
518- // childItem->setEnabled(enable);
519 enableAllChildren(enable, childItem);
520 }
521 }

Subscribers

People subscribed via source and target branches