diff options
author | Guillaume Desmottes <guillaume.desmottes@collabora.co.uk> | 2011-10-27 22:14:58 +0800 |
---|---|---|
committer | Guillaume Desmottes <guillaume.desmottes@collabora.co.uk> | 2011-10-28 15:53:56 +0800 |
commit | 5c4c3ec113984d8ae5a1f68513da64b0eb901841 (patch) | |
tree | 76f760050a28f2c7afeab95736e889a488d69276 /src | |
parent | 9fb03deb660336545d874bc33e35669ce7f57c8d (diff) | |
download | gsoc2013-empathy-5c4c3ec113984d8ae5a1f68513da64b0eb901841.tar gsoc2013-empathy-5c4c3ec113984d8ae5a1f68513da64b0eb901841.tar.gz gsoc2013-empathy-5c4c3ec113984d8ae5a1f68513da64b0eb901841.tar.bz2 gsoc2013-empathy-5c4c3ec113984d8ae5a1f68513da64b0eb901841.tar.lz gsoc2013-empathy-5c4c3ec113984d8ae5a1f68513da64b0eb901841.tar.xz gsoc2013-empathy-5c4c3ec113984d8ae5a1f68513da64b0eb901841.tar.zst gsoc2013-empathy-5c4c3ec113984d8ae5a1f68513da64b0eb901841.zip |
invite-participant-dialog: don't display treeview if no contact list
https://bugzilla.gnome.org/show_bug.cgi?id=662843
Diffstat (limited to 'src')
-rw-r--r-- | src/empathy-invite-participant-dialog.c | 24 |
1 files changed, 22 insertions, 2 deletions
diff --git a/src/empathy-invite-participant-dialog.c b/src/empathy-invite-participant-dialog.c index 7651fad38..8d9d71292 100644 --- a/src/empathy-invite-participant-dialog.c +++ b/src/empathy-invite-participant-dialog.c @@ -168,6 +168,17 @@ filter_individual (EmpathyContactChooser *chooser, return display; } +static gboolean +has_contact_list (EmpathyInviteParticipantDialog *self) +{ + TpConnection *conn; + + conn = tp_channel_borrow_connection (TP_CHANNEL (self->priv->tp_chat)); + + return tp_proxy_has_interface_by_id (conn, + TP_IFACE_QUARK_CONNECTION_INTERFACE_CONTACT_LIST); +} + static void invite_participant_dialog_constructed (GObject *object) { @@ -214,8 +225,17 @@ invite_participant_dialog_constructed (GObject *object) gtk_window_set_title (GTK_WINDOW (self), _("Invite Participant")); gtk_window_set_role (GTK_WINDOW (self), "invite_participant"); - /* Set a default height so a few contacts are displayed */ - gtk_window_set_default_size (GTK_WINDOW (self), -1, 400); + if (has_contact_list (self)) + { + /* Set a default height so a few contacts are displayed */ + gtk_window_set_default_size (GTK_WINDOW (self), -1, 400); + } + else + { + /* No need to display an empty treeview (ie IRC) */ + empathy_contact_chooser_show_tree_view ( + EMPATHY_CONTACT_CHOOSER (self->priv->chooser), FALSE); + } } static void |