Wait for an explicit "Close" by the user instead of closing the DownloadDialog automa...
[supertux.git] / src / supertux / menu / download_dialog.cpp
index 8ba7fc2..c8d1cfd 100644 (file)
@@ -30,6 +30,10 @@ DownloadDialog::DownloadDialog(TransferStatusPtr status) :
     });
 
   update_text();
+
+  status->then([this]{
+      on_download_complete();
+    });
 }
 
 void
@@ -70,4 +74,13 @@ DownloadDialog::on_abort()
   AddonManager::current()->abort_install();
 }
 
+void
+DownloadDialog::on_download_complete()
+{
+  clear_buttons();
+  add_button(_("Close"), [this]{
+      MenuManager::instance().set_dialog({});
+    });
+}
+
 /* EOF */