Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 3268 in orxonox.OLD for orxonox/branches/updater/src/gui


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.

Location:
orxonox/branches/updater/src/gui
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • orxonox/branches/updater/src/gui/Makefile.am

    r3262 r3268  
    1 AM_CXXFLAGS=$(GTK2_CFLAGS) $(GTHREAD_CFLAGS) $(CURL_CFLAGS) $(MSBITFIELDS)
    2 #AM_LDFLAGS=$(GTK2_LIBS)   $(GTHREAD_LIBS)
    3 LIBS=$(GTK2_LIBS) $(GTHREAD_LIBS) $(CURL_LIBS)
     1AM_CXXFLAGS=$(GTK2_CFLAGS) $(CURL_CFLAGS) $(MSBITFIELDS)
     2#AM_LDFLAGS=$(GTK2_LIBS)
     3LIBS=$(GTK2_LIBS) $(CURL_LIBS)
    44
    55bin_PROGRAMS=gui
  • orxonox/branches/updater/src/gui/Makefile.in

    r3262 r3268  
    113113EGREP = @EGREP@
    114114EXEEXT = @EXEEXT@
    115 GTHREAD_CFLAGS = @GTHREAD_CFLAGS@
    116 GTHREAD_LIBS = @GTHREAD_LIBS@
    117115GTK2_CFLAGS = @GTK2_CFLAGS@
    118116GTK2_LIBS = @GTK2_LIBS@
    119117HAVE_CURL_FALSE = @HAVE_CURL_FALSE@
    120118HAVE_CURL_TRUE = @HAVE_CURL_TRUE@
    121 HAVE_GTHREAD_FALSE = @HAVE_GTHREAD_FALSE@
    122 HAVE_GTHREAD_TRUE = @HAVE_GTHREAD_TRUE@
    123119HAVE_GTK2_FALSE = @HAVE_GTK2_FALSE@
    124120HAVE_GTK2_TRUE = @HAVE_GTK2_TRUE@
     
    129125LDFLAGS = @LDFLAGS@
    130126LIBOBJS = @LIBOBJS@
    131 #AM_LDFLAGS=$(GTK2_LIBS)   $(GTHREAD_LIBS)
    132 LIBS = $(GTK2_LIBS) $(GTHREAD_LIBS) $(CURL_LIBS)
     127#AM_LDFLAGS=$(GTK2_LIBS)
     128LIBS = $(GTK2_LIBS) $(CURL_LIBS)
    133129LTLIBOBJS = @LTLIBOBJS@
    134130MAKEINFO = @MAKEINFO@
     
    188184target_os = @target_os@
    189185target_vendor = @target_vendor@
    190 AM_CXXFLAGS = $(GTK2_CFLAGS) $(GTHREAD_CFLAGS) $(CURL_CFLAGS) $(MSBITFIELDS)
     186AM_CXXFLAGS = $(GTK2_CFLAGS) $(CURL_CFLAGS) $(MSBITFIELDS)
    191187gui_SOURCES = orxonox_gui.cc \
    192188            orxonox_gui_gtk.cc \
  • orxonox/branches/updater/src/gui/orxonox_gui_gtk.cc

    r3263 r3268  
    4747bool initGTK(int argc, char *argv[])
    4848{
    49 #ifdef HAVE_GTHREAD
    50   PRINTF(3)("Initializing the ThreadSystem of the GUI\n");
    51   g_thread_init(NULL);
    52   gdk_threads_init();
    53 #endif /* HAVE_GTHREAD */
    5449  gtk_init (&argc, &argv);
    5550  gtk_rc_parse( "rc" );
     
    6156bool mainloopGTK(void)
    6257{
    63   gdk_threads_enter();
    6458  PRINTF(1)("test\n");
    6559  gtk_main();
    66   gdk_threads_leave();
    6760}
    6861#endif /* HAVE_GTK2 */
     
    12101203    this->progress = this->totalSize;
    12111204
     1205
    12121206#ifdef HAVE_GTK2
    12131207  gtk_progress_set_value(GTK_PROGRESS(widget), this->progress*100.0/this->totalSize);
     1208  while (gtk_events_pending())
     1209    gtk_main_iteration_do(TRUE);
    12141210#endif /* HAVE_GTK2 */
    12151211  PRINTF(3)("Progress: %f\n", progress*100.0/totalSize);
  • 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 */
  • orxonox/branches/updater/src/gui/orxonox_gui_update.h

    r3267 r3268  
    5353  static int curlProgressFunc (ProgressBar* Bar, double totalSize, double progress, double upTotal, double upProgress);
    5454
    55   static GThread* downloadThreadID;
    56   static void* downloadThread (void* fileInfo);
    57  
     55  static void* download (void* fileInfo);
     56#ifdef HAVE_GTK2
     57  static gint cancelDownload(GtkWidget* w, GdkEventKey* event, void* bar);
     58#endif /* HAVE_GTK2 */ 
    5859#endif /* HAVE_CURL */
    5960
Note: See TracChangeset for help on using the changeset viewer.