Commit d2037a94 authored by Alexander Schwinn's avatar Alexander Schwinn

Add "xfce_gtk_accel_group_disconnect_action_entries" to be able to

revert "xfce_gtk_accel_group_connect_action_entries"
parent fc634c14
......@@ -40,6 +40,7 @@ xfce_gtk_toggle_menu_item_new_from_action_entry
xfce_gtk_tool_button_new_from_action_entry
xfce_gtk_accel_map_add_entries
xfce_gtk_accel_group_connect_action_entries
xfce_gtk_accel_group_disconnect_action_entries
xfce_gtk_get_action_entry_by_id
xfce_gtk_translate_action_entries
xfce_gtk_menu_append_seperator
......
......@@ -91,6 +91,7 @@ xfce_gtk_toggle_menu_item_new_from_action_entry
xfce_gtk_tool_button_new_from_action_entry
xfce_gtk_accel_map_add_entries
xfce_gtk_accel_group_connect_action_entries
xfce_gtk_accel_group_disconnect_action_entries
xfce_gtk_get_action_entry_by_id
xfce_gtk_translate_action_entries
xfce_gtk_menu_append_seperator
......
......@@ -467,6 +467,39 @@ xfce_gtk_accel_group_connect_action_entries (GtkAccelGroup *accel_gro
/**
* xfce_gtk_accel_group_disconnect_action_entries:
* @accel_group : the #GtkAccelGroup to connect to
* @action_entries : array of action_entries to be added
* @n_action_entries : size of the action_entries array
*
* This method will disconnect each accel_path from the #XfceGtkActionEntry in action_entries.
*
* Since: 4.16
**/
void
xfce_gtk_accel_group_disconnect_action_entries (GtkAccelGroup *accel_group,
const XfceGtkActionEntry *action_entries,
guint n_action_entries)
{
GtkAccelKey key;
g_return_if_fail (GTK_IS_ACCEL_GROUP (accel_group));
for (size_t i = 0; i < n_action_entries; i++)
{
if (action_entries[i].accel_path == NULL || g_strcmp0 (action_entries[i].accel_path, "") == 0)
continue;
if (action_entries[i].callback != NULL)
{
if (gtk_accel_map_lookup_entry (action_entries[i].accel_path, &key) == TRUE)
gtk_accel_group_disconnect_key (accel_group, key.accel_key, key.accel_mods);
}
}
}
/**
* xfce_gtk_get_action_entry_by_id:
* @action_entries : array of action_entries to be searched
......
......@@ -119,6 +119,9 @@ void xfce_gtk_accel_group_connect_action_entries (GtkAc
const XfceGtkActionEntry *action_entries,
guint n_action_entries,
gpointer callback_data);
void xfce_gtk_accel_group_disconnect_action_entries (GtkAccelGroup *accel_group,
const XfceGtkActionEntry *action_entries,
guint n_action_entries);
const XfceGtkActionEntry *xfce_gtk_get_action_entry_by_id (const XfceGtkActionEntry *action_entries,
guint n_action_entries,
guint id);
......
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