]> git.0d.be Git - empathy.git/blobdiff - libempathy-gtk/empathy-ui-utils.c
Updatre python binding
[empathy.git] / libempathy-gtk / empathy-ui-utils.c
index 22a5fc2f739ac04eaef2abd8db6cf6f66bb66e2b..80dcd42275f98a8c581f53add638813116cc1466 100644 (file)
@@ -1,7 +1,7 @@
 /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
 /*
  * Copyright (C) 2002-2007 Imendio AB
- * Copyright (C) 2007 Collabora Ltd.
+ * Copyright (C) 2007-2008 Collabora Ltd.
  *
  * This program is free software; you can redistribute it and/or
  * modify it under the terms of the GNU General Public License as
@@ -60,12 +60,13 @@ get_glade_file (const gchar *filename,
                const gchar *first_required_widget,
                va_list      args)
 {
-       gchar      *path;
        GladeXML   *gui;
+       gchar      *path;
        const char *name;
        GtkWidget **widget_ptr;
 
-       path = g_build_filename (UNINSTALLED_GLADE_DIR, filename, NULL);
+       path = g_build_filename (g_getenv ("EMPATHY_SRCDIR"), "libempathy-gtk",
+                                filename, NULL);
        if (!g_file_test (path, G_FILE_TEST_EXISTS)) {
                g_free (path);
                path = g_build_filename (DATADIR, "empathy", filename, NULL);
@@ -77,7 +78,6 @@ get_glade_file (const gchar *filename,
 
        if (!gui) {
                g_warning ("Couldn't find necessary glade file '%s'", filename);
-               return NULL;
        }
 
        for (name = first_required_widget; name; name = va_arg (args, char *)) {
@@ -114,11 +114,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 *
@@ -220,9 +218,9 @@ empathy_icon_name_from_account (McAccount *account)
 }
 
 const gchar *
-empathy_icon_name_for_presence_state (McPresence state)
+empathy_icon_name_for_presence (McPresence presence)
 {
-       switch (state) {
+       switch (presence) {
        case MC_PRESENCE_AVAILABLE:
                return EMPATHY_IMAGE_AVAILABLE;
        case MC_PRESENCE_DO_NOT_DISTURB:
@@ -243,33 +241,16 @@ empathy_icon_name_for_presence_state (McPresence state)
        return NULL;
 }
 
-const gchar *
-empathy_icon_name_for_presence (EmpathyPresence *presence)
-{
-       McPresence state;
-
-       g_return_val_if_fail (EMPATHY_IS_PRESENCE (presence),
-                             EMPATHY_IMAGE_OFFLINE);
-
-       state = empathy_presence_get_state (presence);
-
-       return empathy_icon_name_for_presence_state (state);
-}
-
 const gchar *
 empathy_icon_name_for_contact (EmpathyContact *contact)
 {
-       EmpathyPresence *presence;
+       McPresence presence;
 
        g_return_val_if_fail (EMPATHY_IS_CONTACT (contact),
                              EMPATHY_IMAGE_OFFLINE);
 
        presence = empathy_contact_get_presence (contact);
-       if (presence) {
-               return empathy_icon_name_for_presence (presence);
-       }
-
-       return EMPATHY_IMAGE_UNKNOWN;
+       return empathy_icon_name_for_presence (presence);
 }
 
 GdkPixbuf *
@@ -1293,6 +1274,9 @@ empathy_window_present (GtkWindow *window,
        timestamp = gtk_get_current_event_time ();
        gtk_window_set_skip_taskbar_hint (window, FALSE);
        gtk_window_present_with_time (window, timestamp);
+       /* FIXME: This shouldn't be required as gtk_window_present's doc says
+        *        it deiconify automatically. */
+       gtk_window_deiconify (window);
 }
 
 GtkWindow *