From c261a99bc4765ccb99206ed6105a323698b514c7 Mon Sep 17 00:00:00 2001 From: Matthew Barnes Date: Tue, 30 Sep 2008 03:25:23 +0000 Subject: Memos are mostly working now. Tasks to follow. svn path=/branches/kill-bonobo/; revision=36495 --- e-util/e-util.c | 26 ++++++++++++++++++++++++++ e-util/e-util.h | 2 ++ 2 files changed, 28 insertions(+) (limited to 'e-util') diff --git a/e-util/e-util.c b/e-util/e-util.c index 0055407068..0c737d08a3 100644 --- a/e-util/e-util.c +++ b/e-util/e-util.c @@ -139,6 +139,32 @@ e_load_ui_definition (GtkUIManager *ui_manager, return merge_id; } +/** + * e_action_group_remove_all_actions: + * @action_group: a #GtkActionGroup + * + * Removes all actions from the action group. + **/ +void +e_action_group_remove_all_actions (GtkActionGroup *action_group) +{ + GList *list, *iter; + + /* XXX I've proposed this function for inclusion in GTK+. + * GtkActionGroup stores actions in an internal hash + * table and can do this more efficiently by calling + * g_hash_table_remove_all(). + * + * http://bugzilla.gnome.org/show_bug.cgi?id=550485 */ + + g_return_if_fail (GTK_IS_ACTION_GROUP (action_group)); + + list = gtk_action_group_list_actions (action_group); + for (iter = list; iter != NULL; iter = iter->next) + gtk_action_group_remove_action (action_group, iter->data); + g_list_free (list); +} + /** * e_str_without_underscores: * @s: the string to strip underscores from. diff --git a/e-util/e-util.h b/e-util/e-util.h index a6aaa19a99..63cdafe058 100644 --- a/e-util/e-util.h +++ b/e-util/e-util.h @@ -46,6 +46,8 @@ void e_display_help (GtkWindow *parent, const gchar *link_id); guint e_load_ui_definition (GtkUIManager *ui_manager, const gchar *basename); +void e_action_group_remove_all_actions + (GtkActionGroup *action_group); char * e_str_without_underscores (const char *s); gint e_str_compare (gconstpointer x, -- cgit v1.2.3