Merge lp:~artmello/ubuntu-calendar-app/ubuntu-calendar-app-fix_1554610 into lp:ubuntu-calendar-app

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
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 :

Chekc my inline comments. I have some suggestion how to implement it in a better way.

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://code.launchpad.net/~artmello/ubuntu-calendar-app/ubuntu-calendar-app-fix_1554610/+merge/288969/+edit-commit-message

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
=== modified file 'EventActions.qml'
--- EventActions.qml 2016-03-04 16:10:56 +0000
+++ EventActions.qml 2016-03-14 20:38:42 +0000
@@ -19,6 +19,7 @@
19import QtQuick 2.419import QtQuick 2.4
20import Ubuntu.Components 1.320import Ubuntu.Components 1.3
21import Ubuntu.SyncMonitor 0.121import Ubuntu.SyncMonitor 0.1
22import Qt.labs.settings 1.0
2223
23Item {24Item {
24 id: actionPool25 id: actionPool
@@ -26,6 +27,7 @@
26 property alias showCalendarAction: _showCalendarAction27 property alias showCalendarAction: _showCalendarAction
27 property alias syncCalendarAction: _syncCalendarAction28 property alias syncCalendarAction: _syncCalendarAction
28 property alias settingsAction: _settingsAction29 property alias settingsAction: _settingsAction
30 property Settings settings
29 readonly property bool syncInProgress: (syncMonitor.state === "syncing")31 readonly property bool syncInProgress: (syncMonitor.state === "syncing")
3032
31 Action {33 Action {
@@ -62,8 +64,6 @@
62 name: "calendarsbutton"64 name: "calendarsbutton"
63 iconName: "settings"65 iconName: "settings"
64 text: i18n.tr("Settings")66 text: i18n.tr("Settings")
65 onTriggered: {67 onTriggered: pageStack.push(Qt.resolvedUrl("SettingsPage.qml"),{"settings": actionPool.settings});
66 pageStack.push(Qt.resolvedUrl("Settings.qml"));
67 }
68 }68 }
69}69}
7070
=== modified file 'NewEvent.qml'
--- NewEvent.qml 2016-03-07 17:57:04 +0000
+++ NewEvent.qml 2016-03-14 20:38:42 +0000
@@ -42,6 +42,8 @@
4242
43 property var startDate;43 property var startDate;
44 property var endDate;44 property var endDate;
45 //default reminder time = 15 min
46 property int reminderValue: 900;
4547
46 property alias scrollY: flickable.contentY48 property alias scrollY: flickable.contentY
47 property bool isEdit: false49 property bool isEdit: false
@@ -245,13 +247,11 @@
245247
246 VisualReminder{248 VisualReminder{
247 id: visualReminder249 id: visualReminder
248 //default reminder time = 15 min250 secondsBeforeStart: root.reminderValue
249 secondsBeforeStart: 900
250 }251 }
251 AudibleReminder{252 AudibleReminder{
252 id: audibleReminder253 id: audibleReminder
253 //default reminder time = 15 min254 secondsBeforeStart: root.reminderValue
254 secondsBeforeStart: 900
255 }255 }
256256
257 function getDaysOfWeek(){257 function getDaysOfWeek(){
258258
=== modified file 'NewEventBottomEdge.qml'
--- NewEventBottomEdge.qml 2016-03-07 17:57:04 +0000
+++ NewEventBottomEdge.qml 2016-03-14 20:38:42 +0000
@@ -26,6 +26,7 @@
26 property var pageStack: null26 property var pageStack: null
27 property var eventModel: null27 property var eventModel: null
28 property var date: new Date()28 property var date: new Date()
29 property int reminderValue
2930
30 // WORKAROUND: BottomEdge component loads the page async while draging it31 // WORKAROUND: BottomEdge component loads the page async while draging it
31 // this cause a very bad visual.32 // this cause a very bad visual.
@@ -93,6 +94,7 @@
9394
94 implicitWidth: bottomEdge.width95 implicitWidth: bottomEdge.width
95 implicitHeight: bottomEdge.height96 implicitHeight: bottomEdge.height
97 reminderValue: bottomEdge.reminderValue
96 model: bottomEdge.eventModel98 model: bottomEdge.eventModel
97 date: bottomEdge.date99 date: bottomEdge.date
98 enabled: bottomEdge.status === BottomEdge.Committed100 enabled: bottomEdge.status === BottomEdge.Committed
99101
=== modified file 'PageWithBottomEdge.qml'
--- PageWithBottomEdge.qml 2016-03-07 17:57:04 +0000
+++ PageWithBottomEdge.qml 2016-03-14 20:38:42 +0000
@@ -23,6 +23,7 @@
2323
24 property alias model: bottomEdge.eventModel24 property alias model: bottomEdge.eventModel
25 property alias createEventAt: bottomEdge.date25 property alias createEventAt: bottomEdge.date
26 property alias reminderValue: bottomEdge.reminderValue
26 property bool bootomEdgeEnabled: bottomEdge.enabled27 property bool bootomEdgeEnabled: bottomEdge.enabled
2728
28 signal bottomEdgeCommitStarted()29 signal bottomEdgeCommitStarted()
2930
=== modified file 'RemindersModel.qml'
--- RemindersModel.qml 2016-01-25 13:20:32 +0000
+++ RemindersModel.qml 2016-03-14 20:38:42 +0000
@@ -20,9 +20,10 @@
2020
21ListModel {21ListModel {
22 id: reminderModel22 id: reminderModel
23 Component.onCompleted: initialise()23
2424 signal loaded()
25 function initialise() {25
26 Component.onCompleted: {
26 reminderModel.append({ "label": i18n.tr("No Reminder"), "value": -1 })27 reminderModel.append({ "label": i18n.tr("No Reminder"), "value": -1 })
27 // TRANSLATORS: this refers to when a reminder should be shown as a notification28 // TRANSLATORS: this refers to when a reminder should be shown as a notification
28 // in the indicators. "On Event" means that it will be shown right at the time29 // in the indicators. "On Event" means that it will be shown right at the time
@@ -37,6 +38,7 @@
37 reminderModel.append({ "label": i18n.tr("2 days"), "value": 172800 })38 reminderModel.append({ "label": i18n.tr("2 days"), "value": 172800 })
38 reminderModel.append({ "label": i18n.tr("1 week"), "value": 604800 })39 reminderModel.append({ "label": i18n.tr("1 week"), "value": 604800 })
39 reminderModel.append({ "label": i18n.tr("2 weeks"), "value": 1209600 })40 reminderModel.append({ "label": i18n.tr("2 weeks"), "value": 1209600 })
41 reminderModel.loaded()
40 }42 }
41}43}
4244
4345
=== renamed file 'Settings.qml' => 'SettingsPage.qml'
--- Settings.qml 2016-03-02 19:55:52 +0000
+++ SettingsPage.qml 2016-03-14 20:38:42 +0000
@@ -18,11 +18,28 @@
1818
19import QtQuick 2.419import QtQuick 2.4
20import Ubuntu.Components 1.320import Ubuntu.Components 1.3
21import Qt.labs.settings 1.0
2122
22Page {23Page {
23 id: settingsPage24 id: settingsPage
24 objectName: "settings"25 objectName: "settings"
2526
27 property Settings settings: undefined
28
29 Binding {
30 target: settingsPage.settings
31 property: "showWeekNumber"
32 value: weekCheckBox.checked
33 when: settings
34 }
35
36 Binding {
37 target: settingsPage.settings
38 property: "showLunarCalendar"
39 value: lunarCalCheckBox.checked
40 when: settings
41 }
42
26 visible: false43 visible: false
2744
28 header: PageHeader {45 header: PageHeader {
@@ -30,15 +47,12 @@
30 leadingActionBar.actions: Action {47 leadingActionBar.actions: Action {
31 text: i18n.tr("Back")48 text: i18n.tr("Back")
32 iconName: "back"49 iconName: "back"
33 onTriggered: {50 onTriggered: pop()
34 pop()
35 }
36 }51 }
37 }52 }
3853
39 Component.onCompleted: {54 RemindersModel {
40 weekCheckBox.checked = mainView.displayWeekNumber55 id: remindersModel
41 lunarCalCheckBox.checked = mainView.displayLunarCalendar
42 }56 }
4357
44 Column {58 Column {
@@ -57,9 +71,7 @@
57 id: weekCheckBox71 id: weekCheckBox
58 objectName: "weekCheckBox"72 objectName: "weekCheckBox"
59 SlotsLayout.position: SlotsLayout.Last73 SlotsLayout.position: SlotsLayout.Last
60 onCheckedChanged: {74 checked: settings ? settings.showWeekNumber : false
61 mainView.displayWeekNumber = weekCheckBox.checked
62 }
63 }75 }
64 }76 }
65 }77 }
@@ -73,8 +85,55 @@
73 id: lunarCalCheckBox85 id: lunarCalCheckBox
74 objectName: "lunarCalCheckbox"86 objectName: "lunarCalCheckbox"
75 SlotsLayout.position: SlotsLayout.Last87 SlotsLayout.position: SlotsLayout.Last
76 onCheckedChanged: {88 checked: settings ? settings.showLunarCalendar : false
77 mainView.displayLunarCalendar = lunarCalCheckBox.checked89 }
90 }
91 }
92
93 ListItem {
94 id: defaultReminderItem
95
96 visible: defaultReminderOptionSelector.model && defaultReminderOptionSelector.model.count > 0
97 height: visible ? defaultReminderLayout.height + divider.height : 0
98
99 Connections {
100 target: remindersModel
101 onLoaded: {
102 if (!defaultReminderOptionSelector.model) {
103 return
104 }
105
106 for (var i=0; i<defaultReminderOptionSelector.model.count; ++i) {
107 var reminder = defaultReminderOptionSelector.model.get(i)
108 if (reminder.value === settings.reminderDefaultValue) {
109 defaultReminderOptionSelector.selectedIndex = i
110 return
111 }
112 }
113
114 defaultReminderOptionSelector.selectedIndex = 0
115 }
116 }
117
118 SlotsLayout {
119 id: defaultReminderLayout
120
121 mainSlot: Item {
122 height: defaultReminderOptionSelector.height
123
124 OptionSelector {
125 id: defaultReminderOptionSelector
126
127 text: i18n.tr("Default reminder")
128 model: remindersModel
129 containerHeight: itemHeight * 4
130
131 delegate: OptionSelectorDelegate {
132 text: label
133 height: units.gu(4)
134 }
135
136 onDelegateClicked: settings.reminderDefaultValue = model.get(index).value
78 }137 }
79 }138 }
80 }139 }
81140
=== modified file 'calendar.qml'
--- calendar.qml 2016-03-07 15:58:43 +0000
+++ calendar.qml 2016-03-14 20:38:42 +0000
@@ -28,6 +28,7 @@
2828
29 property bool displayWeekNumber: false;29 property bool displayWeekNumber: false;
30 property bool displayLunarCalendar: false;30 property bool displayLunarCalendar: false;
31 property int reminderDefaultValue: 900;
31 readonly property bool syncInProgress: commonHeaderActions.syncInProgress32 readonly property bool syncInProgress: commonHeaderActions.syncInProgress
3233
33 // Work-around until this branch lands:34 // Work-around until this branch lands:
@@ -259,12 +260,15 @@
259260
260 EventActions {261 EventActions {
261 id: commonHeaderActions262 id: commonHeaderActions
263 settings: settings
262 }264 }
263265
264 Settings {266 Settings {
265 id: settings267 id: settings
266 property alias defaultViewIndex: tabs.selectedTabIndex268 property alias defaultViewIndex: tabs.selectedTabIndex
267 property alias showWeekNumber: mainView.displayWeekNumber269 property alias showWeekNumber: mainView.displayWeekNumber
270 property alias showLunarCalendar: mainView.displayLunarCalendar
271 property alias reminderDefaultValue: mainView.reminderDefaultValue
268 }272 }
269273
270 Tabs{274 Tabs{
@@ -570,6 +574,7 @@
570 YearView {574 YearView {
571 readonly property bool tabSelected: tabs.selectedTabIndex === yearTab.index575 readonly property bool tabSelected: tabs.selectedTabIndex === yearTab.index
572576
577 reminderValue: mainView.reminderDefaultValue
573 model: eventModel.isReady ? eventModel : null578 model: eventModel.isReady ? eventModel : null
574 bootomEdgeEnabled: tabSelected579 bootomEdgeEnabled: tabSelected
575 displayLunarCalendar: mainView.displayLunarCalendar580 displayLunarCalendar: mainView.displayLunarCalendar
@@ -603,6 +608,7 @@
603 MonthView {608 MonthView {
604 readonly property bool tabSelected: tabs.selectedTabIndex === monthTab.index609 readonly property bool tabSelected: tabs.selectedTabIndex === monthTab.index
605610
611 reminderValue: mainView.reminderDefaultValue
606 model: eventModel.isReady ? eventModel : null612 model: eventModel.isReady ? eventModel : null
607 bootomEdgeEnabled: tabSelected613 bootomEdgeEnabled: tabSelected
608 displayLunarCalendar: mainView.displayLunarCalendar614 displayLunarCalendar: mainView.displayLunarCalendar
@@ -640,6 +646,7 @@
640 WeekView {646 WeekView {
641 readonly property bool tabSelected: tabs.selectedTab === weekTab647 readonly property bool tabSelected: tabs.selectedTab === weekTab
642648
649 reminderValue: mainView.reminderDefaultValue
643 model: eventModel.isReady ? eventModel : null650 model: eventModel.isReady ? eventModel : null
644 bootomEdgeEnabled: tabSelected651 bootomEdgeEnabled: tabSelected
645 displayLunarCalendar: mainView.displayLunarCalendar652 displayLunarCalendar: mainView.displayLunarCalendar
@@ -687,6 +694,7 @@
687 DayView {694 DayView {
688 readonly property bool tabSelected: tabs.selectedTabIndex === dayTab.index695 readonly property bool tabSelected: tabs.selectedTabIndex === dayTab.index
689696
697 reminderValue: mainView.reminderDefaultValue
690 model: eventModel.isReady ? eventModel : null698 model: eventModel.isReady ? eventModel : null
691 bootomEdgeEnabled: tabSelected699 bootomEdgeEnabled: tabSelected
692 displayLunarCalendar: mainView.displayLunarCalendar700 displayLunarCalendar: mainView.displayLunarCalendar
@@ -724,6 +732,7 @@
724 id: agendaViewComp732 id: agendaViewComp
725733
726 AgendaView {734 AgendaView {
735 reminderValue: mainView.reminderDefaultValue
727 model: eventModel.isReady ? eventModel : null736 model: eventModel.isReady ? eventModel : null
728 bootomEdgeEnabled: tabs.selectedTabIndex === agendaTab.index737 bootomEdgeEnabled: tabs.selectedTabIndex === agendaTab.index
729738

Subscribers

People subscribed via source and target branches

to status/vote changes: