~ubuntu-branches/ubuntu/trusty/checkbox/trusty

« back to all changes in this revision

Viewing changes to checkbox-gui/checkbox-gui/qml/SubmissionDialog.qml

  • Committer: Daniel Manrique
  • Date: 2014-04-09 14:27:44 UTC
  • mfrom: (1992.1.11 ubuntu_checkbox)
  • Revision ID: roadmr@ubuntu.com-20140409142744-tpzj2zlqeuob4sl8
Tags: 0.17.6-0ubuntu6
* Use select_jobs to ensure whitelist order is preserved (LP: #1213893)
* Use partial_id to avoid showing overly-long, namespaced job names
  (LP: #1297500)
* Enable customization of some checkbox-gui parameters (LP: #1303849)
* Send test results to Launchpad (LP: #1302615)

Show diffs side-by-side

added added

removed removed

Lines of Context:
29
29
    id: dialog
30
30
 
31
31
    title: i18n.tr("Report")
32
 
    text: i18n.tr("The following report has be generated for submission to the Launchpad hardware database.")
33
 
 
 
32
    text: settings.value("submission/message", i18n.tr("The following test report has been generated. You may view it now or save it for later."))
 
33
 
 
34
    TextField {
 
35
        RegExpValidator {
 
36
            id: regex_validator
 
37
            regExp: new RegExp(settings.value("submission/regex", ".*"));
 
38
        }
 
39
        function initialize() {
 
40
            var input_type = settings.value("submission/input_type", "")
 
41
            if (input_type == "regex") {
 
42
                validator = regex_validator;
 
43
                visible = true;
 
44
            }
 
45
            else if (input_type == "none") {
 
46
                visible = false;
 
47
            }
 
48
            else {
 
49
                inputMethodHints = Qt.ImhEmailCharactersOnly;
 
50
                visible = true;
 
51
            }
 
52
            var secure_id = settings.value("submission/secure_id","");
 
53
            if (secure_id) {
 
54
                text = secure_id;
 
55
            }
 
56
        }
 
57
 
 
58
        id: upload_input
 
59
        placeholderText: settings.value("submission/input_placeholder", i18n.tr("Launchpad E-Mail Address"))
 
60
        Component.onCompleted: initialize()
 
61
    }
 
62
 
 
63
    Row {
 
64
        function initialize() {
 
65
            if (settings.value("submission/submit_to_hexr","false").toLowerCase() == "true") {
 
66
                visible = true;
 
67
            }
 
68
        }
 
69
 
 
70
        spacing: units.gu(8)
 
71
        visible: false
 
72
        Label {
 
73
            id: submit_to_hexr_label
 
74
            text: i18n.tr("Submit to HEXR:")
 
75
        }
 
76
 
 
77
        CheckBox {
 
78
            id: submit_to_hexr
 
79
            text: i18n.tr("Submit to HEXR:")
 
80
        }
 
81
        Component.onCompleted: initialize()
 
82
 
 
83
    }
34
84
 
35
85
    Button {
36
 
        id: savebutton
37
 
        text: i18n.tr("Save Results")
 
86
        id: submitbutton
 
87
        text: settings.value("submission/ok_btn_text", "Submit Results")
 
88
        enabled: upload_input.acceptableInput
38
89
        color: UbuntuColors.orange
39
90
        onClicked: {
40
 
            var mysavepath = guiEngine.GetSaveFileName();
41
 
            runmanagerview.reportIsSaved = guiEngine.GuiExportSessionToFileAsXML(mysavepath);
 
91
            var submit_to = settings.value("transport/submit_to", "")
 
92
            var export_path = settings.value("exporter/xml_export_path", "/tmp/submission.xml")
 
93
 
 
94
            if (!export_path) {
 
95
                export_path = guiEngine.GetSaveFileName();
 
96
            }
 
97
            var success = guiEngine.GuiExportSessionToFileAsXML(export_path);
 
98
            if (submit_to == "certification") {
 
99
                if (success) {
 
100
                    dialog.text = guiEngine.SendSubmissionViaCertificationTransport(export_path,
 
101
                                                                                    upload_input.text,
 
102
                                                                                    submit_to_hexr.checked);
 
103
                }
 
104
                else {
 
105
                    dialog.text = i18n.tr("Could not export the tests results for uploading.");
 
106
                }
 
107
            }
 
108
            else if (submit_to == "local") {
 
109
                if (success) {
 
110
                    runmanagerview.reportIsSaved = success;
 
111
                }
 
112
            }
 
113
            else {
 
114
                dialog.text = guiEngine.SendSubmissionViaLaunchpadTransport(export_path,
 
115
                                                                            upload_input.text);
 
116
            }
42
117
        }
43
118
    }
44
119
    Button {
49
124
            onClicked:{
50
125
                var mysavepath = '/tmp/report.html';
51
126
                runmanagerview.reportIsSaved = guiEngine.GuiExportSessionToFileAsHTML(mysavepath);
52
 
                cmdTool.exec("xdg-open", mysavepath)
 
127
                Qt.openUrlExternally(mysavepath);
53
128
            }
54
129
        }
55
130
    }
68
143
    Component {
69
144
        id: submission_warning_dialog
70
145
        WarningDialog{
71
 
            text: i18n.tr("You are about to exit this test run without saving your results report.  Do you want to save the report?");
 
146
            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?"))
72
147
 
73
148
            showContinue: false
74
149
            showCheckbox: false