@@ -18,6 +18,7 @@ import QtQuick 2.3
18import Ubuntu.Components 1.2
18import Ubuntu.Components 1.2
19import Wizard 0.1
19import Wizard 0.1
20import Ubuntu.SystemSettings.TimeDate 1.0
20import Ubuntu.SystemSettings.TimeDate 1.0
21+import Utils 0.1 as Utils
21import ".." as LocalComponents
22import ".." as LocalComponents
23LocalComponents.Page {
24LocalComponents.Page {
@@ -27,21 +28,11 @@ LocalComponents.Page {
27 title: i18n.tr("Time Zone")
28 title: i18n.tr("Time Zone")
28 forwardButtonSourceComponent: forwardButton
29 forwardButtonSourceComponent: forwardButton
30− property alias selectedTimeZone: tzModel.selectedZoneId
31+ property string selectedTimeZone: ""
32 UbuntuTimeDatePanel {
33 UbuntuTimeDatePanel {
33 id: timeDatePanel
34 id: timeDatePanel
40− TimeZoneFilterModel {
43 filter: searchField.text
35 filter: searchField.text
44− country: root.countryCode
47 Component.onCompleted: {
38 Component.onCompleted: {
@@ -61,28 +52,34 @@ LocalComponents.Page {
62 objectName: "tz"
53 objectName: "tz"
63 highlightColor: backgroundColor
54 highlightColor: backgroundColor
64− readonly property bool currentTz: !!id ? selectedTimeZone === id : false
55+ readonly property bool currentTz: ListView.view.currentIndex === index
67 anchors.verticalCenter: parent.verticalCenter
58 anchors.verticalCenter: parent.verticalCenter
68 anchors.left: parent.left
59 anchors.left: parent.left
69 anchors.leftMargin: leftMargin
60 anchors.leftMargin: leftMargin
61+ anchors.right: image.left
62+ anchors.rightMargin: rightMargin
71 id: cityLabel
64 id: cityLabel
72− text: !!city ? city : ""
65+ text: displayName
73 font.weight: tz.currentTz ? Font.Normal : Font.Light
66 font.weight: tz.currentTz ? Font.Normal : Font.Light
74 fontSize: "medium"
67 fontSize: "medium"
75 color: textColor
68 color: textColor
69+ elide: Text.ElideMiddle
78 id: timeLabel
74 id: timeLabel
79− text: !!time ? time + " " + abbreviation : ""
75+ text: Utils.TimezoneFormatter.currentTimeInTimezoneWithAbbrev(timeZone)
80 font.weight: tz.currentTz ? Font.Normal : Font.Light
76 font.weight: tz.currentTz ? Font.Normal : Font.Light
81 fontSize: "small"
77 fontSize: "small"
82 color: textColor
78 color: textColor
87 right: parent.right
84 right: parent.right
88 verticalCenter: parent.verticalCenter
85 verticalCenter: parent.verticalCenter
@@ -96,9 +93,10 @@ LocalComponents.Page {
98 onClicked: {
95 onClicked: {
99− selectedTimeZone = id
96+ print("Clicked index", index)
100− print("Selected tz: " + selectedTimeZone)
97+ ListView.view.currentIndex = index
98+ selectedTimeZone = timeZone
101− print("Clicked country", countryCode)
99+ print("Clicked country", country)
@@ -121,7 +119,9 @@ LocalComponents.Page {
121 inputMethodHints: Qt.ImhNoPredictiveText
119 inputMethodHints: Qt.ImhNoPredictiveText
122 onTextChanged: {
120 onTextChanged: {
123 // reset when switching between filter modes (text/country)
121 // reset when switching between filter modes (text/country)
122+ print("Filter:", text)
124 selectedTimeZone = ""
123 selectedTimeZone = ""
124+ tzList.currentIndex = -1
@@ -139,7 +139,7 @@ LocalComponents.Page {
141 height: column.height - searchField.height - column.spacing - topMargin
141 height: column.height - searchField.height - column.spacing - topMargin
142− model: tzFilterModel
142+ model: timeDatePanel.timeZoneModel
143 delegate: tzComponent
143 delegate: tzComponent