- Timestamp:
- Dec 24, 2004, 2:58:32 PM (20 years ago)
- Location:
- orxonox/branches/updater/src/gui
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
orxonox/branches/updater/src/gui/orxonox_gui_update.cc
r3263 r3266 30 30 #include "orxonox_gui.h" 31 31 #include <stdio.h> 32 #ifdef HAVE_CURL 32 33 #include <curl/curl.h> 33 34 #include <curl/types.h> 34 #include <curl/easy.h> /* new for v7 */ 35 #include <curl/easy.h> 36 #endif /* HAVE_CURL */ 35 37 using namespace std; 36 38 … … 154 156 strcpy (info->fileOnDisk, "test"); 155 157 info->fileOnNet = new char [100]; 156 strcpy(info->fileOnNet, "http://www.orxonox.ethz.ch/files/ taskHorizon.at.bermuda-funk.ogg");158 strcpy(info->fileOnNet, "http://www.orxonox.ethz.ch/files/02%20orxonox%203.mp3"); 157 159 info->Bar = (ProgressBar*)bar; 158 160 PRINTF(3)("Preparing to download file %s.\n", info->fileOnNet); 159 //downloadThread (info); 160 161 if (!g_thread_create(&downloadThread, info, FALSE, NULL) != 0) 162 PRINTF(1)("can't create the thread"); 161 // downloadThread (info); 162 163 if (downloadThreadID == NULL) 164 { 165 if ( (downloadThreadID =g_thread_create(&downloadThread, info, TRUE, NULL)) == 0 ) 166 PRINTF(1)("can't create the thread"); 167 } 168 else 169 PRINTF(1)("thread already in use\n"); 170 163 171 } 164 172 … … 191 199 int OrxonoxGuiUpdate::curlProgressFunc (ProgressBar* Bar, double totalSize, double progress, double upTotal, double upProgress) 192 200 { 193 //gdk_threads_enter();201 gdk_threads_enter(); 194 202 Bar->setProgress(progress); 195 203 Bar->setTotalSize(totalSize); 196 //gdk_threads_leave();204 gdk_threads_leave(); 197 205 return 0; 198 206 199 207 } 200 208 209 GThread* OrxonoxGuiUpdate::downloadThreadID = NULL; 210 201 211 void* OrxonoxGuiUpdate::downloadThread (void* fileInfo) 202 212 { 213 203 214 PRINTF(3)("Downloading.\n"); 204 215 FileInfo* info = (FileInfo*)fileInfo; … … 225 236 curl_easy_cleanup(curl); 226 237 } 238 downloadThreadID = NULL; 227 239 return NULL; 228 240 } -
orxonox/branches/updater/src/gui/orxonox_gui_update.h
r3263 r3266 50 50 static int curlProgressFunc (ProgressBar* Bar, double totalSize, double progress, double upTotal, double upProgress); 51 51 52 static GThread* downloadThreadID; 52 53 static void* downloadThread (void* fileInfo); 53 54
Note: See TracChangeset
for help on using the changeset viewer.