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
=== modified file 'checkbox-gui/checkbox-gui/main.cpp'
--- checkbox-gui/checkbox-gui/main.cpp 2014-03-19 13:48:36 +0000
+++ checkbox-gui/checkbox-gui/main.cpp 2014-04-01 23:41:12 +0000
@@ -54,6 +54,7 @@
5454
55 // Register the applicationName with the QML runtime55 // Register the applicationName with the QML runtime
56 viewer.rootContext()->setContextProperty("applicationName", applicationName);56 viewer.rootContext()->setContextProperty("applicationName", applicationName);
57 viewer.rootContext()->setContextProperty("client_name", applicationName);
5758
58 // Register the GuiEngine with the QML runtime59 // Register the GuiEngine with the QML runtime
59 viewer.rootContext()->setContextProperty("guiEngine", &guiengine);60 viewer.rootContext()->setContextProperty("guiEngine", &guiengine);
6061
=== modified file 'checkbox-gui/checkbox-gui/qml/SubmissionDialog.qml'
--- checkbox-gui/checkbox-gui/qml/SubmissionDialog.qml 2014-03-20 11:17:53 +0000
+++ checkbox-gui/checkbox-gui/qml/SubmissionDialog.qml 2014-04-01 23:41:12 +0000
@@ -90,11 +90,13 @@
90 onClicked: {90 onClicked: {
91 var submit_to = settings.value("transport/submit_to", "")91 var submit_to = settings.value("transport/submit_to", "")
92 var export_path = settings.value("exporter/xml_export_path", "")92 var export_path = settings.value("exporter/xml_export_path", "")
93 var option_list = new Array("client-name=" + client_name);
9394
94 if (!export_path) {95 if (!export_path) {
95 export_path = guiEngine.GetSaveFileName();96 export_path = guiEngine.GetSaveFileName();
96 }97 }
97 var success = guiEngine.GuiExportSessionToFileAsXML(export_path);98 var success = guiEngine.GuiExportSessionToFileAsXML(export_path,
99 option_list);
98 if (submit_to == "certification") {100 if (submit_to == "certification") {
99 if (success) {101 if (success) {
100 dialog.text = guiEngine.SendSubmissionViaCertificationTransport(export_path,102 dialog.text = guiEngine.SendSubmissionViaCertificationTransport(export_path,
@@ -117,8 +119,10 @@
117 onClicked: {119 onClicked: {
118 onClicked:{120 onClicked:{
119 var mysavepath = '/tmp/report.html';121 var mysavepath = '/tmp/report.html';
120 runmanagerview.reportIsSaved = guiEngine.GuiExportSessionToFileAsHTML(mysavepath);122 var option_list = new Array("client-name=" + client_name);
121 Qt.openUrlExternally(mysavepath)123 runmanagerview.reportIsSaved = guiEngine.GuiExportSessionToFileAsHTML(mysavepath,
124 option_list);
125 Qt.openUrlExternally(mysavepath);
122 }126 }
123 }127 }
124 }128 }
125129
=== modified file 'checkbox-gui/gui-engine/gui-engine.cpp'
--- checkbox-gui/gui-engine/gui-engine.cpp 2014-03-20 10:35:19 +0000
+++ checkbox-gui/gui-engine/gui-engine.cpp 2014-04-01 23:41:12 +0000
@@ -2009,10 +2009,10 @@
2009 return reply;2009 return reply;
2010}2010}
20112011
2012bool GuiEngine::GuiExportSessionToFileAsXML(const QString& output_file)2012bool GuiEngine::GuiExportSessionToFileAsXML(const QString& output_file,
2013 const QStringList& option_list)
2013{2014{
2014 QString output_format = "xml";2015 QString output_format = "xml";
2015 QStringList options; // No options
20162016
2017 // very basic argument checking2017 // very basic argument checking
2018 if (output_file.isEmpty()) {2018 if (output_file.isEmpty()) {
@@ -2020,15 +2020,15 @@
2020 }2020 }
20212021
2022 // FIXME - When we get a useful success/failure code here, return to caller2022 // FIXME - When we get a useful success/failure code here, return to caller
2023 QString done = ExportSessionToFile(m_session,output_format,options,output_file);2023 QString done = ExportSessionToFile(m_session,output_format,option_list,output_file);
20242024
2025 return true;2025 return true;
2026}2026}
20272027
2028bool GuiEngine::GuiExportSessionToFileAsHTML(const QString& output_file)2028bool GuiEngine::GuiExportSessionToFileAsHTML(const QString& output_file,
2029 const QStringList& option_list)
2029{2030{
2030 QString output_format = "html";2031 QString output_format = "html";
2031 QStringList options; // No options
20322032
2033 // very basic argument checking2033 // very basic argument checking
2034 if (output_file.isEmpty()) {2034 if (output_file.isEmpty()) {
@@ -2036,7 +2036,7 @@
2036 }2036 }
20372037
2038 // FIXME - When we get a useful success/failure code here, return to caller2038 // FIXME - When we get a useful success/failure code here, return to caller
2039 QString done = ExportSessionToFile(m_session,output_format,options,output_file);2039 QString done = ExportSessionToFile(m_session,output_format,option_list,output_file);
20402040
2041 return true;2041 return true;
2042}2042}
20432043
=== modified file 'checkbox-gui/gui-engine/gui-engine.h'
--- checkbox-gui/gui-engine/gui-engine.h 2014-03-20 10:35:19 +0000
+++ checkbox-gui/gui-engine/gui-engine.h 2014-04-01 23:41:12 +0000
@@ -163,8 +163,10 @@
163 QString GuiExportSessionAsXML(void);163 QString GuiExportSessionAsXML(void);
164 QString GuiExportSessionAsHTML(void);164 QString GuiExportSessionAsHTML(void);
165165
166 bool GuiExportSessionToFileAsXML(const QString& output_file);166 bool GuiExportSessionToFileAsXML(const QString& output_file,
167 bool GuiExportSessionToFileAsHTML(const QString& output_file);167 const QStringList& option_list);
168 bool GuiExportSessionToFileAsHTML(const QString& output_file,
169 const QStringList& option_list);
168 170
169 const QString SendSubmissionViaCertificationTransport( \171 const QString SendSubmissionViaCertificationTransport( \
170 const QString &submission_path,172 const QString &submission_path,

Subscribers

People subscribed via source and target branches