Difference between revisions of "Patch Email Enable Landscape Viewing"

From WebOS Internals
Jump to navigation Jump to search
Line 86: Line 86:
  
 
-Mamouton
 
-Mamouton
 +
 +
7/24/2009 With the 1.1 update there is no need to edit '''ANY''' pages.
 +
 +
-NetWhiz

Revision as of 12:04, 24 July 2009

Currently does NOT work in 1.1. Typing "wide" at the account listing activates this feature in 1.1, but it is not persistent between application launches. Further work needs to be done to make it persistent and not require a keyword entry.

Preamble

You will need write permissions to the file system on your Pre to apply this patch.

To get write persmissions execute:

rootfs_open -w

After you've made the changes below, remount the file system as read-only:

mount -o remount,ro /

Procedure

Enabling rotation in email is trivial. Whenever you rotate the device, the system calls the orientationChanged function of the app. There's already one defined in email, but for some reason it does nothing. You can enable rotation by applying the following patches.

NOTE: The root of the patches is /usr/palm/applications/com.palm.app.email/

app/controllers/list-assistant.js

--- list-assistant.js_2009-06-27	Sat Jun 27 19:19:19 2009
+++ list-assistant.js	Sat Jun 27 20:03:19 2009
@@ -27,6 +27,9 @@
 				{label:$L('Update'), icon:'sync', command:'sync'}
 			]};
 	this.controller.setupWidget(Mojo.Menu.commandMenu, undefined, this.cmdMenuModel);
+	
+	// enable free orientation
+	this.controller.window.PalmSystem.setWindowOrientation("free");
   },
 
   // NOTE: this is called by app_scene's _setup function

app/controllers/compose-assistant.js

--- compose-assistant.js_2009-06-27	Sat Jun 27 19:21:43 2009
+++ compose-assistant.js	Sat Jun 27 20:03:45 2009
@@ -178,6 +178,9 @@
 
 		// Delayed a little, since we want the header part of render as quickly as possible
 		ComposeAssistant.onLoad.defer(this.controller, this.email);
+		
+		// enable free orientation
+		this.controller.window.PalmSystem.setWindowOrientation("free");
 	},
 
 	cleanup: function() {

app/controllers/accounts-assistant.js

--- accounts-assistant.js_2009-06-27	Sat Jun 27 19:29:47 2009
+++ accounts-assistant.js	Sat Jun 27 20:01:28 2009
@@ -51,6 +51,9 @@
 		EmailAppDepot.depot.isShowFavorites(AccountsAssistant.kFavoriteFoldersAccountID, this.depotGetFavExpanded.bind(this));
 
 		this.controller.listen(this.controller.sceneElement, Mojo.Event.keypress, this.keypressHandler.bind(this));
+		
+		// enable free orientation                                                 
+                this.controller.window.PalmSystem.setWindowOrientation("free");
 	},
 
 	cleanup: function() {

Notes

Credit goes to jblebrun for the original hack.

Seems that the menu disappears in landscape mode and that the orientation mode carries over from one part of the app to the other as you move to a message or back to the message list or account list. This is especially weird in the compose screen since the menu has some needed functionality in it ~ FXDemolisher

Curious item found in accounts-assitant.js. There seems to be an orientationString variable in the controller that is linked to some kind of hack if you type a specific string while having the account(folder) list open. Will investigate further.

UPDATE: Seems that typing "RocknRollHax" (see ./app/controllers/accounts-assistant.js) in the accounts list window will cause the email app to go into 'free' orientation mode. Looks like its an easier way to perform orientation changes instead of explicitly calling setWindowOrientation whenever the orientation changes.

Alternate to RocknRollHax: In accounts-assistant.js, change key word in line 106 to 'wide' or whatever you want. Change string length in line 104 to num characters of your new key word. - xorg

- FXDemolisher

7/24/2009 With the 1.1 update there is no need to edit the compose-assistant.js file referenced in the original mod.

-Mamouton

7/24/2009 With the 1.1 update there is no need to edit ANY pages.

-NetWhiz