Handle standard menu items defined by Nodes in the browser.

The File menu now includes a "Create" submenu, and Delete/Rename
options. Nodes can offer Delete/Rename functionality, and the
options on the menu are automatically enabled/disabled based on
the selected node. Each node can also offer Create functionality,
and specify a list of node types (including itself) from which the
option should be made available. The menu is dynamically generated
based on the selected node.

The Context menu on the treeview works in a similar way, except that
nodes can offer any context menu items (we don't allow this on the
top menu, as that should stay consistent to avoid user confusion).
This commit is contained in:
Dave Page
2015-03-13 10:35:12 +00:00
parent af7dcd49b4
commit 751f8383fa
13 changed files with 314 additions and 83 deletions

View File

@@ -10,6 +10,7 @@
"""Browser integration functions for the About module."""
from flask import render_template, url_for
from flask.ext.babel import gettext
import config
@@ -17,7 +18,7 @@ def get_help_menu_items():
"""Return a (set) of dicts of help menu items, with name, priority, URL,
target and onclick code."""
return [{'name': 'mnu_about',
'label': 'About %s' % (config.APP_NAME),
'label': gettext('About %(appname)s', appname=config.APP_NAME),
'priority': 999,
'url': "#",
'onclick': "about_show()"}]