aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDanielle Madeley <danielle.madeley@collabora.co.uk>2011-04-13 14:23:41 +0800
committerDanielle Madeley <danielle.madeley@collabora.co.uk>2011-04-13 14:23:41 +0800
commita44e407f8d3a7d5d59a95295ae4df4a4742d2ac1 (patch)
tree53e38b263374ddfa2b96c55f333bb2254b6a0846
parent5bc24a81bb3af06626f45932b1c92466eef9cdae (diff)
downloadgsoc2013-empathy-a44e407f8d3a7d5d59a95295ae4df4a4742d2ac1.tar
gsoc2013-empathy-a44e407f8d3a7d5d59a95295ae4df4a4742d2ac1.tar.gz
gsoc2013-empathy-a44e407f8d3a7d5d59a95295ae4df4a4742d2ac1.tar.bz2
gsoc2013-empathy-a44e407f8d3a7d5d59a95295ae4df4a4742d2ac1.tar.lz
gsoc2013-empathy-a44e407f8d3a7d5d59a95295ae4df4a4742d2ac1.tar.xz
gsoc2013-empathy-a44e407f8d3a7d5d59a95295ae4df4a4742d2ac1.tar.zst
gsoc2013-empathy-a44e407f8d3a7d5d59a95295ae4df4a4742d2ac1.zip
contact-selector-dialog: add a selected-account property
-rw-r--r--libempathy-gtk/empathy-contact-selector-dialog.c25
1 files changed, 24 insertions, 1 deletions
diff --git a/libempathy-gtk/empathy-contact-selector-dialog.c b/libempathy-gtk/empathy-contact-selector-dialog.c
index 3ed7f30e5..1fc62ad2f 100644
--- a/libempathy-gtk/empathy-contact-selector-dialog.c
+++ b/libempathy-gtk/empathy-contact-selector-dialog.c
@@ -67,7 +67,8 @@ struct _EmpathyContactSelectorDialogPriv {
enum {
PROP_0,
PROP_SHOW_ACCOUNT_CHOOSER,
- PROP_FILTER_ACCOUNT
+ PROP_FILTER_ACCOUNT,
+ PROP_SELECTED_ACCOUNT
};
enum {
@@ -152,6 +153,8 @@ contact_selector_dialog_account_changed_cb (GtkWidget *widget,
g_object_unref (contact);
members = g_list_delete_link (members, members);
}
+
+ g_object_notify (G_OBJECT (dialog), "selected-account");
}
static gboolean
@@ -376,6 +379,7 @@ empathy_contact_selector_dialog_get_property (GObject *self,
GParamSpec *pspec)
{
EmpathyContactSelectorDialog *dialog = EMPATHY_CONTACT_SELECTOR_DIALOG (self);
+ EmpathyContactSelectorDialogPriv *priv = GET_PRIV (dialog);
switch (prop_id)
{
@@ -389,6 +393,11 @@ empathy_contact_selector_dialog_get_property (GObject *self,
empathy_contact_selector_dialog_get_filter_account (dialog));
break;
+ case PROP_SELECTED_ACCOUNT:
+ g_value_set_object (value, empathy_account_chooser_get_account (
+ EMPATHY_ACCOUNT_CHOOSER (priv->account_chooser)));
+ break;
+
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (self, prop_id, pspec);
break;
@@ -402,6 +411,7 @@ empathy_contact_selector_dialog_set_property (GObject *self,
GParamSpec *pspec)
{
EmpathyContactSelectorDialog *dialog = EMPATHY_CONTACT_SELECTOR_DIALOG (self);
+ EmpathyContactSelectorDialogPriv *priv = GET_PRIV (dialog);
switch (prop_id)
{
@@ -415,6 +425,12 @@ empathy_contact_selector_dialog_set_property (GObject *self,
g_value_get_object (value));
break;
+ case PROP_SELECTED_ACCOUNT:
+ empathy_account_chooser_set_account (
+ EMPATHY_ACCOUNT_CHOOSER (priv->account_chooser),
+ g_value_get_object (value));
+ break;
+
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (self, prop_id, pspec);
break;
@@ -491,6 +507,13 @@ empathy_contact_selector_dialog_class_init (
"account are displayed",
TP_TYPE_ACCOUNT,
G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
+
+ g_object_class_install_property (object_class, PROP_SELECTED_ACCOUNT,
+ g_param_spec_object ("selected-account",
+ "Selected Account",
+ "Current account selected in the account-chooser",
+ TP_TYPE_ACCOUNT,
+ G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
}
const gchar *