aboutsummaryrefslogtreecommitdiffstats
path: root/e-util
diff options
context:
space:
mode:
Diffstat (limited to 'e-util')
-rw-r--r--e-util/e-util.c26
-rw-r--r--e-util/e-util.h2
2 files changed, 28 insertions, 0 deletions
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
@@ -140,6 +140,32 @@ e_load_ui_definition (GtkUIManager *ui_manager,
}
/**
+ * 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,