on xenial help sign in
Support new setTimeZone call for uss module
128e146Michael Terry
debian/control+1−1
@@ -106,7 +106,7 @@ Depends: dmz-cursor-theme,
106 qtdeclarative5-qtmir-plugin (>= 0.4.8),
106 qtdeclarative5-qtmir-plugin (>= 0.4.8),
107 qtdeclarative5-ubuntu-telephony0.1,
107 qtdeclarative5-ubuntu-telephony0.1,
108 qtdeclarative5-ubuntu-web-plugin,
108 qtdeclarative5-ubuntu-web-plugin,
109− ubuntu-system-settings,
109+ ubuntu-system-settings (>= 0.4),
110 unity-launcher-impl-7,
110 unity-launcher-impl-7,
111 unity8-common (= ${source:Version}),
111 unity8-common (= ${source:Version}),
112 unity8-private (= ${binary:Version}),
112 unity8-private (= ${binary:Version}),
qml/Wizard/Pages/50-timezone.qml+5−2
@@ -18,7 +18,7 @@ import QtQuick 2.4
18import QtQuick.Layouts 1.1
18import QtQuick.Layouts 1.1
19import Ubuntu.Components 1.3
19import Ubuntu.Components 1.3
20import Wizard 0.1
20import Wizard 0.1
21−import Ubuntu.SystemSettings.TimeDate 1.0
21+import Ubuntu.SystemSettings.TimeDate 1.1
22import Utils 0.1 as Utils
22import Utils 0.1 as Utils
23import ".." as LocalComponents
23import ".." as LocalComponents
24
24
@@ -30,6 +30,7 @@ LocalComponents.Page {
30 forwardButtonSourceComponent: forwardButton
30 forwardButtonSourceComponent: forwardButton
31
31
32 property string selectedTimeZone: ""
32 property string selectedTimeZone: ""
33+ property string selectedTimeZoneName: ""
33 readonly property bool showingMap: wideMode && width >= units.gu(110)
34 readonly property bool showingMap: wideMode && width >= units.gu(110)
34
35
35 // for testing
36 // for testing
@@ -67,6 +68,7 @@ LocalComponents.Page {
67
68
68 function resetViews() {
69 function resetViews() {
69 selectedTimeZone = ""
70 selectedTimeZone = ""
71+ selectedTimeZoneName = ""
70 tzList.currentIndex = -1
72 tzList.currentIndex = -1
71 highlightImage.source = ""
73 highlightImage.source = ""
72 pinImage.x = 0;
74 pinImage.x = 0;
@@ -144,6 +146,7 @@ LocalComponents.Page {
144 highlightTimezone(offset);
146 highlightTimezone(offset);
145 ListView.view.currentIndex = index;
147 ListView.view.currentIndex = index;
146 selectedTimeZone = timeZone;
148 selectedTimeZone = timeZone;
149+ selectedTimeZoneName = city;
147 //print("Clicked at city with coords:", longitude, latitude);
150 //print("Clicked at city with coords:", longitude, latitude);
148 //print("Clicked on TZ:", timeZone);
151 //print("Clicked on TZ:", timeZone);
149 //print("Highlight at (x,y):", longitudeToX(longitude, map.width), latitudeToY(latitude, map.height));
152 //print("Highlight at (x,y):", longitudeToX(longitude, map.width), latitudeToY(latitude, map.height));
@@ -267,7 +270,7 @@ LocalComponents.Page {
267 text: i18n.tr("Next")
270 text: i18n.tr("Next")
268 enabled: selectedTimeZone != ""
271 enabled: selectedTimeZone != ""
269 onClicked: {
272 onClicked: {
270− timeDatePanel.timeZone = selectedTimeZone;
273+ timeDatePanel.setTimeZone(selectedTimeZone, selectedTimeZoneName);
271 pageStack.next();
274 pageStack.next();
272 }
275 }
273 }
276 }
tests/mocks/Ubuntu/SystemSettings/TimeDate/CMakeLists.txt+1−1
@@ -1 +1 @@
1−add_unity8_mock(Ubuntu.SystemSettings.TimeDate 1.0 Ubuntu/SystemSettings/TimeDate)
1+add_unity8_mock(Ubuntu.SystemSettings.TimeDate 1.1 Ubuntu/SystemSettings/TimeDate)
tests/mocks/Ubuntu/SystemSettings/TimeDate/MockTimeDate.qml+15−3
@@ -18,8 +18,20 @@ import QtQuick 2.4
18
18
19Item {
19Item {
20 id: root
20 id: root
21− property string timeZone: "Europe/Prague"
21+ readonly property alias timeZone: d.timeZone
22− onTimeZoneChanged: root.timeZoneChangedCalled(root.timeZone);
22+ readonly property alias timeZoneName: d.timeZoneName
23
23
24− signal timeZoneChangedCalled(string tz);
24+ signal timeZoneChangedCalled(string tz, string name) // only in mock
25+
26+ function setTimeZone(tz, name) {
27+ d.timeZone = tz;
28+ d.timeZoneName = name;
29+ timeZoneChangedCalled(tz, name);
30+ }
31+
32+ QtObject {
33+ id: d
34+ property string timeZone: "Europe/Prague"
35+ property string timeZoneName: "Prague"
36+ }
25}
37}
tests/mocks/Ubuntu/SystemSettings/TimeDate/qmldir+1−1
@@ -1,2 +1,2 @@
1module Ubuntu.SystemSettings.TimeDate
1module Ubuntu.SystemSettings.TimeDate
2−UbuntuTimeDatePanel 1.0 MockTimeDate.qml
2+UbuntuTimeDatePanel 1.1 MockTimeDate.qml
tests/qmltests/Wizard/tst_Wizard.qml+4−3
@@ -21,7 +21,7 @@ import MeeGo.QOfono 0.2
21import QMenuModel 0.1
21import QMenuModel 0.1
22import Ubuntu.Components 1.3
22import Ubuntu.Components 1.3
23import Ubuntu.SystemSettings.SecurityPrivacy 1.0
23import Ubuntu.SystemSettings.SecurityPrivacy 1.0
24−import Ubuntu.SystemSettings.TimeDate 1.0
24+import Ubuntu.SystemSettings.TimeDate 1.1
25import Unity.Test 0.1 as UT
25import Unity.Test 0.1 as UT
26import Wizard 0.1
26import Wizard 0.1
27import "../../../qml/Wizard"
27import "../../../qml/Wizard"
@@ -463,7 +463,7 @@ Item {
463 var tzFilter = findChild(page, "tzFilter");
463 var tzFilter = findChild(page, "tzFilter");
464 verify(tzFilter);
464 verify(tzFilter);
465 tap(tzFilter);
465 tap(tzFilter);
466− typeString("London");
466+ typeString("Belfa");
467
467
468 var tzList = findChild(page, "tzList");
468 var tzList = findChild(page, "tzList");
469 verify(tzList);
469 verify(tzList);
@@ -477,7 +477,8 @@ Item {
477 // go next and verify the (mock) signal got fired
477 // go next and verify the (mock) signal got fired
478 tap(findChild(page, "forwardButton"));
478 tap(findChild(page, "forwardButton"));
479 tryCompare(timezoneSpy, "count", 1);
479 tryCompare(timezoneSpy, "count", 1);
480+ compare(timezoneSpy.signalArguments[0][0], "Europe/London");
480− tryCompare(page.tdModule, "timeZone", timezoneSpy.signalArguments[0][0]);
481+ compare(timezoneSpy.signalArguments[0][1], "Belfast");
481 }
482 }
482
483
483 function test_accountPage() {
484 function test_accountPage() {