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
1=== modified file 'clock/ClockPage.qml'
2--- clock/ClockPage.qml 2013-09-03 21:06:12 +0000
3+++ clock/ClockPage.qml 2013-09-09 17:09:25 +0000
4@@ -47,6 +47,17 @@
5 updateTime();
6 }
7
8+ actions: [
9+ Action {
10+ id: addCityAction
11+ text: i18n.tr("Add City")
12+ keywords: i18n.tr("Add;Timezone;Timezones;World;City;Cities;Town;Towns;Place;Places;Location;Locations;Time;Locale;Local;Current")
13+ description: "Add a world city"
14+ iconSource: Qt.resolvedUrl("../images/add_icon.png")
15+ onTriggered: pagestack.push(Qt.resolvedUrl("WorldPage.qml"))
16+ }
17+ ]
18+
19 function onTimerUpdate(now) {
20 currentTimeFormatted = Qt.formatTime(new Date(currentTimeStamp + (diff * 60000)), "hh:mm")
21 now.setMinutes(now.getMinutes() + diff)
22@@ -59,7 +70,7 @@
23 function updateTime() {
24 var now = new Date();
25 currentTimeStamp = now.getTime();
26- }
27+ }
28
29 AnimationContainer {
30 id: clockAnimationContainer
31@@ -219,11 +230,7 @@
32 id: toolbarClock
33 ToolbarButton {
34 id: addCity
35- action: Action {
36- iconSource: Qt.resolvedUrl("../images/add_icon.png")
37- text: i18n.tr("Add City")
38- onTriggered: pagestack.push(Qt.resolvedUrl("WorldPage.qml"))
39- }
40+ action: addCityAction
41 }
42 }
43 }
44
45=== modified file 'timer/TimerPage.qml'
46--- timer/TimerPage.qml 2013-09-08 10:31:38 +0000
47+++ timer/TimerPage.qml 2013-09-09 17:09:25 +0000
48@@ -37,6 +37,48 @@
49 property string tempNamePreset
50 property int pagePostion
51
52+ actions: [
53+ Action {
54+ id: addTimerAction
55+ iconSource: Qt.resolvedUrl("../images/add_icon.png")
56+ text: i18n.tr("Add Timer")
57+ description: i18n.tr("Add a new timer")
58+ keywords: i18n.tr("Add;Timer;Eggtimer;Preset;Ticker")
59+ onTriggered: {
60+ reset()
61+ state = "addPreset"
62+ }
63+ },
64+
65+ Action {
66+ id: saveTimerAction
67+ iconSource: Qt.resolvedUrl("../images/select_icon.png")
68+ text: i18n.tr("Save")
69+ onTriggered: {
70+ presetModel.appendPreset(tempNamePreset, namePreset.text, Utils.totalSeconds(hours, minutes, seconds), listTimerPreset.currentIndex)
71+ namePreset.focus = false
72+ if (listTimerPreset.currentIndex == -1) {
73+ reset()
74+ state = "";
75+ timerAnimationContainer.contentY = presetModel.count != 0 ? units.gu(87) - timerPage.height : 0;
76+ }
77+ toolbarTimer.opened = false;
78+ }
79+ },
80+
81+ Action {
82+ id: cancelTimerAction
83+ iconSource: Qt.resolvedUrl("../images/add_icon.png")
84+ text: i18n.tr("Cancel")
85+ onTriggered: {
86+ reset()
87+ state = "";
88+ toolbarTimer.opened = false;
89+ timerAnimationContainer.contentY = presetModel.count != 0 ? units.gu(87) - timerPage.height : 0;
90+ }
91+ }
92+ ]
93+
94 states: [
95 State {
96 name: "selectPreset"
97@@ -335,49 +377,20 @@
98 id: editPresetToolbarButton
99 objectName: "savePresetButton"
100 visible: false
101- action: Action {
102- iconSource: Qt.resolvedUrl("../images/select_icon.png")
103- text: i18n.tr("Save")
104- onTriggered: {
105- presetModel.appendPreset(tempNamePreset, namePreset.text, Utils.totalSeconds(hours, minutes, seconds), listTimerPreset.currentIndex)
106- namePreset.focus = false
107- if (listTimerPreset.currentIndex == -1) {
108- reset()
109- state = "";
110- timerAnimationContainer.contentY = presetModel.count != 0 ? units.gu(87) - timerPage.height : 0;
111- }
112- toolbarTimer.opened = false;
113- }
114- }
115+ action: saveTimerAction
116 }
117
118 ToolbarButton {
119 id: addPresetToolbarButton
120 objectName: "addPresetButton"
121- action: Action {
122- iconSource: Qt.resolvedUrl("../images/add_icon.png")
123- text: i18n.tr("New")
124- onTriggered: {
125- reset()
126- state = "addPreset"
127- }
128- }
129+ action: addTimerAction
130 }
131
132 ToolbarButton {
133 id: cancelPresetToolbarButton
134 objectName: "cancelPresetButton"
135 visible: false;
136- action: Action {
137- iconSource: Qt.resolvedUrl("../images/add_icon.png")
138- text: i18n.tr("Cancel")
139- onTriggered: {
140- reset()
141- state = "";
142- toolbarTimer.opened = false;
143- timerAnimationContainer.contentY = presetModel.count != 0 ? units.gu(87) - timerPage.height : 0;
144- }
145- }
146+ action: cancelTimerAction
147 }
148 }
149 }

Subscribers

People subscribed via source and target branches