Commit 98b4985a authored by Johan Dahlin's avatar Johan Dahlin

(GtkBuilderConverter._add_action_from_menuitem): Only set stock_id

    on the action if the menuitem had a stock or label property set


svn path=/trunk/; revision=18395
parent ac6ba4de
......@@ -12,6 +12,8 @@
tags
(GtkBuilderConverter._convert_menuitem): Add support for CheckMenuItems
and do not set name and action on separators
(GtkBuilderConverter._add_action_from_menuitem): Only set stock_id
on the action if the menuitem had a stock or label property set
2007-07-06 Richard Hult <richard@imendio.com>
......
......@@ -313,7 +313,9 @@ class GtkBuilderConverter(object):
if (children and
children[0].getAttribute('internal-child') == 'image'):
image = get_object_node(children[0])
properties['stock_id'] = get_property(image, 'stock')
stock_id = get_property(node, 'stock')
if stock_id is not None:
properties['stock_id'] = stock_id
elif object_class == 'GtkMenuItem':
name = 'GtkAction'
label = get_property(node, 'label')
......@@ -333,7 +335,10 @@ class GtkBuilderConverter(object):
raise NotImplementedError(object_class)
if get_property(node, 'use_stock') == 'True':
properties['stock_id'] = get_property(node, 'label')
stock_id = get_property(node, 'label')
if stock_id is not None:
properties['stock_id'] = stock_id
properties['name'] = object_id
action = self._create_object(name,
object_id,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment