Merge lp:~nik90/ubuntu-clock-app/performance-patch-1 into lp:ubuntu-clock-app/saucy
- performance-patch-1
- Merge into saucy
Status: | Merged |
---|---|
Approved by: | Nekhelesh Ramananthan |
Approved revision: | 350 |
Merged at revision: | 347 |
Proposed branch: | lp:~nik90/ubuntu-clock-app/performance-patch-1 |
Merge into: | lp:ubuntu-clock-app/saucy |
Diff against target: |
394 lines (+119/-46) 7 files modified
alarm/AlarmPage.qml (+3/-1) clock/ClockPage.qml (+6/-6) clock/WorldClock.qml (+2/-2) common/SettingsPage.qml (+24/-3) stopwatch/StopwatchPage.qml (+5/-1) timer/TimerPage.qml (+5/-1) ubuntu-clock-app.qml (+74/-32) |
To merge this branch: | bzr merge lp:~nik90/ubuntu-clock-app/performance-patch-1 |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Riccardo Padovani | Approve | ||
Alan Pope πΊπ§π± π¦ (community) | Approve | ||
Ubuntu Phone Apps Jenkins Bot | continuous-integration | Approve | |
Review via email: mp+207119@code.launchpad.net |
Commit message
Improved the IDLE performance of the clock app. Added a settings option to hide/show the seconds hand.
Description of the change
Dynamically loads tabs using QML Loaders ensuring there is only one tab in memory at any time. This has improve the IDLE performance of the clock app significantly. It has resulted in the IDLE CPU usage reduction from 2.6-4.0% to 0%.
It also adds an settings option to show/hide the seconds hand.
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) wrote : | # |
- 350. By Nekhelesh Ramananthan
-
Fixed invalid call to clock page
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) wrote : | # |
PASSED: Continuous integration, rev:350
http://
Executed test runs:
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
Alan Pope πΊπ§π± π¦ (popey) wrote : | # |
Looks good.
Riccardo Padovani (rpadovani) wrote : | # |
lgtm, great work :-)
Colin Ian King (colin-king) wrote : | # |
Thanks!
Preview Diff
1 | === modified file 'alarm/AlarmPage.qml' | |||
2 | --- alarm/AlarmPage.qml 2014-02-13 20:46:28 +0000 | |||
3 | +++ alarm/AlarmPage.qml 2014-02-19 09:59:28 +0000 | |||
4 | @@ -26,6 +26,7 @@ | |||
5 | 26 | id: alarmPage | 26 | id: alarmPage |
6 | 27 | objectName: "alarmPage" | 27 | objectName: "alarmPage" |
7 | 28 | 28 | ||
8 | 29 | readonly property real alarmHeaderHeight: units.gu(9.5) | ||
9 | 29 | property string currentTime | 30 | property string currentTime |
10 | 30 | property alias modelCount: listSavedAlarm.count | 31 | property alias modelCount: listSavedAlarm.count |
11 | 31 | property int enabledAlarmCount: 0 | 32 | property int enabledAlarmCount: 0 |
12 | @@ -38,6 +39,7 @@ | |||
13 | 38 | tempPosition = clockAnimationContainer.contentY | 39 | tempPosition = clockAnimationContainer.contentY |
14 | 39 | currentTime = Utils.convertTime(new Date().getHours(), new Date().getMinutes(), new Date().getUTCSeconds(), appSetting.contents.timeFormat) | 40 | currentTime = Utils.convertTime(new Date().getHours(), new Date().getMinutes(), new Date().getUTCSeconds(), appSetting.contents.timeFormat) |
15 | 40 | } | 41 | } |
16 | 42 | Component.onDestruction: Utils.log("AlarmPage unloaded") | ||
17 | 41 | 43 | ||
18 | 42 | onModelCountChanged: modelCount == 0 ? clockAnimationContainer.contentY = tempPosition : undefined | 44 | onModelCountChanged: modelCount == 0 ? clockAnimationContainer.contentY = tempPosition : undefined |
19 | 43 | 45 | ||
20 | @@ -173,7 +175,7 @@ | |||
21 | 173 | Column { | 175 | Column { |
22 | 174 | id: listAlarm | 176 | id: listAlarm |
23 | 175 | 177 | ||
25 | 176 | property int dynamicTopSpacing: alarmPage.height - alarmPage.header.height - alarmFace.height - savedAlarmHeader.height - alarmFace.anchors.topMargin - divider.height; | 178 | property int dynamicTopSpacing: alarmPage.height - alarmHeaderHeight - alarmFace.height - savedAlarmHeader.height - alarmFace.anchors.topMargin - divider.height; |
26 | 177 | 179 | ||
27 | 178 | height: childrenRect.height | 180 | height: childrenRect.height |
28 | 179 | visible: listSavedAlarm.count != 0 ? true : false | 181 | visible: listSavedAlarm.count != 0 ? true : false |
29 | 180 | 182 | ||
30 | === modified file 'clock/ClockPage.qml' | |||
31 | --- clock/ClockPage.qml 2014-02-11 11:58:51 +0000 | |||
32 | +++ clock/ClockPage.qml 2014-02-19 09:59:28 +0000 | |||
33 | @@ -30,6 +30,7 @@ | |||
34 | 30 | id: clockPage | 30 | id: clockPage |
35 | 31 | 31 | ||
36 | 32 | // Property to hold the formatted time string to show on the screen | 32 | // Property to hold the formatted time string to show on the screen |
37 | 33 | readonly property real clockHeaderHeight: units.gu(9.5) | ||
38 | 33 | property string currentTimeFormatted | 34 | property string currentTimeFormatted |
39 | 34 | property string currentDate | 35 | property string currentDate |
40 | 35 | property real currentUTCTime | 36 | property real currentUTCTime |
41 | @@ -76,6 +77,7 @@ | |||
42 | 76 | Utils.log("Saved Current Location: " + currentLocation.contents.city); | 77 | Utils.log("Saved Current Location: " + currentLocation.contents.city); |
43 | 77 | Utils.log("Saved Current Location Coordinates: " + currentLocation.contents.lng + "," + currentLocation.contents.lat) | 78 | Utils.log("Saved Current Location Coordinates: " + currentLocation.contents.lng + "," + currentLocation.contents.lat) |
44 | 78 | } | 79 | } |
45 | 80 | Component.onDestruction: Utils.log("ClockPage unloaded") | ||
46 | 79 | 81 | ||
47 | 80 | actions: [ | 82 | actions: [ |
48 | 81 | Action { | 83 | Action { |
49 | @@ -178,17 +180,15 @@ | |||
50 | 178 | horizontalCenter: parent.horizontalCenter | 180 | horizontalCenter: parent.horizontalCenter |
51 | 179 | } | 181 | } |
52 | 180 | 182 | ||
53 | 183 | showSecondHand: appSetting.contents.seconds === "true" ? true : false | ||
54 | 181 | innerLabel.text: currentTimeFormatted | 184 | innerLabel.text: currentTimeFormatted |
55 | 182 | innerLabel.font.pixelSize: appSetting.contents.timeFormat === "12-hour" ? units.dp(31): units.dp(41) | 185 | innerLabel.font.pixelSize: appSetting.contents.timeFormat === "12-hour" ? units.dp(31): units.dp(41) |
56 | 183 | 186 | ||
57 | 184 | hours: new Date().getHours() * 5 | ||
58 | 185 | minutes: new Date().getMinutes() | ||
59 | 186 | seconds: new Date().getUTCSeconds() | ||
60 | 187 | |||
61 | 188 | function timeChanged(now) { | 187 | function timeChanged(now) { |
62 | 189 | hours = now.getHours() * 5 | 188 | hours = now.getHours() * 5 |
63 | 190 | minutes = now.getMinutes() | 189 | minutes = now.getMinutes() |
65 | 191 | seconds = now.getUTCSeconds(); | 190 | if (appSetting.contents.seconds === "true") |
66 | 191 | seconds = now.getUTCSeconds(); | ||
67 | 192 | } | 192 | } |
68 | 193 | 193 | ||
69 | 194 | onClicked: { | 194 | onClicked: { |
70 | @@ -254,7 +254,7 @@ | |||
71 | 254 | Column { | 254 | Column { |
72 | 255 | id: savedWorldClock | 255 | id: savedWorldClock |
73 | 256 | 256 | ||
75 | 257 | property int dynamicTopSpacing: clockPage.height - clockPage.header.height - clockFace.height - worldLocationHeader.height - clockFace.anchors.topMargin - divider.height; | 257 | property int dynamicTopSpacing: clockPage.height - clockHeaderHeight - clockFace.height - worldLocationHeader.height - clockFace.anchors.topMargin - divider.height; |
76 | 258 | 258 | ||
77 | 259 | height: childrenRect.height; | 259 | height: childrenRect.height; |
78 | 260 | anchors { left:parent.left; right:parent.right; top: clockFace.bottom; topMargin: savedWorldClock.dynamicTopSpacing } | 260 | anchors { left:parent.left; right:parent.right; top: clockFace.bottom; topMargin: savedWorldClock.dynamicTopSpacing } |
79 | 261 | 261 | ||
80 | === modified file 'clock/WorldClock.qml' | |||
81 | --- clock/WorldClock.qml 2014-02-05 14:41:21 +0000 | |||
82 | +++ clock/WorldClock.qml 2014-02-19 09:59:28 +0000 | |||
83 | @@ -66,9 +66,9 @@ | |||
84 | 66 | onStatusChanged: { | 66 | onStatusChanged: { |
85 | 67 | if(status == XmlListModel.Ready && worldClocks.city != "null") { | 67 | if(status == XmlListModel.Ready && worldClocks.city != "null") { |
86 | 68 | if (isWorldCity) | 68 | if (isWorldCity) |
88 | 69 | clockPage.addWorldLocation(worldClocks.city, getTimeDifference(cityDetailsModel.get(0).time), worldClocks.lng, worldClocks.lat) | 69 | clockLoader.item.addWorldLocation(worldClocks.city, getTimeDifference(cityDetailsModel.get(0).time), worldClocks.lng, worldClocks.lat) |
89 | 70 | else | 70 | else |
91 | 71 | clockPage.updateCurrentLocation(worldClocks.city, worldClocks.lng, worldClocks.lat) | 71 | clockLoader.item.updateCurrentLocation(worldClocks.city, worldClocks.lng, worldClocks.lat) |
92 | 72 | worldClocks.clearUserSearch(); | 72 | worldClocks.clearUserSearch(); |
93 | 73 | pageStack.pop() | 73 | pageStack.pop() |
94 | 74 | } | 74 | } |
95 | 75 | 75 | ||
96 | === modified file 'common/SettingsPage.qml' | |||
97 | --- common/SettingsPage.qml 2014-02-01 15:30:26 +0000 | |||
98 | +++ common/SettingsPage.qml 2014-02-19 09:59:28 +0000 | |||
99 | @@ -18,7 +18,7 @@ | |||
100 | 18 | 18 | ||
101 | 19 | import QtQuick 2.0 | 19 | import QtQuick 2.0 |
102 | 20 | import Ubuntu.Components 0.1 | 20 | import Ubuntu.Components 0.1 |
104 | 21 | import Ubuntu.Components.ListItems 0.1 as ListItem | 21 | import Ubuntu.Components.ListItems 0.1 |
105 | 22 | 22 | ||
106 | 23 | Page { | 23 | Page { |
107 | 24 | id: settingsPage | 24 | id: settingsPage |
108 | @@ -35,13 +35,34 @@ | |||
109 | 35 | margins: units.gu(2) | 35 | margins: units.gu(2) |
110 | 36 | } | 36 | } |
111 | 37 | 37 | ||
112 | 38 | Standard { | ||
113 | 39 | id: secondsOption | ||
114 | 40 | |||
115 | 41 | text: "Show Seconds" | ||
116 | 42 | showDivider: false | ||
117 | 43 | anchors { | ||
118 | 44 | left: parent.left | ||
119 | 45 | right: parent.right | ||
120 | 46 | margins: units.gu(-2) | ||
121 | 47 | } | ||
122 | 48 | |||
123 | 49 | control: Switch { | ||
124 | 50 | checked: appSetting.contents.seconds === "true" ? true : false | ||
125 | 51 | onClicked: { | ||
126 | 52 | var settings = JSON.parse(JSON.stringify(appSetting.contents)) | ||
127 | 53 | settings.seconds = checked === true ? "true" : "false" | ||
128 | 54 | appSetting.contents = settings | ||
129 | 55 | } | ||
130 | 56 | } | ||
131 | 57 | } | ||
132 | 58 | |||
133 | 38 | OptionSelector { | 59 | OptionSelector { |
134 | 39 | id: timeFormat | 60 | id: timeFormat |
135 | 40 | text: "Time Format" | 61 | text: "Time Format" |
136 | 41 | model: ["12-hour", "24-hour"] | 62 | model: ["12-hour", "24-hour"] |
137 | 42 | selectedIndex: appSetting.contents.timeFormat === "12-hour" ? 0 : 1 | 63 | selectedIndex: appSetting.contents.timeFormat === "12-hour" ? 0 : 1 |
138 | 43 | onSelectedIndexChanged: { | 64 | onSelectedIndexChanged: { |
140 | 44 | var settings = appSetting.contents | 65 | var settings = JSON.parse(JSON.stringify(appSetting.contents)) |
141 | 45 | settings.timeFormat = selectedIndex === 0 ? "12-hour" : "24-hour" | 66 | settings.timeFormat = selectedIndex === 0 ? "12-hour" : "24-hour" |
142 | 46 | appSetting.contents = settings | 67 | appSetting.contents = settings |
143 | 47 | } | 68 | } |
144 | @@ -55,7 +76,7 @@ | |||
145 | 55 | enabled: false | 76 | enabled: false |
146 | 56 | selectedIndex: appSetting.contents.style === "analogue" ? 0 : 1 | 77 | selectedIndex: appSetting.contents.style === "analogue" ? 0 : 1 |
147 | 57 | onSelectedIndexChanged: { | 78 | onSelectedIndexChanged: { |
149 | 58 | var settings = appSetting.contents | 79 | var settings = JSON.parse(JSON.stringify(appSetting.contents)) |
150 | 59 | settings.style = selectedIndex === 0 ? "analogue" : "digital" | 80 | settings.style = selectedIndex === 0 ? "analogue" : "digital" |
151 | 60 | appSetting.contents = settings | 81 | appSetting.contents = settings |
152 | 61 | } | 82 | } |
153 | 62 | 83 | ||
154 | === modified file 'stopwatch/StopwatchPage.qml' | |||
155 | --- stopwatch/StopwatchPage.qml 2014-02-11 13:27:34 +0000 | |||
156 | +++ stopwatch/StopwatchPage.qml 2014-02-19 09:59:28 +0000 | |||
157 | @@ -28,9 +28,13 @@ | |||
158 | 28 | Page { | 28 | Page { |
159 | 29 | id: stopwatchPage | 29 | id: stopwatchPage |
160 | 30 | 30 | ||
161 | 31 | readonly property real stopwatchHeaderHeight: units.gu(9.5) | ||
162 | 31 | property alias lapStart: laps.lapStart | 32 | property alias lapStart: laps.lapStart |
163 | 33 | property bool isRunning: analogStopwatch.timerStatus && | ||
164 | 34 | analogStopwatch.hours !== 0 || analogStopwatch.minutes !== 0 || analogStopwatch.seconds !== 0 || analogStopwatch.milliseconds !== 0 | ||
165 | 32 | 35 | ||
166 | 33 | Component.onCompleted: Utils.log("StopwatchPage loaded"); | 36 | Component.onCompleted: Utils.log("StopwatchPage loaded"); |
167 | 37 | Component.onDestruction: Utils.log("Stopwatch unloaded"); | ||
168 | 34 | 38 | ||
169 | 35 | // Function to create a lap | 39 | // Function to create a lap |
170 | 36 | function create_lap() { | 40 | function create_lap() { |
171 | @@ -166,7 +170,7 @@ | |||
172 | 166 | id: listLap | 170 | id: listLap |
173 | 167 | lapModel: laps | 171 | lapModel: laps |
174 | 168 | anchors { left: parent.left; right: parent.right; top: analogStopwatch.bottom; topMargin: listLap.dynamicTopSpacing } | 172 | anchors { left: parent.left; right: parent.right; top: analogStopwatch.bottom; topMargin: listLap.dynamicTopSpacing } |
176 | 169 | dynamicTopSpacing: stopwatchPage.height - stopwatchPage.header.height - analogStopwatch.height - headerHeight - analogStopwatch.anchors.topMargin - dividerHeight; | 173 | dynamicTopSpacing: stopwatchPage.height - stopwatchHeaderHeight - analogStopwatch.height - headerHeight - analogStopwatch.anchors.topMargin - dividerHeight; |
177 | 170 | } | 174 | } |
178 | 171 | } | 175 | } |
179 | 172 | } | 176 | } |
180 | 173 | 177 | ||
181 | === modified file 'timer/TimerPage.qml' | |||
182 | --- timer/TimerPage.qml 2014-02-11 09:48:53 +0000 | |||
183 | +++ timer/TimerPage.qml 2014-02-19 09:59:28 +0000 | |||
184 | @@ -28,12 +28,14 @@ | |||
185 | 28 | Page { | 28 | Page { |
186 | 29 | id: timerPage | 29 | id: timerPage |
187 | 30 | 30 | ||
188 | 31 | readonly property real timerHeaderHeight: units.gu(9.5) | ||
189 | 31 | property alias minutes: analogTimer.minutes; | 32 | property alias minutes: analogTimer.minutes; |
190 | 32 | property alias seconds: analogTimer.seconds; | 33 | property alias seconds: analogTimer.seconds; |
191 | 33 | property alias totalTime: analogTimer.totalTime; | 34 | property alias totalTime: analogTimer.totalTime; |
192 | 34 | property alias timerOn: analogTimer.timerOn; | 35 | property alias timerOn: analogTimer.timerOn; |
193 | 35 | property real tempPosition | 36 | property real tempPosition |
194 | 36 | property bool setFocus: false | 37 | property bool setFocus: false |
195 | 38 | property bool isRunning: analogTimer.state !== "" || timerPage.state !== "" || analogTimer.minutes !== 0 || analogTimer.seconds !== 0 | ||
196 | 37 | 39 | ||
197 | 38 | // Default Timer Presets as defined by the design team | 40 | // Default Timer Presets as defined by the design team |
198 | 39 | U1db.Document { | 41 | U1db.Document { |
199 | @@ -166,6 +168,7 @@ | |||
200 | 166 | Utils.log("TimerPage loaded"); | 168 | Utils.log("TimerPage loaded"); |
201 | 167 | tempPosition = timerAnimationContainer.contentY | 169 | tempPosition = timerAnimationContainer.contentY |
202 | 168 | } | 170 | } |
203 | 171 | Component.onDestruction: Utils.log("TimerPage unloaded") | ||
204 | 169 | 172 | ||
205 | 170 | Flickable { | 173 | Flickable { |
206 | 171 | id: timerAnimationContainer | 174 | id: timerAnimationContainer |
207 | @@ -209,6 +212,7 @@ | |||
208 | 209 | onMinutesChanged: innerLabel.text = setTimerLabel(minutes, seconds); | 212 | onMinutesChanged: innerLabel.text = setTimerLabel(minutes, seconds); |
209 | 210 | onSecondsChanged: if (timerOn == true) seconds_timer.restart() | 213 | onSecondsChanged: if (timerOn == true) seconds_timer.restart() |
210 | 211 | else innerLabel.text = setTimerLabel(minutes, seconds); | 214 | else innerLabel.text = setTimerLabel(minutes, seconds); |
211 | 215 | |||
212 | 212 | states:[ | 216 | states:[ |
213 | 213 | State { name: "STOP" }, | 217 | State { name: "STOP" }, |
214 | 214 | State { name: "PAUSE"}, | 218 | State { name: "PAUSE"}, |
215 | @@ -287,7 +291,7 @@ | |||
216 | 287 | model: timers | 291 | model: timers |
217 | 288 | visible: listCount !== 0 | 292 | visible: listCount !== 0 |
218 | 289 | anchors { left: parent.left; right: parent.right; top: analogTimer.bottom; topMargin: listPreset.dynamicTopSpacing } | 293 | anchors { left: parent.left; right: parent.right; top: analogTimer.bottom; topMargin: listPreset.dynamicTopSpacing } |
220 | 290 | dynamicTopSpacing: timerPage.height - timerPage.header.height - analogTimer.height - analogTimer.anchors.topMargin - headerHeight - dividerHeight; | 294 | dynamicTopSpacing: timerPage.height - timerHeaderHeight - analogTimer.height - analogTimer.anchors.topMargin - headerHeight - dividerHeight; |
221 | 291 | } | 295 | } |
222 | 292 | } | 296 | } |
223 | 293 | 297 | ||
224 | 294 | 298 | ||
225 | === modified file 'ubuntu-clock-app.qml' | |||
226 | --- ubuntu-clock-app.qml 2014-02-11 13:54:38 +0000 | |||
227 | +++ ubuntu-clock-app.qml 2014-02-19 09:59:28 +0000 | |||
228 | @@ -47,11 +47,11 @@ | |||
229 | 47 | footerColor: "#D75669" | 47 | footerColor: "#D75669" |
230 | 48 | 48 | ||
231 | 49 | focus: true | 49 | focus: true |
237 | 50 | Keys.onReturnPressed: Keyboard.enterShortcut(event, rootTabs.selectedTabIndex, stopwatchPage) | 50 | Keys.onReturnPressed: Keyboard.enterShortcut(event, rootTabs.selectedTabIndex, stopwatchLoader.item) |
238 | 51 | Keys.onEnterPressed: Keyboard.enterShortcut(event, rootTabs.selectedTabIndex, stopwatchPage) | 51 | Keys.onEnterPressed: Keyboard.enterShortcut(event, rootTabs.selectedTabIndex, stopwatchLoader.item) |
239 | 52 | Keys.onSpacePressed: Keyboard.spaceShortcut(event, rootTabs.selectedTabIndex, stopwatchPage) | 52 | Keys.onSpacePressed: Keyboard.spaceShortcut(event, rootTabs.selectedTabIndex, stopwatchLoader.item) |
240 | 53 | Keys.onEscapePressed: Keyboard.escapeShortcut(event, rootTabs.selectedTabIndex, pagestack, timerPage, stopwatchPage) | 53 | Keys.onEscapePressed: Keyboard.escapeShortcut(event, rootTabs.selectedTabIndex, pagestack, timerLoader.item, stopwatchLoader.item) |
241 | 54 | Keys.onPressed: rootTabs.selectedTabIndex = Keyboard.generalShortcuts(event, rootTabs.count, rootTabs.selectedTabIndex, pagestack, timerPage, stopwatchPage) | 54 | Keys.onPressed: rootTabs.selectedTabIndex = Keyboard.generalShortcuts(event, rootTabs.count, rootTabs.selectedTabIndex, pagestack, timerLoader.item, stopwatchLoader.item) |
242 | 55 | 55 | ||
243 | 56 | // Property to store the default application dimensions | 56 | // Property to store the default application dimensions |
244 | 57 | readonly property real minimumWidth: units.gu(50) | 57 | readonly property real minimumWidth: units.gu(50) |
245 | @@ -98,20 +98,12 @@ | |||
246 | 98 | 98 | ||
247 | 99 | onTriggered: { | 99 | onTriggered: { |
248 | 100 | now = new Date(); | 100 | now = new Date(); |
263 | 101 | // FIXME: only send callback to pages that need it | 101 | if(clockLoader.source != "") |
264 | 102 | /* TODO: this timer should probably be changed to fire | 102 | clockLoader.item.onTimerUpdate(now); |
265 | 103 | every minute (max) when the app is in the background, | 103 | if(alarmLoader.source != "") |
266 | 104 | or just be activated when the app is visible in the | 104 | alarmLoader.item.onTimerUpdate(now); |
267 | 105 | switcher | 105 | if(timerLoader.source != "") |
268 | 106 | */ | 106 | timerLoader.item.onTimerUpdate(now); |
255 | 107 | clockPage.onTimerUpdate(now); | ||
256 | 108 | alarmPage.onTimerUpdate(now); | ||
257 | 109 | timerPage.onTimerUpdate(now); | ||
258 | 110 | |||
259 | 111 | /* stopwatchPage.onTimerUpdate(now) is not required since | ||
260 | 112 | there is an inbuilt stopwatch timer which runs at a | ||
261 | 113 | higher frequency. | ||
262 | 114 | */ | ||
269 | 115 | } | 107 | } |
270 | 116 | } | 108 | } |
271 | 117 | 109 | ||
272 | @@ -127,7 +119,7 @@ | |||
273 | 127 | database: db | 119 | database: db |
274 | 128 | docId: "appSettings" | 120 | docId: "appSettings" |
275 | 129 | create: true | 121 | create: true |
277 | 130 | defaults: { "timeFormat": "12-hour", "style": "analogue" } | 122 | defaults: { "timeFormat": "12-hour", "style": "analogue", "seconds": "false" } |
278 | 131 | } | 123 | } |
279 | 132 | 124 | ||
280 | 133 | //////////////////////////////////////////////////////////////////////////////// | 125 | //////////////////////////////////////////////////////////////////////////////// |
281 | @@ -143,51 +135,101 @@ | |||
282 | 143 | objectName: "rootTabs" | 135 | objectName: "rootTabs" |
283 | 144 | anchors.fill: parent | 136 | anchors.fill: parent |
284 | 145 | 137 | ||
285 | 138 | onSelectedTabChanged: { | ||
286 | 139 | if(rootTabs.selectedTab === stopwatchTab) | ||
287 | 140 | stopwatchLoader.source = Qt.resolvedUrl("stopwatch/StopwatchPage.qml") | ||
288 | 141 | else if(stopwatchLoader.source != "" && !stopwatchLoader.item.isRunning) | ||
289 | 142 | stopwatchLoader.source = "" | ||
290 | 143 | |||
291 | 144 | if(rootTabs.selectedTab === timerTab) | ||
292 | 145 | timerLoader.source = Qt.resolvedUrl("timer/TimerPage.qml") | ||
293 | 146 | else if(timerLoader.source != "" && !timerLoader.item.isRunning) | ||
294 | 147 | timerLoader.source = "" | ||
295 | 148 | |||
296 | 149 | if(rootTabs.selectedTab === alarmTab) | ||
297 | 150 | alarmLoader.source = Qt.resolvedUrl("alarm/AlarmPage.qml") | ||
298 | 151 | else | ||
299 | 152 | alarmLoader.source = "" | ||
300 | 153 | |||
301 | 154 | if(rootTabs.selectedTab === clockTab) | ||
302 | 155 | clockLoader.source = Qt.resolvedUrl("clock/ClockPage.qml") | ||
303 | 156 | else | ||
304 | 157 | clockLoader.source = "" | ||
305 | 158 | } | ||
306 | 159 | |||
307 | 146 | Tab { | 160 | Tab { |
308 | 161 | id: clockTab | ||
309 | 147 | objectName: "ClockTab" | 162 | objectName: "ClockTab" |
310 | 148 | 163 | ||
311 | 149 | title: i18n.tr("Clock") | 164 | title: i18n.tr("Clock") |
312 | 150 | 165 | ||
313 | 151 | // Tab content begins here | 166 | // Tab content begins here |
316 | 152 | page: ClockPage { | 167 | page: Loader { |
317 | 153 | id: clockPage | 168 | id: clockLoader |
318 | 169 | parent: clockTab | ||
319 | 170 | anchors { | ||
320 | 171 | left: parent.left | ||
321 | 172 | right: parent.right | ||
322 | 173 | bottom: parent.bottom | ||
323 | 174 | } | ||
324 | 154 | } | 175 | } |
325 | 155 | } | 176 | } |
326 | 156 | 177 | ||
327 | 157 | // Disabled Alarm Tab until the feature is ready for use. | 178 | // Disabled Alarm Tab until the feature is ready for use. |
328 | 158 | Tab { | 179 | Tab { |
329 | 180 | id: alarmTab | ||
330 | 159 | objectName: "AlarmTab" | 181 | objectName: "AlarmTab" |
331 | 160 | 182 | ||
332 | 161 | title: i18n.tr("Alarm") | 183 | title: i18n.tr("Alarm") |
333 | 162 | 184 | ||
336 | 163 | page: AlarmPage { | 185 | AlarmModel { |
337 | 164 | id: alarmPage | 186 | id: alarmModel |
338 | 187 | Component.onCompleted: Utils.log("Alarm Database loaded") | ||
339 | 188 | onModelReset: if (alarmLoader.source != "") alarmLoader.item.get_next_active_alarm() | ||
340 | 189 | } | ||
341 | 165 | 190 | ||
346 | 166 | AlarmModel { | 191 | page: Loader { |
347 | 167 | id: alarmModel | 192 | id: alarmLoader |
348 | 168 | Component.onCompleted: Utils.log("Alarm Database loaded") | 193 | parent: alarmTab |
349 | 169 | onModelReset: alarmPage.get_next_active_alarm() | 194 | anchors { |
350 | 195 | left: parent.left | ||
351 | 196 | right: parent.right | ||
352 | 197 | bottom: parent.bottom | ||
353 | 170 | } | 198 | } |
354 | 171 | } | 199 | } |
355 | 172 | } | 200 | } |
356 | 173 | 201 | ||
357 | 174 | Tab { | 202 | Tab { |
358 | 203 | id: timerTab | ||
359 | 175 | objectName: "TimerTab" | 204 | objectName: "TimerTab" |
360 | 176 | 205 | ||
361 | 177 | title: i18n.tr("Timer") | 206 | title: i18n.tr("Timer") |
362 | 178 | 207 | ||
365 | 179 | page: TimerPage { | 208 | page: Loader { |
366 | 180 | id: timerPage | 209 | id: timerLoader |
367 | 210 | parent: timerTab | ||
368 | 211 | anchors { | ||
369 | 212 | left: parent.left | ||
370 | 213 | right: parent.right | ||
371 | 214 | bottom: parent.bottom | ||
372 | 215 | } | ||
373 | 181 | } | 216 | } |
374 | 182 | } | 217 | } |
375 | 183 | 218 | ||
376 | 184 | Tab { | 219 | Tab { |
377 | 220 | id: stopwatchTab | ||
378 | 185 | objectName: "StopwatchTab" | 221 | objectName: "StopwatchTab" |
379 | 186 | 222 | ||
380 | 187 | title: i18n.tr("Stopwatch") | 223 | title: i18n.tr("Stopwatch") |
381 | 188 | 224 | ||
384 | 189 | page: StopwatchPage { | 225 | page: Loader { |
385 | 190 | id: stopwatchPage | 226 | id: stopwatchLoader |
386 | 227 | parent: stopwatchTab | ||
387 | 228 | anchors { | ||
388 | 229 | left: parent.left | ||
389 | 230 | right: parent.right | ||
390 | 231 | bottom: parent.bottom | ||
391 | 232 | } | ||
392 | 191 | } | 233 | } |
393 | 192 | } | 234 | } |
394 | 193 | } | 235 | } |
FAILED: Continuous integration, rev:349 91.189. 93.70:8080/ job/ubuntu- clock-app- ci/264/ 91.189. 93.70:8080/ job/generic- mediumtests- trusty/ 1406 91.189. 93.70:8080/ job/ubuntu- clock-app- raring- amd64-ci/ 264 91.189. 93.70:8080/ job/ubuntu- clock-app- saucy-amd64- ci/264 91.189. 93.70:8080/ job/ubuntu- clock-app- trusty- amd64-ci/ 182
http://
Executed test runs:
UNSTABLE: http://
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
Click here to trigger a rebuild: 91.189. 93.70:8080/ job/ubuntu- clock-app- ci/264/ rebuild
http://