diff --git a/ChangeLog b/ChangeLog index 31d7304880..2fb31ae9ef 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +Sat Oct 25 23:30:13 2003 Matthias Clasen + + * gtk/gtkactiongroup.c (gtk_action_group_class_init): Add "name" + as a construct-only property. (#125475, Murray Cumming) + Thu Oct 23 21:55:10 2003 Soeren Sandmann Fix bug 116297 and 125472 diff --git a/ChangeLog.pre-2-10 b/ChangeLog.pre-2-10 index 31d7304880..2fb31ae9ef 100644 --- a/ChangeLog.pre-2-10 +++ b/ChangeLog.pre-2-10 @@ -1,3 +1,8 @@ +Sat Oct 25 23:30:13 2003 Matthias Clasen + + * gtk/gtkactiongroup.c (gtk_action_group_class_init): Add "name" + as a construct-only property. (#125475, Murray Cumming) + Thu Oct 23 21:55:10 2003 Soeren Sandmann Fix bug 116297 and 125472 diff --git a/ChangeLog.pre-2-4 b/ChangeLog.pre-2-4 index 31d7304880..2fb31ae9ef 100644 --- a/ChangeLog.pre-2-4 +++ b/ChangeLog.pre-2-4 @@ -1,3 +1,8 @@ +Sat Oct 25 23:30:13 2003 Matthias Clasen + + * gtk/gtkactiongroup.c (gtk_action_group_class_init): Add "name" + as a construct-only property. (#125475, Murray Cumming) + Thu Oct 23 21:55:10 2003 Soeren Sandmann Fix bug 116297 and 125472 diff --git a/ChangeLog.pre-2-6 b/ChangeLog.pre-2-6 index 31d7304880..2fb31ae9ef 100644 --- a/ChangeLog.pre-2-6 +++ b/ChangeLog.pre-2-6 @@ -1,3 +1,8 @@ +Sat Oct 25 23:30:13 2003 Matthias Clasen + + * gtk/gtkactiongroup.c (gtk_action_group_class_init): Add "name" + as a construct-only property. (#125475, Murray Cumming) + Thu Oct 23 21:55:10 2003 Soeren Sandmann Fix bug 116297 and 125472 diff --git a/ChangeLog.pre-2-8 b/ChangeLog.pre-2-8 index 31d7304880..2fb31ae9ef 100644 --- a/ChangeLog.pre-2-8 +++ b/ChangeLog.pre-2-8 @@ -1,3 +1,8 @@ +Sat Oct 25 23:30:13 2003 Matthias Clasen + + * gtk/gtkactiongroup.c (gtk_action_group_class_init): Add "name" + as a construct-only property. (#125475, Murray Cumming) + Thu Oct 23 21:55:10 2003 Soeren Sandmann Fix bug 116297 and 125472 diff --git a/gtk/gtkactiongroup.c b/gtk/gtkactiongroup.c index f58a44273e..afbebc61b1 100644 --- a/gtk/gtkactiongroup.c +++ b/gtk/gtkactiongroup.c @@ -48,9 +48,23 @@ struct _GtkActionGroupPrivate GtkDestroyNotify translate_notify; }; +enum +{ + PROP_0, + PROP_NAME +}; + static void gtk_action_group_init (GtkActionGroup *self); static void gtk_action_group_class_init (GtkActionGroupClass *class); static void gtk_action_group_finalize (GObject *object); +static void gtk_action_group_set_property (GObject *object, + guint prop_id, + const GValue *value, + GParamSpec *pspec); +static void gtk_action_group_get_property (GObject *object, + guint prop_id, + GValue *value, + GParamSpec *pspec); static GtkAction *gtk_action_group_real_get_action (GtkActionGroup *self, const gchar *name); @@ -93,8 +107,18 @@ gtk_action_group_class_init (GtkActionGroupClass *klass) parent_class = g_type_class_peek_parent (klass); gobject_class->finalize = gtk_action_group_finalize; + gobject_class->set_property = gtk_action_group_set_property; + gobject_class->get_property = gtk_action_group_get_property; klass->get_action = gtk_action_group_real_get_action; + g_object_class_install_property (gobject_class, + PROP_NAME, + g_param_spec_string ("name", + _("Name"), + _("A name for the action group."), + NULL, + G_PARAM_READWRITE | + G_PARAM_CONSTRUCT_ONLY)); g_type_class_add_private (gobject_class, sizeof (GtkActionGroupPrivate)); } @@ -154,6 +178,51 @@ gtk_action_group_finalize (GObject *object) (* parent_class->finalize) (object); } +static void +gtk_action_group_set_property (GObject *object, + guint prop_id, + const GValue *value, + GParamSpec *pspec) +{ + GtkActionGroup *self; + gchar *tmp; + + self = GTK_ACTION_GROUP (object); + + switch (prop_id) + { + case PROP_NAME: + tmp = self->private_data->name; + self->private_data->name = g_value_dup_string (value); + g_free (tmp); + break; + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); + break; + } +} + +static void +gtk_action_group_get_property (GObject *object, + guint prop_id, + GValue *value, + GParamSpec *pspec) +{ + GtkActionGroup *self; + + self = GTK_ACTION_GROUP (object); + + switch (prop_id) + { + case PROP_NAME: + g_value_set_string (value, self->private_data->name); + break; + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); + break; + } +} + static GtkAction * gtk_action_group_real_get_action (GtkActionGroup *self, const gchar *action_name)