Reset the rotation mode on expose event in case the MCE accelerometer monitoring...
[drlaunch] / src / widget.py
index 8a8bd3c..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 """
@@ -129,6 +131,10 @@ class DrlaunchPlugin(IconGrid, HomePluginItem, FremantleRotation):
        HomePluginItem.do_realize(self)
 
     def on_orientation_changed(self, orientation):
+       # Avoid bugs
+       if orientation==None or len(orientation)==0:
+           return
+
        # Get the first character of the string (l/p)
        o=orientation[0]
        self.setMode(o)
@@ -137,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:
@@ -162,6 +169,7 @@ class DrlaunchPlugin(IconGrid, HomePluginItem, FremantleRotation):
        config.setLongpress(dt['longpress'])
        config.setAnimate(dt['animate'])
        config.setNoBg(dt['nobg'])
+       config.setThemeBg(dt['themebg'])
        config.save()
        
        # Resize widget