[wiican: 13/15] [s][ui] Prevent to launch mappings from indicator menu on inconsistent states



commit f119699cd6e79a936ed93ce7ffd4a3cdb2717100
Author: J. FÃlix OntaÃÃn <fontanon emergya es>
Date:   Mon Aug 8 00:12:41 2011 +0200

    [s][ui] Prevent to launch mappings from indicator menu on inconsistent states

 bin/wiican |    8 +++++++-
 1 files changed, 7 insertions(+), 1 deletions(-)
---
diff --git a/bin/wiican b/bin/wiican
index fa96a2f..24a3ae4 100755
--- a/bin/wiican
+++ b/bin/wiican
@@ -117,17 +117,23 @@ class WiicanIndicator(appindicator.Indicator, GConfStore):
         self.error_menuitem.get_child().set_text(_('Plug a bluetooth adapter'))
         self.error_menuitem.set_visible(True)
         self.disconnect_menuitem.set_sensitive(False)
+        for mapping_menuitem in self.menu_mappings:
+            mapping_menuitem.set_sensitive(False)
 
     def __set_no_uinput_st(self):
         self.set_icon('wiican-off')
         self.error_menuitem.get_child().set_text(_('Please load uinput module first'))
         self.error_menuitem.set_visible(True)
         self.disconnect_menuitem.set_sensitive(False)
+        for mapping_menuitem in self.menu_mappings:
+            mapping_menuitem.set_sensitive(False)
 
     def __idle_st(self):
         self.disconnect_menuitem.set_sensitive(False)
         self.error_menuitem.set_visible(False)
         self.set_icon('wiican-on')
+        for mapping_menuitem in self.menu_mappings:
+            mapping_menuitem.set_sensitive(True)
 
     def __discovering_st(self):
         def animate():
@@ -141,7 +147,7 @@ class WiicanIndicator(appindicator.Indicator, GConfStore):
         gobject.timeout_add(500, animate)
 
     def __load_mappings_menu(self):
-        # Remove all mapping menuitems before addin<g the updated list
+        # Remove all mapping menuitems before adding the updated list
         for mapping_menuitem in self.menu_mappings:
             self.main_menu.remove(mapping_menuitem)
 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]