Difference between revisions of "Patch Messaging Landscape Orientation"

From WebOS Internals
Jump to: navigation, search
 
(9 intermediate revisions by one other user not shown)
Line 1: Line 1:
Landscape Orientation in Messagin app:
+
{{template:patch}}
 +
Landscape Orientation in Messagin App:
  
first file we should edit is '''/usr/palm/applications/com.palm.app.messaging/app/controllers/compose-assistant.js'''
+
 
around line 390 u will see this:
+
'''MUST BE IN [root@castle:/#] TO INSTALL'''
<pre>  var ComposeAssistant = Class.create({
+
<pre>cd /opt/src/modifications
  }
+
git pull
this.setCharacterCounterMaxLength();
+
cd /
  },</pre>
+
quilt import /opt/src/modifications/message-orientation.patch
add this code right under it
+
quilt push -a -f</pre>
<pre> orientationChanged: function(orientation) {
+
'''''to apply this patch just copy the above how-to and then you will be done..thats it !!'''''
if (orientation === "left" || orientation === "right") {
+
 
this.controller.sceneElement.addClassName('landscape');
+
 
} else {
+
----
this.controller.sceneElement.removeClassName('landscape');
+
 
}
+
 
},</pre>
+
Manually doing this patch you will have to put the codes in the patch in their corresponding places..
once you are done it should look like this:
+
 
<pre>var ComposeAssistant = Class.create({
+
 
 +
'''PATCH CODE'''
 +
<pre>Index: /usr/palm/applications/com.palm.app.messaging/app/controllers/chatview-assistant.js
 +
===================================================================
 +
--- .orig/usr/palm/applications/com.palm.app.messaging/app/controllers/chatview-assistant.js
 +
+++ /usr/palm/applications/com.palm.app.messaging/app/controllers/chatview-assistant.js
 +
@@ -97,7 +97,9 @@ var ChatviewAssistant = Class.create({
 +
 +
setup: function(){
 +
this.controller.setupWidget(Mojo.Menu.appMenu, this.appMenuAttrs, this.appMenuModel);
 +
-
 +
+
 +
+ // enable free orientation
 +
+ this.controller.window.PalmSystem.setWindowOrientation("free");
 +
var messageTextWidgetAttributes = {
 +
modelProperty: 'value',
 +
hintText: $L('Enter message here...'),
 +
@@ -196,6 +198,14 @@ var ChatviewAssistant = Class.create({
 +
this.handleFocus();
 +
}
 +
},
 +
+
 +
+ orientationChanged: function(orientation) {
 +
+ if (orientation === "left" || orientation === "right") {
 +
+ this.controller.sceneElement.addClassName('landscape');
 +
+ } else {
 +
+ this.controller.sceneElement.removeClassName('landscape');
 +
+ }
 +
+ },
 +
 +
cleanup: function(){
 +
this.chatViewHeaderClickTarget.stopObserving(Mojo.Event.tap, this.handleHeaderTap);
 +
Index: /usr/palm/applications/com.palm.app.messaging/app/controllers/compose-assistant.js
 +
===================================================================
 +
--- .orig/usr/palm/applications/com.palm.app.messaging/app/controllers/compose-assistant.js
 +
+++ /usr/palm/applications/com.palm.app.messaging/app/controllers/compose-assistant.js
 +
@@ -73,7 +73,9 @@ var ComposeAssistant = Class.create({
 +
 +
  setup: function() {
 +
    this.controller.setupWidget(Mojo.Menu.appMenu, this.appMenuAttrs, this.appMenuModel);
 +
-
 +
+
 +
+    // enable free orientation
 +
+ this.controller.window.PalmSystem.setWindowOrientation("free");
 +
this.searchList = {
 +
"property": "to$A",
 +
"includeEmails": false,
 +
@@ -386,6 +388,14 @@ var ComposeAssistant = Class.create({
 
     }
 
     }
 
  this.setCharacterCounterMaxLength();
 
  this.setCharacterCounterMaxLength();
 
   },
 
   },
+
+
orientationChanged: function(orientation) {
+
+ orientationChanged: function(orientation) {
if (orientation === "left" || orientation === "right") {
+
+ if (orientation === "left" || orientation === "right") {
this.controller.sceneElement.addClassName('landscape');
+
+ this.controller.sceneElement.addClassName('landscape');
} else {
+
+ } else {
this.controller.sceneElement.removeClassName('landscape');
+
+ this.controller.sceneElement.removeClassName('landscape');
}
+
+ }
},
+
+ },
 
    
 
    
 
   cleanup: function() {
 
   cleanup: function() {
     var that = this;</pre>
+
     var that = this;
now save and exit. new file we should edit is '''listview-assistant.js''' same directory.
+
Index: /usr/palm/applications/com.palm.app.messaging/app/controllers/listview-assistant.js
around line 212 under '''var ListviewAssistant = Class.create(App e''' in the line:
+
===================================================================
<pre>this.controller.setupWidget(Mojo.Menu.commandMenu, {}, this.cmdMenuModel);</pre>
+
--- .orig/usr/palm/applications/com.palm.app.messaging/app/controllers/listview-assistant.js
edit it so that it looks like this then right under it add:
+
+++ /usr/palm/applications/com.palm.app.messaging/app/controllers/listview-assistant.js
<pre>this.controller.setupWidget(Mojo.Menu.commandMenu, undefined, this.cmdMenuModel);
+
@@ -212,8 +212,10 @@ var ListviewAssistant = Class.create(App
// enable free orientation
 
this.controller.window.PalmSystem.setWindowOrientation("free");</pre>
 
should look like:
 
<pre>var ListviewAssistant = Class.create(App
 
 
  items:this.commandMenuModel  
 
  items:this.commandMenuModel  
 
     };   
 
     };   
 
 
 
 
   this.controller.setupWidget(Mojo.Menu.commandMenu, undefined, this.cmdMenuModel);
+
-    this.controller.setupWidget(Mojo.Menu.commandMenu, {}, this.cmdMenuModel);
+
-
// enable free orientation
+
+   this.controller.setupWidget(Mojo.Menu.commandMenu, undefined, this.cmdMenuModel);
this.controller.window.PalmSystem.setWindowOrientation("free");
+
+
 +
+ // enable free orientation
 +
+ this.controller.window.PalmSystem.setWindowOrientation("free");
 
  this.filterField = this.controller.get('filterField');
 
  this.filterField = this.controller.get('filterField');
 
  this.buddyListHeader = this.controller.get('buddyListHeader');
 
  this.buddyListHeader = this.controller.get('buddyListHeader');
     this.controller.setupWidget('filterField',{filterFieldName:'filterFieldElement'},this.filterField);</pre>
+
     this.controller.setupWidget('filterField',{filterFieldName:'filterFieldElement'},this.filterField);
then around line 409 above '''handleCommand: function(event) {''' add :
+
@@ -1086,7 +1088,15 @@ var ListviewAssistant = Class.create(App
<pre>+
+
  loadDebugView: function() {
orientationChanged: function(orientation) {
+
    this.controller.stageController.pushScene('debug');
if (orientation === "left" || orientation === "right") {
+
  },  
this.controller.sceneElement.addClassName('landscape');
+
-  
} else {
+
+
this.controller.sceneElement.removeClassName('landscape');
+
orientationChanged: function(orientation) {
}
+
+ if (orientation === "left" || orientation === "right") {
},</pre>
+
+ this.controller.sceneElement.addClassName('landscape');
this is how it should look like:
+
+ } else {
<pre> }
+
+ this.controller.sceneElement.removeClassName('landscape');
}
+
+ }
  },
+
+ },
orientationChanged: function(orientation) {
+
if (orientation === "left" || orientation === "right") {
+
  cleanup: function() {
this.controller.sceneElement.addClassName('landscape');
+
// save the listview state
} else {
+
  MessagingMojoService.setIsHistoryViewSelected(this.controller,(this.currentListView == this.Messaging.Views.HISTORY));
this.controller.sceneElement.removeClassName('landscape');
+
Index: /usr/palm/applications/com.palm.app.messaging/stylesheets/messaging.css
}
+
===================================================================
},
+
--- .orig/usr/palm/applications/com.palm.app.messaging/stylesheets/messaging.css
 +
+++ /usr/palm/applications/com.palm.app.messaging/stylesheets/messaging.css
 +
@@ -642,10 +642,10 @@ img.avatar-overlay {
 +
}
 +
 +
.their-chat .message-container {
 +
- width: 255px;
 +
+ width: 85%;
 +
}
 +
.my-chat .message-container {
 +
- width: 280px;
 +
+ width: 95%;
 +
}
 +
.chat-entry .chat-balloon {
 +
min-height: 26px;
 +
@@ -823,7 +823,7 @@ img.avatar-overlay {
 +
position: fixed;
 +
bottom:0px;
 +
left:0px;
 +
- width: 320px;
 +
+ width: 100%;
 +
}
 
   
 
   
handleCommand: function(event) {
+
#messageContainer #messageTextWidget {
    // handle menu button command events</pre>
+
</pre>
 +
 
 +
 
 +
'''Credits: FRITOS1406'''

Latest revision as of 10:06, 19 October 2009


Landscape Orientation in Messagin App:


MUST BE IN [root@castle:/#] TO INSTALL

cd /opt/src/modifications
git pull
cd /
quilt import /opt/src/modifications/message-orientation.patch
quilt push -a -f

to apply this patch just copy the above how-to and then you will be done..thats it !!




Manually doing this patch you will have to put the codes in the patch in their corresponding places..


PATCH CODE

Index: /usr/palm/applications/com.palm.app.messaging/app/controllers/chatview-assistant.js
===================================================================
--- .orig/usr/palm/applications/com.palm.app.messaging/app/controllers/chatview-assistant.js
+++ /usr/palm/applications/com.palm.app.messaging/app/controllers/chatview-assistant.js
@@ -97,7 +97,9 @@ var ChatviewAssistant = Class.create({
 	
 	setup: function(){	
 		this.controller.setupWidget(Mojo.Menu.appMenu, this.appMenuAttrs, this.appMenuModel);
-		
+	
+	// enable free orientation
+	this.controller.window.PalmSystem.setWindowOrientation("free");		
 		var messageTextWidgetAttributes = {
 			modelProperty: 'value',
 			hintText: $L('Enter message here...'),
@@ -196,6 +198,14 @@ var ChatviewAssistant = Class.create({
 			this.handleFocus();
 		}		
 	},
+ 
+	orientationChanged: function(orientation) {
+		if (orientation === "left" || orientation === "right") {
+			this.controller.sceneElement.addClassName('landscape');
+		} else {
+			this.controller.sceneElement.removeClassName('landscape');
+		}
+	},
 
 	cleanup: function(){
 		this.chatViewHeaderClickTarget.stopObserving(Mojo.Event.tap, this.handleHeaderTap);
Index: /usr/palm/applications/com.palm.app.messaging/app/controllers/compose-assistant.js
===================================================================
--- .orig/usr/palm/applications/com.palm.app.messaging/app/controllers/compose-assistant.js
+++ /usr/palm/applications/com.palm.app.messaging/app/controllers/compose-assistant.js
@@ -73,7 +73,9 @@ var ComposeAssistant = Class.create({
 
   setup: function() {
     this.controller.setupWidget(Mojo.Menu.appMenu, this.appMenuAttrs, this.appMenuModel);
-
+	
+    // enable free orientation
+	this.controller.window.PalmSystem.setWindowOrientation("free");
 	this.searchList = {
 		"property": "to$A",
 		"includeEmails": false,
@@ -386,6 +388,14 @@ var ComposeAssistant = Class.create({
     }
 	this.setCharacterCounterMaxLength();
   },
+ 
+	orientationChanged: function(orientation) {
+		if (orientation === "left" || orientation === "right") {
+			this.controller.sceneElement.addClassName('landscape');
+		} else {
+			this.controller.sceneElement.removeClassName('landscape');
+		}
+	},
   
   cleanup: function() {
     var that = this;
Index: /usr/palm/applications/com.palm.app.messaging/app/controllers/listview-assistant.js
===================================================================
--- .orig/usr/palm/applications/com.palm.app.messaging/app/controllers/listview-assistant.js
+++ /usr/palm/applications/com.palm.app.messaging/app/controllers/listview-assistant.js
@@ -212,8 +212,10 @@ var ListviewAssistant = Class.create(App
 		items:this.commandMenuModel 
     };  
 	
-    this.controller.setupWidget(Mojo.Menu.commandMenu, {}, this.cmdMenuModel);	
-	
+    this.controller.setupWidget(Mojo.Menu.commandMenu, undefined, this.cmdMenuModel);	
+			
+	// enable free orientation
+	this.controller.window.PalmSystem.setWindowOrientation("free");
 	this.filterField = this.controller.get('filterField');
 	this.buddyListHeader = this.controller.get('buddyListHeader');
     this.controller.setupWidget('filterField',{filterFieldName:'filterFieldElement'},this.filterField);
@@ -1086,7 +1088,15 @@ var ListviewAssistant = Class.create(App
   loadDebugView: function() {
     this.controller.stageController.pushScene('debug');
   },		  
-	  
+
+  orientationChanged: function(orientation) {
+		if (orientation === "left" || orientation === "right") {
+			this.controller.sceneElement.addClassName('landscape');
+		} else {
+			this.controller.sceneElement.removeClassName('landscape');
+		}
+	},
+  
   cleanup: function() {
 	// save the listview state
 	MessagingMojoService.setIsHistoryViewSelected(this.controller,(this.currentListView == this.Messaging.Views.HISTORY));
Index: /usr/palm/applications/com.palm.app.messaging/stylesheets/messaging.css
===================================================================
--- .orig/usr/palm/applications/com.palm.app.messaging/stylesheets/messaging.css
+++ /usr/palm/applications/com.palm.app.messaging/stylesheets/messaging.css
@@ -642,10 +642,10 @@ img.avatar-overlay {
 }
 
 .their-chat .message-container {
-	width: 255px;
+	width: 85%;
 }
 .my-chat .message-container {
-	width: 280px;
+	width: 95%;
 }
 .chat-entry .chat-balloon {
 	min-height: 26px;
@@ -823,7 +823,7 @@ img.avatar-overlay {
 	position: fixed;
 	bottom:0px;
 	left:0px;
-	width: 320px;
+	width: 100%;
 }
 
 #messageContainer #messageTextWidget {


Credits: FRITOS1406