Forgotten commit.

This commit is contained in:
Matthias Clasen 2004-05-11 04:16:53 +00:00
parent 8f74f43f3b
commit 37bb484dc5

View File

@ -553,8 +553,8 @@ gtk_action_group_add_action (GtkActionGroup *action_group,
* @action_group: the action group * @action_group: the action group
* @action: the action to add * @action: the action to add
* @accelerator: the accelerator for the action, in * @accelerator: the accelerator for the action, in
* the format understood by gtk_accelerator_parse(), or %NULL to use the * the format understood by gtk_accelerator_parse(), or "" for no accelerator, or
* stock accelerator * %NULL to use the stock accelerator
* *
* Adds an action object to the action group and sets up the accelerator. * Adds an action object to the action group and sets up the accelerator.
* *
@ -584,12 +584,17 @@ gtk_action_group_add_action_with_accel (GtkActionGroup *action_group,
action_group->private_data->name, "/", name, NULL); action_group->private_data->name, "/", name, NULL);
if (accelerator) if (accelerator)
{
if (accelerator[0] == 0)
accel_key = 0;
else
{ {
gtk_accelerator_parse (accelerator, &accel_key, &accel_mods); gtk_accelerator_parse (accelerator, &accel_key, &accel_mods);
if (accel_key == 0) if (accel_key == 0)
g_warning ("Unable to parse accelerator '%s' for action '%s'", g_warning ("Unable to parse accelerator '%s' for action '%s'",
accelerator, name); accelerator, name);
} }
}
else if (stock_id && gtk_stock_lookup (stock_id, &stock_item)) else if (stock_id && gtk_stock_lookup (stock_id, &stock_item))
{ {
accel_key = stock_item.keyval; accel_key = stock_item.keyval;