~jocave/checkbox/hybrid-amd-gpu-mods

« back to all changes in this revision

Viewing changes to checkbox-touch/components/TestVerificationPage.qml

  • Committer: Zygmunt Krynicki
  • Date: 2013-05-29 07:50:30 UTC
  • mto: This revision was merged to the branch mainline in revision 2153.
  • Revision ID: zygmunt.krynicki@canonical.com-20130529075030-ngwz245hs2u3y6us
checkbox: move current checkbox code into checkbox-old

This patch cleans up the top-level directory of the project into dedicated
sub-project directories. One for checkbox-old (the current checkbox and all the
associated stuff), one for plainbox and another for checkbox-ng.

There are some associated changes, such as updating the 'source' mode of
checkbox provider in plainbox, and fixing paths in various test scripts that we
have.

Signed-off-by: Zygmunt Krynicki <zygmunt.krynicki@canonical.com>

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/*
2
 
 * This file is part of Checkbox
3
 
 *
4
 
 * Copyright 2014, 2015 Canonical Ltd.
5
 
 *
6
 
 * Authors:
7
 
 * - Maciej Kisielewski <maciej.kisielewski@canonical.com>
8
 
 *
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.
12
 
 *
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.
17
 
 *
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/>.
20
 
 */
21
 
 
22
 
/*! \brief Test verification page
23
 
 
24
 
    This page asks user whether the action was completed successfully
25
 
    See design document at: http://goo.gl/ghR9wL
26
 
*/
27
 
 
28
 
import QtQuick 2.0
29
 
import Ubuntu.Components 1.1
30
 
import QtQuick.Layouts 1.1
31
 
import Ubuntu.Components.Popups 0.1
32
 
import "actions"
33
 
 
34
 
Page {
35
 
    id: testVerification
36
 
    property var test: { "name": "", "verificationDescription": "", "test_number": 0, "tests_count": 0}
37
 
 
38
 
    signal testDone(var test);
39
 
 
40
 
    objectName: "testVerificationPage"
41
 
    title: i18n.tr("Verification")
42
 
 
43
 
    head {
44
 
        actions: [
45
 
            AddCommentAction {},
46
 
            SkipAction {}
47
 
        ]
48
 
    }
49
 
 
50
 
    TestPageBody {
51
 
        header: test["name"]
52
 
        body: test["verificationDescription"]
53
 
 
54
 
        Button {
55
 
            id: showOutputButton
56
 
            objectName: "showOutputButton"
57
 
            visible: ((test["command"]) ? true : false)
58
 
            color: "white"
59
 
            Layout.fillWidth: true
60
 
            text: "Output"
61
 
            onClicked: {
62
 
                pageStack.push(commandOutputPage);
63
 
            }
64
 
        }
65
 
 
66
 
        LatchButton {
67
 
            id: passButton
68
 
            objectName: "passButton"
69
 
            unlatchedColor: UbuntuColors.green
70
 
            Layout.fillWidth: true
71
 
            // TRANSLATORS: this string is on a button that marks the given test as passed
72
 
            text: i18n.tr("Pass")
73
 
            onLatchedClicked: {
74
 
                test["outcome"] = "pass";
75
 
                latchingTestDone();
76
 
 
77
 
            }
78
 
        }
79
 
 
80
 
        LatchButton {
81
 
            id: failButton
82
 
            objectName: "failButton"
83
 
            unlatchedColor: UbuntuColors.red
84
 
            Layout.fillWidth: true
85
 
            // TRANSLATORS: this string is on a button that marks the given test as failed
86
 
            text: i18n.tr("Fail")
87
 
            onLatchedClicked: {
88
 
                test["outcome"] = "fail";
89
 
                latchingTestDone();
90
 
            }
91
 
        }
92
 
    }
93
 
 
94
 
    function latchingTestDone() {
95
 
        passButton.state = "latched";
96
 
        failButton.state = "latched";
97
 
        testDone(test);
98
 
    }
99
 
}