diff options
author | Carlos Soriano <csoriano@gnome.org> | 2015-07-14 10:13:48 +0200 |
---|---|---|
committer | Carlos Soriano <csoriano@gnome.org> | 2015-07-17 00:45:39 +0200 |
commit | 2db9a2950b90e82f6f2123280cbf209976bce977 (patch) | |
tree | 000f0b2b670f28a29ba83421e146b182dc222bc7 /src/nautilus-progress-info-widget.c | |
parent | 192d2e2fccd86ad438b5fc3c7a7752840c903e49 (diff) | |
download | nautilus-2db9a2950b90e82f6f2123280cbf209976bce977.tar.gz |
progress-info: allow finished infos to remain alive
We want to not hide the operations and the operations button
in the toolbar if the popover is open. For that, we need to
allow operations widgets to remain alive even when the operation
is finished.
For that we need to add a new status state to copying/moving/trashing,
like copied/moved/trashed.
On the way, improve the wording of file-operations to match the mockups,
and also make the report operations code more consistent to each other.
Diffstat (limited to 'src/nautilus-progress-info-widget.c')
-rw-r--r-- | src/nautilus-progress-info-widget.c | 22 |
1 files changed, 19 insertions, 3 deletions
diff --git a/src/nautilus-progress-info-widget.c b/src/nautilus-progress-info-widget.c index 783467686..452284bc6 100644 --- a/src/nautilus-progress-info-widget.c +++ b/src/nautilus-progress-info-widget.c @@ -47,7 +47,13 @@ G_DEFINE_TYPE_WITH_PRIVATE (NautilusProgressInfoWidget, nautilus_progress_info_w static void info_finished (NautilusProgressInfoWidget *self) { - gtk_widget_destroy (GTK_WIDGET (self)); + gtk_widget_set_sensitive (self->priv->cancel, FALSE); +} + +static void +info_cancelled (NautilusProgressInfoWidget *self) +{ + gtk_widget_set_sensitive (self->priv->cancel, FALSE); } static void @@ -85,7 +91,6 @@ cancel_clicked (GtkWidget *button, NautilusProgressInfoWidget *self) { nautilus_progress_info_cancel (self->priv->info); - gtk_widget_set_sensitive (button, FALSE); } static void @@ -117,6 +122,9 @@ nautilus_progress_info_widget_constructed (GObject *obj) g_signal_connect_swapped (self->priv->info, "finished", G_CALLBACK (info_finished), self); + g_signal_connect_swapped (self->priv->info, + "cancelled", + G_CALLBACK (info_cancelled), self); update_data (self); update_progress (self); @@ -186,7 +194,15 @@ nautilus_progress_info_widget_class_init (NautilusProgressInfoWidgetClass *klass GtkWidget * nautilus_progress_info_widget_new (NautilusProgressInfo *info) { - return g_object_new (NAUTILUS_TYPE_PROGRESS_INFO_WIDGET, + NautilusProgressInfoWidget *self; + + self = g_object_new (NAUTILUS_TYPE_PROGRESS_INFO_WIDGET, "info", info, NULL); + + gtk_widget_set_sensitive (self->priv->cancel, + !nautilus_progress_info_get_is_finished (self->priv->info) && + !nautilus_progress_info_get_is_cancelled (self->priv->info)); + + return GTK_WIDGET (self); } |