]> Pileus Git - ~andy/gtk/commitdiff
Use g_object_notify() instead of triggering a ::notify by re-setting the
authorMatthias Clasen <mclasen@redhat.com>
Fri, 29 Apr 2005 16:31:49 +0000 (16:31 +0000)
committerMatthias Clasen <matthiasc@src.gnome.org>
Fri, 29 Apr 2005 16:31:49 +0000 (16:31 +0000)
2005-04-29  Matthias Clasen  <mclasen@redhat.com>

* gtk/gtkuimanager.c (update_node): Use g_object_notify() instead
of triggering a ::notify by re-setting the property.  (#300982,
Sven Neumann)

* gtk/gtkaction.c (connect_proxy): Use gtk_action_sync_tooltip().

ChangeLog
ChangeLog.pre-2-10
ChangeLog.pre-2-8
gtk/gtkaction.c
gtk/gtkuimanager.c

index b00a5d94149dd98f7a59b69e83acd7eac7e7a235..435b1a51e4b376813e4f48b79311347827db5f4b 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,11 @@
 2005-04-29  Matthias Clasen  <mclasen@redhat.com>
 
+       * gtk/gtkuimanager.c (update_node): Use g_object_notify() instead
+       of triggering a ::notify by re-setting the property.  (#300982,
+       Sven Neumann)
+
+       * gtk/gtkaction.c (connect_proxy): Use gtk_action_sync_tooltip().
+
        * gtk/gtkiconview.c (gtk_icon_view_scroll_to_item): Also
        scroll horizontally when necessary, and keep the northwest
        corner of the item visible.  (#300913, Mathias Hasselmann)
index b00a5d94149dd98f7a59b69e83acd7eac7e7a235..435b1a51e4b376813e4f48b79311347827db5f4b 100644 (file)
@@ -1,5 +1,11 @@
 2005-04-29  Matthias Clasen  <mclasen@redhat.com>
 
+       * gtk/gtkuimanager.c (update_node): Use g_object_notify() instead
+       of triggering a ::notify by re-setting the property.  (#300982,
+       Sven Neumann)
+
+       * gtk/gtkaction.c (connect_proxy): Use gtk_action_sync_tooltip().
+
        * gtk/gtkiconview.c (gtk_icon_view_scroll_to_item): Also
        scroll horizontally when necessary, and keep the northwest
        corner of the item visible.  (#300913, Mathias Hasselmann)
index b00a5d94149dd98f7a59b69e83acd7eac7e7a235..435b1a51e4b376813e4f48b79311347827db5f4b 100644 (file)
@@ -1,5 +1,11 @@
 2005-04-29  Matthias Clasen  <mclasen@redhat.com>
 
+       * gtk/gtkuimanager.c (update_node): Use g_object_notify() instead
+       of triggering a ::notify by re-setting the property.  (#300982,
+       Sven Neumann)
+
+       * gtk/gtkaction.c (connect_proxy): Use gtk_action_sync_tooltip().
+
        * gtk/gtkiconview.c (gtk_icon_view_scroll_to_item): Also
        scroll horizontally when necessary, and keep the northwest
        corner of the item visible.  (#300913, Mathias Hasselmann)
index a664f6e972993e06638d95c77819db0d84b9cc2a..51bfa2c38faaef462767c9d097a2efeb3cb7e9bb 100644 (file)
@@ -889,6 +889,8 @@ connect_proxy (GtkAction     *action,
     }
   else if (GTK_IS_TOOL_ITEM (proxy))
     {
+      GParamSpec *pspec;
+
       /* toolbar item specific synchronisers ... */
 
       g_object_set (proxy,
@@ -896,9 +898,11 @@ connect_proxy (GtkAction     *action,
                    "visible_vertical",   action->private_data->visible_vertical,
                    "is_important", action->private_data->is_important,
                    NULL);
-      /* FIXME: we should set the tooltip here, but the current api
-       * doesn't allow it before the item is added to a toolbar. 
-       */
+
+      pspec = g_object_class_find_property (G_OBJECT_GET_CLASS (action),
+                                            "tooltip");
+      gtk_action_sync_tooltip (action, pspec, proxy);
+
       g_signal_connect_object (action, "notify::visible-horizontal",
                               G_CALLBACK (gtk_action_sync_property), 
                               proxy, 0);
@@ -926,9 +930,7 @@ connect_proxy (GtkAction     *action,
                        "use_underline", TRUE,
                        "stock_id", action->private_data->stock_id,
                        NULL);
-         /* FIXME: we should set the tooltip here, but the current api
-          * doesn't allow it before the item is added to a toolbar. 
-          */
+
          g_signal_connect_object (action, "notify::short-label",
                                   G_CALLBACK (gtk_action_sync_short_label),
                                   proxy, 0);      
index e3407e3c2aa7dac9fcf6c4ec53a62737cb95b365..d5e759c59d65db9697b5b6972e5d035849003989 100644 (file)
@@ -2070,7 +2070,6 @@ update_node (GtkUIManager *self,
   Node *info;
   GNode *child;
   GtkAction *action;
-  gchar *tooltip;
   const gchar *action_name;
   NodeUIReference *ref;
   
@@ -2455,9 +2454,7 @@ update_node (GtkUIManager *self,
               * tooltips on toolitems can't be set before the toolitem 
               * is added to the toolbar.
               */
-             g_object_get (action, "tooltip", &tooltip, NULL);
-             g_object_set (action, "tooltip", tooltip, NULL);
-             g_free (tooltip);
+              g_object_notify (G_OBJECT (action), "tooltip");
            }
        }
       else