Merge lp:~artmello/ubuntu-calendar-app/ubuntu-calendar-app-fix_1554610 into lp:ubuntu-calendar-app
- ubuntu-calendar-app-fix_1554610
- Merge into trunk
Proposed by
Arthur Mello
Status: | Merged |
---|---|
Approved by: | Renato Araujo Oliveira Filho |
Approved revision: | 781 |
Merged at revision: | 780 |
Proposed branch: | lp:~artmello/ubuntu-calendar-app/ubuntu-calendar-app-fix_1554610 |
Merge into: | lp:ubuntu-calendar-app |
Diff against target: |
304 lines (+94/-21) 7 files modified
EventActions.qml (+3/-3) NewEvent.qml (+4/-4) NewEventBottomEdge.qml (+2/-0) PageWithBottomEdge.qml (+1/-0) RemindersModel.qml (+5/-3) SettingsPage.qml (+70/-11) calendar.qml (+9/-0) |
To merge this branch: | bzr merge lp:~artmello/ubuntu-calendar-app/ubuntu-calendar-app-fix_1554610 |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Jenkins Bot | continuous-integration | Needs Fixing | |
Renato Araujo Oliveira Filho (community) | Approve | ||
Review via email: mp+288969@code.launchpad.net |
Commit message
Add support to set a default reminder value time from settings page
Description of the change
Add support to set a default reminder value time from settings page
To post a comment you must log in.
Revision history for this message
Renato Araujo Oliveira Filho (renatofilho) wrote : | # |
Revision history for this message
Renato Araujo Oliveira Filho (renatofilho) wrote : | # |
code looks good.
Works as expected.
review:
Approve
Revision history for this message
Renato Araujo Oliveira Filho (renatofilho) wrote : | # |
agenda view still not using the configured value.
Revision history for this message
Renato Araujo Oliveira Filho (renatofilho) wrote : | # |
works nice.
review:
Approve
Revision history for this message
Jenkins Bot (ubuntu-core-apps-jenkins-bot) wrote : | # |
FAILED: Autolanding.
No commit message was specified in the merge proposal. Hit 'Add commit message' on the merge proposal web page or follow the link below. You can approve the merge proposal yourself to rerun.
https:/
review:
Needs Fixing
(continuous-integration)
Revision history for this message
Nekhelesh Ramananthan (nik90) wrote : | # |
Added commit message to fix failed autolanding.
Preview Diff
[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1 | === modified file 'EventActions.qml' | |||
2 | --- EventActions.qml 2016-03-04 16:10:56 +0000 | |||
3 | +++ EventActions.qml 2016-03-14 20:38:42 +0000 | |||
4 | @@ -19,6 +19,7 @@ | |||
5 | 19 | import QtQuick 2.4 | 19 | import QtQuick 2.4 |
6 | 20 | import Ubuntu.Components 1.3 | 20 | import Ubuntu.Components 1.3 |
7 | 21 | import Ubuntu.SyncMonitor 0.1 | 21 | import Ubuntu.SyncMonitor 0.1 |
8 | 22 | import Qt.labs.settings 1.0 | ||
9 | 22 | 23 | ||
10 | 23 | Item { | 24 | Item { |
11 | 24 | id: actionPool | 25 | id: actionPool |
12 | @@ -26,6 +27,7 @@ | |||
13 | 26 | property alias showCalendarAction: _showCalendarAction | 27 | property alias showCalendarAction: _showCalendarAction |
14 | 27 | property alias syncCalendarAction: _syncCalendarAction | 28 | property alias syncCalendarAction: _syncCalendarAction |
15 | 28 | property alias settingsAction: _settingsAction | 29 | property alias settingsAction: _settingsAction |
16 | 30 | property Settings settings | ||
17 | 29 | readonly property bool syncInProgress: (syncMonitor.state === "syncing") | 31 | readonly property bool syncInProgress: (syncMonitor.state === "syncing") |
18 | 30 | 32 | ||
19 | 31 | Action { | 33 | Action { |
20 | @@ -62,8 +64,6 @@ | |||
21 | 62 | name: "calendarsbutton" | 64 | name: "calendarsbutton" |
22 | 63 | iconName: "settings" | 65 | iconName: "settings" |
23 | 64 | text: i18n.tr("Settings") | 66 | text: i18n.tr("Settings") |
27 | 65 | onTriggered: { | 67 | onTriggered: pageStack.push(Qt.resolvedUrl("SettingsPage.qml"),{"settings": actionPool.settings}); |
25 | 66 | pageStack.push(Qt.resolvedUrl("Settings.qml")); | ||
26 | 67 | } | ||
28 | 68 | } | 68 | } |
29 | 69 | } | 69 | } |
30 | 70 | 70 | ||
31 | === modified file 'NewEvent.qml' | |||
32 | --- NewEvent.qml 2016-03-07 17:57:04 +0000 | |||
33 | +++ NewEvent.qml 2016-03-14 20:38:42 +0000 | |||
34 | @@ -42,6 +42,8 @@ | |||
35 | 42 | 42 | ||
36 | 43 | property var startDate; | 43 | property var startDate; |
37 | 44 | property var endDate; | 44 | property var endDate; |
38 | 45 | //default reminder time = 15 min | ||
39 | 46 | property int reminderValue: 900; | ||
40 | 45 | 47 | ||
41 | 46 | property alias scrollY: flickable.contentY | 48 | property alias scrollY: flickable.contentY |
42 | 47 | property bool isEdit: false | 49 | property bool isEdit: false |
43 | @@ -245,13 +247,11 @@ | |||
44 | 245 | 247 | ||
45 | 246 | VisualReminder{ | 248 | VisualReminder{ |
46 | 247 | id: visualReminder | 249 | id: visualReminder |
49 | 248 | //default reminder time = 15 min | 250 | secondsBeforeStart: root.reminderValue |
48 | 249 | secondsBeforeStart: 900 | ||
50 | 250 | } | 251 | } |
51 | 251 | AudibleReminder{ | 252 | AudibleReminder{ |
52 | 252 | id: audibleReminder | 253 | id: audibleReminder |
55 | 253 | //default reminder time = 15 min | 254 | secondsBeforeStart: root.reminderValue |
54 | 254 | secondsBeforeStart: 900 | ||
56 | 255 | } | 255 | } |
57 | 256 | 256 | ||
58 | 257 | function getDaysOfWeek(){ | 257 | function getDaysOfWeek(){ |
59 | 258 | 258 | ||
60 | === modified file 'NewEventBottomEdge.qml' | |||
61 | --- NewEventBottomEdge.qml 2016-03-07 17:57:04 +0000 | |||
62 | +++ NewEventBottomEdge.qml 2016-03-14 20:38:42 +0000 | |||
63 | @@ -26,6 +26,7 @@ | |||
64 | 26 | property var pageStack: null | 26 | property var pageStack: null |
65 | 27 | property var eventModel: null | 27 | property var eventModel: null |
66 | 28 | property var date: new Date() | 28 | property var date: new Date() |
67 | 29 | property int reminderValue | ||
68 | 29 | 30 | ||
69 | 30 | // WORKAROUND: BottomEdge component loads the page async while draging it | 31 | // WORKAROUND: BottomEdge component loads the page async while draging it |
70 | 31 | // this cause a very bad visual. | 32 | // this cause a very bad visual. |
71 | @@ -93,6 +94,7 @@ | |||
72 | 93 | 94 | ||
73 | 94 | implicitWidth: bottomEdge.width | 95 | implicitWidth: bottomEdge.width |
74 | 95 | implicitHeight: bottomEdge.height | 96 | implicitHeight: bottomEdge.height |
75 | 97 | reminderValue: bottomEdge.reminderValue | ||
76 | 96 | model: bottomEdge.eventModel | 98 | model: bottomEdge.eventModel |
77 | 97 | date: bottomEdge.date | 99 | date: bottomEdge.date |
78 | 98 | enabled: bottomEdge.status === BottomEdge.Committed | 100 | enabled: bottomEdge.status === BottomEdge.Committed |
79 | 99 | 101 | ||
80 | === modified file 'PageWithBottomEdge.qml' | |||
81 | --- PageWithBottomEdge.qml 2016-03-07 17:57:04 +0000 | |||
82 | +++ PageWithBottomEdge.qml 2016-03-14 20:38:42 +0000 | |||
83 | @@ -23,6 +23,7 @@ | |||
84 | 23 | 23 | ||
85 | 24 | property alias model: bottomEdge.eventModel | 24 | property alias model: bottomEdge.eventModel |
86 | 25 | property alias createEventAt: bottomEdge.date | 25 | property alias createEventAt: bottomEdge.date |
87 | 26 | property alias reminderValue: bottomEdge.reminderValue | ||
88 | 26 | property bool bootomEdgeEnabled: bottomEdge.enabled | 27 | property bool bootomEdgeEnabled: bottomEdge.enabled |
89 | 27 | 28 | ||
90 | 28 | signal bottomEdgeCommitStarted() | 29 | signal bottomEdgeCommitStarted() |
91 | 29 | 30 | ||
92 | === modified file 'RemindersModel.qml' | |||
93 | --- RemindersModel.qml 2016-01-25 13:20:32 +0000 | |||
94 | +++ RemindersModel.qml 2016-03-14 20:38:42 +0000 | |||
95 | @@ -20,9 +20,10 @@ | |||
96 | 20 | 20 | ||
97 | 21 | ListModel { | 21 | ListModel { |
98 | 22 | id: reminderModel | 22 | id: reminderModel |
102 | 23 | Component.onCompleted: initialise() | 23 | |
103 | 24 | 24 | signal loaded() | |
104 | 25 | function initialise() { | 25 | |
105 | 26 | Component.onCompleted: { | ||
106 | 26 | reminderModel.append({ "label": i18n.tr("No Reminder"), "value": -1 }) | 27 | reminderModel.append({ "label": i18n.tr("No Reminder"), "value": -1 }) |
107 | 27 | // TRANSLATORS: this refers to when a reminder should be shown as a notification | 28 | // TRANSLATORS: this refers to when a reminder should be shown as a notification |
108 | 28 | // in the indicators. "On Event" means that it will be shown right at the time | 29 | // in the indicators. "On Event" means that it will be shown right at the time |
109 | @@ -37,6 +38,7 @@ | |||
110 | 37 | reminderModel.append({ "label": i18n.tr("2 days"), "value": 172800 }) | 38 | reminderModel.append({ "label": i18n.tr("2 days"), "value": 172800 }) |
111 | 38 | reminderModel.append({ "label": i18n.tr("1 week"), "value": 604800 }) | 39 | reminderModel.append({ "label": i18n.tr("1 week"), "value": 604800 }) |
112 | 39 | reminderModel.append({ "label": i18n.tr("2 weeks"), "value": 1209600 }) | 40 | reminderModel.append({ "label": i18n.tr("2 weeks"), "value": 1209600 }) |
113 | 41 | reminderModel.loaded() | ||
114 | 40 | } | 42 | } |
115 | 41 | } | 43 | } |
116 | 42 | 44 | ||
117 | 43 | 45 | ||
118 | === renamed file 'Settings.qml' => 'SettingsPage.qml' | |||
119 | --- Settings.qml 2016-03-02 19:55:52 +0000 | |||
120 | +++ SettingsPage.qml 2016-03-14 20:38:42 +0000 | |||
121 | @@ -18,11 +18,28 @@ | |||
122 | 18 | 18 | ||
123 | 19 | import QtQuick 2.4 | 19 | import QtQuick 2.4 |
124 | 20 | import Ubuntu.Components 1.3 | 20 | import Ubuntu.Components 1.3 |
125 | 21 | import Qt.labs.settings 1.0 | ||
126 | 21 | 22 | ||
127 | 22 | Page { | 23 | Page { |
128 | 23 | id: settingsPage | 24 | id: settingsPage |
129 | 24 | objectName: "settings" | 25 | objectName: "settings" |
130 | 25 | 26 | ||
131 | 27 | property Settings settings: undefined | ||
132 | 28 | |||
133 | 29 | Binding { | ||
134 | 30 | target: settingsPage.settings | ||
135 | 31 | property: "showWeekNumber" | ||
136 | 32 | value: weekCheckBox.checked | ||
137 | 33 | when: settings | ||
138 | 34 | } | ||
139 | 35 | |||
140 | 36 | Binding { | ||
141 | 37 | target: settingsPage.settings | ||
142 | 38 | property: "showLunarCalendar" | ||
143 | 39 | value: lunarCalCheckBox.checked | ||
144 | 40 | when: settings | ||
145 | 41 | } | ||
146 | 42 | |||
147 | 26 | visible: false | 43 | visible: false |
148 | 27 | 44 | ||
149 | 28 | header: PageHeader { | 45 | header: PageHeader { |
150 | @@ -30,15 +47,12 @@ | |||
151 | 30 | leadingActionBar.actions: Action { | 47 | leadingActionBar.actions: Action { |
152 | 31 | text: i18n.tr("Back") | 48 | text: i18n.tr("Back") |
153 | 32 | iconName: "back" | 49 | iconName: "back" |
157 | 33 | onTriggered: { | 50 | onTriggered: pop() |
155 | 34 | pop() | ||
156 | 35 | } | ||
158 | 36 | } | 51 | } |
159 | 37 | } | 52 | } |
160 | 38 | 53 | ||
164 | 39 | Component.onCompleted: { | 54 | RemindersModel { |
165 | 40 | weekCheckBox.checked = mainView.displayWeekNumber | 55 | id: remindersModel |
163 | 41 | lunarCalCheckBox.checked = mainView.displayLunarCalendar | ||
166 | 42 | } | 56 | } |
167 | 43 | 57 | ||
168 | 44 | Column { | 58 | Column { |
169 | @@ -57,9 +71,7 @@ | |||
170 | 57 | id: weekCheckBox | 71 | id: weekCheckBox |
171 | 58 | objectName: "weekCheckBox" | 72 | objectName: "weekCheckBox" |
172 | 59 | SlotsLayout.position: SlotsLayout.Last | 73 | SlotsLayout.position: SlotsLayout.Last |
176 | 60 | onCheckedChanged: { | 74 | checked: settings ? settings.showWeekNumber : false |
174 | 61 | mainView.displayWeekNumber = weekCheckBox.checked | ||
175 | 62 | } | ||
177 | 63 | } | 75 | } |
178 | 64 | } | 76 | } |
179 | 65 | } | 77 | } |
180 | @@ -73,8 +85,55 @@ | |||
181 | 73 | id: lunarCalCheckBox | 85 | id: lunarCalCheckBox |
182 | 74 | objectName: "lunarCalCheckbox" | 86 | objectName: "lunarCalCheckbox" |
183 | 75 | SlotsLayout.position: SlotsLayout.Last | 87 | SlotsLayout.position: SlotsLayout.Last |
186 | 76 | onCheckedChanged: { | 88 | checked: settings ? settings.showLunarCalendar : false |
187 | 77 | mainView.displayLunarCalendar = lunarCalCheckBox.checked | 89 | } |
188 | 90 | } | ||
189 | 91 | } | ||
190 | 92 | |||
191 | 93 | ListItem { | ||
192 | 94 | id: defaultReminderItem | ||
193 | 95 | |||
194 | 96 | visible: defaultReminderOptionSelector.model && defaultReminderOptionSelector.model.count > 0 | ||
195 | 97 | height: visible ? defaultReminderLayout.height + divider.height : 0 | ||
196 | 98 | |||
197 | 99 | Connections { | ||
198 | 100 | target: remindersModel | ||
199 | 101 | onLoaded: { | ||
200 | 102 | if (!defaultReminderOptionSelector.model) { | ||
201 | 103 | return | ||
202 | 104 | } | ||
203 | 105 | |||
204 | 106 | for (var i=0; i<defaultReminderOptionSelector.model.count; ++i) { | ||
205 | 107 | var reminder = defaultReminderOptionSelector.model.get(i) | ||
206 | 108 | if (reminder.value === settings.reminderDefaultValue) { | ||
207 | 109 | defaultReminderOptionSelector.selectedIndex = i | ||
208 | 110 | return | ||
209 | 111 | } | ||
210 | 112 | } | ||
211 | 113 | |||
212 | 114 | defaultReminderOptionSelector.selectedIndex = 0 | ||
213 | 115 | } | ||
214 | 116 | } | ||
215 | 117 | |||
216 | 118 | SlotsLayout { | ||
217 | 119 | id: defaultReminderLayout | ||
218 | 120 | |||
219 | 121 | mainSlot: Item { | ||
220 | 122 | height: defaultReminderOptionSelector.height | ||
221 | 123 | |||
222 | 124 | OptionSelector { | ||
223 | 125 | id: defaultReminderOptionSelector | ||
224 | 126 | |||
225 | 127 | text: i18n.tr("Default reminder") | ||
226 | 128 | model: remindersModel | ||
227 | 129 | containerHeight: itemHeight * 4 | ||
228 | 130 | |||
229 | 131 | delegate: OptionSelectorDelegate { | ||
230 | 132 | text: label | ||
231 | 133 | height: units.gu(4) | ||
232 | 134 | } | ||
233 | 135 | |||
234 | 136 | onDelegateClicked: settings.reminderDefaultValue = model.get(index).value | ||
235 | 78 | } | 137 | } |
236 | 79 | } | 138 | } |
237 | 80 | } | 139 | } |
238 | 81 | 140 | ||
239 | === modified file 'calendar.qml' | |||
240 | --- calendar.qml 2016-03-07 15:58:43 +0000 | |||
241 | +++ calendar.qml 2016-03-14 20:38:42 +0000 | |||
242 | @@ -28,6 +28,7 @@ | |||
243 | 28 | 28 | ||
244 | 29 | property bool displayWeekNumber: false; | 29 | property bool displayWeekNumber: false; |
245 | 30 | property bool displayLunarCalendar: false; | 30 | property bool displayLunarCalendar: false; |
246 | 31 | property int reminderDefaultValue: 900; | ||
247 | 31 | readonly property bool syncInProgress: commonHeaderActions.syncInProgress | 32 | readonly property bool syncInProgress: commonHeaderActions.syncInProgress |
248 | 32 | 33 | ||
249 | 33 | // Work-around until this branch lands: | 34 | // Work-around until this branch lands: |
250 | @@ -259,12 +260,15 @@ | |||
251 | 259 | 260 | ||
252 | 260 | EventActions { | 261 | EventActions { |
253 | 261 | id: commonHeaderActions | 262 | id: commonHeaderActions |
254 | 263 | settings: settings | ||
255 | 262 | } | 264 | } |
256 | 263 | 265 | ||
257 | 264 | Settings { | 266 | Settings { |
258 | 265 | id: settings | 267 | id: settings |
259 | 266 | property alias defaultViewIndex: tabs.selectedTabIndex | 268 | property alias defaultViewIndex: tabs.selectedTabIndex |
260 | 267 | property alias showWeekNumber: mainView.displayWeekNumber | 269 | property alias showWeekNumber: mainView.displayWeekNumber |
261 | 270 | property alias showLunarCalendar: mainView.displayLunarCalendar | ||
262 | 271 | property alias reminderDefaultValue: mainView.reminderDefaultValue | ||
263 | 268 | } | 272 | } |
264 | 269 | 273 | ||
265 | 270 | Tabs{ | 274 | Tabs{ |
266 | @@ -570,6 +574,7 @@ | |||
267 | 570 | YearView { | 574 | YearView { |
268 | 571 | readonly property bool tabSelected: tabs.selectedTabIndex === yearTab.index | 575 | readonly property bool tabSelected: tabs.selectedTabIndex === yearTab.index |
269 | 572 | 576 | ||
270 | 577 | reminderValue: mainView.reminderDefaultValue | ||
271 | 573 | model: eventModel.isReady ? eventModel : null | 578 | model: eventModel.isReady ? eventModel : null |
272 | 574 | bootomEdgeEnabled: tabSelected | 579 | bootomEdgeEnabled: tabSelected |
273 | 575 | displayLunarCalendar: mainView.displayLunarCalendar | 580 | displayLunarCalendar: mainView.displayLunarCalendar |
274 | @@ -603,6 +608,7 @@ | |||
275 | 603 | MonthView { | 608 | MonthView { |
276 | 604 | readonly property bool tabSelected: tabs.selectedTabIndex === monthTab.index | 609 | readonly property bool tabSelected: tabs.selectedTabIndex === monthTab.index |
277 | 605 | 610 | ||
278 | 611 | reminderValue: mainView.reminderDefaultValue | ||
279 | 606 | model: eventModel.isReady ? eventModel : null | 612 | model: eventModel.isReady ? eventModel : null |
280 | 607 | bootomEdgeEnabled: tabSelected | 613 | bootomEdgeEnabled: tabSelected |
281 | 608 | displayLunarCalendar: mainView.displayLunarCalendar | 614 | displayLunarCalendar: mainView.displayLunarCalendar |
282 | @@ -640,6 +646,7 @@ | |||
283 | 640 | WeekView { | 646 | WeekView { |
284 | 641 | readonly property bool tabSelected: tabs.selectedTab === weekTab | 647 | readonly property bool tabSelected: tabs.selectedTab === weekTab |
285 | 642 | 648 | ||
286 | 649 | reminderValue: mainView.reminderDefaultValue | ||
287 | 643 | model: eventModel.isReady ? eventModel : null | 650 | model: eventModel.isReady ? eventModel : null |
288 | 644 | bootomEdgeEnabled: tabSelected | 651 | bootomEdgeEnabled: tabSelected |
289 | 645 | displayLunarCalendar: mainView.displayLunarCalendar | 652 | displayLunarCalendar: mainView.displayLunarCalendar |
290 | @@ -687,6 +694,7 @@ | |||
291 | 687 | DayView { | 694 | DayView { |
292 | 688 | readonly property bool tabSelected: tabs.selectedTabIndex === dayTab.index | 695 | readonly property bool tabSelected: tabs.selectedTabIndex === dayTab.index |
293 | 689 | 696 | ||
294 | 697 | reminderValue: mainView.reminderDefaultValue | ||
295 | 690 | model: eventModel.isReady ? eventModel : null | 698 | model: eventModel.isReady ? eventModel : null |
296 | 691 | bootomEdgeEnabled: tabSelected | 699 | bootomEdgeEnabled: tabSelected |
297 | 692 | displayLunarCalendar: mainView.displayLunarCalendar | 700 | displayLunarCalendar: mainView.displayLunarCalendar |
298 | @@ -724,6 +732,7 @@ | |||
299 | 724 | id: agendaViewComp | 732 | id: agendaViewComp |
300 | 725 | 733 | ||
301 | 726 | AgendaView { | 734 | AgendaView { |
302 | 735 | reminderValue: mainView.reminderDefaultValue | ||
303 | 727 | model: eventModel.isReady ? eventModel : null | 736 | model: eventModel.isReady ? eventModel : null |
304 | 728 | bootomEdgeEnabled: tabs.selectedTabIndex === agendaTab.index | 737 | bootomEdgeEnabled: tabs.selectedTabIndex === agendaTab.index |
305 | 729 | 738 |
Chekc my inline comments. I have some suggestion how to implement it in a better way.