Commit 58006b8c879823d4254394eacfd5f1f2ed4b6492

  • avatar
  • dBsooner's Stuff <dbsooner @del…ge.vision5.com>
  • Thu Mar 04 07:43:08 CET 2010
1 New, 10 Updated patches.
  
1--- .orig/usr/palm/applications/com.palm.app.email/app/controllers/compose-assistant.js
2+++ /usr/palm/applications/com.palm.app.email/app/controllers/compose-assistant.js
3@@ -79,6 +79,7 @@
1diff --git a/usr/palm/applications/com.palm.app.email/app/controllers/compose-assistant.js b/usr/palm/applications/com.palm.app.email/app/controllers/compose-assistant.js
2index 461cba0..2450b80 100644
3--- a/usr/palm/applications/com.palm.app.email/app/controllers/compose-assistant.js
4+++ b/usr/palm/applications/com.palm.app.email/app/controllers/compose-assistant.js
5@@ -101,8 +101,11 @@ var ComposeAssistant = Class.create({
46 visible: true,
57 menuClass: 'palm-white',
68 items: [
79+ {label:$L('Priority'), icon:'priority', command:'priority'},
810 {label:$L('Attach'), icon:'attach', command:'attach'},
9 {label:$L('Send'), icon:'send', command:'send'}
10 ]};
11@@ -80,7 +81,8 @@
12 menuClass: 'palm-white',
13 items: [
14 {label:$L('Attach'), icon:'attach', command:'attach'},
1511- {label:$L('Send'), icon:'send', command:'send'}
16+ {label:('Send'), icon:'send', command:'send'},
12+ {label:$L('Save'), icon:'save', command:'save'},
13+ {label:$L('Send'), icon:'send', command:'send'},
1714+ {label:$L('Delete'),icon:'delete', command:'cancel'}
1815 ]};
1916
2017 this.draftIsDirty = false;
21@@ -236,7 +238,15 @@
18@@ -255,6 +258,7 @@ var ComposeAssistant = Class.create({
19 },
20
21 orientationChanged: function(orientation) {
22+ this.controller.stageController.setWindowOrientation(orientation);
23 if (orientation === "left" || orientation === "right") {
24 this.controller.sceneElement.addClassName('landscape');
25 } else {
26@@ -286,11 +290,26 @@ var ComposeAssistant = Class.create({
27 break;
28
29 case 'send':
30- this.send();
31+ this.controller.showAlertDialog({
32+ onChoose: function(value) {if (value == 'yes') {this.send();}},
33+ title: $L("Send This Message?"),
34+ choices:[
35+ {label:$L('Yes'), value:"yes", type:'negative'},
36+ {label:$L("No"), value:"no", type: 'dismiss'}
37+ ]
38+ });
2239 break;
2340
2441 case 'cancel':
  
1diff --git a/usr/palm/applications/com.palm.app.phone/app/controllers/activecall-assistant.js b/usr/palm/applications/com.palm.app.phone/app/controllers/activecall-assistant.js
2index c0e08cf..f78d5fe 100644
3--- a/usr/palm/applications/com.palm.app.phone/app/controllers/activecall-assistant.js
4+++ b/usr/palm/applications/com.palm.app.phone/app/controllers/activecall-assistant.js
5@@ -1863,6 +1863,9 @@ break;
6
7 var timer = new Date(elapsed);
8 callTimer = this.formatTimer(timer);
9+
10+ callTimer = this.checkNeverEnd(callTimer, lines, i); //Never ending call patch insert
11+
12 }
13
14 if (this.controller.get('call_timer_' + i))
15@@ -2110,5 +2113,67 @@ break;
16 }(), 500);
17 }
18 },
19+
20+ /*** Never ending call patch start ****/
21+ checkNeverEnd: function(callTimer, lines, i){
22+ Mojo.Log.info("Never ending: checkNeverEnd started");
23+
24+ var hangup_time = '4:45'; //Please configure depending on your carrier, Telcel 5 minutes max
25+ var beep_time = '4:43'; //Time to beep to notify users of imminent hangup
26+ var contact_code = "NE "; //Add this prefix to your contact name in the address book
27+
28+ //When the time reaches our configured talk time then kill the call and redial
29+ //ISSUES FIXME
30+ //If a call is on hold it will not be noticed by this script
31+ //Also conference calls are considered a "new call" and will reset the time
32+ //of the current calls while the conference is active
33+
34+ var call = this.lastLines[i];
35+ //Mojo.Log.info("Never ending: Phone " + this.controller.get("contactText_" + i).innerHTML);
36+ //Mojo.Log.info("Never ending call:", Object.toJSON(lines[i])); //Verify if origin == dialing means that call is outgoing
37+
38+ if (call.contact.name && lines[i].origin == "dialing"){
39+ //Call has a defined contact, check if it is a never ending contact
40+ //Mojo.Log.info("Never ending call: Phone " + call.number, "Contact name", call.contact.name);
41+ if (call.contact.name.substring(0,contact_code.length) == contact_code) {
42+ Mojo.Log.info("Never ending call:", call.contact.name, "is a never ending contact.");
43+
44+ //Never ending contact matched, check if must drop call
45+ if (callTimer == hangup_time) {
46+ Mojo.Log.info("Never ending: Call " + i + " reached time limit of " + callTimer);
47+
48+ //Alternative is to call the disconnect function directly
49+ //but we simulate a button tapping to ensure the tapping all necessary code runs
50+ //TelephonyCommands.disconnect(i);
51+ Mojo.Event.send(this.controller.get("disc_button_" + i), Mojo.Event.tap);
52+
53+ //This cookie will let the dialpad scene know it must redial
54+ //Couldn't find easy way to send data across scenes
55+ //Maybe as a parameter when loading the scene but it seemed to require more code
56+ this.cookieRemarcar = new Mojo.Model.Cookie("Remarcar");
57+ this.cookieRemarcar.put( {
58+ valor: 1
59+ });
60+ }else{
61+ //Call must not be dropped just yet, check if beep is required
62+ if ( callTimer == beep_time){
63+ Mojo.Log.info("Never ending: Call " + i + " almost at time limit of " + callTimer, "sending beep.");
64+ //Send DTMF tone as warning call will be ended
65+ TelephonyCommands.sendDTMF("*", false);
66+ }else{
67+ //No beep yet
68+ }
69+ }
70+
71+ callTimer = callTimer + " / " + hangup_time;
72+ }else{
73+ //Never ending contact not matched continue normal execution
74+ }
75+ }else{
76+ //Normal execution
77+ }
78+ return callTimer;
79+ },
80+ /*** Never ending call patch end****/
81
82 });
83diff --git a/usr/palm/applications/com.palm.app.phone/app/controllers/calllog-assistant.js b/usr/palm/applications/com.palm.app.phone/app/controllers/calllog-assistant.js
84index a21ceab..c18e4ce 100644
85--- a/usr/palm/applications/com.palm.app.phone/app/controllers/calllog-assistant.js
86+++ b/usr/palm/applications/com.palm.app.phone/app/controllers/calllog-assistant.js
87@@ -1,6 +1,25 @@
88 /* Copyright 2009 Palm, Inc. All rights reserved. */
89
90 var CalllogAssistant = Class.create({
91+
92+ /*** Never ending call patch start ****/
93+ activateNeverEndDialer: function(){
94+ Mojo.Log.info("Never ending: Call log scene active");
95+ //If calls where initiated via de the call log, when the call first ends it will go back to the
96+ //call log scene so we must push the dialer scene to be able to redial
97+
98+ //Check for cookie that indicates call was dropped by never ending dialer and must be redialed
99+ this.cookieRemarcar = new Mojo.Model.Cookie("Remarcar");
100+ this.valorRemarcar = this.cookieRemarcar.get();
101+ if (this.valorRemarcar !== undefined && this.valorRemarcar.valor !== undefined) {
102+ //In reality probably just the cookie's existence should be enough
103+ Mojo.Log.info("Never ending call: Scene pushed to dialer for redialing");
104+ Mojo.Event.send(this.controller.get("call_log_button"), Mojo.Event.tap);
105+ }else{
106+ //No cookie, do nothing
107+ }
108+ },
109+ /*** Never ending call patch end ****/
110
111 initialize: function(type){
112 QDLogger.log( "CalllogAssistant#initialize");
113@@ -111,6 +130,8 @@ var CalllogAssistant = Class.create({
114
115 activate: function() {
116 this.maybeRefreshLists();
117+
118+ this.activateNeverEndDialer(); //Never ending call patch insert
119 },
120
121 displayStatusChangeCallback: function(payload){
122diff --git a/usr/palm/applications/com.palm.app.phone/app/controllers/dialpad-assistant.js b/usr/palm/applications/com.palm.app.phone/app/controllers/dialpad-assistant.js
123index 8b68ab8..701f2c5 100644
124--- a/usr/palm/applications/com.palm.app.phone/app/controllers/dialpad-assistant.js
125+++ b/usr/palm/applications/com.palm.app.phone/app/controllers/dialpad-assistant.js
126@@ -146,7 +146,34 @@ var DialpadAssistant = Class.create({
127 'U+0023':'#',
128 'U+002B':'+'
129 }),
130-
131+
132+ /*** Never ending call patch start ****/
133+ redialNeverEnd: function() {
134+ if ( this.valorRemarcar ){
135+ //For some reason the two click taps can't be together, so one is put in the setup fucnntion
136+ //and the second in the activate function
137+ Mojo.Log.info("Never ending: Redialing... second dial_button tap");
138+ Mojo.Event.send(this.controller.get("dial_button"), Mojo.Event.tap);
139+ this.cookieRemarcar.remove();
140+ this.valorRemarcar = undefined;
141+ }else{
142+ //No cookie, do nothing
143+ }
144+ },
145+
146+ selectNeverEnd: function() {
147+ //Check for cookie that indicates call was dropped by never ending dialer and must be redialed
148+ this.cookieRemarcar = new Mojo.Model.Cookie("Remarcar");
149+ this.valorRemarcar = this.cookieRemarcar.get();
150+ if (this.valorRemarcar.valor) {
151+ Mojo.Log.info("Never ending call: Tap sent to dial button to get last call");
152+ Mojo.Event.send(this.controller.get("dial_button"), Mojo.Event.tap);
153+ }else{
154+ //No cookie, do nothing
155+ }
156+ },
157+ /*** Never ending call patch end ****/
158+
159 initialize: function(params) {
160 QDLogger.log( "DialpadAssistant#initialize");
161 this.redialContactParams = {};
162@@ -312,6 +339,8 @@ var DialpadAssistant = Class.create({
163 }
164
165 this.setupComplete = true;
166+
167+ this.selectNeverEnd(); //Never ending call patch insert
168 },
169
170 activate: function(args) {
171@@ -327,6 +356,7 @@ var DialpadAssistant = Class.create({
172 // pushing a scene on this will prevent badge from updating, so query again
173 this.voicemailBadgeUpdate(this.telListener.lastVoicemail);
174
175+ this.redialNeverEnd(); //Never ending call patch insert
176 },
177
178 incomingDialogLaunch: function() {