2
* This file is part of Checkbox
4
* Copyright 2013 Canonical Ltd.
7
* - Julia Segal <julia.segal@cellsoftware.co.uk>
9
* This program is free software; you can redistribute it and/or modify
10
* it under the terms of the GNU General Public License as published by
11
* the Free Software Foundation; version 3.
13
* This program is distributed in the hope that it will be useful,
14
* but WITHOUT ANY WARRANTY; without even the implied warranty of
15
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16
* GNU General Public License for more details.
18
* You should have received a copy of the GNU General Public License
19
* along with this program. If not, see <http://www.gnu.org/licenses/>.
24
import Ubuntu.Components 0.1
25
import Ubuntu.Components.Popups 0.1
31
title: i18n.tr("Report")
32
text: settings.value("submission/message", i18n.tr("The following test report has been generated for submission to Launchpad. You may also view it or save it."))
37
regExp: new RegExp(settings.value("submission/regex", ".*"));
39
function initialize() {
40
var input_type = settings.value("submission/input_type", "")
41
if (input_type == "regex") {
42
validator = regex_validator;
45
else if (input_type == "none") {
49
inputMethodHints = Qt.ImhEmailCharactersOnly;
52
var secure_id = settings.value("submission/secure_id","");
59
placeholderText: settings.value("submission/input_placeholder", i18n.tr("Launchpad E-Mail Address"))
60
Component.onCompleted: initialize()
64
function initialize() {
65
if (settings.value("submission/submit_to_hexr","false").toLowerCase() == "true") {
73
id: submit_to_hexr_label
74
text: i18n.tr("Submit to HEXR:")
79
text: i18n.tr("Submit to HEXR:")
81
Component.onCompleted: initialize()
87
text: settings.value("submission/ok_btn_text", i18n.tr("Submit Results"))
88
enabled: upload_input.acceptableInput
89
color: UbuntuColors.orange
91
var submit_to = settings.value("transport/submit_to", "")
92
var export_path = settings.value("exporter/xml_export_path", "/tmp/submission.xml")
94
if (submit_to == "certification") {
95
if (updater.success) {
96
dialog.text = guiEngine.SendSubmissionViaCertificationTransport(export_path,
98
submit_to_hexr.checked);
101
dialog.text = i18n.tr("Could not export the tests results for uploading.");
105
dialog.text = guiEngine.SendSubmissionViaLaunchpadTransport(export_path,
112
function initialize() {
113
reportTypeModel.append({"type": "xml", "name": i18n.tr("XML Report (*.xml)")})
114
reportTypeModel.append({"type": "xlsx", "name": i18n.tr("XLSX Report (*.xlsx)")})
115
reportTypeModel.append({"type": "json", "name": i18n.tr("JSON Report (*.json)")})
119
Component.onCompleted: initialize()
123
id: reportTypeDelegate
124
OptionSelectorDelegate {
131
model: reportTypeModel
132
delegate: reportTypeDelegate
137
text: i18n.tr("Save Report")
138
color: UbuntuColors.lightAubergine
140
var option_list = new Array("client-name=" + client_name, "with-certification-status");
142
if (reportTypeSelect.selectedIndex == 0) {
143
var exporter_unit = settings.value("exporter/XML", "2013.com.canonical.plainbox::hexr")
144
var path = guiEngine.GetSaveFileName('submission.xml',
145
i18n.tr("XML files (*.xml)"))
146
success = guiEngine.GuiExportSessionToFileAsXML(path,
150
else if (reportTypeSelect.selectedIndex == 1) {
151
var exporter_unit = settings.value("exporter/XLSX", "2013.com.canonical.plainbox::xlsx")
152
var path = guiEngine.GetSaveFileName('submission.xlsx',
153
i18n.tr("XLSX files (*.xlsx)"))
154
success = guiEngine.GuiExportSessionToFileAsXLSX(path, ["with-sys-info", "with-summary", "with-job-description", "with-text-attachments"], exporter_unit);
156
else if (reportTypeSelect.selectedIndex == 2) {
157
var exporter_unit = settings.value("exporter/JSON", "2013.com.canonical.plainbox::json")
158
var path = guiEngine.GetSaveFileName('submission.json',
159
i18n.tr("JSON files (*.json)"))
160
success = guiEngine.GuiExportSessionToFileAsJSON(path, ["with-certification-status", "with-job-defs", "with-io-log", "with-comments"], exporter_unit);
164
runmanagerview.reportIsSaved = success;
171
text: i18n.tr("View Results")
172
color: UbuntuColors.lightAubergine
175
var mysavepath = '/tmp/report.html';
176
var exporter_unit = settings.value("exporter/HTML", "2013.com.canonical.plainbox::html")
177
var option_list = new Array("client-name=" + client_name, "with-certification-status");
178
runmanagerview.reportIsSaved = guiEngine.GuiExportSessionToFileAsHTML(mysavepath,
181
Qt.openUrlExternally(mysavepath);
187
text: i18n.tr("Done")
188
color: UbuntuColors.warmGrey
190
if (!runmanagerview.reportIsSaved)
191
PopupUtils.open(submission_warning_dialog, donebutton);
193
PopupUtils.close(dialog)
198
id: submission_warning_dialog
200
text: settings.value("submission/cancel_warning", i18n.tr("You are about to exit this test run without saving your results report. Do you want to save the report?"))
205
onCancel: PopupUtils.close(dialog)