Merge lp:~nik90/ubuntu-clock-app/10-alarm-change into lp:ubuntu-clock-app

Proposed by Nekhelesh Ramananthan
Status: Merged
Approved by: Nekhelesh Ramananthan
Approved revision: 106
Merged at revision: 132
Proposed branch: lp:~nik90/ubuntu-clock-app/10-alarm-change
Merge into: lp:ubuntu-clock-app
Prerequisite: lp:~nik90/ubuntu-clock-app/sync-bottomedge-sep08
Diff against target: 187 lines (+45/-44)
5 files modified
app/clock/ClockPage.qml (+4/-2)
app/clock/MainClock.qml (+0/-39)
app/ubuntu-clock-app.qml (+36/-0)
debian/changelog (+2/-0)
po/com.ubuntu.clock.pot (+3/-3)
To merge this branch: bzr merge lp:~nik90/ubuntu-clock-app/10-alarm-change
Reviewer Review Type Date Requested Status
Ubuntu Phone Apps Jenkins Bot continuous-integration Approve
Riccardo Padovani Approve
Nekhelesh Ramananthan Needs Fixing
Review via email: mp+237040@code.launchpad.net

Commit message

Moved the datetime object from clockPage.qml to ubuntu-clock-app.qml which will help in using one common datetime object for multiple purposes and improve performance when adding features in the upcoming branches.

Description of the change

Moves the datetime object from clockPage.qml to ubuntu-clock-app.qml which will help in using one common datetime object for multiple purposes and improve performance when adding features in the upcoming branches.

This is a pre-requisite change for the upcoming feature implementations.

To post a comment you must log in.
Revision history for this message
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Nekhelesh Ramananthan (nik90) wrote :

#blocked on Jenkins. This requires a patch to the Jenkins environment since the xvfb package which is used to run the clock app tests takes input focus away from the clock app when it is launched. This is causing the AP tests to be pass. Francis and Nicholas have been informed. Once jenkins is fixed, we should be good to merge this branch.

review: Needs Fixing
Revision history for this message
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Riccardo Padovani (rpadovani) wrote :

Tested, lgtm

review: Approve
105. By Nekhelesh Ramananthan

Merged prerequisite branch

106. By Nekhelesh Ramananthan

Updated debian changelog

Revision history for this message
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) wrote :
review: Approve (continuous-integration)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'app/clock/ClockPage.qml'
2--- app/clock/ClockPage.qml 2014-10-09 16:38:10 +0000
3+++ app/clock/ClockPage.qml 2014-10-09 16:38:10 +0000
4@@ -22,7 +22,6 @@
5 import "../components"
6 import "../upstreamcomponents"
7 import "../worldclock"
8-import "../components/Utils.js" as Utils
9
10 PageWithBottomEdge {
11 id: _clockPage
12@@ -31,10 +30,13 @@
13 // Property to keep track of the clock mode
14 property alias isDigital: clock.isDigital
15
16+ // Property to keep track of the clock time
17+ property alias clockTime: clock.analogTime
18+
19 flickable: null
20
21 Component.onCompleted: {
22- Utils.log(debugMode, "Clock Page loaded")
23+ console.log("[LOG] Clock Page loaded")
24 _clockPage.setBottomEdgePage(Qt.resolvedUrl("../alarm/AlarmPage.qml"), {})
25 }
26
27
28=== modified file 'app/clock/MainClock.qml'
29--- app/clock/MainClock.qml 2014-10-07 07:52:16 +0000
30+++ app/clock/MainClock.qml 2014-10-09 16:38:10 +0000
31@@ -17,7 +17,6 @@
32 */
33
34 import QtQuick 2.3
35-import DateTime 1.0
36 import Ubuntu.Components 1.1
37 import "../components"
38
39@@ -30,44 +29,6 @@
40
41 isMainClock: true
42
43- Connections {
44- target: clockApp
45- onApplicationStateChanged: {
46- localTimeSource.update()
47- }
48- }
49-
50- DateTime {
51- id: localTimeSource
52- updateInterval: 1000
53- }
54-
55- /*
56- Create a new Date() object and pass the date, month, year, hour, minute
57- and second received from the DateTime plugin manually to ensure the
58- timezone info is set correctly.
59-
60- Javascript Month is 0-11 while QDateTime month is 1-12. Hence the -1
61- is required.
62- */
63-
64- /*
65- FIXME: When the upstream QT bug at
66- https://bugreports.qt-project.org/browse/QTBUG-40275 is fixed it will be
67- possible to receive a datetime object directly instead of using this hack.
68- */
69- analogTime: new Date
70- (
71- localTimeSource.localDateString.split(":")[0],
72- localTimeSource.localDateString.split(":")[1]-1,
73- localTimeSource.localDateString.split(":")[2],
74- localTimeSource.localTimeString.split(":")[0],
75- localTimeSource.localTimeString.split(":")[1],
76- localTimeSource.localTimeString.split(":")[2],
77- localTimeSource.localTimeString.split(":")[3]
78- )
79- time: Qt.formatTime(analogTime)
80-
81 isDigital: clockModeDocument.contents.digitalMode ? true : false
82
83 Component.onCompleted: {
84
85=== modified file 'app/ubuntu-clock-app.qml'
86--- app/ubuntu-clock-app.qml 2014-10-09 16:38:10 +0000
87+++ app/ubuntu-clock-app.qml 2014-10-09 16:38:10 +0000
88@@ -17,6 +17,7 @@
89 */
90
91 import QtQuick 2.3
92+import DateTime 1.0
93 import U1db 1.0 as U1db
94 import Ubuntu.Components 1.1
95 import "clock"
96@@ -80,6 +81,15 @@
97 Component.onCompleted: Utils.log(debugMode, "Alarm Database loaded")
98 }
99
100+ DateTime {
101+ id: localTimeSource
102+ updateInterval: 1000
103+ }
104+
105+ onApplicationStateChanged: {
106+ localTimeSource.update()
107+ }
108+
109 PageStack {
110 id: mainStack
111
112@@ -97,6 +107,32 @@
113 */
114
115 /*
116+ Create a new Date() object and pass the date, month, year, hour, minute
117+ and second received from the DateTime plugin manually to ensure the
118+ timezone info is set correctly.
119+
120+ Javascript Month is 0-11 while QDateTime month is 1-12. Hence the -1
121+ is required.
122+ */
123+
124+ /*
125+ FIXME: When the upstream QT bug at
126+ https://bugreports.qt-project.org/browse/QTBUG-40275 is fixed it will be
127+ possible to receive a datetime object directly instead of using this hack.
128+ */
129+
130+ clockTime: new Date
131+ (
132+ localTimeSource.localDateString.split(":")[0],
133+ localTimeSource.localDateString.split(":")[1]-1,
134+ localTimeSource.localDateString.split(":")[2],
135+ localTimeSource.localTimeString.split(":")[0],
136+ localTimeSource.localTimeString.split(":")[1],
137+ localTimeSource.localTimeString.split(":")[2],
138+ localTimeSource.localTimeString.split(":")[3]
139+ )
140+
141+ /*
142 #TODO: The bottom edge title should reflect the time to the next
143 alarm. For instance it should read "Next alarm in 9h23m".
144 */
145
146=== modified file 'debian/changelog'
147--- debian/changelog 2014-10-09 16:38:10 +0000
148+++ debian/changelog 2014-10-09 16:38:10 +0000
149@@ -3,6 +3,8 @@
150 [Nekhelesh Ramananthan]
151 * Fixed bottom edge hint timeout which made it possible for new users to not notice
152 the bottom edge action. (LP: #1357945)
153+ * Moved DateTime object to ubuntu-clock-app.qml so that it can be used in multiple
154+ places and avoid the need to duplicate the object.
155
156 [Akiva Shammai Avraham]
157 * Improved the analog clock performance by updating the clock hands every second
158
159=== modified file 'po/com.ubuntu.clock.pot'
160--- po/com.ubuntu.clock.pot 2014-10-07 08:01:14 +0000
161+++ po/com.ubuntu.clock.pot 2014-10-09 16:38:10 +0000
162@@ -8,7 +8,7 @@
163 msgstr ""
164 "Project-Id-Version: \n"
165 "Report-Msgid-Bugs-To: \n"
166-"POT-Creation-Date: 2014-10-07 01:01-0700\n"
167+"POT-Creation-Date: 2014-10-09 12:00+0200\n"
168 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
169 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
170 "Language-Team: LANGUAGE <LL@li.org>\n"
171@@ -42,7 +42,7 @@
172 msgid "Delete"
173 msgstr ""
174
175-#: ../app/alarm/AlarmPage.qml:26 ../app/ubuntu-clock-app.qml:103
176+#: ../app/alarm/AlarmPage.qml:26 ../app/ubuntu-clock-app.qml:139
177 msgid "Alarms"
178 msgstr ""
179
180@@ -141,7 +141,7 @@
181 msgid "Delete alarm"
182 msgstr ""
183
184-#: ../app/clock/ClockPage.qml:134
185+#: ../app/clock/ClockPage.qml:143
186 msgid "Location"
187 msgstr ""
188

Subscribers

People subscribed via source and target branches