~osomon/ubuntu-system-settings/autopkgtest

« back to all changes in this revision

Viewing changes to wizard/qml/Pages/10-welcome.qml

  • Committer: CI bot
  • Author(s): Michael Terry
  • Date: 2014-12-02 19:39:44 UTC
  • mfrom: (1202.1.2 drop-wizard)
  • Revision ID: ps-jenkins@lists.canonical.com-20141202193944-iv7x24asrsor6tyi
Drop wizard code from ubuntu-system-settings, moving it to unity8. 
Approved by: Ken VanDine

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/*
2
 
 * Copyright (C) 2013 Canonical, Ltd.
3
 
 *
4
 
 * This program is free software; you can redistribute it and/or modify
5
 
 * it under the terms of the GNU General Public License as published by
6
 
 * the Free Software Foundation; version 3.
7
 
 *
8
 
 * This program is distributed in the hope that it will be useful,
9
 
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10
 
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
11
 
 * GNU General Public License for more details.
12
 
 *
13
 
 * You should have received a copy of the GNU General Public License
14
 
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
15
 
 */
16
 
 
17
 
import QtQuick 2.3
18
 
import Ubuntu.Components 1.1
19
 
import Ubuntu.Components.ListItems 0.1
20
 
import Ubuntu.SystemSettings.LanguagePlugin 1.0
21
 
import Ubuntu.SystemSettings.Wizard.Utils 0.1
22
 
import "../Components" as LocalComponents
23
 
 
24
 
LocalComponents.Page {
25
 
    title: i18n.tr("Hi!")
26
 
    forwardButtonSourceComponent: forwardButton
27
 
 
28
 
    UbuntuLanguagePlugin {
29
 
        id: plugin
30
 
    }
31
 
 
32
 
    Column {
33
 
        id: column
34
 
        anchors.fill: content
35
 
        spacing: units.gu(1)
36
 
 
37
 
        Label {
38
 
            id: label1
39
 
            anchors.left: parent.left
40
 
            anchors.right: parent.right
41
 
            wrapMode: Text.Wrap
42
 
            text: i18n.tr("Welcome to your Ubuntu phone.")
43
 
        }
44
 
 
45
 
        Label {
46
 
            id: label2
47
 
            anchors.left: parent.left
48
 
            anchors.right: parent.right
49
 
            wrapMode: Text.Wrap
50
 
            text: i18n.tr("Let’s get started.")
51
 
        }
52
 
 
53
 
        Item { // spacer
54
 
            height: units.gu(2)
55
 
            width: units.gu(1) // needed else it will be ignored
56
 
        }
57
 
 
58
 
        ComboButton {
59
 
            id: combo
60
 
            anchors.left: parent.left
61
 
            anchors.right: parent.right
62
 
            text: listview.currentItem.text
63
 
            onClicked: expanded = !expanded
64
 
            expandedHeight: column.height - combo.y
65
 
            UbuntuListView {
66
 
                id: listview
67
 
                model: plugin.languageNames
68
 
                currentIndex: plugin.currentLanguage
69
 
                delegate: Standard {
70
 
                    text: modelData
71
 
                    onClicked: {
72
 
                        listview.currentIndex = index
73
 
                        combo.expanded = false
74
 
                        i18n.language = plugin.languageCodes[index]
75
 
                        i18n.domain = i18n.domain
76
 
                    }
77
 
                }
78
 
            }
79
 
        }
80
 
    }
81
 
 
82
 
    Component {
83
 
        id: forwardButton
84
 
        LocalComponents.StackButton {
85
 
            text: i18n.tr("Continue")
86
 
            onClicked: {
87
 
                plugin.currentLanguage = listview.currentIndex
88
 
                System.updateSessionLanguage()
89
 
                pageStack.next()
90
 
            }
91
 
        }
92
 
    }
93
 
}