aboutsummaryrefslogtreecommitdiffstats
path: root/e-util/e-util.c
diff options
context:
space:
mode:
authorMatthew Barnes <mbarnes@redhat.com>2009-09-25 06:04:36 +0800
committerMatthew Barnes <mbarnes@redhat.com>2009-11-17 08:33:32 +0800
commit054c0881696a85f537e93b4950a28f505a3dc0f7 (patch)
treee63cfece426e2de5898c926eb6737cff229bb38b /e-util/e-util.c
parent6348266ee635db59a12d75497f980dd85d0fcf58 (diff)
downloadgsoc2013-evolution-054c0881696a85f537e93b4950a28f505a3dc0f7.tar
gsoc2013-evolution-054c0881696a85f537e93b4950a28f505a3dc0f7.tar.gz
gsoc2013-evolution-054c0881696a85f537e93b4950a28f505a3dc0f7.tar.bz2
gsoc2013-evolution-054c0881696a85f537e93b4950a28f505a3dc0f7.tar.lz
gsoc2013-evolution-054c0881696a85f537e93b4950a28f505a3dc0f7.tar.xz
gsoc2013-evolution-054c0881696a85f537e93b4950a28f505a3dc0f7.tar.zst
gsoc2013-evolution-054c0881696a85f537e93b4950a28f505a3dc0f7.zip
BugĀ 589153 - Use GtkBuilder instead of libglade
Diffstat (limited to 'e-util/e-util.c')
-rw-r--r--e-util/e-util.c59
1 files changed, 56 insertions, 3 deletions
diff --git a/e-util/e-util.c b/e-util/e-util.c
index 6a9ad6d780..800974577c 100644
--- a/e-util/e-util.c
+++ b/e-util/e-util.c
@@ -47,6 +47,7 @@
#include <libedataserver/e-data-server-util.h>
#include <libedataserver/e-categories.h>
+#include <libedataserver/e-source-list.h>
#include "filter/e-filter-option.h"
@@ -281,7 +282,36 @@ e_lookup_action_group (GtkUIManager *ui_manager,
}
/**
- * e_load_ui_definition:
+ * e_load_ui_builder_definition:
+ * @builder: a #GtkBuilder
+ * @basename: basename of the UI definition file
+ *
+ * Loads a UI definition into @builder from Evolution's UI directory.
+ * Failure here is fatal, since the application can't function without
+ * its UI definitions.
+ **/
+void
+e_load_ui_builder_definition (GtkBuilder *builder,
+ const gchar *basename)
+{
+ gchar *filename;
+ GError *error = NULL;
+
+ g_return_if_fail (GTK_IS_BUILDER (builder));
+ g_return_if_fail (basename != NULL);
+
+ filename = g_build_filename (EVOLUTION_UIDIR, basename, NULL);
+ gtk_builder_add_from_file (builder, filename, &error);
+ g_free (filename);
+
+ if (error != NULL) {
+ g_error ("%s: %s", basename, error->message);
+ g_assert_not_reached ();
+ }
+}
+
+/**
+ * e_load_ui_manager_definition:
* @ui_manager: a #GtkUIManager
* @basename: basename of the UI definition file
*
@@ -293,8 +323,8 @@ e_lookup_action_group (GtkUIManager *ui_manager,
* unmerge the UI with gtk_ui_manager_remove_ui().
**/
guint
-e_load_ui_definition (GtkUIManager *ui_manager,
- const gchar *basename)
+e_load_ui_manager_definition (GtkUIManager *ui_manager,
+ const gchar *basename)
{
gchar *filename;
guint merge_id;
@@ -1490,6 +1520,29 @@ e_util_get_category_filter_options (void)
return g_slist_reverse (res);
}
+/**
+ * e_util_set_source_combo_box_list:
+ * @source_combo_box: an #ESourceComboBox
+ * @source_gconf_path: GConf path with sources to use in an #ESourceList
+ *
+ * Sets an #ESourceList of a given GConf path to an #ESourceComboBox.
+ **/
+void
+e_util_set_source_combo_box_list (GtkWidget *source_combo_box, const gchar *source_gconf_path)
+{
+ ESourceList *source_list;
+ GConfClient *gconf_client;
+
+ g_return_if_fail (source_combo_box != NULL);
+ g_return_if_fail (source_gconf_path != NULL);
+
+ gconf_client = gconf_client_get_default ();
+ source_list = e_source_list_new_for_gconf (gconf_client, source_gconf_path);
+ g_object_set (G_OBJECT (source_combo_box), "source-list", source_list, NULL);
+ g_object_unref (source_list);
+ g_object_unref (gconf_client);
+}
+
static gpointer
e_camel_object_copy (gpointer camel_object)
{