webOS Nation Forums > Homebrew > webOS patches > HOWTO - Always enable E-mail app rotation w/ landscape view
1 2 3 4 5 
Member: d2globalinc
at: 12:24 PM 07/09/2009
- UPDATE 07-23-2009 - UPDATED AND CERTIFIED FOR Palm WebOS v1.1.0

THIS HOWTO IS CERTIFIED FOR WEBOS v1.1.0 - DO NOT USE THIS FOR OLDER VERSIONS OF WEBOS!

This HOWTO requires that you already have root access to your phone. If you need more information on how to do that search the forum.

UPDATED JULY 12th, 2009 - NOW INCLUDES BROKEN FORMATTING FIX FOR REPLY/FORWARD E-MAILS
To update or Install just follow the same instructions, the script will restore from the original backup copies first, then make all modifications again.

Click Here to search for my HOWTO's and Answers for the Palm PRE!

NOTES:
This was taken from the original post over at predev.wikidot.com/enable-landscape-viewing - I just put it into a simple script/command set that you can just copy and paste into your ssh / terminal window. Thanks to predev.wikidot.com for the information!

USAGE:
Just open the messaging application and then rotate your Palm Pre! This is the same thing that is enabled when you type the cheat/hidden code "RocknRollHax" in the messaging application, however this enables the feature without having to do that everytime you open the messaging application.


I'll try to make this as simple as possible.

1. Login to your Palm PRE and obtain root access.. (Again look around the forums to see how to do this)

2. Once you are at the "root@castle" prompt COPY and PASTE all of the following code into your terminal / putty / ssh window.. (These commands will make backup copies of the original files, then modify them)


** This will reboot your PRE so be sure to close all of your applications beforehand. **
[code]
#
# ENABLE EMAIL ROTATION - LANDSCAPE MODE
#
mount -o remount,rw /
#
# RESTORE FILES
#
echo RESTORING ORIGINAL FILES IF AVAILABLE
cp /usr/palm/applications/com.palm.app.email/app/controllers/list-assistant.js_1-1-0 /usr/palm/applications/com.palm.app.email/app/controllers/list-assistant.js
cp /usr/palm/applications/com.palm.app.email/app/controllers/compose-assistant.js_1-1-0 /usr/palm/applications/com.palm.app.email/app/controllers/compose-assistant.js
cp /usr/palm/applications/com.palm.app.email/app/controllers/accounts-assistant.js_1-1-0 /usr/palm/applications/com.palm.app.email/app/controllers/accounts-assistant.js
#
# BACKUP FILES
#
echo BACKING UP ORIGINAL FILES
cp /usr/palm/applications/com.palm.app.email/app/controllers/list-assistant.js /usr/palm/applications/com.palm.app.email/app/controllers/list-assistant.js_1-1-0
cp /usr/palm/applications/com.palm.app.email/app/controllers/compose-assistant.js /usr/palm/applications/com.palm.app.email/app/controllers/compose-assistant.js_1-1-0
cp /usr/palm/applications/com.palm.app.email/app/controllers/accounts-assistant.js /usr/palm/applications/com.palm.app.email/app/controllers/accounts-assistant.js_1-1-0
#
# MAKE MODIFICATIONS TO list-assistant.js
#
echo MAKING MODIFICATIONS TO list-assistant.js
sed -i "s/this.controller.setupWidget(Mojo.Menu.commandMenu, undefined, this.cmdMenuModel);/this.controller.setupWidget(Mojo.Menu.commandMenu, undefined, this.cmdMenuModel);\n\
this.controller.window.PalmSystem.setWindowOrientation(\"free\");/g" /usr/palm/applications/com.palm.app.email/app/controllers/list-assistant.js
#
# MAKE MODIFICATIONS TO compose-assistant.js
#
echo MAKING MODIFICATIONS TO compose-assistant.js
sed -i "s/ComposeAssistant.onLoad.defer(this.controller, this.email);/ComposeAssistant.onLoad.defer(this.controller, this.email);\n\
this.controller.window.PalmSystem.setWindowOrientation(\"free\");/g" /usr/palm/applications/com.palm.app.email/app/controllers/compose-assistant.js
#
# MAKE MODIFICATIONS TO compose-assistant.js - FIX BROKEN FORMATTING IN REPLY-FORWARD EMAILS
#
echo MAKING MODIFICATIONS TO compose-assistant.js - FIX BROKEN FORMATTING IN REPLY-FORWARD EMAILS - PART 1
sed -i "s/var splitIndex = originalText.indexOf(\"<body\");/\/* -START- REPLACE BY D2GLOBALINC MODIFICATION TO FIX REPLY-FORWARD FORMATTING\n\
var splitIndex = originalText.indexOf(\"<body\");/g" /usr/palm/applications/com.palm.app.email/app/controllers/compose-assistant.js
#
#
echo MAKING MODIFICATIONS TO compose-assistant.js - FIX BROKEN FORMATTING IN REPLY-FORWARD EMAILS - PART 2
sed -i "s/\/\/ Truncate to 100K if the message is too long./*\/\n\
\/\/ -END- REPLACE BY D2GLOBALINC MODIFICATION TO FIX REPLY-FORWARD FORMATTING\n\
\n\
\/\/ FIX BROKEN FORMATTING IN REPLAY-FORWARD\n\
var splitIndex = originalText.indexOf(\"<body\");\n\
if (splitIndex > 0) {\n\
splitIndex = originalText.indexOf(\'>\', splitIndex);\n\
if (splitIndex > 0) {\n\
splitIndex++;\n\
Mojo.Log.info(\"Slicing header starting at\", splitIndex);\n\
originalText = originalText.slice(splitIndex);\n\
}\n\
} else {\n\
originalText = originalText.gsub(\"\\\n\",\"<br\/>\");\n\
}\n\
\n\
\/\/ Truncate to 100K if the message is too long./g" /usr/palm/applications/com.palm.app.email/app/controllers/compose-assistant.js
#
# MAKE MODIFICATIONS TO accounts-assistant.js
#
echo MAKING MODIFICATIONS TO accounts-assistant.js
sed -i "s/this.controller.listen(this.controller.sceneElement, Mojo.Event.keypress, this.keypressHandler.bind(this));/this.controller.listen(this.controller.sceneElement, Mojo.Event.keypress, this.keypressHandler.bind(this));\n\
this.controller.window.PalmSystem.setWindowOrientation(\"free\");/g" /usr/palm/applications/com.palm.app.email/app/controllers/accounts-assistant.js
#
# COMPLETE UPDATE
#
mount -o remount,ro /
echo INSTALLATION COMPELTE... REBOOTING DEVICE...
/sbin/reboot
#

[/code]

Good Luck! And Happy Hacking!!

- D2G


To restore original files use the following:
[code]
#
# DISABLE EMAIL ROTATION - LANDSCAPE MODE
#
mount -o remount,rw /
#
# RESTORE FILES
#
echo RESTORING ORIGINAL FILES IF AVAILABLE
cp /usr/palm/applications/com.palm.app.email/app/controllers/list-assistant.js_1-1-0 /usr/palm/applications/com.palm.app.email/app/controllers/list-assistant.js
cp /usr/palm/applications/com.palm.app.email/app/controllers/compose-assistant.js_1-1-0 /usr/palm/applications/com.palm.app.email/app/controllers/compose-assistant.js
cp /usr/palm/applications/com.palm.app.email/app/controllers/accounts-assistant.js_1-1-0 /usr/palm/applications/com.palm.app.email/app/controllers/accounts-assistant.js
#
# COMPLETE UPDATE
#
mount -o remount,ro /
echo INSTALLATION COMPELTE... REBOOTING DEVICE...
/sbin/reboot

[/code]
Reply
Member: DNic
at: 12:47 PM 07/09/2009
Thanks these are easy to implement. Was trying to do the patches, but I must be missing something.
Reply
Member: The_lane
at: 01:06 PM 07/09/2009
Copy/pasted the whole thing, worked fine. Good job sir!
Reply
Member: dbarrett5381
at: 01:09 PM 07/09/2009
Worked awesome! Thanks!
Reply
Member: mdmogren
at: 01:22 PM 07/09/2009
Thanks, I didn't care enough to do this until you made it so easy, works great!
Reply
Member: morningisbad
at: 01:52 PM 07/09/2009
wow...i saw this and was a little suspicious...could it really be this easy? and yes...yes it is.
Reply
Member: Bigchris
at: 02:33 PM 07/09/2009
I have to agree, I was scared to root the pre and do this, but it is very easy... THANK YOU VERY MUCH....
Reply
Member: halmo20
at: 03:39 PM 07/09/2009
Thanks! After rooting, I was lost as to how to apply patches!! Your instructions are super easy. I am bookmarking all your HOW TO's. Again, thanks much!!
Reply
Member: Ajax
at: 04:11 PM 07/09/2009
This is very nice! Thanks!
Reply
Member: cell128
at: 04:30 PM 07/09/2009
can you please do the same copy n paste trick for the "enable downloading from web browser"? I really want to enable this. thanx alot
Reply
Member: ldostang
at: 04:34 PM 07/09/2009
Originally Posted by cell128:
can you please do the same copy n paste trick for the "enable downloading from web browser"? I really want to enable this. thanx alot
lol. i wish they were all these simple. i asked if he could do the same with the call duration hack. im trying to get call duration and sms time/date stamps but its not as simple as these.
Reply
Member: majikTib
at: 12:56 AM 07/10/2009
w00t! worked! My first Pre rooting change!
Reply
Member: cannibal869
at: 02:20 AM 07/10/2009
Thanks man super easy!!!
Reply
Member: dsackr
at: 02:41 AM 07/10/2009
d2globalinc - you are my new PRE hero!!!
Reply
Member: SirataXero
at: 04:00 AM 07/10/2009
Originally Posted by dsackr:
d2globalinc - you are my new PRE hero!!!
Pre-ro?

O_o
Reply
Member: bobvr
at: 04:18 AM 07/10/2009
Thanks, worked great.
Reply
Member: erider81
at: 10:38 AM 07/10/2009
thank you very much. worked perfect.
Reply
Member: zxi
at: 02:59 PM 07/10/2009
Thanks, worked perfectly!
Reply
Member: Xyg
at: 04:19 PM 07/10/2009
Can't you just type RocknRollHax if you don't feel like rooting?
Reply
Member: ldostang
at: 04:22 PM 07/10/2009
Originally Posted by Xyg:
Can't you just type RocknRollHax if you don't feel like rooting?
yes you can but you would have to do it everytime you reopen the email app.
Reply
Tagsemail, landscape, rocknrollhax
1 2 3 4 5 
webOS Nation Forums > Homebrew > webOS patches > HOWTO - Always enable E-mail app rotation w/ landscape view