Commit b0d72c4d authored by Tim Janik's avatar Tim Janik Committed by Tim Janik

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.
parent 3e886418
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
......
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
......
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
......
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
......
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
......
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
......
......@@ -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
......
......@@ -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;
......
......@@ -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;
}
......
......@@ -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);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment