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

Proposed by Brendan Donegan
Status: Rejected
Rejected by: Marc Tardif
Proposed branch: lp:~brendan-donegan/checkbox/bug971181_next_button
Merge into: lp:checkbox
Diff against target: 88 lines (+35/-2)
4 files modified
checkbox_qt/qt_interface.py (+7/-1)
debian/changelog (+4/-0)
qt/frontend/qtfront.cpp (+19/-1)
qt/frontend/qtfront.h (+5/-0)
To merge this branch: bzr merge lp:~brendan-donegan/checkbox/bug971181_next_button
Reviewer Review Type Date Requested Status
Jeff Lane  Disapprove
Ara Pulido (community) Needs Fixing
Review via email: mp+101511@code.launchpad.net

Description of the change

Previously, when a test was run by clicking the 'Test' button in the Qt UI, and the appropriate 'Yes'/'No' result button was selected, if the user clicked on Next then they would still be warned about skipping the test. This seemed to be a little bit unintuitive for some people. I made a few changes to fix this so that if Next is pressed then the current state of the Yes/No buttons will be taken into account.

My concern here is that this fix feels like hackery, because we're essentially turning the push buttons into a sort of radio button.

I'd like some feedback on this proposed fix, to see if the approach is agreeable.

To post a comment you must log in.
Revision history for this message
Ara Pulido (ara) wrote :

This wouldn't work in the cases where a test is manual, but you click Test to perform an action.

Example:

On the External Audio test, when you click on Test, Yes is automatically selected (as the script returns 0).

So, this does not seem like a solution for every case.

How many tests do we have that are semi-automated? I am starting to think that we may need to change the descriptions to match the new UI.

review: Needs Fixing
Revision history for this message
Jeff Lane  (bladernr) wrote :

Per discussion during the meeting, rejecting this... however, while I have not tested this to verify that Ara's concerns are valid, I like the idea at least so please hold onto this for either an SRU or for 0.14.

I'm thinking maybe we could expand this and just get rid of the Next button alltogether. Clicking Yes or No would initiate the move to the next test instead... <- just a thought at least but I do like the idea of trying to clean up the UI a bit...

So I've merged Daniel's branch based on the discussion from the team meeting, so lets see if that clears up the confusion of if we really do need to revisit the buttons on the new UI later.

review: Disapprove

Unmerged revisions

1356. By Brendan Donegan

Fixed UI so that if the Yes/No button is highlighted automatically then the
appropriate result is marked for the test when Next is clicked (LP: #971181)

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-22 16:33:36 +0000
3+++ checkbox_qt/qt_interface.py 2012-04-11 08:46:19 +0000
4@@ -194,8 +194,14 @@
5 self._run_test(test, runner)
6
7 def onNextTestClicked():
8- test["status"] = ANSWER_TO_STATUS[SKIP_ANSWER]
9+ if self.qtiface.getFocusTestYes():
10+ test["status"] = ANSWER_TO_STATUS[YES_ANSWER]
11+ elif self.qtiface.getFocusTestNo():
12+ test["status"] = ANSWER_TO_STATUS[NO_ANSWER]
13+ else:
14+ test["status"] = ANSWER_TO_STATUS[SKIP_ANSWER]
15 self.direction = NEXT
16+ self.qtiface.clearFocusTestYesNo()
17 self.loop.quit()
18
19 def onPreviousTestClicked():
20
21=== modified file 'debian/changelog'
22--- debian/changelog 2012-04-11 07:12:00 +0000
23+++ debian/changelog 2012-04-11 08:46:19 +0000
24@@ -18,6 +18,10 @@
25 made during the cert sprint.
26
27
28+ [Brendan Donegan]
29+ * Fixed UI so that if the Yes/No button is highlighted automatically then the
30+ appropriate result is marked for the test when Next is clicked (LP: #971181)
31+
32 -- Jeff Lane <jeff@ubuntu.com> Mon, 09 Apr 2012 17:12:51 -0400
33
34 checkbox (0.13.6) precise; urgency=low
35
36=== modified file 'qt/frontend/qtfront.cpp'
37--- qt/frontend/qtfront.cpp 2012-04-09 21:15:16 +0000
38+++ qt/frontend/qtfront.cpp 2012-04-11 08:46:19 +0000
39@@ -181,7 +181,7 @@
40
41 void QtFront::onNextTestClicked()
42 {
43- if (!m_skipTestMessage) {
44+ if (!m_skipTestMessage && !getFocusTestYes() && !getFocusTestNo()) {
45 QMessageBox msgBox(QMessageBox::Question, checkboxTr("Are you sure?", 0), checkboxTr("Do you really want to skip this test?", 0), 0, ui->tabWidget);
46 QCheckBox dontPrompt(checkboxTr("Don't ask me again", 0), &msgBox);
47 dontPrompt.blockSignals(true);
48@@ -375,6 +375,24 @@
49 }
50 }
51
52+void QtFront::clearFocusTestYesNo()
53+{
54+ ui->noTestButton->setDefault(false);
55+ ui->noTestButton->clearFocus();
56+ ui->yesTestButton->setDefault(false);
57+ ui->yesTestButton->clearFocus();
58+}
59+
60+bool QtFront::getFocusTestYes()
61+{
62+ return ui->yesTestButton->isDefault();
63+}
64+
65+bool QtFront::getFocusTestNo()
66+{
67+ return ui->noTestButton->isDefault();
68+}
69+
70 void QtFront::updateTestStatus(QStandardItem *item, QString status)
71 {
72 int numRows = item->rowCount();
73
74=== modified file 'qt/frontend/qtfront.h'
75--- qt/frontend/qtfront.h 2012-04-03 11:38:10 +0000
76+++ qt/frontend/qtfront.h 2012-04-11 08:46:19 +0000
77@@ -55,6 +55,11 @@
78 void showTest(QString purpose, QString steps, QString verification, QString info, QString comment, QString testType, QString testName, bool enableTestButton);
79 void showTestControls(bool enableTestControls);
80 void setFocusTestYesNo(bool status);
81+ void clearFocusTestYesNo();
82+
83+ bool getFocusTestYes();
84+ bool getFocusTestNo();
85+
86 Q_NOREPLY void showInfo(QString text, QStringList options, QString defaultoption);
87 void setUiFlags(QVariantMap flags);
88 void updateAutoTestStatus(QString status, QString testName);

Subscribers

People subscribed via source and target branches