aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthew Barnes <mbarnes@redhat.com>2008-11-07 13:25:11 +0800
committerBharath Acharya <abharath@src.gnome.org>2008-11-07 13:25:11 +0800
commitf24169e26d073aecb9380eabd4c757db51f8d8f1 (patch)
treedf2ff0d7a0eb7e4788308b44de5cceebf740532e
parent507262bcd6876a4f44a40bc57d059d47584541d5 (diff)
downloadgsoc2013-evolution-f24169e26d073aecb9380eabd4c757db51f8d8f1.tar
gsoc2013-evolution-f24169e26d073aecb9380eabd4c757db51f8d8f1.tar.gz
gsoc2013-evolution-f24169e26d073aecb9380eabd4c757db51f8d8f1.tar.bz2
gsoc2013-evolution-f24169e26d073aecb9380eabd4c757db51f8d8f1.tar.lz
gsoc2013-evolution-f24169e26d073aecb9380eabd4c757db51f8d8f1.tar.xz
gsoc2013-evolution-f24169e26d073aecb9380eabd4c757db51f8d8f1.tar.zst
gsoc2013-evolution-f24169e26d073aecb9380eabd4c757db51f8d8f1.zip
Committing on behalf of Matthew Barnes <mbarnes@redhat.com>
2008-11-07 Matthew Barnes <mbarnes@redhat.com> ** Fix for bug #559518 * google-source.c: (retrieve_list_clicked), (retrieve_list_sensitize), (plugin_google): Desensitizes the button when the username field is blank. svn path=/trunk/; revision=36755
-rw-r--r--plugins/google-account-setup/ChangeLog8
-rw-r--r--plugins/google-account-setup/google-source.c19
2 files changed, 23 insertions, 4 deletions
diff --git a/plugins/google-account-setup/ChangeLog b/plugins/google-account-setup/ChangeLog
index d251678eac..a59a5aad19 100644
--- a/plugins/google-account-setup/ChangeLog
+++ b/plugins/google-account-setup/ChangeLog
@@ -1,3 +1,11 @@
+2008-11-07 Matthew Barnes <mbarnes@redhat.com>
+
+ ** Fix for bug #559518
+
+ * google-source.c: (retrieve_list_clicked),
+ (retrieve_list_sensitize), (plugin_google): Desensitizes the button
+ when the username field is blank.
+
2008-11-06 Bharath Acharya <abharath@novell.com>
** Fix for bug #557726
diff --git a/plugins/google-account-setup/google-source.c b/plugins/google-account-setup/google-source.c
index 772d8a771a..dd86d1723b 100644
--- a/plugins/google-account-setup/google-source.c
+++ b/plugins/google-account-setup/google-source.c
@@ -435,10 +435,7 @@ retrieve_list_clicked (GtkButton *button, GtkComboBox *combo)
g_return_if_fail (source != NULL);
username = e_source_get_property (source, "username");
- if (!username || !*username) {
- claim_error (parent, _("Please enter user name first."));
- return;
- }
+ g_return_if_fail (username != NULL && *username != '\0');
tmp = g_strdup_printf (_("Enter password for user %s to access list of subscribed calendars."), username);
password = e_passwords_ask_password (_("Enter password"), "Calendar", "", tmp,
@@ -553,6 +550,18 @@ retrieve_list_clicked (GtkButton *button, GtkComboBox *combo)
g_object_unref (service);
}
+static void
+retrieve_list_sensitize (GtkEntry *username_entry,
+ GtkWidget *button)
+{
+ const gchar *text;
+ gboolean sensitive;
+
+ text = gtk_entry_get_text (username_entry);
+ sensitive = (text != NULL && *text != '\0');
+ gtk_widget_set_sensitive (button, sensitive);
+}
+
GtkWidget *
plugin_google (EPlugin *epl,
EConfigHookItemFactoryData *data)
@@ -727,8 +736,10 @@ plugin_google (EPlugin *epl,
gtk_box_pack_start (GTK_BOX (hbox), combo, TRUE, TRUE, 0);
label = gtk_button_new_with_mnemonic (_("Retrieve _list"));
g_signal_connect (label, "clicked", G_CALLBACK (retrieve_list_clicked), combo);
+ g_signal_connect (user, "changed", G_CALLBACK (retrieve_list_sensitize), label);
g_object_set_data (G_OBJECT (label), "ESource", source);
gtk_box_pack_start (GTK_BOX (hbox), label, FALSE, FALSE, 0);
+ gtk_widget_set_sensitive (label, FALSE);
gtk_widget_show_all (hbox);
gtk_table_attach (GTK_TABLE (parent), hbox, 1, 2, row + 4, row + 5, GTK_FILL | GTK_EXPAND, 0, 0, 0);