aboutsummaryrefslogtreecommitdiffstats
path: root/libempathy-gtk
diff options
context:
space:
mode:
authorGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>2009-12-16 19:18:37 +0800
committerGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>2009-12-17 18:38:50 +0800
commit0af3c68b4c8c9392174d780712f5d4a12d0e13e6 (patch)
tree4d5fa6d6ab63a07b8ded2b0c9d2b4185937d963d /libempathy-gtk
parent5631f4f5e4a4d446d5e4d81acd94b69567f9dcfa (diff)
downloadgsoc2013-empathy-0af3c68b4c8c9392174d780712f5d4a12d0e13e6.tar
gsoc2013-empathy-0af3c68b4c8c9392174d780712f5d4a12d0e13e6.tar.gz
gsoc2013-empathy-0af3c68b4c8c9392174d780712f5d4a12d0e13e6.tar.bz2
gsoc2013-empathy-0af3c68b4c8c9392174d780712f5d4a12d0e13e6.tar.lz
gsoc2013-empathy-0af3c68b4c8c9392174d780712f5d4a12d0e13e6.tar.xz
gsoc2013-empathy-0af3c68b4c8c9392174d780712f5d4a12d0e13e6.tar.zst
gsoc2013-empathy-0af3c68b4c8c9392174d780712f5d4a12d0e13e6.zip
contact-selector-dialog: add API for subclass to redefine the accoutn filter function
Diffstat (limited to 'libempathy-gtk')
-rw-r--r--libempathy-gtk/empathy-contact-selector-dialog.c18
-rw-r--r--libempathy-gtk/empathy-contact-selector-dialog.h3
2 files changed, 19 insertions, 2 deletions
diff --git a/libempathy-gtk/empathy-contact-selector-dialog.c b/libempathy-gtk/empathy-contact-selector-dialog.c
index c52ac6c56..6c0448441 100644
--- a/libempathy-gtk/empathy-contact-selector-dialog.c
+++ b/libempathy-gtk/empathy-contact-selector-dialog.c
@@ -230,6 +230,20 @@ entry_activate_cb (GtkEntry *entry,
gtk_dialog_response (GTK_DIALOG (self), GTK_RESPONSE_ACCEPT);
}
+static gboolean
+account_chooser_filter (TpAccount *account,
+ gpointer user_data)
+{
+ EmpathyContactSelectorDialog *self = user_data;
+ EmpathyContactSelectorDialogClass *class = \
+ EMPATHY_CONTACT_SELECTOR_DIALOG_GET_CLASS (self);
+
+ if (class->account_filter == NULL)
+ return empathy_account_chooser_filter_is_connected (account, user_data);
+
+ return class->account_filter (self, account);
+}
+
static void
empathy_contact_selector_dialog_init (EmpathyContactSelectorDialog *dialog)
{
@@ -299,8 +313,8 @@ empathy_contact_selector_dialog_init (EmpathyContactSelectorDialog *dialog)
1, 2, 0, 1);
empathy_account_chooser_set_filter (
EMPATHY_ACCOUNT_CHOOSER (priv->account_chooser),
- empathy_account_chooser_filter_is_connected,
- NULL);
+ account_chooser_filter,
+ dialog);
gtk_widget_show (priv->account_chooser);
contact_selector_dialog_account_changed_cb (priv->account_chooser, dialog);
diff --git a/libempathy-gtk/empathy-contact-selector-dialog.h b/libempathy-gtk/empathy-contact-selector-dialog.h
index 0f5279946..2315bc401 100644
--- a/libempathy-gtk/empathy-contact-selector-dialog.h
+++ b/libempathy-gtk/empathy-contact-selector-dialog.h
@@ -39,6 +39,9 @@ struct _EmpathyContactSelectorDialogClass {
void (*got_response) (EmpathyContactSelectorDialog *self,
TpConnection *connection,
const gchar *contact_id);
+
+ gboolean (*account_filter) (EmpathyContactSelectorDialog *self,
+ TpAccount *account);
};
struct _EmpathyContactSelectorDialog {