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
=== modified file 'app/clock/ClockPage.qml'
--- app/clock/ClockPage.qml 2014-10-09 16:38:10 +0000
+++ app/clock/ClockPage.qml 2014-10-09 16:38:10 +0000
@@ -22,7 +22,6 @@
22import "../components"22import "../components"
23import "../upstreamcomponents"23import "../upstreamcomponents"
24import "../worldclock"24import "../worldclock"
25import "../components/Utils.js" as Utils
2625
27PageWithBottomEdge {26PageWithBottomEdge {
28 id: _clockPage27 id: _clockPage
@@ -31,10 +30,13 @@
31 // Property to keep track of the clock mode30 // Property to keep track of the clock mode
32 property alias isDigital: clock.isDigital31 property alias isDigital: clock.isDigital
3332
33 // Property to keep track of the clock time
34 property alias clockTime: clock.analogTime
35
34 flickable: null36 flickable: null
3537
36 Component.onCompleted: {38 Component.onCompleted: {
37 Utils.log(debugMode, "Clock Page loaded")39 console.log("[LOG] Clock Page loaded")
38 _clockPage.setBottomEdgePage(Qt.resolvedUrl("../alarm/AlarmPage.qml"), {})40 _clockPage.setBottomEdgePage(Qt.resolvedUrl("../alarm/AlarmPage.qml"), {})
39 }41 }
4042
4143
=== modified file 'app/clock/MainClock.qml'
--- app/clock/MainClock.qml 2014-10-07 07:52:16 +0000
+++ app/clock/MainClock.qml 2014-10-09 16:38:10 +0000
@@ -17,7 +17,6 @@
17 */17 */
1818
19import QtQuick 2.319import QtQuick 2.3
20import DateTime 1.0
21import Ubuntu.Components 1.120import Ubuntu.Components 1.1
22import "../components"21import "../components"
2322
@@ -30,44 +29,6 @@
3029
31 isMainClock: true30 isMainClock: true
3231
33 Connections {
34 target: clockApp
35 onApplicationStateChanged: {
36 localTimeSource.update()
37 }
38 }
39
40 DateTime {
41 id: localTimeSource
42 updateInterval: 1000
43 }
44
45 /*
46 Create a new Date() object and pass the date, month, year, hour, minute
47 and second received from the DateTime plugin manually to ensure the
48 timezone info is set correctly.
49
50 Javascript Month is 0-11 while QDateTime month is 1-12. Hence the -1
51 is required.
52 */
53
54 /*
55 FIXME: When the upstream QT bug at
56 https://bugreports.qt-project.org/browse/QTBUG-40275 is fixed it will be
57 possible to receive a datetime object directly instead of using this hack.
58 */
59 analogTime: new Date
60 (
61 localTimeSource.localDateString.split(":")[0],
62 localTimeSource.localDateString.split(":")[1]-1,
63 localTimeSource.localDateString.split(":")[2],
64 localTimeSource.localTimeString.split(":")[0],
65 localTimeSource.localTimeString.split(":")[1],
66 localTimeSource.localTimeString.split(":")[2],
67 localTimeSource.localTimeString.split(":")[3]
68 )
69 time: Qt.formatTime(analogTime)
70
71 isDigital: clockModeDocument.contents.digitalMode ? true : false32 isDigital: clockModeDocument.contents.digitalMode ? true : false
7233
73 Component.onCompleted: {34 Component.onCompleted: {
7435
=== modified file 'app/ubuntu-clock-app.qml'
--- app/ubuntu-clock-app.qml 2014-10-09 16:38:10 +0000
+++ app/ubuntu-clock-app.qml 2014-10-09 16:38:10 +0000
@@ -17,6 +17,7 @@
17 */17 */
1818
19import QtQuick 2.319import QtQuick 2.3
20import DateTime 1.0
20import U1db 1.0 as U1db21import U1db 1.0 as U1db
21import Ubuntu.Components 1.122import Ubuntu.Components 1.1
22import "clock"23import "clock"
@@ -80,6 +81,15 @@
80 Component.onCompleted: Utils.log(debugMode, "Alarm Database loaded")81 Component.onCompleted: Utils.log(debugMode, "Alarm Database loaded")
81 }82 }
8283
84 DateTime {
85 id: localTimeSource
86 updateInterval: 1000
87 }
88
89 onApplicationStateChanged: {
90 localTimeSource.update()
91 }
92
83 PageStack {93 PageStack {
84 id: mainStack94 id: mainStack
8595
@@ -97,6 +107,32 @@
97 */107 */
98108
99 /*109 /*
110 Create a new Date() object and pass the date, month, year, hour, minute
111 and second received from the DateTime plugin manually to ensure the
112 timezone info is set correctly.
113
114 Javascript Month is 0-11 while QDateTime month is 1-12. Hence the -1
115 is required.
116 */
117
118 /*
119 FIXME: When the upstream QT bug at
120 https://bugreports.qt-project.org/browse/QTBUG-40275 is fixed it will be
121 possible to receive a datetime object directly instead of using this hack.
122 */
123
124 clockTime: new Date
125 (
126 localTimeSource.localDateString.split(":")[0],
127 localTimeSource.localDateString.split(":")[1]-1,
128 localTimeSource.localDateString.split(":")[2],
129 localTimeSource.localTimeString.split(":")[0],
130 localTimeSource.localTimeString.split(":")[1],
131 localTimeSource.localTimeString.split(":")[2],
132 localTimeSource.localTimeString.split(":")[3]
133 )
134
135 /*
100 #TODO: The bottom edge title should reflect the time to the next136 #TODO: The bottom edge title should reflect the time to the next
101 alarm. For instance it should read "Next alarm in 9h23m".137 alarm. For instance it should read "Next alarm in 9h23m".
102 */138 */
103139
=== modified file 'debian/changelog'
--- debian/changelog 2014-10-09 16:38:10 +0000
+++ debian/changelog 2014-10-09 16:38:10 +0000
@@ -3,6 +3,8 @@
3 [Nekhelesh Ramananthan]3 [Nekhelesh Ramananthan]
4 * Fixed bottom edge hint timeout which made it possible for new users to not notice4 * Fixed bottom edge hint timeout which made it possible for new users to not notice
5 the bottom edge action. (LP: #1357945)5 the bottom edge action. (LP: #1357945)
6 * Moved DateTime object to ubuntu-clock-app.qml so that it can be used in multiple
7 places and avoid the need to duplicate the object.
68
7 [Akiva Shammai Avraham]9 [Akiva Shammai Avraham]
8 * Improved the analog clock performance by updating the clock hands every second10 * Improved the analog clock performance by updating the clock hands every second
911
=== modified file 'po/com.ubuntu.clock.pot'
--- po/com.ubuntu.clock.pot 2014-10-07 08:01:14 +0000
+++ po/com.ubuntu.clock.pot 2014-10-09 16:38:10 +0000
@@ -8,7 +8,7 @@
8msgstr ""8msgstr ""
9"Project-Id-Version: \n"9"Project-Id-Version: \n"
10"Report-Msgid-Bugs-To: \n"10"Report-Msgid-Bugs-To: \n"
11"POT-Creation-Date: 2014-10-07 01:01-0700\n"11"POT-Creation-Date: 2014-10-09 12:00+0200\n"
12"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"12"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
13"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"13"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
14"Language-Team: LANGUAGE <LL@li.org>\n"14"Language-Team: LANGUAGE <LL@li.org>\n"
@@ -42,7 +42,7 @@
42msgid "Delete"42msgid "Delete"
43msgstr ""43msgstr ""
4444
45#: ../app/alarm/AlarmPage.qml:26 ../app/ubuntu-clock-app.qml:10345#: ../app/alarm/AlarmPage.qml:26 ../app/ubuntu-clock-app.qml:139
46msgid "Alarms"46msgid "Alarms"
47msgstr ""47msgstr ""
4848
@@ -141,7 +141,7 @@
141msgid "Delete alarm"141msgid "Delete alarm"
142msgstr ""142msgstr ""
143143
144#: ../app/clock/ClockPage.qml:134144#: ../app/clock/ClockPage.qml:143
145msgid "Location"145msgid "Location"
146msgstr ""146msgstr ""
147147

Subscribers

People subscribed via source and target branches