aboutsummaryrefslogtreecommitdiffstats
path: root/libempathy-gtk/empathy-ui-utils.c
diff options
context:
space:
mode:
authorXavier Claessens <xclaesse@src.gnome.org>2008-02-11 01:12:07 +0800
committerXavier Claessens <xclaesse@src.gnome.org>2008-02-11 01:12:07 +0800
commita84d2ff1a684995ce75ff78c57c0e1ac2a4bf7d5 (patch)
treeece047db6008d25e2c5effa0b85a4584f90a6eec /libempathy-gtk/empathy-ui-utils.c
parent88efb8a4070d91d833186906a4099b445c60975d (diff)
downloadgsoc2013-empathy-a84d2ff1a684995ce75ff78c57c0e1ac2a4bf7d5.tar
gsoc2013-empathy-a84d2ff1a684995ce75ff78c57c0e1ac2a4bf7d5.tar.gz
gsoc2013-empathy-a84d2ff1a684995ce75ff78c57c0e1ac2a4bf7d5.tar.bz2
gsoc2013-empathy-a84d2ff1a684995ce75ff78c57c0e1ac2a4bf7d5.tar.lz
gsoc2013-empathy-a84d2ff1a684995ce75ff78c57c0e1ac2a4bf7d5.tar.xz
gsoc2013-empathy-a84d2ff1a684995ce75ff78c57c0e1ac2a4bf7d5.tar.zst
gsoc2013-empathy-a84d2ff1a684995ce75ff78c57c0e1ac2a4bf7d5.zip
Add a generic UI to make easy building UI for protocol specific settings. Port empathy-account-widget-*.[ch] to use that API.
svn path=/trunk/; revision=621
Diffstat (limited to 'libempathy-gtk/empathy-ui-utils.c')
-rw-r--r--libempathy-gtk/empathy-ui-utils.c39
1 files changed, 24 insertions, 15 deletions
diff --git a/libempathy-gtk/empathy-ui-utils.c b/libempathy-gtk/empathy-ui-utils.c
index 0b29232bc..23875f722 100644
--- a/libempathy-gtk/empathy-ui-utils.c
+++ b/libempathy-gtk/empathy-ui-utils.c
@@ -53,17 +53,13 @@ struct SizeData {
gboolean preserve_aspect_ratio;
};
-static GladeXML *
-get_glade_file (const gchar *filename,
- const gchar *root,
- const gchar *domain,
- const gchar *first_required_widget,
- va_list args)
+GladeXML *
+empathy_glade_get (const gchar *filename,
+ const gchar *root,
+ const gchar *domain)
{
- gchar *path;
- GladeXML *gui;
- const char *name;
- GtkWidget **widget_ptr;
+ GladeXML *gui;
+ gchar *path;
path = g_build_filename (UNINSTALLED_GLADE_DIR, filename, NULL);
if (!g_file_test (path, G_FILE_TEST_EXISTS)) {
@@ -77,9 +73,24 @@ get_glade_file (const gchar *filename,
if (!gui) {
g_warning ("Couldn't find necessary glade file '%s'", filename);
- return NULL;
}
+ return gui;
+}
+
+static GladeXML *
+get_glade_file (const gchar *filename,
+ const gchar *root,
+ const gchar *domain,
+ const gchar *first_required_widget,
+ va_list args)
+{
+ GladeXML *gui;
+ const char *name;
+ GtkWidget **widget_ptr;
+
+ gui = empathy_glade_get (filename, root, domain);
+
for (name = first_required_widget; name; name = va_arg (args, char *)) {
widget_ptr = va_arg (args, void *);
@@ -114,11 +125,9 @@ empathy_glade_get_file_simple (const gchar *filename,
va_end (args);
- if (!gui) {
- return;
+ if (gui) {
+ g_object_unref (gui);
}
-
- g_object_unref (gui);
}
GladeXML *