placesview: Fix server mount feedback

We weren't properly resetting the in-entry progress.
This commit is contained in:
Matthias Clasen 2021-04-16 19:34:24 -04:00
parent 3df3a0499f
commit 379bb6c9f5

View File

@ -1215,12 +1215,14 @@ server_mount_ready_cb (GObject *source_file,
g_clear_error (&error); g_clear_error (&error);
} }
if (view->destroyed) { if (view->destroyed)
{
g_object_unref (view); g_object_unref (view);
return; return;
} }
view->should_pulse_entry = FALSE; view->should_pulse_entry = FALSE;
gtk_entry_set_progress_fraction (GTK_ENTRY (view->address_entry), 0);
/* Restore from Cancel to Connect */ /* Restore from Cancel to Connect */
gtk_button_set_label (GTK_BUTTON (view->connect_button), _("Con_nect")); gtk_button_set_label (GTK_BUTTON (view->connect_button), _("Con_nect"));
@ -1388,8 +1390,7 @@ pulse_entry_cb (gpointer user_data)
} }
else else
{ {
gtk_entry_set_progress_pulse_step (GTK_ENTRY (view->address_entry), 0.0); gtk_entry_set_progress_fraction (GTK_ENTRY (view->address_entry), 0);
gtk_entry_set_progress_fraction (GTK_ENTRY (view->address_entry), 0.0);
view->entry_pulse_timeout_id = 0; view->entry_pulse_timeout_id = 0;
return G_SOURCE_REMOVE; return G_SOURCE_REMOVE;
@ -1443,6 +1444,7 @@ mount_server (GtkPlacesView *view,
view->should_pulse_entry = TRUE; view->should_pulse_entry = TRUE;
gtk_entry_set_progress_pulse_step (GTK_ENTRY (view->address_entry), 0.1); gtk_entry_set_progress_pulse_step (GTK_ENTRY (view->address_entry), 0.1);
gtk_entry_set_progress_fraction (GTK_ENTRY (view->address_entry), 0.1);
/* Allow to cancel the operation */ /* Allow to cancel the operation */
gtk_button_set_label (GTK_BUTTON (view->connect_button), _("Cance_l")); gtk_button_set_label (GTK_BUTTON (view->connect_button), _("Cance_l"));
gtk_widget_set_sensitive (view->address_entry, FALSE); gtk_widget_set_sensitive (view->address_entry, FALSE);