From bd006e65c7e0af34288b15ff1dab031536cd2816 Mon Sep 17 00:00:00 2001 From: Danielle Madeley Date: Thu, 10 Mar 2011 17:26:40 +1100 Subject: If the password is fake, and the user focuses in, clear the fake password Also mark the password entry as no longer fake. This allows the user to change their password even though an old password was saved. --- libempathy-gtk/empathy-account-widget-skype.c | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/libempathy-gtk/empathy-account-widget-skype.c b/libempathy-gtk/empathy-account-widget-skype.c index a1af69fb8..70cbc8dfc 100644 --- a/libempathy-gtk/empathy-account-widget-skype.c +++ b/libempathy-gtk/empathy-account-widget-skype.c @@ -404,6 +404,23 @@ account_widget_build_skype_account_properties_changed_cb (TpProxy *account, NULL, password_entry); } +static void +account_widget_build_skype_password_entry_focus (GtkWidget *password_entry, + GdkEventFocus *event, + gpointer user_data) +{ + if (g_object_get_data (G_OBJECT (password_entry), "fake-password") == NULL) + return; + + 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)); + + /* FIXME: need to light up the apply/cancel buttons */ +} + static void account_widget_build_skype_get_privacy_settings_cb (TpProxy *cm, GHashTable *props, @@ -759,6 +776,11 @@ empathy_account_widget_build_skype (EmpathyAccountWidget *self, account_widget_build_skype_account_properties_changed_cb, NULL, NULL, G_OBJECT (password_entry), NULL); } + + /* 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); } gboolean -- cgit v1.2.3