Merge lp:~nik90/ubuntu-clock-app/add-hud-support into lp:ubuntu-clock-app/saucy

Proposed by Nekhelesh Ramananthan
Status: Merged
Approved by: Paolo Rotolo
Approved revision: 187
Merged at revision: 192
Proposed branch: lp:~nik90/ubuntu-clock-app/add-hud-support
Merge into: lp:ubuntu-clock-app/saucy
Diff against target: 149 lines (+58/-38)
2 files modified
clock/ClockPage.qml (+13/-6)
timer/TimerPage.qml (+45/-32)
To merge this branch: bzr merge lp:~nik90/ubuntu-clock-app/add-hud-support
Reviewer Review Type Date Requested Status
Paolo Rotolo (community) Approve
Ubuntu Phone Apps Jenkins Bot continuous-integration Approve
Review via email: mp+184626@code.launchpad.net

Commit message

Added HUD action support to the existing toolbar buttons.

Description of the change

This MP adds HUD support to the existing toolbar actions.

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: Approve (continuous-integration)
Revision history for this message
Paolo Rotolo (paolorotolo) wrote :

lgtm

review: Approve
Revision history for this message
Nekhelesh Ramananthan (nik90) wrote :

feel free to approve it at the top (shown by status). Jenkins will then merge it :)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'clock/ClockPage.qml'
--- clock/ClockPage.qml 2013-09-03 21:06:12 +0000
+++ clock/ClockPage.qml 2013-09-09 17:09:25 +0000
@@ -47,6 +47,17 @@
47 updateTime();47 updateTime();
48 }48 }
4949
50 actions: [
51 Action {
52 id: addCityAction
53 text: i18n.tr("Add City")
54 keywords: i18n.tr("Add;Timezone;Timezones;World;City;Cities;Town;Towns;Place;Places;Location;Locations;Time;Locale;Local;Current")
55 description: "Add a world city"
56 iconSource: Qt.resolvedUrl("../images/add_icon.png")
57 onTriggered: pagestack.push(Qt.resolvedUrl("WorldPage.qml"))
58 }
59 ]
60
50 function onTimerUpdate(now) {61 function onTimerUpdate(now) {
51 currentTimeFormatted = Qt.formatTime(new Date(currentTimeStamp + (diff * 60000)), "hh:mm")62 currentTimeFormatted = Qt.formatTime(new Date(currentTimeStamp + (diff * 60000)), "hh:mm")
52 now.setMinutes(now.getMinutes() + diff)63 now.setMinutes(now.getMinutes() + diff)
@@ -59,7 +70,7 @@
59 function updateTime() {70 function updateTime() {
60 var now = new Date();71 var now = new Date();
61 currentTimeStamp = now.getTime();72 currentTimeStamp = now.getTime();
62 }73 }
6374
64 AnimationContainer {75 AnimationContainer {
65 id: clockAnimationContainer76 id: clockAnimationContainer
@@ -219,11 +230,7 @@
219 id: toolbarClock230 id: toolbarClock
220 ToolbarButton {231 ToolbarButton {
221 id: addCity232 id: addCity
222 action: Action {233 action: addCityAction
223 iconSource: Qt.resolvedUrl("../images/add_icon.png")
224 text: i18n.tr("Add City")
225 onTriggered: pagestack.push(Qt.resolvedUrl("WorldPage.qml"))
226 }
227 }234 }
228 }235 }
229}236}
230237
=== modified file 'timer/TimerPage.qml'
--- timer/TimerPage.qml 2013-09-08 10:31:38 +0000
+++ timer/TimerPage.qml 2013-09-09 17:09:25 +0000
@@ -37,6 +37,48 @@
37 property string tempNamePreset37 property string tempNamePreset
38 property int pagePostion38 property int pagePostion
3939
40 actions: [
41 Action {
42 id: addTimerAction
43 iconSource: Qt.resolvedUrl("../images/add_icon.png")
44 text: i18n.tr("Add Timer")
45 description: i18n.tr("Add a new timer")
46 keywords: i18n.tr("Add;Timer;Eggtimer;Preset;Ticker")
47 onTriggered: {
48 reset()
49 state = "addPreset"
50 }
51 },
52
53 Action {
54 id: saveTimerAction
55 iconSource: Qt.resolvedUrl("../images/select_icon.png")
56 text: i18n.tr("Save")
57 onTriggered: {
58 presetModel.appendPreset(tempNamePreset, namePreset.text, Utils.totalSeconds(hours, minutes, seconds), listTimerPreset.currentIndex)
59 namePreset.focus = false
60 if (listTimerPreset.currentIndex == -1) {
61 reset()
62 state = "";
63 timerAnimationContainer.contentY = presetModel.count != 0 ? units.gu(87) - timerPage.height : 0;
64 }
65 toolbarTimer.opened = false;
66 }
67 },
68
69 Action {
70 id: cancelTimerAction
71 iconSource: Qt.resolvedUrl("../images/add_icon.png")
72 text: i18n.tr("Cancel")
73 onTriggered: {
74 reset()
75 state = "";
76 toolbarTimer.opened = false;
77 timerAnimationContainer.contentY = presetModel.count != 0 ? units.gu(87) - timerPage.height : 0;
78 }
79 }
80 ]
81
40 states: [82 states: [
41 State {83 State {
42 name: "selectPreset"84 name: "selectPreset"
@@ -335,49 +377,20 @@
335 id: editPresetToolbarButton377 id: editPresetToolbarButton
336 objectName: "savePresetButton"378 objectName: "savePresetButton"
337 visible: false379 visible: false
338 action: Action {380 action: saveTimerAction
339 iconSource: Qt.resolvedUrl("../images/select_icon.png")
340 text: i18n.tr("Save")
341 onTriggered: {
342 presetModel.appendPreset(tempNamePreset, namePreset.text, Utils.totalSeconds(hours, minutes, seconds), listTimerPreset.currentIndex)
343 namePreset.focus = false
344 if (listTimerPreset.currentIndex == -1) {
345 reset()
346 state = "";
347 timerAnimationContainer.contentY = presetModel.count != 0 ? units.gu(87) - timerPage.height : 0;
348 }
349 toolbarTimer.opened = false;
350 }
351 }
352 }381 }
353382
354 ToolbarButton {383 ToolbarButton {
355 id: addPresetToolbarButton384 id: addPresetToolbarButton
356 objectName: "addPresetButton"385 objectName: "addPresetButton"
357 action: Action {386 action: addTimerAction
358 iconSource: Qt.resolvedUrl("../images/add_icon.png")
359 text: i18n.tr("New")
360 onTriggered: {
361 reset()
362 state = "addPreset"
363 }
364 }
365 }387 }
366388
367 ToolbarButton {389 ToolbarButton {
368 id: cancelPresetToolbarButton390 id: cancelPresetToolbarButton
369 objectName: "cancelPresetButton"391 objectName: "cancelPresetButton"
370 visible: false;392 visible: false;
371 action: Action {393 action: cancelTimerAction
372 iconSource: Qt.resolvedUrl("../images/add_icon.png")
373 text: i18n.tr("Cancel")
374 onTriggered: {
375 reset()
376 state = "";
377 toolbarTimer.opened = false;
378 timerAnimationContainer.contentY = presetModel.count != 0 ? units.gu(87) - timerPage.height : 0;
379 }
380 }
381 }394 }
382 }395 }
383}396}

Subscribers

People subscribed via source and target branches