|___* demos/gtk-demo/demo.ui: |___* gtk/gtk-builder-convert: |___*

2007-07-09  Johan Dahlin,,,  <jdahlin@lozenge>

|___* demos/gtk-demo/demo.ui:
|___* gtk/gtk-builder-convert:
|___* gtk/gtkactiongroup.c: (gtk_action_group_buildable_init),
|___(gtk_action_group_buildable_add_child),
|___(accelerator_start_element),
|___(gtk_action_group_buildable_custom_tag_start),
|___(gtk_action_group_buildable_custom_tag_end):
|___* gtk/gtkuimanager.c: (child_hierarchy_changed_cb),
|___(gtk_ui_manager_buildable_construct_child):
|___* tests/buildertest.c: (test_uimanager_simple):

|___Add actiongroup/action accelerator support for builder. #454654


svn path=/trunk/; revision=18408
This commit is contained in:
Johan Dahlin
2007-07-09 13:40:10 +00:00
committed by Johan Dahlin
parent 8ba20f3ebe
commit 83b5d32aef
6 changed files with 191 additions and 4 deletions

View File

@ -92,6 +92,16 @@ def get_signal_nodes(node):
signals.append(child)
return signals
def get_accelerator_nodes(node):
assert node.tagName == 'object'
accelerators = []
for child in node.childNodes:
if child.nodeType == Node.TEXT_NODE:
continue
if child.tagName == 'accelerator':
accelerators.append(child)
return accelerators
def get_object_node(child_node):
assert child_node.tagName == 'child'
nodes = []
@ -418,6 +428,15 @@ class GtkBuilderConverter(object):
group.appendChild(child)
child.appendChild(action)
for accelerator in get_accelerator_nodes(node):
signal = accelerator.getAttribute('signal')
if signal_name != 'activate':
print 'Unhandled accelerator signal for %s::%s' % (
node.getAttribute('class'), signal_name)
continue
accelerator.removeAttribute('signal')
child.appendChild(accelerator)
def _convert_sizegroup(self, node, prop):
# This is Gazpacho only
node.removeChild(prop)