don't install/change accelerators from locked accel groups.

Tue Apr 16 07:53:49 2002  Tim Janik  <timj@gtk.org>

        * gtk/gtkmenu.c (gtk_menu_key_press): don't install/change accelerators
        from locked accel groups.

        * gtk/gtkwidget.c (_gtk_widget_get_accel_path): export whether the
        accel path is from a locked accel group.
This commit is contained in:
Tim Janik 2002-04-16 05:57:45 +00:00 committed by Tim Janik
parent 3e88641895
commit b0d72c4d93
10 changed files with 59 additions and 7 deletions

View File

@ -1,3 +1,11 @@
Tue Apr 16 07:53:49 2002 Tim Janik <timj@gtk.org>
* gtk/gtkmenu.c (gtk_menu_key_press): don't install/change accelerators
from locked accel groups.
* gtk/gtkwidget.c (_gtk_widget_get_accel_path): export whether the
accel path is from a locked accel group.
Mon Apr 15 15:41:56 2002 Jonathan Blandford <jrb@redhat.com>
* gtk/gtkcontainer.c (gtk_container_focus): include internal

View File

@ -1,3 +1,11 @@
Tue Apr 16 07:53:49 2002 Tim Janik <timj@gtk.org>
* gtk/gtkmenu.c (gtk_menu_key_press): don't install/change accelerators
from locked accel groups.
* gtk/gtkwidget.c (_gtk_widget_get_accel_path): export whether the
accel path is from a locked accel group.
Mon Apr 15 15:41:56 2002 Jonathan Blandford <jrb@redhat.com>
* gtk/gtkcontainer.c (gtk_container_focus): include internal

View File

@ -1,3 +1,11 @@
Tue Apr 16 07:53:49 2002 Tim Janik <timj@gtk.org>
* gtk/gtkmenu.c (gtk_menu_key_press): don't install/change accelerators
from locked accel groups.
* gtk/gtkwidget.c (_gtk_widget_get_accel_path): export whether the
accel path is from a locked accel group.
Mon Apr 15 15:41:56 2002 Jonathan Blandford <jrb@redhat.com>
* gtk/gtkcontainer.c (gtk_container_focus): include internal

View File

@ -1,3 +1,11 @@
Tue Apr 16 07:53:49 2002 Tim Janik <timj@gtk.org>
* gtk/gtkmenu.c (gtk_menu_key_press): don't install/change accelerators
from locked accel groups.
* gtk/gtkwidget.c (_gtk_widget_get_accel_path): export whether the
accel path is from a locked accel group.
Mon Apr 15 15:41:56 2002 Jonathan Blandford <jrb@redhat.com>
* gtk/gtkcontainer.c (gtk_container_focus): include internal

View File

@ -1,3 +1,11 @@
Tue Apr 16 07:53:49 2002 Tim Janik <timj@gtk.org>
* gtk/gtkmenu.c (gtk_menu_key_press): don't install/change accelerators
from locked accel groups.
* gtk/gtkwidget.c (_gtk_widget_get_accel_path): export whether the
accel path is from a locked accel group.
Mon Apr 15 15:41:56 2002 Jonathan Blandford <jrb@redhat.com>
* gtk/gtkcontainer.c (gtk_container_focus): include internal

View File

@ -1,3 +1,11 @@
Tue Apr 16 07:53:49 2002 Tim Janik <timj@gtk.org>
* gtk/gtkmenu.c (gtk_menu_key_press): don't install/change accelerators
from locked accel groups.
* gtk/gtkwidget.c (_gtk_widget_get_accel_path): export whether the
accel path is from a locked accel group.
Mon Apr 15 15:41:56 2002 Jonathan Blandford <jrb@redhat.com>
* gtk/gtkcontainer.c (gtk_container_focus): include internal

View File

@ -1817,16 +1817,16 @@ gtk_menu_key_press (GtkWidget *widget,
(delete || gtk_accelerator_valid (event->keyval, event->state)))
{
GtkWidget *menu_item = menu_shell->active_menu_item;
gboolean replace_accels = TRUE;
gboolean locked, replace_accels = TRUE;
const gchar *path;
path = _gtk_widget_get_accel_path (menu_item);
if (!path)
path = _gtk_widget_get_accel_path (menu_item, &locked);
if (!path || locked)
{
/* can't change accelerators on menu_items without paths
* (basically, those items are accelerator-locked).
*/
/* g_print("item has no path, menu prefix: %s\n", menu->accel_path); */
/* g_print("item has no path or is locked, menu prefix: %s\n", menu->accel_path); */
gdk_beep ();
}
else

View File

@ -1082,7 +1082,7 @@ _gtk_menu_item_refresh_accel_path (GtkMenuItem *menu_item,
return;
}
path = _gtk_widget_get_accel_path (widget);
path = _gtk_widget_get_accel_path (widget, NULL);
if (!path) /* no active accel_path yet */
{
path = menu_item->accel_path;

View File

@ -2828,13 +2828,16 @@ gtk_widget_set_accel_path (GtkWidget *widget,
}
const gchar*
_gtk_widget_get_accel_path (GtkWidget *widget)
_gtk_widget_get_accel_path (GtkWidget *widget,
gboolean *locked)
{
AccelPath *apath;
g_return_val_if_fail (GTK_IS_WIDGET (widget), NULL);
apath = g_object_get_qdata (G_OBJECT (widget), quark_accel_path);
if (locked)
*locked = apath ? apath->accel_group->lock_count > 0 : TRUE;
return apath ? g_quark_to_string (apath->path_quark) : NULL;
}

View File

@ -496,7 +496,8 @@ gboolean gtk_widget_remove_accelerator (GtkWidget *widget,
void gtk_widget_set_accel_path (GtkWidget *widget,
const gchar *accel_path,
GtkAccelGroup *accel_group);
const gchar* _gtk_widget_get_accel_path (GtkWidget *widget);
const gchar* _gtk_widget_get_accel_path (GtkWidget *widget,
gboolean *locked);
GList* gtk_widget_list_accel_closures (GtkWidget *widget);
gboolean gtk_widget_mnemonic_activate (GtkWidget *widget,
gboolean group_cycling);