4.30. umbra.managers.actionsManager — Umbra 1.0.9 documentation

# 4.30. umbra.managers.actionsManager

actionsManager.py

Platform:
  Windows, Linux, Mac Os X.
Description:
  Defines the `ActionsManager` class.
  The `ActionsManager` class provides a centralized hub to manage Applications actions.
  It defines methods to register, unregister and list actions.

Others:

## 4.30.1. Module Attributes

`umbra.managers.actionsManager.` `LOGGER`

## 4.30.2. Classes

class `umbra.managers.actionsManager.` `ActionsManager`(parent=None, namespaceSplitter=u'|', rootNamespace=u'Actions', defaultNamespace=u'Others')

  Bases: `PyQt4.QtCore.QObject`

  Defines a QObject subclass providing an actions manager.

  Initializes the class.

  Parameters: | parent (QObject) – Object parent. namespaceSplitter (unicode) – Namespace splitters character. rootNamespace (unicode) – Root foundations.namespace. defaultNamespace (unicode) – Default namespace ( For actions with relative path ).

  `namespaceSplitter`

    Property for self.__namespaceSplitter attribute.

    Returns: | self.__namespaceSplitter.
    Return type: | unicode

  `rootNamespace`

    Property for self.__rootNamespace attribute.

    Returns: | self.__rootNamespace.
    Return type: | unicode

  `defaultNamespace`

    Property for self.__defaultNamespace attribute.

    Returns: | self.__defaultNamespace.
    Return type: | unicode

  `categories`

    Property for self.__categories attribute.

    Returns: | self.__categories.
    Return type: | dict

  `get`(action, default=None)

    Returns given action value.

    Parameters: | action (unicode) – Action name. default (object) – Default value if action is not found.
    Returns: | Action.
    Return type: | QAction

  `listActions`()

    Returns the registered actions.

    Returns: | Actions list.
    Return type: | list

  `getCategory`(name, vivify=False)

    Returns requested category.

    Parameters: | name (unicode) – Category to retrieve. vivify (bool) – Vivify missing parents in the chain to the requested category.
    Returns: | Category.
    Return type: | dict

  `addToCategory`(category, name, action)

    Adds given action to given category.

    Parameters: | category (unicode) – Category to store the action. name (unicode) – Action name. action (QAction) – Action object.
    Returns: | Method success.
    Return type: | bool

  `removeFromCategory`(category, name)

    Removes given action from given category.

    Parameters: | category (unicode) – Category to remove the action from. name (unicode) – Action name.
    Returns: | Method success.
    Return type: | bool

  `getAction`(action)

    Returns requested action.

    Parameters: | action (unicode) – Action name.
    Returns: | Action.
    Return type: | QAction

  `isActionRegistered`(name)

    Returns if the given action name is registered.

    Parameters: | name (unicode) – Action name.
    Returns: | Is action registered.
    Return type: | bool

  `registerAction`(name, **kwargs)

    Registers given action name, optional arguments like a parent, icon, slot etc ... can be given.

    Parameters: | name (unicode) – Action to register. **kwargs (**) – Keywords arguments.
    Returns: | Action.
    Return type: | QAction

  `unregisterAction`(name)

    Unregisters given action name.

    Parameters: | name (unicode) – Action to register.
    Returns: | Method success.
    Return type: | bool

  `isShortcutInUse`(shortcut)

    Returns if given action shortcut is in use.

    Parameters: | name (unicode) – Action shortcut.
    Returns: | Is shortcut in use.
    Return type: | bool

  `getShortcut`(name)

    Returns given action shortcut.

    Parameters: | name (unicode) – Action to retrieve the shortcut.
    Returns: | Action shortcut.
    Return type: | unicode

  `setShortcut`(name, shortcut)

    Sets given action shortcut.

    Parameters: | name (unicode) – Action to set the shortcut. shortcut (unicode) – Shortcut to set.
    Returns: | Method success.
    Return type: | bool