diff options
author | Matthew Barnes <mbarnes@src.gnome.org> | 2008-11-24 13:14:44 +0800 |
---|---|---|
committer | Matthew Barnes <mbarnes@src.gnome.org> | 2008-11-24 13:14:44 +0800 |
commit | 4f4615a46d5ba518c1e6a0c2412b1edf1e268d99 (patch) | |
tree | 828acaa7b76aa12a490a3238b0ec4a7086b8be16 /plugins/google-account-setup/google-source.c | |
parent | 076b7c45131482b87d18963d34d035435491ee8d (diff) | |
download | gsoc2013-evolution-4f4615a46d5ba518c1e6a0c2412b1edf1e268d99.tar gsoc2013-evolution-4f4615a46d5ba518c1e6a0c2412b1edf1e268d99.tar.gz gsoc2013-evolution-4f4615a46d5ba518c1e6a0c2412b1edf1e268d99.tar.bz2 gsoc2013-evolution-4f4615a46d5ba518c1e6a0c2412b1edf1e268d99.tar.lz gsoc2013-evolution-4f4615a46d5ba518c1e6a0c2412b1edf1e268d99.tar.xz gsoc2013-evolution-4f4615a46d5ba518c1e6a0c2412b1edf1e268d99.tar.zst gsoc2013-evolution-4f4615a46d5ba518c1e6a0c2412b1edf1e268d99.zip |
Merge revisions 36737:36810 from trunk.
svn path=/branches/kill-bonobo/; revision=36811
Diffstat (limited to 'plugins/google-account-setup/google-source.c')
-rw-r--r-- | plugins/google-account-setup/google-source.c | 19 |
1 files changed, 15 insertions, 4 deletions
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); |