From 98b4985adaee466d3b16f413f9e54502f3b7ccd0 Mon Sep 17 00:00:00 2001 From: Johan Dahlin Date: Sat, 7 Jul 2007 16:18:38 +0000 Subject: (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 --- gtk/gtk-builder-convert | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'gtk/gtk-builder-convert') diff --git a/gtk/gtk-builder-convert b/gtk/gtk-builder-convert index d18e48638b..4b92157d3d 100755 --- a/gtk/gtk-builder-convert +++ b/gtk/gtk-builder-convert @@ -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, -- cgit v1.2.1