Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
}
if action_name is not None:
try:
mod, action = action_name.split('.', 1)
method = getattr(env.get(mod, self), action)
if menu_action.isCheckable():
menu_action.triggered.connect(method)
else:
menu_action.triggered.connect(lambda checked: method(*args, **kwargs))
return
except:
pass
try:
actions.bindWidget(menu_action, action_name)
return
except actions.InvalidAction:
LOG.exception('Error binding menu action %s', action_name)
msg = "The <b>{}</b> action specified for the " \
"<b>{}</b> menu item could not be triggered. " \
"Check the YAML config file for errors." \
.format(action_name or '', title.replace('&', ''))
menu_action.triggered.connect(lambda: QMessageBox.critical(self, "Menu Action Error!", msg))
def actionName(self, action_name):
self._action_name = action_name
try:
bindWidget(self, action_name)
except InvalidAction:
pass
def actionName(self, action_name):
"""Sets the name of the action the slider should trigger.
Args:
action_name (str) : A fully qualified action name.
"""
self._action_name = action_name
bindWidget(self, action_name)
def actionName(self, action_name):
"""Sets the name of the action the button should trigger and
binds the widget to that action.
Args:
action_name (str) : A fully qualified action name.
"""
self._action_name = action_name
bindWidget(self, action_name)
def actionName(self, action_name):
self._action_name = action_name
bindWidget(self, action_name)