ubuntu-touch-coreapps-reviewers team mailing list archive
-
ubuntu-touch-coreapps-reviewers team
-
Mailing list archive
-
Message #08989
[Merge] lp:~renatofilho/ubuntu-calendar-app/fix-1470583 into lp:ubuntu-calendar-app
Renato Araujo Oliveira Filho has proposed merging lp:~renatofilho/ubuntu-calendar-app/fix-1470583 into lp:ubuntu-calendar-app.
Commit message:
Fix reminder save.
Remove audible reminder if the event is marked with 'no reminder';
Make sure that audible reminders are saved with 0 repetition;
Requested reviews:
Nekhelesh Ramananthan (nik90)
Ubuntu Calendar Developers (ubuntu-calendar-dev)
Related bugs:
Bug #1470583 in Ubuntu Calendar App: "Phone notifies me of calendar events multiple times."
https://bugs.launchpad.net/ubuntu-calendar-app/+bug/1470583
For more details, see:
https://code.launchpad.net/~renatofilho/ubuntu-calendar-app/fix-1470583/+merge/289705
--
Your team Ubuntu Calendar Developers is requested to review the proposed merge of lp:~renatofilho/ubuntu-calendar-app/fix-1470583 into lp:ubuntu-calendar-app.
=== modified file 'EventDetails.qml'
--- EventDetails.qml 2016-03-21 14:40:17 +0000
+++ EventDetails.qml 2016-03-21 19:49:22 +0000
@@ -136,7 +136,9 @@
}
function updateReminder(event) {
- var reminder = event.detail(Detail.VisualReminder)
+ //TODO: implment support for display information about all reminder
+ // We can have multiples Audible and Visible reminders.
+ var reminder = event.detail(Detail.AudibleReminder)
if(reminder) {
for(var i=0; i<reminderModel.count; i++) {
if(reminder.secondsBeforeStart === reminderModel.get(i).value) {
=== modified file 'EventReminder.qml'
--- EventReminder.qml 2016-01-29 14:47:31 +0000
+++ EventReminder.qml 2016-03-21 19:49:22 +0000
@@ -24,11 +24,12 @@
id:root
objectName: "eventReminder"
- property var visualReminder: null
property var audibleReminder: null
property var reminderModel: null
property var eventTitle: null
- property var reminderTime: visualReminder.secondsBeforeStart
+ property int reminderTime: -1
+
+ signal reminderTimeUpdated(int value);
visible: false
flickable: null
@@ -37,26 +38,7 @@
head.backAction: Action{
iconName:"back"
onTriggered:{
- var repeatCount = 3;
- var repeatDelay = 5 * 60;
-
- //reminder on event time
- if( reminderTime === 0 ) {
- repeatCount = 0;
- repeatDelay = 0;
- } else if( reminderTime === 300) { //5 min
- repeatCount = 1;
- }
-
- visualReminder.repetitionCount = repeatCount;
- visualReminder.repetitionDelay = repeatDelay;
- visualReminder.message = eventTitle
- visualReminder.secondsBeforeStart = reminderTime;
-
- audibleReminder.repetitionCount = repeatCount;
- audibleReminder.repetitionDelay = repeatDelay;
- audibleReminder.secondsBeforeStart = reminderTime;
-
+ reminderTimeUpdated(reminderTime)
pop();
}
}
=== modified file 'NewEvent.qml'
--- NewEvent.qml 2016-03-18 00:40:37 +0000
+++ NewEvent.qml 2016-03-21 19:49:22 +0000
@@ -42,8 +42,7 @@
property var startDate;
property var endDate;
- //default reminder time = 15 min
- property int reminderValue: 900;
+ property alias reminderValue: eventReminder.reminderValue
property alias scrollY: flickable.contentY
property bool isEdit: false
@@ -75,7 +74,6 @@
function updateEventInfo(date, allDay) {
selectCalendar(model.getDefaultCollection().collectionId);
- eventReminder.reminderValue = root.reminderValue
updateEventDate(date, allDay)
}
@@ -165,13 +163,12 @@
}
}
}
- var reminder = e.detail( Detail.VisualReminder);
+ var reminder = e.detail(Detail.AudibleReminder);
if (reminder) {
- visualReminder.secondsBeforeStart = reminder.secondsBeforeStart;
+ root.reminderValue = reminder.secondsBeforeStart
} else {
- visualReminder.secondsBeforeStart = reminderModel.get(0).value;
+ root.reminderValue = -1
}
-
selectCalendar(e.collectionId);
}
@@ -225,20 +222,21 @@
}
}
- //remove old reminder value
- var oldVisualReminder = event.detail(Detail.VisualReminder);
- if(oldVisualReminder) {
- event.removeDetail(oldVisualReminder);
+ // update audible reminder time if necessary
+ // TODO: we only support audible reminders for now
+ var reminder = event.detail(Detail.AudibleReminder);
+ if (root.reminderValue >= 0) {
+ if (!reminder) {
+ reminder = Qt.createQmlObject("import QtOrganizer 5.0; AudibleReminder {}", root, "")
+ reminder.repetitionCount = 0
+ reminder.repetitionDelay = 0
+ }
+ reminder.secondsBeforeStart = root.reminderValue
+ event.setDetail(reminder)
+ } else if (reminder) {
+ event.removeDetail(reminder)
}
- var oldAudibleReminder = event.detail(Detail.AudibleReminder);
- if(oldAudibleReminder) {
- event.removeDetail(oldAudibleReminder);
- }
- if(visualReminder.secondsBeforeStart >= 0) {
- event.setDetail(visualReminder);
- event.setDetail(audibleReminder);
- }
event.collectionId = calendarsOption.model[calendarsOption.selectedIndex].collectionId;
model.setDefaultCollection(event.collectionId);
@@ -254,17 +252,6 @@
}
}
- VisualReminder{
- id: visualReminder
- secondsBeforeStart: root.reminderValue
-
- onSecondsBeforeStartChanged: eventReminder.reminderValue = visualReminder.secondsBeforeStart
- }
- AudibleReminder{
- id: audibleReminder
- secondsBeforeStart: root.reminderValue
- }
-
function getDaysOfWeek(){
var daysOfWeek = [];
switch(recurrenceOption.selectedIndex){
@@ -748,11 +735,13 @@
if (!stack)
stack = bottomEdgePageStack
- stack.push(Qt.resolvedUrl("EventReminder.qml"),
- {"visualReminder": visualReminder,
- "audibleReminder": audibleReminder,
- "reminderModel": reminderModel,
- "eventTitle": titleEdit.text})
+ var reminderPick = stack.push(Qt.resolvedUrl("EventReminder.qml"),
+ {"reminderTime": root.reminderValue,
+ "reminderModel": reminderModel,
+ "eventTitle": titleEdit.text})
+ reminderPick.reminderTimeUpdated.connect(function(value) {
+ root.reminderValue = value
+ })
}
}
Follow ups