[gnome-boxes/obsessive-compulsive-disorder: 7/11] downloads-hub: Don't dismiss a row until the download is complete
- From: Felipe Borges <felipeborges src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-boxes/obsessive-compulsive-disorder: 7/11] downloads-hub: Don't dismiss a row until the download is complete
- Date: Mon, 30 Mar 2020 09:23:52 +0000 (UTC)
commit 5a86d26e03577140700b740b2b530d362f871ffe
Author: Felipe Borges <felipeborges gnome org>
Date: Thu Mar 26 12:18:28 2020 +0100
downloads-hub: Don't dismiss a row until the download is complete
src/downloads-hub.vala | 10 ++++++++--
1 file changed, 8 insertions(+), 2 deletions(-)
---
diff --git a/src/downloads-hub.vala b/src/downloads-hub.vala
index fc25f9cb..3b1bc8ef 100644
--- a/src/downloads-hub.vala
+++ b/src/downloads-hub.vala
@@ -89,15 +89,18 @@ private void on_download_complete (string label, string path) {
popdown ();
App.app.main_window.show_vm_assistant (row.local_file);
- row.destroy ();
+ listbox.remove (row);
}
}
[GtkCallback]
private void on_row_activated (Gtk.ListBoxRow _row) {
+ var row = _row as DownloadsHubRow;
+ if (!row.complete)
+ return;
+
popdown ();
- var row = _row as DownloadsHubRow;
if (row.local_file != null) {
App.app.main_window.show_vm_assistant (row.local_file);
}
@@ -153,6 +156,8 @@ private bool draw_button_pie (Widget drawing_area, Cairo.Context context) {
public signal void download_complete (string label, string path);
+ public bool complete = false;
+
public DownloadsHubRow.from_entry (WizardDownloadableEntry entry) {
label.label = entry.title;
@@ -183,6 +188,7 @@ private async void download (string url, string filename) {
}
if (!cancellable.is_cancelled ()) {
+ complete = true;
download_complete (label.label, local_file);
download_status.set_visible_child (download_complete_label);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]