Merge lp:~tiagosh/checkbox/test-comment into lp:checkbox

Proposed by Tiago Salem Herrmann
Status: Merged
Merged at revision: 1327
Proposed branch: lp:~tiagosh/checkbox/test-comment
Merge into: lp:checkbox
Diff against target: 198 lines (+48/-12)
4 files modified
checkbox_qt/qt_interface.py (+5/-2)
qt/frontend/qtfront.cpp (+18/-1)
qt/frontend/qtfront.h (+4/-1)
qt/frontend/qtfront.ui (+21/-8)
To merge this branch: bzr merge lp:~tiagosh/checkbox/test-comment
Reviewer Review Type Date Requested Status
Daniel Manrique (community) Approve
Review via email: mp+97667@code.launchpad.net

Description of the change

This will add a popup comment box for each test under the "Run" tab.

To post a comment you must log in.
lp:~tiagosh/checkbox/test-comment updated
1316. By Tiago Salem Herrmann

change buttons position

Revision history for this message
Tiago Salem Herrmann (tiagosh) wrote :
Revision history for this message
Ara Pulido (ara) wrote :

It looks good to me!

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

Merged as bug fix since the FFe was approved. 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-15 17:21:20 +0000
4@@ -203,8 +203,11 @@
5 else:
6 info = ""
7
8+ if not "data" in test:
9+ test["data"] = ""
10+
11 self.qtiface.showTest(
12- test["purpose"], test["steps"], test["verification"], info,
13+ test["purpose"], test["steps"], test["verification"], info, test["data"],
14 test["suite"], test["name"], enableTestButton)
15 self.wait_on_signals(
16 startTestClicked=onStartTestClicked,
17@@ -213,7 +216,7 @@
18 noTestClicked=onNoTestClicked,
19 yesTestClicked=onYesTestClicked)
20
21- test["data"] = ""
22+ test["data"] = self.qtiface.getTestComment()
23 return False
24
25 def show_info(self, text, options=[], default=None):
26
27=== modified file 'qt/frontend/qtfront.cpp'
28--- qt/frontend/qtfront.cpp 2012-03-08 17:15:05 +0000
29+++ qt/frontend/qtfront.cpp 2012-03-15 17:21:20 +0000
30@@ -5,6 +5,7 @@
31 #include <QMenu>
32 #include <QMetaType>
33 #include <QDBusMetaType>
34+#include <QWidgetAction>
35
36 #include "qtfront.h"
37 #include "treemodel.h"
38@@ -38,6 +39,7 @@
39 ui(new Ui_main),
40 m_model(0),
41 m_statusModel(new QStandardItemModel()),
42+ m_currentTextComment(new QTextEdit()),
43 m_currentTab(1),
44 m_skipTestMessage(false)
45 {
46@@ -70,6 +72,15 @@
47 connect(ui->treeView, SIGNAL(customContextMenuRequested(const QPoint&)), this, SLOT(onSelectAllContextMenu(const QPoint&)));
48 ui->stepsFrame->setFixedHeight(0);
49
50+ // comment box
51+ ui->commentTestButton->setMenu(new QMenu());
52+ QWidgetAction *action = new QWidgetAction(ui->commentTestButton);
53+ action->setDefaultWidget(m_currentTextComment);
54+ ui->commentTestButton->menu()->addAction(action);
55+ // force cursor blink without having to click inside the QTextEdit
56+ m_currentTextComment->setFocus();
57+ m_currentTextComment->setStyleSheet("background-color: white");
58+
59 m_titleTestTypes["__audio__"] = "Audio Test";
60 m_titleTestTypes["__bluetooth__"] = "Bluetooth Test";
61 m_titleTestTypes["__camera__"] = "Camera Test";
62@@ -276,10 +287,11 @@
63
64 }
65
66-void QtFront::showTest(QString purpose, QString steps, QString verification, QString info, QString testType, QString testName, bool enableTestButton)
67+void QtFront::showTest(QString purpose, QString steps, QString verification, QString info, QString comment, QString testType, QString testName, bool enableTestButton)
68 {
69 currentState = TESTING;
70 m_currentTestName = testName;
71+ m_currentTextComment->setText(comment);
72 updateTestStatus(STATUS_INPROGRESS);
73 ui->radioTestTab->setVisible(true);
74 ui->nextPrevButtons->setVisible(true);
75@@ -531,6 +543,11 @@
76 return selectedOptions;
77 }
78
79+QString QtFront::getTestComment()
80+{
81+ return m_currentTextComment->toPlainText();
82+}
83+
84 QtFront::~QtFront()
85 {
86 delete ui;
87
88=== modified file 'qt/frontend/qtfront.h'
89--- qt/frontend/qtfront.h 2012-03-08 17:15:05 +0000
90+++ qt/frontend/qtfront.h 2012-03-15 17:21:20 +0000
91@@ -4,6 +4,7 @@
92 #include <QWidget>
93 #include <QtDBus>
94 #include <QCloseEvent>
95+#include <QTextEdit>
96
97 #include "treemodel.h"
98
99@@ -49,7 +50,8 @@
100 void showEntry(QString text);
101 QVariantMap getTestsToRun();
102 QString getEmailAddress();
103- void showTest(QString purpose, QString steps, QString verification, QString info, QString testType, QString testName, bool enableTestButton);
104+ QString getTestComment();
105+ void showTest(QString purpose, QString steps, QString verification, QString info, QString comment, QString testType, QString testName, bool enableTestButton);
106 QString showInfo(QString text, QStringList options, QString defaultoption);
107 void updateAutoTestStatus(QString status, QString testName);
108
109@@ -94,6 +96,7 @@
110 QWidget *m_mainWindow;
111 TreeModel * m_model;
112 QStandardItemModel *m_statusModel;
113+ QTextEdit *m_currentTextComment;
114 QMap<QString, QString> m_statusList;
115 QMap <QString, QString> m_titleTestTypes;
116 QMap <QString, QString> m_statusStrings;
117
118=== modified file 'qt/frontend/qtfront.ui'
119--- qt/frontend/qtfront.ui 2012-03-06 21:07:47 +0000
120+++ qt/frontend/qtfront.ui 2012-03-15 17:21:20 +0000
121@@ -457,7 +457,7 @@
122 <enum>QTabWidget::Rounded</enum>
123 </property>
124 <property name="currentIndex">
125- <number>2</number>
126+ <number>1</number>
127 </property>
128 <widget class="QWidget" name="welcome">
129 <property name="font">
130@@ -823,7 +823,7 @@
131 <x>0</x>
132 <y>0</y>
133 <width>500</width>
134- <height>200</height>
135+ <height>189</height>
136 </rect>
137 </property>
138 <layout class="QVBoxLayout" name="verticalLayout_4">
139@@ -872,9 +872,6 @@
140 </widget>
141 </item>
142 </layout>
143- <zorder>stepsFrame</zorder>
144- <zorder>stepsFrame</zorder>
145- <zorder>scrollArea</zorder>
146 </widget>
147 </item>
148 <item>
149@@ -898,7 +895,7 @@
150 <property name="geometry">
151 <rect>
152 <x>10</x>
153- <y>0</y>
154+ <y>100</y>
155 <width>85</width>
156 <height>27</height>
157 </rect>
158@@ -911,7 +908,7 @@
159 <property name="geometry">
160 <rect>
161 <x>10</x>
162- <y>40</y>
163+ <y>41</y>
164 <width>85</width>
165 <height>27</height>
166 </rect>
167@@ -924,7 +921,7 @@
168 <property name="geometry">
169 <rect>
170 <x>10</x>
171- <y>80</y>
172+ <y>130</y>
173 <width>85</width>
174 <height>27</height>
175 </rect>
176@@ -933,6 +930,22 @@
177 <string>No</string>
178 </property>
179 </widget>
180+ <widget class="QToolButton" name="commentTestButton">
181+ <property name="geometry">
182+ <rect>
183+ <x>10</x>
184+ <y>170</y>
185+ <width>85</width>
186+ <height>27</height>
187+ </rect>
188+ </property>
189+ <property name="text">
190+ <string>Comment</string>
191+ </property>
192+ <property name="popupMode">
193+ <enum>QToolButton::InstantPopup</enum>
194+ </property>
195+ </widget>
196 </widget>
197 </item>
198 </layout>

Subscribers

People subscribed via source and target branches