osc_generator/osc_generator.py
def add_action(
            self,
            icon_path,
            text,
            callback,
            enabled_flag=True,
            add_to_menu=True,
            add_to_toolbar=True,
            status_tip=None,
            whats_this=None,
            parent=None):
        """Add a toolbar icon to the toolbar.

        :param icon_path: Path to the icon for this action. Can be a resource
            path (e.g. ':/plugins/foo/bar.png') or a normal file system path.
        :type icon_path: str

        :param text: Text that should be shown in menu items for this action.
        :type text: str

        :param callback: Function to be called when the action is triggered.
        :type callback: function

        :param enabled_flag: A flag indicating if the action should be enabled
            by default. Defaults to True.
        :type enabled_flag: bool

        :param add_to_menu: Flag indicating whether the action should also
            be added to the menu. Defaults to True.
        :type add_to_menu: bool

        :param add_to_toolbar: Flag indicating whether the action should also
            be added to the toolbar. Defaults to True.
        :type add_to_toolbar: bool

        :param status_tip: Optional text to show in a popup when mouse pointer
            hovers over the action.
        :type status_tip: str

        :param parent: Parent widget for the new action. Defaults None.
        :type parent: QWidget

        :param whats_this: Optional text to show in the status bar when the
            mouse pointer hovers over the action.

        :returns: The action that was created. Note that the action is also
            added to self.actions list.
        :rtype: QAction
        """

        icon = QIcon(icon_path)
        action = QAction(icon, text, parent)
        action.triggered.connect(callback)
        action.setEnabled(enabled_flag)

        if status_tip is not None:
            action.setStatusTip(status_tip)

        if whats_this is not None:
            action.setWhatsThis(whats_this)

        if add_to_toolbar:
            self.toolbar.addAction(action)

        if add_to_menu:
            self.iface.addPluginToMenu(
                self.menu,
                action)

        self.actions.append(action)

        return action
Add a toolbar icon to the toolbar.

        :param icon_path: Path to the icon for this action. Can be a resource
            path (e.g. ':/plugins/foo/bar.png') or a normal file system path.
        :type icon_path: str

        :param text: Text that should be shown in menu items for this action.
        :type text: str

        :param callback: Function to be called when the action is triggered.
        :type callback: function

        :param enabled_flag: A flag indicating if the action should be enabled
            by default. Defaults to True.
        :type enabled_flag: bool

        :param add_to_menu: Flag indicating whether the action should also
            be added to the menu. Defaults to True.
        :type add_to_menu: bool

        :param add_to_toolbar: Flag indicating whether the action should also
            be added to the toolbar. Defaults to True.
        :type add_to_toolbar: bool

        :param status_tip: Optional text to show in a popup when mouse pointer
            hovers over the action.
        :type status_tip: str

        :param parent: Parent widget for the new action. Defaults None.
        :type parent: QWidget

        :param whats_this: Optional text to show in the status bar when the
            mouse pointer hovers over the action.

        :returns: The action that was created. Note that the action is also
            added to self.actions list.
        :rtype: QAction
        
Add a toolbar icon to the toolbar.
Add a toolbar icon to the toolbar .
def add_action(
            self,
            icon_path,
            text,
            callback,
            enabled_flag=True,
            add_to_menu=True,
            add_to_toolbar=True,
            status_tip=None,
            whats_this=None,
            parent=None):
        icon = QIcon(icon_path)
        action = QAction(icon, text, parent)
        action.triggered.connect(callback)
        action.setEnabled(enabled_flag)
        if status_tip is not None:
            action.setStatusTip(status_tip)
        if whats_this is not None:
            action.setWhatsThis(whats_this)
        if add_to_toolbar:
            self.toolbar.addAction(action)
        if add_to_menu:
            self.iface.addPluginToMenu(
                self.menu,
                action)
        self.actions.append(action)
        return action
def add_action ( self , icon_path , text , callback , enabled_flag = True , add_to_menu = True , add_to_toolbar = True , status_tip = None , whats_this = None , parent = None ) : icon = QIcon ( icon_path ) action = QAction ( icon , text , parent ) action . triggered . connect ( callback ) action . setEnabled ( enabled_flag ) if status_tip is not None : action . setStatusTip ( status_tip ) if whats_this is not None : action . setWhatsThis ( whats_this ) if add_to_toolbar : self . toolbar . addAction ( action ) if add_to_menu : self . iface . addPluginToMenu ( self . menu , action ) self . actions . append ( action ) return action
Add a toolbar icon to the toolbar.
Add a toolbar icon to the toolbar .
"""Add a toolbar icon to the toolbar.

        :param icon_path: Path to the icon for this action. Can be a resource
            path (e.g. ':/plugins/foo/bar.png') or a normal file system path.
        :type icon_path: str

        :param text: Text that should be shown in menu items for this action.
        :type text: str

        :param callback: Function to be called when the action is triggered.
        :type callback: function

        :param enabled_flag: A flag indicating if the action should be enabled
            by default. Defaults to True.
        :type enabled_flag: bool

        :param add_to_menu: Flag indicating whether the action should also
            be added to the menu. Defaults to True.
        :type add_to_menu: bool

        :param add_to_toolbar: Flag indicating whether the action should also
            be added to the toolbar. Defaults to True.
        :type add_to_toolbar: bool

        :param status_tip: Optional text to show in a popup when mouse pointer
            hovers over the action.
        :type status_tip: str

        :param parent: Parent widget for the new action. Defaults None.
        :type parent: QWidget

        :param whats_this: Optional text to show in the status bar when the
            mouse pointer hovers over the action.

        :returns: The action that was created. Note that the action is also
            added to self.actions list.
        :rtype: QAction
        """
The action that was created. Note that the action is also
added to self.actions list.
The action that was created . Note that the action is also added to self . actions list .
QAction
self
icon_path
Path to the icon for this action. Can be a resource
path  or a normal file system path.
Path to the icon for this action . Can be a resource path or a normal file system path .
text
Text that should be shown in menu items for this action.
Text that should be shown in menu items for this action .
callback
Function to be called when the action is triggered.
Function to be called when the action is triggered .
enabled_flag
A flag indicating if the action should be enabled
by default. Defaults to True.
A flag indicating if the action should be enabled by default . Defaults to True .
add_to_menu
Flag indicating whether the action should also
be added to the menu. Defaults to True.
Flag indicating whether the action should also be added to the menu . Defaults to True .
add_to_toolbar
Flag indicating whether the action should also
be added to the toolbar. Defaults to True.
Flag indicating whether the action should also be added to the toolbar . Defaults to True .
status_tip
Optional text to show in a popup when mouse pointer
hovers over the action.
Optional text to show in a popup when mouse pointer hovers over the action .
whats_this
Optional text to show in the status bar when the
mouse pointer hovers over the action.
Optional text to show in the status bar when the mouse pointer hovers over the action .
parent
Parent widget for the new action. Defaults None.
Parent widget for the new action . Defaults None .