on xenial help sign in
Support new setTimeZone call for uss module
commit128e14608252dee33ade0120236316343d23ef0a authorMichael Terry <michael.terry@canonical.com> dateTue 5 Apr 2016, 15:57 (11 years ago) parent8e46b45
6 files changed+27−11
debian/control+1−1 qml/Wizard/Pages/50-timezone.qml+5−2 tests/mocks/Ubuntu/SystemSettings/TimeDate/CMakeLists.txt+1−1 tests/mocks/Ubuntu/SystemSettings/TimeDate/MockTimeDate.qml+15−3 tests/mocks/Ubuntu/SystemSettings/TimeDate/qmldir+1−1 tests/qmltests/Wizard/tst_Wizard.qml+4−3
debian/control+1−1
@@ -106,7 +106,7 @@ Depends: dmz-cursor-theme,
106106 qtdeclarative5-qtmir-plugin (>= 0.4.8),
107107 qtdeclarative5-ubuntu-telephony0.1,
108108 qtdeclarative5-ubuntu-web-plugin,
109− ubuntu-system-settings,
109+ ubuntu-system-settings (>= 0.4),
110110 unity-launcher-impl-7,
111111 unity8-common (= ${source:Version}),
112112 unity8-private (= ${binary:Version}),
qml/Wizard/Pages/50-timezone.qml+5−2
@@ -18,7 +18,7 @@ import QtQuick 2.4
1818import QtQuick.Layouts 1.1
1919import Ubuntu.Components 1.3
2020import Wizard 0.1
21−import Ubuntu.SystemSettings.TimeDate 1.0
21+import Ubuntu.SystemSettings.TimeDate 1.1
2222import Utils 0.1 as Utils
2323import ".." as LocalComponents
2424
@@ -30,6 +30,7 @@ LocalComponents.Page {
3030 forwardButtonSourceComponent: forwardButton
3131
3232 property string selectedTimeZone: ""
33+ property string selectedTimeZoneName: ""
3334 readonly property bool showingMap: wideMode && width >= units.gu(110)
3435
3536 // for testing
@@ -67,6 +68,7 @@ LocalComponents.Page {
6768
6869 function resetViews() {
6970 selectedTimeZone = ""
71+ selectedTimeZoneName = ""
7072 tzList.currentIndex = -1
7173 highlightImage.source = ""
7274 pinImage.x = 0;
@@ -144,6 +146,7 @@ LocalComponents.Page {
144146 highlightTimezone(offset);
145147 ListView.view.currentIndex = index;
146148 selectedTimeZone = timeZone;
149+ selectedTimeZoneName = city;
147150 //print("Clicked at city with coords:", longitude, latitude);
148151 //print("Clicked on TZ:", timeZone);
149152 //print("Highlight at (x,y):", longitudeToX(longitude, map.width), latitudeToY(latitude, map.height));
@@ -267,7 +270,7 @@ LocalComponents.Page {
267270 text: i18n.tr("Next")
268271 enabled: selectedTimeZone != ""
269272 onClicked: {
270− timeDatePanel.timeZone = selectedTimeZone;
273+ timeDatePanel.setTimeZone(selectedTimeZone, selectedTimeZoneName);
271274 pageStack.next();
272275 }
273276 }
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
1818
1919Item {
2020 id: root
21− property string timeZone: "Europe/Prague"
22− onTimeZoneChanged: root.timeZoneChangedCalled(root.timeZone);
21+ readonly property alias timeZone: d.timeZone
22+ readonly property alias timeZoneName: d.timeZoneName
2323
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+ }
2537}
tests/mocks/Ubuntu/SystemSettings/TimeDate/qmldir+1−1
@@ -1,2 +1,2 @@
11module 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
2121import QMenuModel 0.1
2222import Ubuntu.Components 1.3
2323import Ubuntu.SystemSettings.SecurityPrivacy 1.0
24−import Ubuntu.SystemSettings.TimeDate 1.0
24+import Ubuntu.SystemSettings.TimeDate 1.1
2525import Unity.Test 0.1 as UT
2626import Wizard 0.1
2727import "../../../qml/Wizard"
@@ -463,7 +463,7 @@ Item {
463463 var tzFilter = findChild(page, "tzFilter");
464464 verify(tzFilter);
465465 tap(tzFilter);
466− typeString("London");
466+ typeString("Belfa");
467467
468468 var tzList = findChild(page, "tzList");
469469 verify(tzList);
@@ -477,7 +477,8 @@ Item {
477477 // go next and verify the (mock) signal got fired
478478 tap(findChild(page, "forwardButton"));
479479 tryCompare(timezoneSpy, "count", 1);
480− tryCompare(page.tdModule, "timeZone", timezoneSpy.signalArguments[0][0]);
480+ compare(timezoneSpy.signalArguments[0][0], "Europe/London");
481+ compare(timezoneSpy.signalArguments[0][1], "Belfast");
481482 }
482483
483484 function test_accountPage() {