Skip to content

Commit

Permalink
Updated for 1.3.1
Browse files Browse the repository at this point in the history
  • Loading branch information
lclarkjr committed Nov 16, 2009
1 parent 4f762c9 commit bf3eb67
Showing 1 changed file with 36 additions and 31 deletions.
67 changes: 36 additions & 31 deletions calendar/calendar-notification-repeat.patch
Original file line number Diff line number Diff line change
@@ -1,59 +1,64 @@
This patch will repeat the reminder notification every 2 minutes until you either dismiss or snooze the reminder.

11-15-09:
Updated for 1.3.1
Index: /usr/palm/applications/com.palm.app.calendar/app/controllers/app-assistant.js
===================================================================
--- .orig/usr/palm/applications/com.palm.app.calendar/app/controllers/app-assistant.js
+++ /usr/palm/applications/com.palm.app.calendar/app/controllers/app-assistant.js
@@ -95,6 +95,9 @@ var AppAssistant = Class.create({
}
@@ -98,6 +98,9 @@ var AppAssistant = Class.create({
else if (launchParams.alarmclose){
//console.error("$$$$$$$$ AppAssistant handleLaunch : alarmclose");
this.closeReminder(launchParams.alarmclose);
+ }
+ else if (launchParams.playalarmsound){
+ this.playAlarmSound();
}
else if (launchParams.dayChange){
this.dayChange();
@@ -236,6 +239,13 @@ var AppAssistant = Class.create({
@@ -241,7 +244,14 @@ var AppAssistant = Class.create({
}
//console.error("$$$$$$$$ AppAssistant closeReminder:end");
},

-
+
+ playAlarmSound: function() {
+ if (this.openReminderAlert) {
+ this.openReminderAlert.playAlarmSound();
+ this.openReminderAlert = null;
+ }
+ },
+
+
scheduleNextReminder: function(eventId) {
//console.error("$$$$$$$$ AppAssistant scheduleNextReminder: for event:"+eventId);
new Mojo.Service.Request('palm://com.palm.calendar', {
method: 'scheduleNextReminder',
Index: /usr/palm/applications/com.palm.app.calendar/app/controllers/reminder-assistant.js
===================================================================
--- .orig/usr/palm/applications/com.palm.app.calendar/app/controllers/reminder-assistant.js
+++ /usr/palm/applications/com.palm.app.calendar/app/controllers/reminder-assistant.js
@@ -49,6 +49,9 @@ var ReminderAssistant = Class.create({
this.removeAutoCloseTask();

@@ -57,6 +57,9 @@ var ReminderAssistant = Class.create({
}
}
//console.error("$$$$$$$$ Reminder-assistant cleanup:end:");
+
+ //remove the Notification repeat task
+ this.removePlayAlarmSoundTask();
},

remindersUpdated: function() {
@@ -67,6 +70,9 @@ var ReminderAssistant = Class.create({
this.reminder = this.reminders.getMostRecentReminder();
@@ -90,6 +93,9 @@ var ReminderAssistant = Class.create({
this.scheduleAutoCloseTask();
this.updateDisplay();
//console.error("$$$$$$$$ Reminder-assistant updateMostRecentReminder:end");
+
+ //setup the notification repeat task
+ this.schedulePlayAlarmSoundTask();
},

updateDisplay: function() {
@@ -269,6 +275,14 @@ var ReminderAssistant = Class.create({
this.dismissed = true; // prevent snooze
@@ -312,6 +318,14 @@ var ReminderAssistant = Class.create({
this.closeAlert();
//console.error("$$$$$$$$ Reminder-assistant autoCloseAlert: end " + this.reminder.id);
},
+
+ playAlarmSound: function() {
Expand All @@ -62,37 +67,37 @@ Index: /usr/palm/applications/com.palm.app.calendar/app/controllers/reminder-ass
+ this.DEFAULT_SNOOZE = 0;
+ this.closeAlert();
+ },
+
specialCleanup:function(){
Mojo.Log.info("****************in special cleanup");
this.shuttingDown =true;
@@ -308,6 +322,29 @@ var ReminderAssistant = Class.create({
+
specialCleanup:function(eventId){
//console.error("$$$$$$$$ Reminder-assistant specialCleanup: start:**********"+eventId );
//we need to do this so that cleanup snoozes the right reminder
@@ -360,6 +374,29 @@ var ReminderAssistant = Class.create({
});
//console.error("$$$$$$$$ Reminder-assistant removeAutoCloseTask: end " + this.reminder.id);
},
+
+ schedulePlayAlarmSoundTask: function() {
+ //retrigger reminder every two minutes until we acknowledge it.
+ //change the value in addMinutes to a value other than 2 if you prefer a different time span for the notification repeat.
+ //ultimatly it would be best to add this to the preferences page.
+ var playSoundTime = new Date().addMinutes(2);
+
+
+ this.controller.serviceRequest('palm://com.palm.taskScheduler', {
+ method: 'updateTask',
+ parameters: {uri: 'palm://com.palm.applicationManager/open',
+ arguments: {'id': 'com.palm.app.calendar',
+ 'params': {'playalarmsound': 'true'}},
+ key: 'calendar-playalarmsound',
+ start: {date: playSoundTime.toUTCString()}}
+ });
+ method: 'updateTask',
+ parameters: {uri: 'palm://com.palm.applicationManager/open',
+ arguments: {'id': 'com.palm.app.calendar',
+ 'params': {'playalarmsound': 'true'}},
+ key: 'calendar-playalarmsound',
+ start: {date: playSoundTime.toUTCString()}}
+ });
+ },
+
+ removePlayAlarmSoundTask: function() {
+ this.controller.serviceRequest('palm://com.palm.taskScheduler', {
+ method: 'removeTask',
+ parameters: {key: 'calendar-playalarmsound'}
+ });
+ },
+
+ },
replaceHTML: function(element, content) {
var range = element.ownerDocument.createRange();
range.selectNode(element);
//console.error("$$$$$$$$ Reminder-assistant replaceHTML:start");

0 comments on commit bf3eb67

Please sign in to comment.