From 40532b0d45e4d5bd72f039725acbfcee079582f2 Mon Sep 17 00:00:00 2001 From: Matthias Clasen Date: Thu, 29 Apr 2004 21:36:30 +0000 Subject: [PATCH] Use _gtk_action_emit_activate() instead of directly emitting the activate 2004-04-29 Matthias Clasen * gtk/gtkaction.c (closure_accel_activate): Use _gtk_action_emit_activate() instead of directly emitting the activate signal. (#141429, Jody Goldberg) * gtk/gtkactiongroup.c (gtk_action_group_add_action_with_accel): Warn people when the accelerator can not be parsed. (#141429, Jody Goldberg) --- ChangeLog | 10 ++++++++++ ChangeLog.pre-2-10 | 10 ++++++++++ ChangeLog.pre-2-4 | 10 ++++++++++ ChangeLog.pre-2-6 | 10 ++++++++++ ChangeLog.pre-2-8 | 10 ++++++++++ gtk/gtkaction.c | 8 +++----- gtk/gtkactiongroup.c | 5 +++++ 7 files changed, 58 insertions(+), 5 deletions(-) diff --git a/ChangeLog b/ChangeLog index c2f0d1179..54efeb14e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,13 @@ +2004-04-29 Matthias Clasen + + * gtk/gtkaction.c (closure_accel_activate): Use + _gtk_action_emit_activate() instead of directly + emitting the activate signal. (#141429, Jody Goldberg) + + * gtk/gtkactiongroup.c (gtk_action_group_add_action_with_accel): + Warn people when the accelerator can not be + parsed. (#141429, Jody Goldberg) + 2004-04-29 Matthias Clasen * tests/testentrycompletion.c (main): Add a missing diff --git a/ChangeLog.pre-2-10 b/ChangeLog.pre-2-10 index c2f0d1179..54efeb14e 100644 --- a/ChangeLog.pre-2-10 +++ b/ChangeLog.pre-2-10 @@ -1,3 +1,13 @@ +2004-04-29 Matthias Clasen + + * gtk/gtkaction.c (closure_accel_activate): Use + _gtk_action_emit_activate() instead of directly + emitting the activate signal. (#141429, Jody Goldberg) + + * gtk/gtkactiongroup.c (gtk_action_group_add_action_with_accel): + Warn people when the accelerator can not be + parsed. (#141429, Jody Goldberg) + 2004-04-29 Matthias Clasen * tests/testentrycompletion.c (main): Add a missing diff --git a/ChangeLog.pre-2-4 b/ChangeLog.pre-2-4 index c2f0d1179..54efeb14e 100644 --- a/ChangeLog.pre-2-4 +++ b/ChangeLog.pre-2-4 @@ -1,3 +1,13 @@ +2004-04-29 Matthias Clasen + + * gtk/gtkaction.c (closure_accel_activate): Use + _gtk_action_emit_activate() instead of directly + emitting the activate signal. (#141429, Jody Goldberg) + + * gtk/gtkactiongroup.c (gtk_action_group_add_action_with_accel): + Warn people when the accelerator can not be + parsed. (#141429, Jody Goldberg) + 2004-04-29 Matthias Clasen * tests/testentrycompletion.c (main): Add a missing diff --git a/ChangeLog.pre-2-6 b/ChangeLog.pre-2-6 index c2f0d1179..54efeb14e 100644 --- a/ChangeLog.pre-2-6 +++ b/ChangeLog.pre-2-6 @@ -1,3 +1,13 @@ +2004-04-29 Matthias Clasen + + * gtk/gtkaction.c (closure_accel_activate): Use + _gtk_action_emit_activate() instead of directly + emitting the activate signal. (#141429, Jody Goldberg) + + * gtk/gtkactiongroup.c (gtk_action_group_add_action_with_accel): + Warn people when the accelerator can not be + parsed. (#141429, Jody Goldberg) + 2004-04-29 Matthias Clasen * tests/testentrycompletion.c (main): Add a missing diff --git a/ChangeLog.pre-2-8 b/ChangeLog.pre-2-8 index c2f0d1179..54efeb14e 100644 --- a/ChangeLog.pre-2-8 +++ b/ChangeLog.pre-2-8 @@ -1,3 +1,13 @@ +2004-04-29 Matthias Clasen + + * gtk/gtkaction.c (closure_accel_activate): Use + _gtk_action_emit_activate() instead of directly + emitting the activate signal. (#141429, Jody Goldberg) + + * gtk/gtkactiongroup.c (gtk_action_group_add_action_with_accel): + Warn people when the accelerator can not be + parsed. (#141429, Jody Goldberg) + 2004-04-29 Matthias Clasen * tests/testentrycompletion.c (main): Add a missing diff --git a/gtk/gtkaction.c b/gtk/gtkaction.c index 089b2a27e..5ab6e5789 100644 --- a/gtk/gtkaction.c +++ b/gtk/gtkaction.c @@ -315,6 +315,8 @@ gtk_action_init (GtkAction *action) action->private_data->short_label_set = FALSE; action->private_data->accel_count = 0; + action->private_data->accel_group = NULL; + action->private_data->accel_quark = 0; action->private_data->accel_closure = g_closure_new_object (sizeof (GClosure), G_OBJECT (action)); g_closure_set_marshal (action->private_data->accel_closure, @@ -322,10 +324,6 @@ gtk_action_init (GtkAction *action) g_closure_ref (action->private_data->accel_closure); g_closure_sink (action->private_data->accel_closure); - action->private_data->accel_quark = 0; - action->private_data->accel_count = 0; - action->private_data->accel_group = NULL; - action->private_data->action_group = NULL; action->private_data->proxies = NULL; @@ -1300,7 +1298,7 @@ closure_accel_activate (GClosure *closure, gpointer marshal_data) { if (gtk_action_is_sensitive (GTK_ACTION (closure->data))) - g_signal_emit (closure->data, action_signals[ACTIVATE], 0); + _gtk_action_emit_activate (GTK_ACTION (closure->data)); /* we handled the accelerator */ g_value_set_boolean (return_value, TRUE); diff --git a/gtk/gtkactiongroup.c b/gtk/gtkactiongroup.c index a9318b0db..f265bd2c2 100644 --- a/gtk/gtkactiongroup.c +++ b/gtk/gtkactiongroup.c @@ -584,7 +584,12 @@ gtk_action_group_add_action_with_accel (GtkActionGroup *action_group, action_group->private_data->name, "/", name, NULL); if (accelerator) + { gtk_accelerator_parse (accelerator, &accel_key, &accel_mods); + if (accel_key == 0) + g_warning ("Unable to parse accelerator '%s' for action '%s'", + accelerator, name); + } else if (stock_id && gtk_stock_lookup (stock_id, &stock_item)) { accel_key = stock_item.keyval; -- 2.43.2