Reset the rotation mode on expose event in case the MCE accelerometer monitoring...
authorStefanos Harhalakis <v13@v13.gr>
Fri, 14 Jan 2011 10:10:03 +0000 (10:10 +0000)
committerStefanos Harhalakis <v13@v13.gr>
Fri, 14 Jan 2011 10:10:03 +0000 (10:10 +0000)
src/portrait.py
src/widget.py

index 4b2b457..c66b338 100644 (file)
@@ -144,6 +144,12 @@ class FremantleRotation(object):
 
             self._mode = new_mode
 
+    def reset_mode(self):
+       if self._mode==self.AUTOMATIC:
+           self._send_mce_request(self._ENABLE_ACCEL)
+       else:
+           self._send_mce_request(self._DISABLE_ACCEL)
+
     def _send_mce_request(self, request):
         rpc = osso.Rpc(self._osso_context)
         rpc.rpc_run(self._MCE_SERVICE, \
index 11e4cf9..6953b89 100755 (executable)
@@ -75,6 +75,8 @@ class DrlaunchPlugin(IconGrid, HomePluginItem, FremantleRotation):
        self.id=None
        self.config=None
 
+       self.reset_mode()
+
     def get_id0(self):
        """If this is called from the constructor then the program
        core dumps """
@@ -141,6 +143,7 @@ class DrlaunchPlugin(IconGrid, HomePluginItem, FremantleRotation):
     def do_expose_event(self, event):
        IconGrid.do_expose_event(self, event)
        HomePluginItem.do_expose_event(self, event)
+       self.reset_mode()
 
     def slot_show_settings(self, dt):
        if self.winConfig!=None: