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
=== modified file 'checkbox_qt/qt_interface.py'
--- checkbox_qt/qt_interface.py 2012-03-12 21:27:15 +0000
+++ checkbox_qt/qt_interface.py 2012-03-15 17:21:20 +0000
@@ -203,8 +203,11 @@
203 else:203 else:
204 info = ""204 info = ""
205205
206 if not "data" in test:
207 test["data"] = ""
208
206 self.qtiface.showTest(209 self.qtiface.showTest(
207 test["purpose"], test["steps"], test["verification"], info,210 test["purpose"], test["steps"], test["verification"], info, test["data"],
208 test["suite"], test["name"], enableTestButton)211 test["suite"], test["name"], enableTestButton)
209 self.wait_on_signals(212 self.wait_on_signals(
210 startTestClicked=onStartTestClicked,213 startTestClicked=onStartTestClicked,
@@ -213,7 +216,7 @@
213 noTestClicked=onNoTestClicked,216 noTestClicked=onNoTestClicked,
214 yesTestClicked=onYesTestClicked)217 yesTestClicked=onYesTestClicked)
215218
216 test["data"] = ""219 test["data"] = self.qtiface.getTestComment()
217 return False220 return False
218221
219 def show_info(self, text, options=[], default=None):222 def show_info(self, text, options=[], default=None):
220223
=== modified file 'qt/frontend/qtfront.cpp'
--- qt/frontend/qtfront.cpp 2012-03-08 17:15:05 +0000
+++ qt/frontend/qtfront.cpp 2012-03-15 17:21:20 +0000
@@ -5,6 +5,7 @@
5#include <QMenu>5#include <QMenu>
6#include <QMetaType>6#include <QMetaType>
7#include <QDBusMetaType>7#include <QDBusMetaType>
8#include <QWidgetAction>
89
9#include "qtfront.h"10#include "qtfront.h"
10#include "treemodel.h"11#include "treemodel.h"
@@ -38,6 +39,7 @@
38 ui(new Ui_main),39 ui(new Ui_main),
39 m_model(0),40 m_model(0),
40 m_statusModel(new QStandardItemModel()),41 m_statusModel(new QStandardItemModel()),
42 m_currentTextComment(new QTextEdit()),
41 m_currentTab(1),43 m_currentTab(1),
42 m_skipTestMessage(false)44 m_skipTestMessage(false)
43{45{
@@ -70,6 +72,15 @@
70 connect(ui->treeView, SIGNAL(customContextMenuRequested(const QPoint&)), this, SLOT(onSelectAllContextMenu(const QPoint&)));72 connect(ui->treeView, SIGNAL(customContextMenuRequested(const QPoint&)), this, SLOT(onSelectAllContextMenu(const QPoint&)));
71 ui->stepsFrame->setFixedHeight(0);73 ui->stepsFrame->setFixedHeight(0);
7274
75 // comment box
76 ui->commentTestButton->setMenu(new QMenu());
77 QWidgetAction *action = new QWidgetAction(ui->commentTestButton);
78 action->setDefaultWidget(m_currentTextComment);
79 ui->commentTestButton->menu()->addAction(action);
80 // force cursor blink without having to click inside the QTextEdit
81 m_currentTextComment->setFocus();
82 m_currentTextComment->setStyleSheet("background-color: white");
83
73 m_titleTestTypes["__audio__"] = "Audio Test";84 m_titleTestTypes["__audio__"] = "Audio Test";
74 m_titleTestTypes["__bluetooth__"] = "Bluetooth Test";85 m_titleTestTypes["__bluetooth__"] = "Bluetooth Test";
75 m_titleTestTypes["__camera__"] = "Camera Test";86 m_titleTestTypes["__camera__"] = "Camera Test";
@@ -276,10 +287,11 @@
276287
277}288}
278289
279void QtFront::showTest(QString purpose, QString steps, QString verification, QString info, QString testType, QString testName, bool enableTestButton)290void QtFront::showTest(QString purpose, QString steps, QString verification, QString info, QString comment, QString testType, QString testName, bool enableTestButton)
280{291{
281 currentState = TESTING;292 currentState = TESTING;
282 m_currentTestName = testName;293 m_currentTestName = testName;
294 m_currentTextComment->setText(comment);
283 updateTestStatus(STATUS_INPROGRESS);295 updateTestStatus(STATUS_INPROGRESS);
284 ui->radioTestTab->setVisible(true);296 ui->radioTestTab->setVisible(true);
285 ui->nextPrevButtons->setVisible(true);297 ui->nextPrevButtons->setVisible(true);
@@ -531,6 +543,11 @@
531 return selectedOptions;543 return selectedOptions;
532}544}
533545
546QString QtFront::getTestComment()
547{
548 return m_currentTextComment->toPlainText();
549}
550
534QtFront::~QtFront()551QtFront::~QtFront()
535{552{
536 delete ui;553 delete ui;
537554
=== modified file 'qt/frontend/qtfront.h'
--- qt/frontend/qtfront.h 2012-03-08 17:15:05 +0000
+++ qt/frontend/qtfront.h 2012-03-15 17:21:20 +0000
@@ -4,6 +4,7 @@
4#include <QWidget>4#include <QWidget>
5#include <QtDBus>5#include <QtDBus>
6#include <QCloseEvent>6#include <QCloseEvent>
7#include <QTextEdit>
78
8#include "treemodel.h"9#include "treemodel.h"
910
@@ -49,7 +50,8 @@
49 void showEntry(QString text);50 void showEntry(QString text);
50 QVariantMap getTestsToRun();51 QVariantMap getTestsToRun();
51 QString getEmailAddress();52 QString getEmailAddress();
52 void showTest(QString purpose, QString steps, QString verification, QString info, QString testType, QString testName, bool enableTestButton);53 QString getTestComment();
54 void showTest(QString purpose, QString steps, QString verification, QString info, QString comment, QString testType, QString testName, bool enableTestButton);
53 QString showInfo(QString text, QStringList options, QString defaultoption);55 QString showInfo(QString text, QStringList options, QString defaultoption);
54 void updateAutoTestStatus(QString status, QString testName);56 void updateAutoTestStatus(QString status, QString testName);
5557
@@ -94,6 +96,7 @@
94 QWidget *m_mainWindow;96 QWidget *m_mainWindow;
95 TreeModel * m_model;97 TreeModel * m_model;
96 QStandardItemModel *m_statusModel;98 QStandardItemModel *m_statusModel;
99 QTextEdit *m_currentTextComment;
97 QMap<QString, QString> m_statusList;100 QMap<QString, QString> m_statusList;
98 QMap <QString, QString> m_titleTestTypes;101 QMap <QString, QString> m_titleTestTypes;
99 QMap <QString, QString> m_statusStrings;102 QMap <QString, QString> m_statusStrings;
100103
=== modified file 'qt/frontend/qtfront.ui'
--- qt/frontend/qtfront.ui 2012-03-06 21:07:47 +0000
+++ qt/frontend/qtfront.ui 2012-03-15 17:21:20 +0000
@@ -457,7 +457,7 @@
457 <enum>QTabWidget::Rounded</enum>457 <enum>QTabWidget::Rounded</enum>
458 </property>458 </property>
459 <property name="currentIndex">459 <property name="currentIndex">
460 <number>2</number>460 <number>1</number>
461 </property>461 </property>
462 <widget class="QWidget" name="welcome">462 <widget class="QWidget" name="welcome">
463 <property name="font">463 <property name="font">
@@ -823,7 +823,7 @@
823 <x>0</x>823 <x>0</x>
824 <y>0</y>824 <y>0</y>
825 <width>500</width>825 <width>500</width>
826 <height>200</height>826 <height>189</height>
827 </rect>827 </rect>
828 </property>828 </property>
829 <layout class="QVBoxLayout" name="verticalLayout_4">829 <layout class="QVBoxLayout" name="verticalLayout_4">
@@ -872,9 +872,6 @@
872 </widget>872 </widget>
873 </item>873 </item>
874 </layout>874 </layout>
875 <zorder>stepsFrame</zorder>
876 <zorder>stepsFrame</zorder>
877 <zorder>scrollArea</zorder>
878 </widget>875 </widget>
879 </item>876 </item>
880 <item>877 <item>
@@ -898,7 +895,7 @@
898 <property name="geometry">895 <property name="geometry">
899 <rect>896 <rect>
900 <x>10</x>897 <x>10</x>
901 <y>0</y>898 <y>100</y>
902 <width>85</width>899 <width>85</width>
903 <height>27</height>900 <height>27</height>
904 </rect>901 </rect>
@@ -911,7 +908,7 @@
911 <property name="geometry">908 <property name="geometry">
912 <rect>909 <rect>
913 <x>10</x>910 <x>10</x>
914 <y>40</y>911 <y>41</y>
915 <width>85</width>912 <width>85</width>
916 <height>27</height>913 <height>27</height>
917 </rect>914 </rect>
@@ -924,7 +921,7 @@
924 <property name="geometry">921 <property name="geometry">
925 <rect>922 <rect>
926 <x>10</x>923 <x>10</x>
927 <y>80</y>924 <y>130</y>
928 <width>85</width>925 <width>85</width>
929 <height>27</height>926 <height>27</height>
930 </rect>927 </rect>
@@ -933,6 +930,22 @@
933 <string>No</string>930 <string>No</string>
934 </property>931 </property>
935 </widget>932 </widget>
933 <widget class="QToolButton" name="commentTestButton">
934 <property name="geometry">
935 <rect>
936 <x>10</x>
937 <y>170</y>
938 <width>85</width>
939 <height>27</height>
940 </rect>
941 </property>
942 <property name="text">
943 <string>Comment</string>
944 </property>
945 <property name="popupMode">
946 <enum>QToolButton::InstantPopup</enum>
947 </property>
948 </widget>
936 </widget>949 </widget>
937 </item>950 </item>
938 </layout>951 </layout>

Subscribers

People subscribed via source and target branches