Merge lp:~sylvain-pineau/checkbox/954556_select_yes_on_pass into lp:checkbox

Proposed by Sylvain Pineau on 2012-03-19
Status: Merged
Merged at revision: 1330
Proposed branch: lp:~sylvain-pineau/checkbox/954556_select_yes_on_pass
Merge into: lp:checkbox
Diff against target: 100 lines (+35/-2)
4 files modified
checkbox_qt/qt_interface.py (+8/-2)
debian/changelog (+1/-0)
qt/frontend/qtfront.cpp (+24/-0)
qt/frontend/qtfront.h (+2/-0)
To merge this branch: bzr merge lp:~sylvain-pineau/checkbox/954556_select_yes_on_pass
Reviewer Review Type Date Requested Status
Daniel Manrique Approve on 2012-03-20
Tiago Salem Herrmann (community) 2012-03-19 Approve on 2012-03-20
Review via email: mp+98208@code.launchpad.net
To post a comment you must log in.
Sylvain Pineau (sylvain-pineau) wrote :

As the GTK ui, this MR highlights the YES/NO buttons depending of the result of the test command (if exists).
Moreover, Test controls (YES,NO,TEST,PREV and NEXT) are disabled during the script execution.
And finally the TEST button is grayed out if no command are linked to the test.

Tiago Salem Herrmann (tiagosh) wrote :

code looks ok.
Just tested and it works great.

review: Approve
Daniel Manrique (roadmr) wrote :

Merging based on Tiago's approval. Thanks!

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'checkbox_qt/qt_interface.py'
2--- checkbox_qt/qt_interface.py 2012-03-12 21:27:15 +0000
3+++ checkbox_qt/qt_interface.py 2012-03-19 14:40:24 +0000
4@@ -22,6 +22,7 @@
5 from gettext import gettext as _
6 from string import Template
7
8+from checkbox.job import PASS
9 from checkbox.user_interface import (UserInterface,
10 NEXT, PREV, YES_ANSWER, NO_ANSWER, SKIP_ANSWER,
11 ANSWER_TO_STATUS)
12@@ -167,7 +168,10 @@
13 return buildDict(self.qtiface.getTestsToRun())
14
15 def _run_test(self, test, runner):
16+ self.qtiface.showTestControls(False)
17 (status, data, duration) = runner(test)
18+ self.qtiface.setFocusTestYesNo(True if status == PASS else False)
19+ self.qtiface.showTestControls(True)
20
21 return Template(test["info"]).substitute({
22 "output": data.strip()})
23@@ -195,14 +199,16 @@
24 self.direction = NEXT
25 self.loop.quit()
26
27- enableTestButton = True
28+ enableTestButton = False
29 self._set_main_title(test["name"])
30 if test["info"] and "$output" in test["info"]:
31 info = self._run_test(test, runner)
32- enableTestButton = False
33 else:
34 info = ""
35
36+ if "command" in test:
37+ enableTestButton = True
38+
39 self.qtiface.showTest(
40 test["purpose"], test["steps"], test["verification"], info,
41 test["suite"], test["name"], enableTestButton)
42
43=== modified file 'debian/changelog'
44--- debian/changelog 2012-03-19 08:22:57 +0000
45+++ debian/changelog 2012-03-19 14:40:24 +0000
46@@ -42,6 +42,7 @@
47 [Sylvain Pineau]
48 * Show the UF invalidation warning if all test cases are unchecked from the
49 right click menu (LP: #956757)
50+ * Tests now select Yes on PASS status (LP: #954556)
51
52 -- Jeff Lane <jeff@ubuntu.com> Fri, 16 Mar 2012 19:14:09 -0400
53
54
55=== modified file 'qt/frontend/qtfront.cpp'
56--- qt/frontend/qtfront.cpp 2012-03-16 22:00:08 +0000
57+++ qt/frontend/qtfront.cpp 2012-03-19 14:40:24 +0000
58@@ -335,6 +335,30 @@
59
60 }
61
62+void QtFront::showTestControls(bool enableTestControls)
63+{
64+ ui->testTestButton->setEnabled(enableTestControls);
65+ ui->yesTestButton->setEnabled(enableTestControls);
66+ ui->noTestButton->setEnabled(enableTestControls);
67+ ui->nextPrevButtons->setEnabled(enableTestControls);
68+}
69+
70+void QtFront::setFocusTestYesNo(bool status)
71+{
72+ if (status) {
73+ ui->noTestButton->setDefault(false);
74+ ui->noTestButton->clearFocus();
75+ ui->yesTestButton->setDefault(true);
76+ ui->yesTestButton->setFocus();
77+ }
78+ else {
79+ ui->yesTestButton->setDefault(false);
80+ ui->yesTestButton->clearFocus();
81+ ui->noTestButton->setDefault(true);
82+ ui->noTestButton->setFocus();
83+ }
84+}
85+
86 void QtFront::updateTestStatus(QStandardItem *item, QString status)
87 {
88 int numRows = item->rowCount();
89
90=== modified file 'qt/frontend/qtfront.h'
91--- qt/frontend/qtfront.h 2012-03-08 17:15:05 +0000
92+++ qt/frontend/qtfront.h 2012-03-19 14:40:24 +0000
93@@ -50,6 +50,8 @@
94 QVariantMap getTestsToRun();
95 QString getEmailAddress();
96 void showTest(QString purpose, QString steps, QString verification, QString info, QString testType, QString testName, bool enableTestButton);
97+ void showTestControls(bool enableTestControls);
98+ void setFocusTestYesNo(bool status);
99 QString showInfo(QString text, QStringList options, QString defaultoption);
100 void updateAutoTestStatus(QString status, QString testName);
101

Subscribers

People subscribed via source and target branches