Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Dec 24, 2004, 4:25:41 PM (19 years ago)
Author:
bensch
Message:

orxonox/branches/updater: deleted threading again. I have found a different Way
Now I am redrawing the GUI every time a ProgressBar is changed.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • orxonox/branches/updater/src/gui/orxonox_gui_update.cc

    r3267 r3268  
    158158  info->Bar = (ProgressBar*)bar;
    159159  PRINTF(3)("Preparing to download file %s.\n", info->fileName);
    160   //  downloadThread (info);
    161 
    162   if (downloadThreadID == NULL)
    163     {
    164       if ( (downloadThreadID =g_thread_create(&downloadThread, info, TRUE, NULL)) == 0 )
    165         PRINTF(1)("can't create the thread");
    166     }
    167   else
    168     PRINTF(1)("thread already in use\n");
    169 
     160  download(info);
    170161}
    171162
     
    198189int OrxonoxGuiUpdate::curlProgressFunc (ProgressBar* Bar, double totalSize, double progress, double upTotal, double upProgress)
    199190{
    200   gdk_threads_enter();
    201191  Bar->setProgress(progress);
    202192  Bar->setTotalSize(totalSize);
    203   gdk_threads_leave();
    204193  return 0;
    205 
    206 }
    207 
    208 GThread* OrxonoxGuiUpdate::downloadThreadID = NULL;
    209 
    210 void* OrxonoxGuiUpdate::downloadThread (void* fileInfo)
     194}
     195
     196
     197void* OrxonoxGuiUpdate::download (void* fileInfo)
    211198{
    212199 
     
    241228      curl_easy_cleanup(curl);
    242229    }
    243   downloadThreadID = NULL;
    244230  return NULL;
    245231}
     232
     233#ifdef HAVE_GTK2
     234gint OrxonoxGuiUpdate::cancelDownload(GtkWidget* w, GdkEventKey* event, void* bar)
     235{
     236}
     237#endif /* HAVE_GTK2 */
    246238
    247239#endif /* HAVE_CURL */
Note: See TracChangeset for help on using the changeset viewer.