gtk+ r19404 - in trunk: . gtk



Author: johan
Date: Fri Jan 25 18:00:15 2008
New Revision: 19404
URL: http://svn.gnome.org/viewvc/gtk+?rev=19404&view=rev

Log:
2008-01-25  Johan Dahlin  <johan gnome org>

	* gtk/gtk-builder-convert
	(GtkBuilderConverter._convert_combobox_items): Remove the items
	even if there are no items set.
	(GtkBuilderConverter._add_action_from_menuitem): Convert toggled
	signals and tooltips for all menu items subclasses and 
	GtkImageMenuItem:label. 
	Makes it possible to fully convert and run Jokosher.glade.



Modified:
   trunk/ChangeLog
   trunk/gtk/gtk-builder-convert

Modified: trunk/gtk/gtk-builder-convert
==============================================================================
--- trunk/gtk/gtk-builder-convert	(original)
+++ trunk/gtk/gtk-builder-convert	Fri Jan 25 18:00:15 2008
@@ -381,7 +381,7 @@
         return menu
 
     def _menuitem_to_action(self, node, properties):
-        copy_properties(node, ['label'], properties)
+        copy_properties(node, ['label', 'tooltip'], properties)
 
     def _togglemenuitem_to_action(self, node, properties):
         self._menuitem_to_action(node, properties)
@@ -413,6 +413,7 @@
                 child = get_property_node(image, 'stock')
                 if child is not None:
                     properties['stock_id'] = child
+            self._menuitem_to_action(node, properties)
         elif object_class == 'GtkSeparatorMenuItem':
             return
         else:
@@ -430,7 +431,7 @@
 
         for signal in get_signal_nodes(node):
             signal_name = signal.getAttribute('name')
-            if signal_name == 'activate':
+            if signal_name in ['activate', 'toggled']:
                 action.appendChild(signal)
             else:
                 print 'Unhandled signal %s::%s' % (node.getAttribute('class'),
@@ -528,7 +529,9 @@
         prop.childNodes[0].data = adj.getAttribute('id')
 
     def _convert_combobox_items(self, node, prop):
+        parent = prop.parentNode
         if not prop.childNodes:
+            parent.removeChild(prop)
             return
         value = prop.childNodes[0].data
         model = self._create_root_object("GtkListStore",
@@ -553,7 +556,6 @@
             col.appendChild(self._dom.createTextNode(item))
             row.appendChild(col)
 
-        parent = prop.parentNode
         model_prop = self._dom.createElement('property')
         model_prop.setAttribute('name', 'model')
         model_prop.appendChild(



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]