From 7669e3e56c38209fbb2edf9db28cce2c1e5fe372 Mon Sep 17 00:00:00 2001 From: Danielle Madeley Date: Tue, 15 Mar 2011 20:08:56 +1100 Subject: Set Apply/Cancel buttons sensitive when password is changed --- libempathy-gtk/empathy-account-widget-skype.c | 26 +++++++++++++++++--------- 1 file changed, 17 insertions(+), 9 deletions(-) diff --git a/libempathy-gtk/empathy-account-widget-skype.c b/libempathy-gtk/empathy-account-widget-skype.c index 3775d7b57..d21ecf50c 100644 --- a/libempathy-gtk/empathy-account-widget-skype.c +++ b/libempathy-gtk/empathy-account-widget-skype.c @@ -423,18 +423,26 @@ account_widget_build_skype_account_properties_changed_cb (TpProxy *account, static gboolean account_widget_build_skype_password_entry_focus (GtkWidget *password_entry, GdkEventFocus *event, - gpointer user_data) + EmpathyAccountWidget *self) { - if (g_object_get_data (G_OBJECT (password_entry), "fake-password") == NULL) - return; + EmpathyAccountWidgetPriv *priv = GET_PRIV (self); + TpAccount *account = empathy_account_settings_get_account (priv->settings); - DEBUG ("Clearing fake password for editing"); + if (g_object_get_data (G_OBJECT (password_entry), "fake-password") != NULL) + { + DEBUG ("Clearing fake password for editing"); - gtk_entry_set_text (GTK_ENTRY (password_entry), ""); - g_object_set_data (G_OBJECT (password_entry), "fake-password", - GUINT_TO_POINTER (FALSE)); + gtk_entry_set_text (GTK_ENTRY (password_entry), ""); + g_object_set_data (G_OBJECT (password_entry), "fake-password", + GUINT_TO_POINTER (FALSE)); + } - /* FIXME: need to light up the apply/cancel buttons */ + if (tp_account_is_enabled (account)) + { + DEBUG ("Highlighting Apply/Cancel button"); + + empathy_account_widget_changed (self); + } return FALSE; } @@ -830,7 +838,7 @@ empathy_account_widget_build_skype (EmpathyAccountWidget *self, /* if the user changes the password, it's probably no longer a fake * password */ g_signal_connect (password_entry, "focus-in-event", - G_CALLBACK (account_widget_build_skype_password_entry_focus), NULL); + G_CALLBACK (account_widget_build_skype_password_entry_focus), self); } gboolean -- cgit v1.2.3