aboutsummaryrefslogtreecommitdiffstats
path: root/e-util
diff options
context:
space:
mode:
authorMatthew Barnes <mbarnes@src.gnome.org>2009-01-01 04:24:59 +0800
committerMatthew Barnes <mbarnes@src.gnome.org>2009-01-01 04:24:59 +0800
commit9d915124c28eb0772b4e1086d6988e7d56d9a04c (patch)
tree11224ba217bd8a17ca1a0f54230a096db842a6b4 /e-util
parent11e1bc38c325665c24b1c831d009f89b7112ebe5 (diff)
downloadgsoc2013-evolution-9d915124c28eb0772b4e1086d6988e7d56d9a04c.tar
gsoc2013-evolution-9d915124c28eb0772b4e1086d6988e7d56d9a04c.tar.gz
gsoc2013-evolution-9d915124c28eb0772b4e1086d6988e7d56d9a04c.tar.bz2
gsoc2013-evolution-9d915124c28eb0772b4e1086d6988e7d56d9a04c.tar.lz
gsoc2013-evolution-9d915124c28eb0772b4e1086d6988e7d56d9a04c.tar.xz
gsoc2013-evolution-9d915124c28eb0772b4e1086d6988e7d56d9a04c.tar.zst
gsoc2013-evolution-9d915124c28eb0772b4e1086d6988e7d56d9a04c.zip
Get the Character Encoding menu working.
Kill e_charset_picker_bonobo_ui_populate(). svn path=/branches/kill-bonobo/; revision=36950
Diffstat (limited to 'e-util')
-rw-r--r--e-util/e-util.c35
-rw-r--r--e-util/e-util.h2
2 files changed, 37 insertions, 0 deletions
diff --git a/e-util/e-util.c b/e-util/e-util.c
index 373002d4d9..3fce52f9bd 100644
--- a/e-util/e-util.c
+++ b/e-util/e-util.c
@@ -164,6 +164,41 @@ e_load_ui_definition (GtkUIManager *ui_manager,
}
/**
+ * e_action_compare_by_label:
+ * @action1: a #GtkAction
+ * @action2: a #GtkAction
+ *
+ * Compares the labels for @action1 and @action2 using g_utf8_collate().
+ *
+ * Returns: &lt; 0 if @action1 compares before @action2, 0 if they
+ * compare equal, &gt; 0 if @action1 compares after @action2
+ **/
+gint
+e_action_compare_by_label (GtkAction *action1,
+ GtkAction *action2)
+{
+ gchar *label1;
+ gchar *label2;
+ gint result;
+
+ /* XXX This is horribly inefficient but will generally only be
+ * used on short lists of actions during UI construction. */
+
+ if (action1 == action2)
+ return 0;
+
+ g_object_get (action1, "label", &label1, NULL);
+ g_object_get (action2, "label", &label2, NULL);
+
+ result = g_utf8_collate (label1, label2);
+
+ g_free (label1);
+ g_free (label2);
+
+ return result;
+}
+
+/**
* e_action_group_remove_all_actions:
* @action_group: a #GtkActionGroup
*
diff --git a/e-util/e-util.h b/e-util/e-util.h
index 4878178ec6..0d2628bbf0 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);
+gint e_action_compare_by_label (GtkAction *action1,
+ GtkAction *action2);
void e_action_group_remove_all_actions
(GtkActionGroup *action_group);