Ejemplo n.º 1
0
    def _get_key_help(self, key, state):
        page = self.screen.get_visible_page()
        originating_plugin = page.originating_plugin
        if originating_plugin:
            import gnome15.g15pluginmanager as g15pluginmanager
            actions = g15pluginmanager.get_actions(
                g15pluginmanager.get_module_for_id(
                    originating_plugin.__module__), self.screen.device)
            active_profile = g15profile.get_active_profile(
                self.screen.driver.device
            ) if self.screen.driver is not None else None
            for action_id in actions:
                # First try the active profile to see if the action has been re-mapped
                action_binding = active_profile.get_binding_for_action(
                    state, action_id)
                if action_binding is None:
                    # No other keys bound to action, try the device defaults
                    device_info = g15devices.get_device_info(
                        self.screen.driver.get_model_name())
                    if action_id in device_info.action_keys:
                        action_binding = device_info.action_keys[action_id]

                if action_binding is not None and key in action_binding.keys:
                    return actions[action_id]

        return "?"
Ejemplo n.º 2
0
def get_backend(account_type):
    """
    Get the backend plugin module, given the account_type
    
    Keyword arguments:
    account_type          -- account type
    """
    from gnome15 import g15pluginmanager
    return g15pluginmanager.get_module_for_id("cal-%s" % account_type)
Ejemplo n.º 3
0
def get_backend(backend_type):
    """
    Get the backend plugin module, given the backend_type
    
    Keyword arguments:
    backend_type          -- backend type
    """
    import gnome15.g15pluginmanager as g15pluginmanager
    return g15pluginmanager.get_module_for_id("voip-%s" % backend_type)
Ejemplo n.º 4
0
Archivo: voip.py Proyecto: FPar/gnome15
def get_backend(backend_type):
    """
    Get the backend plugin module, given the backend_type
    
    Keyword arguments:
    backend_type          -- backend type
    """
    import gnome15.g15pluginmanager as g15pluginmanager
    return g15pluginmanager.get_module_for_id("voip-%s" % backend_type)
Ejemplo n.º 5
0
def get_backend(account_type):
    """
    Get the backend plugin module, given the account_type
    
    Keyword arguments:
    account_type          -- account type
    """
    import gnome15.g15pluginmanager as g15pluginmanager
    return g15pluginmanager.get_module_for_id("weather-%s" % account_type)
Ejemplo n.º 6
0
 def _get_key_help(self, key, state):
     page = self.screen.get_visible_page()
     originating_plugin = page.originating_plugin
     if originating_plugin:
         import gnome15.g15pluginmanager as g15pluginmanager
         actions = g15pluginmanager.get_actions(g15pluginmanager.get_module_for_id(originating_plugin.__module__), self.screen.device)
         active_profile = g15profile.get_active_profile(self.screen.driver.device) if self.screen.driver is not None else None
         for action_id in actions:
             # First try the active profile to see if the action has been re-mapped
             action_binding = active_profile.get_binding_for_action(state, action_id)
             if action_binding is None:
                 # No other keys bound to action, try the device defaults
                 device_info = g15devices.get_device_info(self.screen.driver.get_model_name())                
                 if action_id in device_info.action_keys:
                     action_binding = device_info.action_keys[action_id]
             
             if action_binding is not None and key in action_binding.keys:
                 return actions[action_id]
         
     return "?"