Difference between revisions of "Set Email as High Priority & Discard Message"

From WebOS Internals
Jump to: navigation, search
 
Line 40: Line 40:
 
Update: Added discard message confirmation popup and removed the items from menu.  
 
Update: Added discard message confirmation popup and removed the items from menu.  
  
Around line 89 you will see
+
 
<pre><nowiki>
 
this.appMenuModel = {
 
visible:true,
 
items: [
 
this.priorityFlagMenuItem,
 
{label:$L('Discard Message'), command:'cancel'},
 
{label:$L('Save as Draft'),  command:'save', disabledProperty:true }
 
]};
 
</nowiki></pre>
 
 
Comment out the this priority and discard message, it should look like this
 
Comment out the this priority and discard message, it should look like this
<pre><nowiki>
 
this.appMenuModel = {
 
visible:true,
 
items: [
 
//this.priorityFlagMenuItem,
 
//{label:$L('Discard Message'), command:'cancel'},
 
{label:$L('Save as Draft'),  command:'save', disabledProperty:true }
 
]};
 
 
</nowiki></pre>
 
 
Around line 238 you will see
 
Around line 238 you will see
 
<pre><nowiki>
 
<pre><nowiki>

Latest revision as of 18:46, 5 November 2009

I really don't like using the menu options. After seeing Jason's move folder patch, I started thinking how can I move the High Priority and Discard message to the bottom.

Always make a backup copy.

cd /usr/palm/applications/com.palm.app.email/app/controllers/ 
cp compose-assistant.js compose-assistant.js.bak
vi compose-assistant.js

Around line 82 you will see

this.cmdMenuModel = {
				visible: true,
				menuClass: 'palm-white',
				items: [
					{label:$L('Attach'), icon:'attach', command:'attach'},
					{label:('Send'), icon:'send', command:'send'}
				]}; 

add the lines

 
                                        {label:$L('Priority'), icon:'priority', command:'priority'},
					{label:$L('Delete'),icon:'delete', command:'cancel'}, 

to make it look like this

 this.cmdMenuModel = {
				visible: true,
				menuClass: 'palm-white',
				items: [
					{label:$L('Attach'), icon:'attach', command:'attach'},
					{label:$L('Priority'), icon:'priority', command:'priority'},
					{label:$L('Delete'),icon:'delete', command:'cancel'},
					{label:('Send'), icon:'send', command:'send'}
				]}; 

Update: Added discard message confirmation popup and removed the items from menu.


Comment out the this priority and discard message, it should look like this Around line 238 you will see

                                       case 'cancel':
					this.cancelCompose();
					break;

change it to

                                case 'cancel':
				this.controller.showAlertDialog({
			        onChoose: function(value) {if (value == 'yes'){this.cancelCompose();}},
				title: $L("Discard this Draft?"),
				message: $L("This cannot be undone"),
				choices:[
					{label:$L('Yes'), value:"yes", type:'negative'},  
					{label:$L("No"), value:"no", type: 'dismiss'}
						]
				});
                                break;

Special Thanks to Jason on Precentral for the realization that menu items could be moved and the creator of the Read All Delete All patch for the icons.

Special Thanks to Tibfib for his creation of the discard message confirmation and removing the menu items.