]> git.0d.be Git - empathy.git/blobdiff - libempathy-gtk/empathy-ui-utils.c
Add a generic UI to make easy building UI for protocol specific settings. Port empath...
[empathy.git] / libempathy-gtk / empathy-ui-utils.c
index 0b29232bcfb661a1a8c2c078e15762cd96456525..23875f7220a43052cd49c7c41c91d434bc58ab94 100644 (file)
@@ -53,17 +53,13 @@ struct SizeData {
        gboolean preserve_aspect_ratio;
 };
 
        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)) {
 
        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);
 
        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 *);
 
        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);
 
 
        va_end (args);
 
-       if (!gui) {
-               return;
+       if (gui) {
+               g_object_unref (gui);
        }
        }
-
-       g_object_unref (gui);
 }
 
 GladeXML *
 }
 
 GladeXML *