aboutsummaryrefslogtreecommitdiffstats
path: root/libempathy-gtk
diff options
context:
space:
mode:
authorSjoerd Simons <sjoerd.simons@collabora.co.uk>2009-08-28 20:40:47 +0800
committerSjoerd Simons <sjoerd.simons@collabora.co.uk>2009-08-31 23:34:42 +0800
commit2a59b87c17d5bc66a72d3509247a3e2650559a67 (patch)
treeaf36b21d4054f9929f4847cadd2b7ec83748f307 /libempathy-gtk
parent61398dbbf1b7dc364c54e999fa983ce6fb078e3b (diff)
downloadgsoc2013-empathy-2a59b87c17d5bc66a72d3509247a3e2650559a67.tar
gsoc2013-empathy-2a59b87c17d5bc66a72d3509247a3e2650559a67.tar.gz
gsoc2013-empathy-2a59b87c17d5bc66a72d3509247a3e2650559a67.tar.bz2
gsoc2013-empathy-2a59b87c17d5bc66a72d3509247a3e2650559a67.tar.lz
gsoc2013-empathy-2a59b87c17d5bc66a72d3509247a3e2650559a67.tar.xz
gsoc2013-empathy-2a59b87c17d5bc66a72d3509247a3e2650559a67.tar.zst
gsoc2013-empathy-2a59b87c17d5bc66a72d3509247a3e2650559a67.zip
GTalk-enable the protocol chooser
Diffstat (limited to 'libempathy-gtk')
-rw-r--r--libempathy-gtk/empathy-protocol-chooser.c37
-rw-r--r--libempathy-gtk/empathy-protocol-chooser.h4
2 files changed, 34 insertions, 7 deletions
diff --git a/libempathy-gtk/empathy-protocol-chooser.c b/libempathy-gtk/empathy-protocol-chooser.c
index 16ede4fd9..7f2ca147f 100644
--- a/libempathy-gtk/empathy-protocol-chooser.c
+++ b/libempathy-gtk/empathy-protocol-chooser.c
@@ -77,6 +77,7 @@ enum
COL_LABEL,
COL_CM,
COL_PROTOCOL,
+ COL_IS_GTALK,
COL_COUNT
};
@@ -208,8 +209,23 @@ protocol_choosers_add_cm (EmpathyProtocolChooser *chooser,
COL_LABEL, display_name,
COL_CM, cm,
COL_PROTOCOL, proto,
+ COL_IS_GTALK, FALSE,
-1);
+ if (!tp_strdiff (proto->name, "jabber") &&
+ !tp_strdiff (cm->name, "gabble"))
+ {
+ display_name = empathy_protocol_name_to_display_name ("gtalk");
+ gtk_list_store_insert_with_values (priv->store,
+ NULL, 0,
+ COL_ICON, "im-google-talk",
+ COL_LABEL, display_name,
+ COL_CM, cm,
+ COL_PROTOCOL, proto,
+ COL_IS_GTALK, TRUE,
+ -1);
+ }
+
g_free (icon_name);
}
}
@@ -251,7 +267,8 @@ protocol_chooser_constructed (GObject *object)
G_TYPE_STRING, /* Icon name */
G_TYPE_STRING, /* Label */
G_TYPE_OBJECT, /* CM */
- G_TYPE_POINTER); /* protocol */
+ G_TYPE_POINTER, /* protocol */
+ G_TYPE_BOOLEAN); /* is gtalk */
/* Set the protocol sort function */
gtk_tree_sortable_set_sort_func (GTK_TREE_SORTABLE (priv->store),
@@ -394,7 +411,8 @@ protocol_chooser_filter_visible_func (GtkTreeModel *model,
TpConnectionManager *
empathy_protocol_chooser_dup_selected (
EmpathyProtocolChooser *protocol_chooser,
- TpConnectionManagerProtocol **protocol)
+ TpConnectionManagerProtocol **protocol,
+ gboolean *is_gtalk)
{
GtkTreeIter iter;
TpConnectionManager *cm = NULL;
@@ -414,9 +432,18 @@ empathy_protocol_chooser_dup_selected (
-1);
if (protocol != NULL)
- gtk_tree_model_get (GTK_TREE_MODEL (cur_model), &iter,
- COL_PROTOCOL, protocol,
- -1);
+ {
+ gtk_tree_model_get (GTK_TREE_MODEL (cur_model), &iter,
+ COL_PROTOCOL, protocol,
+ -1);
+ }
+
+ if (is_gtalk != NULL)
+ {
+ gtk_tree_model_get (GTK_TREE_MODEL (cur_model), &iter,
+ COL_IS_GTALK, is_gtalk,
+ -1);
+ }
}
return cm;
diff --git a/libempathy-gtk/empathy-protocol-chooser.h b/libempathy-gtk/empathy-protocol-chooser.h
index 55e8e355e..a649aa578 100644
--- a/libempathy-gtk/empathy-protocol-chooser.h
+++ b/libempathy-gtk/empathy-protocol-chooser.h
@@ -65,13 +65,13 @@ GType empathy_protocol_chooser_get_type (void) G_GNUC_CONST;
GtkWidget * empathy_protocol_chooser_new (void);
TpConnectionManager *empathy_protocol_chooser_dup_selected (
EmpathyProtocolChooser *protocol_chooser,
- TpConnectionManagerProtocol **protocol);
+ TpConnectionManagerProtocol **protocol,
+ gboolean *is_gtalk);
void empathy_protocol_chooser_set_visible (
EmpathyProtocolChooser *protocol_chooser,
EmpathyProtocolChooserFilterFunc func,
gpointer user_data);
-
G_END_DECLS
#endif /* __EMPATHY_PROTOCOL_CHOOSER_H__ */