From b024319f60d3c8ab298c1593b83e0cb756f109af Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Diego=20Iv=C3=A1n=20M=2EE?= Date: Wed, 7 Aug 2024 15:34:25 -0600 Subject: [PATCH] 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. --- src/gui/calendar-management/gcal-new-calendar-page.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/gui/calendar-management/gcal-new-calendar-page.c b/src/gui/calendar-management/gcal-new-calendar-page.c index 4a1d1b04..ff5b5f2a 100644 --- a/src/gui/calendar-management/gcal-new-calendar-page.c +++ b/src/gui/calendar-management/gcal-new-calendar-page.c @@ -366,6 +366,7 @@ validate_url_cb (gpointer data) GCAL_ENTRY; + update_url_entry_state (self, ENTRY_STATE_VALIDATING); 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); @@ -438,7 +439,7 @@ on_url_entry_text_changed_cb (GtkEntry *entry, GParamSpec *pspec, GcalNewCalendarPage *self) { - const gchar* text; + const gchar *text; GCAL_ENTRY; @@ -459,11 +460,10 @@ on_url_entry_text_changed_cb (GtkEntry *entry, if (text && g_utf8_strlen (text, -1) > 0) { /* - * At first, don't bother the user with the login prompt. Only prompt it when - * it fails. + * Only validate the text after the timeout, as we don't want to bother them + * as soon as they type into the entry. */ - self->validate_url_resource_id = g_timeout_add (500, validate_url_cb, self); - update_url_entry_state (self, ENTRY_STATE_VALIDATING); + self->validate_url_resource_id = g_timeout_add (750, validate_url_cb, self); } else {