@@ -0,0 +1,131 @@
1+/*
2+ * Copyright (C) 2015 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 QtQuick.Layouts 1.1
19+import Ubuntu.Components 1.2
20+import Wizard 0.1
21+import ".." as LocalComponents
22+
23+LocalComponents.Page {
24+ id: tzPage
25+ objectName: "tzPage"
26+
27+ title: i18n.tr("Time Zone")
28+ forwardButtonSourceComponent: forwardButton
29+
30+ readonly property alias selectedTimeZone: tzModel.selectedZoneId
31+
32+ TimeZoneModel {
33+ id: tzModel
34+ }
35+
36+ TimeZoneFilterModel {
37+ id: tzFilterModel
38+ sourceModel: tzModel
39+ filter: searchField.text
40+ }
41+
42+ Component {
43+ id: tzComponent
44+ ListItem {
45+ id: tz
46+ objectName: "tz"
47+ property QtObject tzData: null
48+
49+ Label {
50+ id: cityLabel
51+ text: tzData.city
52+ anchors.left: parent.left
53+ anchors.top: parent.top
54+ }
55+ Label {
56+ id: timeLabel
57+ text: tzData.time
58+ anchors.right: parent.right
59+ anchors.top: parent.top
60+ }
61+ Label {
62+ id: abbrevLabel
63+ text: tzData.abbreviation
64+ anchors.right: parent.right
65+ anchors.top: timeLabel.bottom
66+ }
67+ }
68+ }
69+
70+ Column {
71+ id: column
72+ spacing: units.gu(2)
73+ anchors.leftMargin: leftMargin
74+ anchors.rightMargin: rightMargin
75+ anchors.top: content.top
76+ anchors.bottom: content.bottom
77+ anchors.left: tzPage.left
78+ anchors.right: tzPage.right
79+
80+ TextField {
81+ id: searchField
82+ anchors.left: parent.left
83+ anchors.right: parent.right
84+ placeholderText: i18n.tr("Enter your city")
85+ }
86+
87+ Flickable {
88+ anchors.left: parent.left
89+ anchors.right: parent.right
90+ anchors.topMargin: topMargin
91+ height: column.height - searchField.height - column.spacing - topMargin
92+ contentHeight: contentItem.childrenRect.height
93+ clip: true
94+ flickDeceleration: 1500 * units.gridUnit / 8
95+ maximumFlickVelocity: 2500 * units.gridUnit / 8
96+ boundsBehavior: (contentHeight > height) ? Flickable.DragAndOvershootBounds : Flickable.StopAtBounds
97+
98+ Column {
99+ anchors.left: parent.left
100+ anchors.right: parent.right
101+
102+ Repeater {
103+ id: mainMenu
104+
105+ model: tzFilterModel
106+
107+ delegate: Loader {
108+ id: loader
109+ anchors.left: parent.left
110+ anchors.right: parent.right
111+ height: units.gu(6)
112+ asynchronous: true
113+ sourceComponent: tzComponent
114+
115+ onLoaded: {
116+ item.tzData = Qt.binding(function() { return model; });
117+ }
118+ }
119+ }
120+ }
121+ }
122+ }
123+
124+ Component {
125+ id: forwardButton
126+ LocalComponents.StackButton {
127+ text: i18n.tr("Next")
128+ onClicked: pageStack.next()
129+ }
130+ }
131+}