Hooked up progress reporting into the AddonDialog, non-blocking downloads are working now
authorIngo Ruhnke <grumbel@gmail.com>
Tue, 26 Aug 2014 05:33:15 +0000 (07:33 +0200)
committerIngo Ruhnke <grumbel@gmail.com>
Tue, 26 Aug 2014 22:57:44 +0000 (00:57 +0200)
Code still misses proper Addon install once the Download is completed

src/addon/downloader.cpp
src/supertux/menu/addon_dialog.cpp

index 702ce24..349dc27 100644 (file)
@@ -124,6 +124,7 @@ public:
   void on_progress(curl_off_t dltotal, curl_off_t dlnow,
                    curl_off_t ultotal, curl_off_t ulnow)
   {
+    log_info << "progress: " << dlnow << "/" << dltotal << std::endl;
     m_status->dltotal = dltotal;
     m_status->dlnow = dlnow;
 
@@ -258,6 +259,7 @@ Downloader::update()
     {
       case CURLMSG_DONE:
         curl_multi_remove_handle(m_multi_handle, msg->easy_handle);
+        log_info << "DOWNLOAD DONE" << std::endl;
         //FIXME: finish_transfer(msg->easy_handle);
         break;
 
index bf0e005..92bb812 100644 (file)
@@ -36,6 +36,8 @@ AddonDialog::update()
 {
   AddonManager::current()->update();
 
+  update_text();
+
   if (m_status->done)
   {
     MenuManager::instance().set_dialog({});