new-calendar-page: Change URL validation feedback
Currently, the progress bar is pulsed as soon as the user starts typing, giving the impression that a process is on going. But, in reality, validation is performed 500 ms. After this changes the progress bar is pulsed only when validation is on-going. The timeout has been increased to 750ms too.
This commit is contained in:
@@ -366,6 +366,7 @@ validate_url_cb (gpointer data)
|
|||||||
|
|
||||||
GCAL_ENTRY;
|
GCAL_ENTRY;
|
||||||
|
|
||||||
|
update_url_entry_state (self, ENTRY_STATE_VALIDATING);
|
||||||
self->validate_url_resource_id = 0;
|
self->validate_url_resource_id = 0;
|
||||||
|
|
||||||
guri = g_uri_parse (gtk_editable_get_text (GTK_EDITABLE (self->calendar_address_entry)), SOUP_HTTP_URI_FLAGS | G_URI_FLAGS_PARSE_RELAXED, NULL);
|
guri = g_uri_parse (gtk_editable_get_text (GTK_EDITABLE (self->calendar_address_entry)), SOUP_HTTP_URI_FLAGS | G_URI_FLAGS_PARSE_RELAXED, NULL);
|
||||||
@@ -459,11 +460,10 @@ on_url_entry_text_changed_cb (GtkEntry *entry,
|
|||||||
if (text && g_utf8_strlen (text, -1) > 0)
|
if (text && g_utf8_strlen (text, -1) > 0)
|
||||||
{
|
{
|
||||||
/*
|
/*
|
||||||
* At first, don't bother the user with the login prompt. Only prompt it when
|
* Only validate the text after the timeout, as we don't want to bother them
|
||||||
* it fails.
|
* as soon as they type into the entry.
|
||||||
*/
|
*/
|
||||||
self->validate_url_resource_id = g_timeout_add (500, validate_url_cb, self);
|
self->validate_url_resource_id = g_timeout_add (750, validate_url_cb, self);
|
||||||
update_url_entry_state (self, ENTRY_STATE_VALIDATING);
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user