#include <glib/gi18n-lib.h>
#include <tp-account-widgets/tpaw-connection-managers.h>
+#include <tp-account-widgets/tpaw-utils.h>
#include "empathy-ui-utils.h"
#include "empathy-utils.h"
g_hash_table_insert (priv->protocols,
g_strdup (proto_name), g_strdup (cm_name));
- icon_name = empathy_protocol_icon_name (proto_name);
+ icon_name = tpaw_protocol_icon_name (proto_name);
pixbuf = empathy_pixbuf_from_icon_name (icon_name, GTK_ICON_SIZE_BUTTON);
- display_name = empathy_protocol_name_to_display_name (proto_name);
+ display_name = tpaw_protocol_name_to_display_name (proto_name);
gtk_list_store_insert_with_values (priv->store,
NULL, 0,
if (!tp_strdiff (proto_name, "jabber") &&
!tp_strdiff (cm_name, "gabble"))
{
- display_name = empathy_service_name_to_display_name ("google-talk");
+ display_name = tpaw_service_name_to_display_name ("google-talk");
pixbuf = empathy_pixbuf_from_icon_name ("im-google-talk",
GTK_ICON_SIZE_BUTTON);
g_clear_object (&pixbuf);
- display_name = empathy_service_name_to_display_name ("facebook");
+ display_name = tpaw_service_name_to_display_name ("facebook");
pixbuf = empathy_pixbuf_from_icon_name ("im-facebook",
GTK_ICON_SIZE_BUTTON);
goto out;
if (service != NULL)
- display_name = empathy_service_name_to_display_name (service);
+ display_name = tpaw_service_name_to_display_name (service);
else
- display_name = empathy_protocol_name_to_display_name (
+ display_name = tpaw_protocol_name_to_display_name (
tp_protocol_get_name (proto));
/* Create account */
#include "empathy-theme-adium.h"
#include <glib/gi18n-lib.h>
+#include <tp-account-widgets/tpaw-utils.h>
#include "empathy-gsettings.h"
#include "empathy-images.h"
/* Get information */
sender = empathy_message_get_sender (msg);
account = empathy_contact_get_account (sender);
- service_name = empathy_protocol_name_to_display_name
+ service_name = tpaw_protocol_name_to_display_name
(tp_account_get_protocol_name (account));
if (service_name == NULL)
service_name = tp_account_get_protocol_name (account);
return *(guint *) a - *(guint *) b;
}
-gchar *
-empathy_protocol_icon_name (const gchar *protocol)
-{
- if (!tp_strdiff (protocol, "yahoojp"))
- /* Yahoo Japan uses the same icon as Yahoo */
- protocol = "yahoo";
- else if (!tp_strdiff (protocol, "simple"))
- /* SIMPLE uses the same icon as SIP */
- protocol = "sip";
- else if (!tp_strdiff (protocol, "sms"))
- return g_strdup ("phone");
-
- return g_strdup_printf ("im-%s", protocol);
-}
-
GType
empathy_type_dbus_ao (void)
{
return t;
}
-const char *
-empathy_protocol_name_to_display_name (const gchar *proto_name)
-{
- int i;
- static struct {
- const gchar *proto;
- const gchar *display;
- gboolean translated;
- } names[] = {
- { "jabber", "Jabber", FALSE },
- { "msn", "Windows Live (MSN)", FALSE, },
- { "local-xmpp", N_("People Nearby"), TRUE },
- { "irc", "IRC", FALSE },
- { "icq", "ICQ", FALSE },
- { "aim", "AIM", FALSE },
- { "yahoo", "Yahoo!", FALSE },
- { "yahoojp", N_("Yahoo! Japan"), TRUE },
- { "groupwise", "GroupWise", FALSE },
- { "sip", "SIP", FALSE },
- { "gadugadu", "Gadu-Gadu", FALSE },
- { "mxit", "Mxit", FALSE },
- { "myspace", "Myspace", FALSE },
- { "sametime", "Sametime", FALSE },
- { "skype-dbus", "Skype (D-BUS)", FALSE },
- { "skype-x11", "Skype (X11)", FALSE },
- { "zephyr", "Zephyr", FALSE },
- { NULL, NULL }
- };
-
- for (i = 0; names[i].proto != NULL; i++)
- {
- if (!tp_strdiff (proto_name, names[i].proto))
- {
- if (names[i].translated)
- return gettext (names[i].display);
- else
- return names[i].display;
- }
- }
-
- return proto_name;
-}
-
-const char *
-empathy_service_name_to_display_name (const gchar *service_name)
-{
- int i;
- static struct {
- const gchar *service;
- const gchar *display;
- gboolean translated;
- } names[] = {
- { "google-talk", N_("Google Talk"), FALSE },
- { "facebook", N_("Facebook Chat"), TRUE },
- { NULL, NULL }
- };
-
- for (i = 0; names[i].service != NULL; i++)
- {
- if (!tp_strdiff (service_name, names[i].service))
- {
- if (names[i].translated)
- return gettext (names[i].display);
- else
- return names[i].display;
- }
- }
-
- return service_name;
-}
-
gboolean
empathy_account_manager_get_accounts_connected (gboolean *connecting)
{
const gchar * empathy_account_get_error_message (TpAccount *account,
gboolean *user_requested);
-gchar *empathy_protocol_icon_name (const gchar *protocol);
-const gchar *empathy_protocol_name_to_display_name (const gchar *proto_name);
-const gchar *empathy_service_name_to_display_name (const gchar *proto_name);
-
#define EMPATHY_ARRAY_TYPE_OBJECT (empathy_type_dbus_ao ())
GType empathy_type_dbus_ao (void);
gtk_image_set_from_icon_name (GTK_IMAGE (priv->image_type),
icon_name, GTK_ICON_SIZE_DIALOG);
gtk_widget_set_tooltip_text (priv->image_type,
- empathy_protocol_name_to_display_name
+ tpaw_protocol_name_to_display_name
(tpaw_account_settings_get_protocol (settings)));
gtk_widget_show (priv->image_type);
#include "tpaw-keyring.h"
#include "empathy-presence-manager.h"
#include "empathy-utils.h"
+#include "tpaw-utils.h"
#define DEBUG_FLAG EMPATHY_DEBUG_ACCOUNT
#include "empathy-debug.h"
}
else
{
- priv->icon_name = empathy_protocol_icon_name (priv->protocol);
+ priv->icon_name = tpaw_protocol_icon_name (priv->protocol);
}
g_assert (priv->cm_name != NULL && priv->protocol != NULL);
return default_display_name;
}
- if ((p = empathy_protocol_name_to_display_name (protocol)) != NULL)
+ if ((p = tpaw_protocol_name_to_display_name (protocol)) != NULL)
protocol = p;
if (protocol != NULL)
*
* Authors: Marco Barisione <marco.barisione@collabora.co.uk>
* Guillaume Desmottes <guillaume.desmottes@collabora.co.uk>
+ * Sjoerd Simons <sjoerd.simons@collabora.co.uk>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
#include "config.h"
#include "tpaw-utils.h"
+#include <glib/gi18n-lib.h>
+
#define DEBUG_FLAG EMPATHY_DEBUG_OTHER
#include "empathy-debug.h"
break;
}
}
+
+gchar *
+tpaw_protocol_icon_name (const gchar *protocol)
+{
+ if (!tp_strdiff (protocol, "yahoojp"))
+ /* Yahoo Japan uses the same icon as Yahoo */
+ protocol = "yahoo";
+ else if (!tp_strdiff (protocol, "simple"))
+ /* SIMPLE uses the same icon as SIP */
+ protocol = "sip";
+ else if (!tp_strdiff (protocol, "sms"))
+ return g_strdup ("phone");
+
+ return g_strdup_printf ("im-%s", protocol);
+}
+
+const char *
+tpaw_protocol_name_to_display_name (const gchar *proto_name)
+{
+ int i;
+ static struct {
+ const gchar *proto;
+ const gchar *display;
+ gboolean translated;
+ } names[] = {
+ { "jabber", "Jabber", FALSE },
+ { "msn", "Windows Live (MSN)", FALSE, },
+ { "local-xmpp", N_("People Nearby"), TRUE },
+ { "irc", "IRC", FALSE },
+ { "icq", "ICQ", FALSE },
+ { "aim", "AIM", FALSE },
+ { "yahoo", "Yahoo!", FALSE },
+ { "yahoojp", N_("Yahoo! Japan"), TRUE },
+ { "groupwise", "GroupWise", FALSE },
+ { "sip", "SIP", FALSE },
+ { "gadugadu", "Gadu-Gadu", FALSE },
+ { "mxit", "Mxit", FALSE },
+ { "myspace", "Myspace", FALSE },
+ { "sametime", "Sametime", FALSE },
+ { "skype-dbus", "Skype (D-BUS)", FALSE },
+ { "skype-x11", "Skype (X11)", FALSE },
+ { "zephyr", "Zephyr", FALSE },
+ { NULL, NULL }
+ };
+
+ for (i = 0; names[i].proto != NULL; i++)
+ {
+ if (!tp_strdiff (proto_name, names[i].proto))
+ {
+ if (names[i].translated)
+ return gettext (names[i].display);
+ else
+ return names[i].display;
+ }
+ }
+
+ return proto_name;
+}
+
+const char *
+tpaw_service_name_to_display_name (const gchar *service_name)
+{
+ int i;
+ static struct {
+ const gchar *service;
+ const gchar *display;
+ gboolean translated;
+ } names[] = {
+ { "google-talk", N_("Google Talk"), FALSE },
+ { "facebook", N_("Facebook Chat"), TRUE },
+ { NULL, NULL }
+ };
+
+ for (i = 0; names[i].service != NULL; i++)
+ {
+ if (!tp_strdiff (service_name, names[i].service))
+ {
+ if (names[i].translated)
+ return gettext (names[i].display);
+ else
+ return names[i].display;
+ }
+ }
+
+ return service_name;
+}
*
* Authors: Marco Barisione <marco.barisione@collabora.co.uk>
* Guillaume Desmottes <guillaume.desmottes@collabora.co.uk>
+ * Sjoerd Simons <sjoerd.simons@collabora.co.uk>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
void tpaw_connect_new_account (TpAccount *account,
TpAccountManager *account_manager);
+gchar *tpaw_protocol_icon_name (const gchar *protocol);
+const gchar *tpaw_protocol_name_to_display_name (const gchar *proto_name);
+const gchar *tpaw_service_name_to_display_name (const gchar *proto_name);
+
G_END_DECLS
#endif /* __TPAW_UTILS_H__ */