Hi Terry
On Sunday, 8 December 2013 17:25:42 UTC, Terry wrote:
>
> [...]
You could use '---' to indicate separators - a trivial part of the
> problem, but I think there's another context in Leo where that's used
> to indicate a separator, maybe in @rlick nodes, so that would be
> consistent.
>
> Cheers -Terry
>
Yes, I agree. Here's a fairly naive first attempt. It's a replacement for
configuredcommands_rclick()
in plugins/contextmenu.py:
{{{
def configuredcommands_rclick(c,p, menu):
""" use '@data contextmenu_commands' to create context menu entries """
config = c.config.getData('contextmenu_commands')
if not config:
return
for el in config:
cmds = el.split(None,1)
if len(cmds) == 2 and cmds[0][0] != '#':
cmd = cmds[0]; desc = cmds[1]
def configcmd_rclick_cb(cm = cmd):
c.k.simulateCommand(cm)
action = menu.addAction(desc)
#action.setToolTip(cmd)
action.connect(action, QtCore.SIGNAL("triggered()"),
configcmd_rclick_cb)
elif len(cmds) >=1 and cmds[0].startswith('---'):
menu.addSeparator()
}}}
Cheers
jon N
--
You received this message because you are subscribed to the Google Groups
"leo-editor" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/leo-editor.
For more options, visit https://groups.google.com/groups/opt_out.