diff options
author | Ting-Wei Lan <lantw44@gmail.com> | 2013-07-29 12:20:46 +0800 |
---|---|---|
committer | LAN-TW <lantw44@gmail.com> | 2013-07-29 12:20:46 +0800 |
commit | d6dcd28a6168d4a4e001572d6931ef74f50ffea5 (patch) | |
tree | ab9a972d8040fd80b8d65e3d18d4a00fda2b8cd3 | |
parent | 5309cd286a3de502b56d82166fa90d1bd84937bc (diff) | |
download | gsoc2013-epiphany-d6dcd28a6168d4a4e001572d6931ef74f50ffea5.tar.gz gsoc2013-epiphany-d6dcd28a6168d4a4e001572d6931ef74f50ffea5.tar.zst gsoc2013-epiphany-d6dcd28a6168d4a4e001572d6931ef74f50ffea5.zip |
Allow users to click "Open" if extraction has failed
-rw-r--r-- | lib/widgets/ephy-download-widget.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/lib/widgets/ephy-download-widget.c b/lib/widgets/ephy-download-widget.c index eddbde476..55b1796e7 100644 --- a/lib/widgets/ephy-download-widget.c +++ b/lib/widgets/ephy-download-widget.c @@ -55,7 +55,7 @@ struct _EphyDownloadWidgetPrivate GtkWidget *icon; gboolean finished; - gboolean arextract_ok; + gboolean archive_end; }; enum @@ -411,6 +411,9 @@ widget_archive_error_cb (AutoarExtract *arextract, errmsg = g_strdup_printf (_("Finished (extraction error: %s)"), error->message); update_download_label_and_tooltip (widget, errmsg); update_download_icon (widget); + widget->priv->archive_end = TRUE; + g_object_unref (widget->priv->arextract); + widget->priv->arextract = NULL; g_free (dest); } @@ -418,7 +421,7 @@ static void widget_archive_completed_cb (AutoarExtract *arextract, EphyDownloadWidget *widget) { - widget->priv->arextract_ok = TRUE; + widget->priv->archive_end = TRUE; update_download_label_and_tooltip (widget, _("Finished")); } @@ -449,7 +452,7 @@ folder_activate_cb (GtkMenuItem *item, EphyDownloadWidget *widget) { if (ephy_download_do_download_action (widget->priv->download, EPHY_DOWNLOAD_ACTION_BROWSE_TO) && - (widget->priv->arextract == NULL || widget->priv->arextract_ok)) + (widget->priv->arextract == NULL || widget->priv->archive_end)) gtk_widget_destroy (GTK_WIDGET (widget)); } static void @@ -637,7 +640,7 @@ ephy_download_widget_init (EphyDownloadWidget *self) GtkStyleContext *context; self->priv = DOWNLOAD_WIDGET_PRIVATE (self); - self->priv->arextract_ok = FALSE; + self->priv->archive_end = FALSE; gtk_orientable_set_orientation (GTK_ORIENTABLE (self), GTK_ORIENTATION_HORIZONTAL); |