aboutsummaryrefslogtreecommitdiffstats
path: root/e-util/e-util.c
diff options
context:
space:
mode:
authorMatthew Barnes <mbarnes@src.gnome.org>2008-08-14 04:31:08 +0800
committerMatthew Barnes <mbarnes@src.gnome.org>2008-08-14 04:31:08 +0800
commit08bd7765721e5d866c4d7a546b94f691cf62d972 (patch)
treeaaca52e83da675b32534d29176e94ebc0b13a53b /e-util/e-util.c
parent5f6a18500c3119731663ac4c059426c62a3b37f6 (diff)
downloadgsoc2013-evolution-08bd7765721e5d866c4d7a546b94f691cf62d972.tar
gsoc2013-evolution-08bd7765721e5d866c4d7a546b94f691cf62d972.tar.gz
gsoc2013-evolution-08bd7765721e5d866c4d7a546b94f691cf62d972.tar.bz2
gsoc2013-evolution-08bd7765721e5d866c4d7a546b94f691cf62d972.tar.lz
gsoc2013-evolution-08bd7765721e5d866c4d7a546b94f691cf62d972.tar.xz
gsoc2013-evolution-08bd7765721e5d866c4d7a546b94f691cf62d972.tar.zst
gsoc2013-evolution-08bd7765721e5d866c4d7a546b94f691cf62d972.zip
Get a basic shell window working.
svn path=/branches/kill-bonobo/; revision=35982
Diffstat (limited to 'e-util/e-util.c')
-rw-r--r--e-util/e-util.c33
1 files changed, 33 insertions, 0 deletions
diff --git a/e-util/e-util.c b/e-util/e-util.c
index 116ebd3f55..5bb42b2afa 100644
--- a/e-util/e-util.c
+++ b/e-util/e-util.c
@@ -70,6 +70,39 @@ e_get_user_data_dir (void)
}
/**
+ * e_load_ui_definition:
+ * @manager: a #GtkUIManager
+ * @basename: basename of the UI definition file
+ *
+ * Loads a UI definition into @manager from Evolution's UI directory.
+ * Failure here is fatal, since the application can't function without
+ * its UI definitions.
+ *
+ * Returns: The merge ID for the merged UI. The merge ID can be used to
+ * unmerge the UI with gtk_ui_manager_remove_ui().
+ **/
+guint
+e_load_ui_definition (GtkUIManager *manager,
+ const gchar *basename)
+{
+ gchar *filename;
+ guint merge_id;
+ GError *error = NULL;
+
+ g_return_val_if_fail (GTK_IS_UI_MANAGER (manager), 0);
+ g_return_val_if_fail (basename != NULL, 0);
+
+ filename = g_build_filename (EVOLUTION_UIDIR, basename, NULL);
+ merge_id = gtk_ui_manager_add_ui_from_file (manager, filename, &error);
+ g_free (filename);
+
+ if (error != NULL)
+ g_error ("%s", error->message); /* does not return */
+
+ return merge_id;
+}
+
+/**
* e_str_without_underscores:
* @s: the string to strip underscores from.
*