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

Proposed by Brendan Donegan
Status: Merged
Merged at revision: 2955
Proposed branch: lp:~brendan-donegan/checkbox/xls_report
Merge into: lp:checkbox
Diff against target: 76 lines (+32/-0)
3 files modified
checkbox-gui/checkbox-gui/qml/SubmissionDialog.qml (+2/-0)
checkbox-gui/gui-engine/gui-engine.cpp (+27/-0)
checkbox-gui/gui-engine/gui-engine.h (+3/-0)
To merge this branch: bzr merge lp:~brendan-donegan/checkbox/xls_report
Reviewer Review Type Date Requested Status
Zygmunt Krynicki (community) Needs Information
Daniel Manrique (community) Approve
Review via email: mp+217455@code.launchpad.net

Description of the change

When the submission.xml file is saved, also save the xlsx report.

To post a comment you must log in.
Revision history for this message
Daniel Manrique (roadmr) wrote :

Looks good, I'm OK with the empty options list, we can always change that once we implement client information support on the xlsx exporter (rather, generic option list support).

review: Approve
Revision history for this message
Zygmunt Krynicki (zyga) wrote :

so two questions:

1) Do we want to do that unconditionally?
2) What happens when someone doesn't have python3-xslxwriter installed and the DBus call crashes?

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

(set back to needs review pending answers to Zygmunt's comments - hopefully tarmac will check status *before* doing final merging)

Revision history for this message
Zygmunt Krynicki (zyga) wrote :

(It does)

On Mon, Apr 28, 2014 at 5:13 PM, Daniel Manrique <
<email address hidden>> wrote:

> (set back to needs review pending answers to Zygmunt's comments -
> hopefully tarmac will check status *before* doing final merging)
> --
>
> https://code.launchpad.net/~brendan-donegan/checkbox/xls_report/+merge/217455
> You are reviewing the proposed merge of
> lp:~brendan-donegan/checkbox/xls_report into lp:checkbox.
>

Revision history for this message
Zygmunt Krynicki (zyga) wrote :

Or so I thought :D

On Mon, Apr 28, 2014 at 5:16 PM, <email address hidden> wrote:

> The proposal to merge lp:~brendan-donegan/checkbox/xls_report into
> lp:checkbox has been updated.
>
> Status: Needs review => Merged
>
> For more details, see:
>
> https://code.launchpad.net/~brendan-donegan/checkbox/xls_report/+merge/217455
> --
>
> https://code.launchpad.net/~brendan-donegan/checkbox/xls_report/+merge/217455
> You are reviewing the proposed merge of
> lp:~brendan-donegan/checkbox/xls_report into lp:checkbox.
>

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'checkbox-gui/checkbox-gui/qml/SubmissionDialog.qml'
2--- checkbox-gui/checkbox-gui/qml/SubmissionDialog.qml 2014-04-04 11:05:55 +0000
3+++ checkbox-gui/checkbox-gui/qml/SubmissionDialog.qml 2014-04-28 14:32:31 +0000
4@@ -97,6 +97,8 @@
5 }
6 var success = guiEngine.GuiExportSessionToFileAsXML(export_path,
7 option_list);
8+ var xls_export_path = export_path.replace('.xml', '.xls');
9+ guiEngine.GuiExportSessionToFileAsXLSX(xls_export_path, []);
10 if (submit_to == "certification") {
11 if (success) {
12 dialog.text = guiEngine.SendSubmissionViaCertificationTransport(export_path,
13
14=== modified file 'checkbox-gui/gui-engine/gui-engine.cpp'
15--- checkbox-gui/gui-engine/gui-engine.cpp 2014-04-04 11:05:55 +0000
16+++ checkbox-gui/gui-engine/gui-engine.cpp 2014-04-28 14:32:31 +0000
17@@ -1970,6 +1970,17 @@
18 return ExportSession(m_session,output_format,options);
19 }
20
21+QString GuiEngine::GuiExportSessionAsXLSX(void)
22+{
23+ qDebug("GuiEngine::GuiExportSessionAsXLSX");
24+
25+ QString output_format = "xlsx";
26+ QStringList options; // No options
27+
28+ return ExportSession(m_session,output_format,options);
29+}
30+
31+
32 const QString GuiEngine::ExportSession(const QDBusObjectPath session, \
33 const QString &output_format, \
34 const QStringList& option_list)
35@@ -2041,6 +2052,22 @@
36 return true;
37 }
38
39+bool GuiEngine::GuiExportSessionToFileAsXLSX(const QString& output_file,
40+ const QStringList& option_list)
41+{
42+ QString output_format = "xlsx";
43+
44+ // very basic argument checking
45+ if (output_file.isEmpty()) {
46+ return false;
47+ }
48+
49+ // FIXME - When we get a useful success/failure code here, return to caller
50+ QString done = ExportSessionToFile(m_session,output_format,option_list,output_file);
51+
52+ return true;
53+}
54+
55 const QString GuiEngine::ExportSessionToFile(const QDBusObjectPath session, \
56 const QString &output_format, \
57 const QStringList &option_list, \
58
59=== modified file 'checkbox-gui/gui-engine/gui-engine.h'
60--- checkbox-gui/gui-engine/gui-engine.h 2014-04-04 11:05:55 +0000
61+++ checkbox-gui/gui-engine/gui-engine.h 2014-04-28 14:32:31 +0000
62@@ -162,11 +162,14 @@
63 // Convenience functions for the GUI
64 QString GuiExportSessionAsXML(void);
65 QString GuiExportSessionAsHTML(void);
66+ QString GuiExportSessionAsXLSX(void);
67
68 bool GuiExportSessionToFileAsXML(const QString& output_file,
69 const QStringList& option_list);
70 bool GuiExportSessionToFileAsHTML(const QString& output_file,
71 const QStringList& option_list);
72+ bool GuiExportSessionToFileAsXLSX(const QString& output_file,
73+ const QStringList& option_list);
74
75 const QString SendSubmissionViaCertificationTransport( \
76 const QString &submission_path,

Subscribers

People subscribed via source and target branches