Merge lp:~roadmr/checkbox/cdts-report-3-checkbox-gui-send-client-name-option into lp:checkbox

Proposed by Daniel Manrique
Status: Merged
Approved by: Zygmunt Krynicki
Approved revision: 2864
Merged at revision: 2865
Proposed branch: lp:~roadmr/checkbox/cdts-report-3-checkbox-gui-send-client-name-option
Merge into: lp:checkbox
Prerequisite: lp:~roadmr/checkbox/cdts-report-2-exporter-non-boolean-options-xml-client-name-option
Diff against target: 105 lines (+18/-11)
4 files modified
checkbox-gui/checkbox-gui/main.cpp (+1/-0)
checkbox-gui/checkbox-gui/qml/SubmissionDialog.qml (+7/-3)
checkbox-gui/gui-engine/gui-engine.cpp (+6/-6)
checkbox-gui/gui-engine/gui-engine.h (+4/-2)
To merge this branch: bzr merge lp:~roadmr/checkbox/cdts-report-3-checkbox-gui-send-client-name-option
Reviewer Review Type Date Requested Status
Zygmunt Krynicki (community) Approve
Review via email: mp+213746@code.launchpad.net

Commit message

  checkbox-gui: Added support for sending client-name as an option to exporters.

Description of the change

   checkbox-gui: Added support for client-name as an option to exporters.

    when saving both html and xml, the applicationName will be sent as an
    option to the exporters, to be used as the client-name that will appear
    in the reports.

    Note I didn't use the existing applicationName variable because it has
    special meaning to QML to configure storage paths, so it can't be just
    renamed (but also doesn't just work if used), so I simply copied the
    value on another variable.

To post a comment you must log in.
Revision history for this message
Zygmunt Krynicki (zyga) wrote :

Looks good to me, thanks, +1

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'checkbox-gui/checkbox-gui/main.cpp'
2--- checkbox-gui/checkbox-gui/main.cpp 2014-03-19 13:48:36 +0000
3+++ checkbox-gui/checkbox-gui/main.cpp 2014-04-01 23:41:12 +0000
4@@ -54,6 +54,7 @@
5
6 // Register the applicationName with the QML runtime
7 viewer.rootContext()->setContextProperty("applicationName", applicationName);
8+ viewer.rootContext()->setContextProperty("client_name", applicationName);
9
10 // Register the GuiEngine with the QML runtime
11 viewer.rootContext()->setContextProperty("guiEngine", &guiengine);
12
13=== modified file 'checkbox-gui/checkbox-gui/qml/SubmissionDialog.qml'
14--- checkbox-gui/checkbox-gui/qml/SubmissionDialog.qml 2014-03-20 11:17:53 +0000
15+++ checkbox-gui/checkbox-gui/qml/SubmissionDialog.qml 2014-04-01 23:41:12 +0000
16@@ -90,11 +90,13 @@
17 onClicked: {
18 var submit_to = settings.value("transport/submit_to", "")
19 var export_path = settings.value("exporter/xml_export_path", "")
20+ var option_list = new Array("client-name=" + client_name);
21
22 if (!export_path) {
23 export_path = guiEngine.GetSaveFileName();
24 }
25- var success = guiEngine.GuiExportSessionToFileAsXML(export_path);
26+ var success = guiEngine.GuiExportSessionToFileAsXML(export_path,
27+ option_list);
28 if (submit_to == "certification") {
29 if (success) {
30 dialog.text = guiEngine.SendSubmissionViaCertificationTransport(export_path,
31@@ -117,8 +119,10 @@
32 onClicked: {
33 onClicked:{
34 var mysavepath = '/tmp/report.html';
35- runmanagerview.reportIsSaved = guiEngine.GuiExportSessionToFileAsHTML(mysavepath);
36- Qt.openUrlExternally(mysavepath)
37+ var option_list = new Array("client-name=" + client_name);
38+ runmanagerview.reportIsSaved = guiEngine.GuiExportSessionToFileAsHTML(mysavepath,
39+ option_list);
40+ Qt.openUrlExternally(mysavepath);
41 }
42 }
43 }
44
45=== modified file 'checkbox-gui/gui-engine/gui-engine.cpp'
46--- checkbox-gui/gui-engine/gui-engine.cpp 2014-03-20 10:35:19 +0000
47+++ checkbox-gui/gui-engine/gui-engine.cpp 2014-04-01 23:41:12 +0000
48@@ -2009,10 +2009,10 @@
49 return reply;
50 }
51
52-bool GuiEngine::GuiExportSessionToFileAsXML(const QString& output_file)
53+bool GuiEngine::GuiExportSessionToFileAsXML(const QString& output_file,
54+ const QStringList& option_list)
55 {
56 QString output_format = "xml";
57- QStringList options; // No options
58
59 // very basic argument checking
60 if (output_file.isEmpty()) {
61@@ -2020,15 +2020,15 @@
62 }
63
64 // FIXME - When we get a useful success/failure code here, return to caller
65- QString done = ExportSessionToFile(m_session,output_format,options,output_file);
66+ QString done = ExportSessionToFile(m_session,output_format,option_list,output_file);
67
68 return true;
69 }
70
71-bool GuiEngine::GuiExportSessionToFileAsHTML(const QString& output_file)
72+bool GuiEngine::GuiExportSessionToFileAsHTML(const QString& output_file,
73+ const QStringList& option_list)
74 {
75 QString output_format = "html";
76- QStringList options; // No options
77
78 // very basic argument checking
79 if (output_file.isEmpty()) {
80@@ -2036,7 +2036,7 @@
81 }
82
83 // FIXME - When we get a useful success/failure code here, return to caller
84- QString done = ExportSessionToFile(m_session,output_format,options,output_file);
85+ QString done = ExportSessionToFile(m_session,output_format,option_list,output_file);
86
87 return true;
88 }
89
90=== modified file 'checkbox-gui/gui-engine/gui-engine.h'
91--- checkbox-gui/gui-engine/gui-engine.h 2014-03-20 10:35:19 +0000
92+++ checkbox-gui/gui-engine/gui-engine.h 2014-04-01 23:41:12 +0000
93@@ -163,8 +163,10 @@
94 QString GuiExportSessionAsXML(void);
95 QString GuiExportSessionAsHTML(void);
96
97- bool GuiExportSessionToFileAsXML(const QString& output_file);
98- bool GuiExportSessionToFileAsHTML(const QString& output_file);
99+ bool GuiExportSessionToFileAsXML(const QString& output_file,
100+ const QStringList& option_list);
101+ bool GuiExportSessionToFileAsHTML(const QString& output_file,
102+ const QStringList& option_list);
103
104 const QString SendSubmissionViaCertificationTransport( \
105 const QString &submission_path,

Subscribers

People subscribed via source and target branches