aboutsummaryrefslogtreecommitdiffstats
path: root/libempathy-gtk/empathy-contact-widget.c
diff options
context:
space:
mode:
authorxclaesse <xclaesse@4ee84921-47dd-4033-b63a-18d7a039a3e4>2008-11-11 23:27:42 +0800
committerxclaesse <xclaesse@4ee84921-47dd-4033-b63a-18d7a039a3e4>2008-11-11 23:27:42 +0800
commitbb6b25000448db315423a459073949a9c7b9c59d (patch)
tree95ca7e1e9df304928d7dade08b133e03df7d572f /libempathy-gtk/empathy-contact-widget.c
parent7da172b581b4931e1f5921bdde47073635607ad2 (diff)
downloadgsoc2013-empathy-bb6b25000448db315423a459073949a9c7b9c59d.tar
gsoc2013-empathy-bb6b25000448db315423a459073949a9c7b9c59d.tar.gz
gsoc2013-empathy-bb6b25000448db315423a459073949a9c7b9c59d.tar.bz2
gsoc2013-empathy-bb6b25000448db315423a459073949a9c7b9c59d.tar.lz
gsoc2013-empathy-bb6b25000448db315423a459073949a9c7b9c59d.tar.xz
gsoc2013-empathy-bb6b25000448db315423a459073949a9c7b9c59d.tar.zst
gsoc2013-empathy-bb6b25000448db315423a459073949a9c7b9c59d.zip
Update avatar chooser's account from its own callback.
This fixes a bug where the account chooser's account would change, but the avatar picker would not be updated because the main account_chooser::changed signal handler is suppressed! git-svn-id: svn+ssh://svn.gnome.org/svn/empathy/trunk@1701 4ee84921-47dd-4033-b63a-18d7a039a3e4
Diffstat (limited to 'libempathy-gtk/empathy-contact-widget.c')
-rw-r--r--libempathy-gtk/empathy-contact-widget.c41
1 files changed, 19 insertions, 22 deletions
diff --git a/libempathy-gtk/empathy-contact-widget.c b/libempathy-gtk/empathy-contact-widget.c
index 25fc275f4..770d9874b 100644
--- a/libempathy-gtk/empathy-contact-widget.c
+++ b/libempathy-gtk/empathy-contact-widget.c
@@ -105,8 +105,6 @@ static void contact_widget_contact_update (EmpathyContactWidget *information);
static void contact_widget_change_contact (EmpathyContactWidget *information);
static void contact_widget_avatar_changed_cb (EmpathyAvatarChooser *chooser,
EmpathyContactWidget *information);
-static void contact_widget_update_avatar_chooser_account (
- EmpathyContactWidget *information);
static void contact_widget_account_changed_cb (GtkComboBox *widget,
EmpathyContactWidget *information);
static gboolean contact_widget_id_focus_out_cb (GtkWidget *widget,
@@ -495,6 +493,16 @@ widget_avatar_button_press_event_cb (GtkWidget *widget,
}
static void
+update_avatar_chooser_account_cb (EmpathyAccountChooser *account_chooser,
+ EmpathyAvatarChooser *avatar_chooser)
+{
+ McAccount *account;
+
+ account = empathy_account_chooser_get_account (account_chooser);
+ g_object_set (avatar_chooser, "account", account, NULL);
+}
+
+static void
contact_widget_contact_setup (EmpathyContactWidget *information)
{
/* Setup account label/chooser */
@@ -505,7 +513,6 @@ contact_widget_contact_setup (EmpathyContactWidget *information)
g_signal_connect (information->widget_account, "changed",
G_CALLBACK (contact_widget_account_changed_cb),
information);
- contact_widget_update_avatar_chooser_account (information);
}
else
{
@@ -527,6 +534,15 @@ contact_widget_contact_setup (EmpathyContactWidget *information)
g_signal_connect (information->widget_avatar, "changed",
G_CALLBACK (contact_widget_avatar_changed_cb),
information);
+ if (information->flags & EMPATHY_CONTACT_WIDGET_EDIT_ACCOUNT)
+ {
+ g_signal_connect (information->widget_account, "changed",
+ G_CALLBACK (update_avatar_chooser_account_cb),
+ information->widget_avatar);
+ update_avatar_chooser_account_cb (
+ EMPATHY_ACCOUNT_CHOOSER (information->widget_account),
+ EMPATHY_AVATAR_CHOOSER (information->widget_avatar));
+ }
}
else
{
@@ -731,28 +747,9 @@ contact_widget_avatar_changed_cb (EmpathyAvatarChooser *chooser,
}
static void
-contact_widget_update_avatar_chooser_account (EmpathyContactWidget *information)
-{
- McAccount *account;
- EmpathyAccountChooser *account_chooser;
-
- g_assert (EMPATHY_IS_ACCOUNT_CHOOSER (information->widget_account));
- account_chooser = EMPATHY_ACCOUNT_CHOOSER (information->widget_account);
-
- if (information->flags & EMPATHY_CONTACT_WIDGET_EDIT_AVATAR)
- {
- g_assert (EMPATHY_IS_AVATAR_CHOOSER (information->widget_avatar));
-
- account = empathy_account_chooser_get_account (account_chooser);
- g_object_set (information->widget_avatar, "account", account, NULL);
- }
-}
-
-static void
contact_widget_account_changed_cb (GtkComboBox *widget,
EmpathyContactWidget *information)
{
- contact_widget_update_avatar_chooser_account (information);
contact_widget_change_contact (information);
}