Changeset 4061 in orxonox.OLD for orxonox/trunk/src/lib/gui
- Timestamp:
- May 5, 2005, 3:10:03 AM (20 years ago)
- Location:
- orxonox/trunk/src/lib/gui
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
orxonox/trunk/src/lib/gui/Makefile.in
r4054 r4061 89 89 EXEEXT = @EXEEXT@ 90 90 GPROF = @GPROF@ 91 GTHREAD_CFLAGS = @GTHREAD_CFLAGS@92 GTHREAD_LIBS = @GTHREAD_LIBS@93 91 GTK2_CFLAGS = @GTK2_CFLAGS@ 94 92 GTK2_LIBS = @GTK2_LIBS@ 95 93 HAVE_CURL_FALSE = @HAVE_CURL_FALSE@ 96 94 HAVE_CURL_TRUE = @HAVE_CURL_TRUE@ 97 HAVE_GTHREAD_FALSE = @HAVE_GTHREAD_FALSE@98 HAVE_GTHREAD_TRUE = @HAVE_GTHREAD_TRUE@99 95 HAVE_GTK2_FALSE = @HAVE_GTK2_FALSE@ 100 96 HAVE_GTK2_TRUE = @HAVE_GTK2_TRUE@ -
orxonox/trunk/src/lib/gui/console/Makefile.in
r4054 r4061 107 107 EXEEXT = @EXEEXT@ 108 108 GPROF = @GPROF@ 109 GTHREAD_CFLAGS = @GTHREAD_CFLAGS@110 GTHREAD_LIBS = @GTHREAD_LIBS@111 109 GTK2_CFLAGS = @GTK2_CFLAGS@ 112 110 GTK2_LIBS = @GTK2_LIBS@ 113 111 HAVE_CURL_FALSE = @HAVE_CURL_FALSE@ 114 112 HAVE_CURL_TRUE = @HAVE_CURL_TRUE@ 115 HAVE_GTHREAD_FALSE = @HAVE_GTHREAD_FALSE@116 HAVE_GTHREAD_TRUE = @HAVE_GTHREAD_TRUE@117 113 HAVE_GTK2_FALSE = @HAVE_GTK2_FALSE@ 118 114 HAVE_GTK2_TRUE = @HAVE_GTK2_TRUE@ -
orxonox/trunk/src/lib/gui/gui/Makefile.in
r4054 r4061 112 112 EXEEXT = @EXEEXT@ 113 113 GPROF = @GPROF@ 114 GTHREAD_CFLAGS = @GTHREAD_CFLAGS@115 GTHREAD_LIBS = @GTHREAD_LIBS@116 114 GTK2_CFLAGS = @GTK2_CFLAGS@ 117 115 GTK2_LIBS = @GTK2_LIBS@ 118 116 HAVE_CURL_FALSE = @HAVE_CURL_FALSE@ 119 117 HAVE_CURL_TRUE = @HAVE_CURL_TRUE@ 120 HAVE_GTHREAD_FALSE = @HAVE_GTHREAD_FALSE@121 HAVE_GTHREAD_TRUE = @HAVE_GTHREAD_TRUE@122 118 HAVE_GTK2_FALSE = @HAVE_GTK2_FALSE@ 123 119 HAVE_GTK2_TRUE = @HAVE_GTK2_TRUE@ -
orxonox/trunk/src/lib/gui/gui/gui_gtk.cc
r4058 r4061 49 49 50 50 #ifdef HAVE_GTK2 51 #ifdef HAVE_GTHREAD52 PRINTF(4)("Initializing the ThreadSystem of the GUI\n");53 g_thread_init(NULL);54 gdk_threads_init();55 #endif /* HAVE_GTHREAD */56 51 gtk_init(&argc, &argv); 57 52 #include "rc" … … 66 61 { 67 62 #ifdef HAVE_GTK2 68 gdk_threads_enter();69 63 gtk_main(); 70 gdk_threads_leave();71 delete Window::mainWindow;72 64 #else /* HAVE_GTK2 */ 73 65 char boolAns = 'y'; -
orxonox/trunk/src/lib/gui/gui/gui_update.cc
r4056 r4061 276 276 bar->setTotalSize(totalSize); 277 277 #ifdef HAVE_GTK2 278 #ifndef HAVE_PTHREAD_H279 278 while(gtk_events_pending()) gtk_main_iteration(); 280 279 #endif 281 #endif282 280 return 0; 283 281 } … … 288 286 CURL* GuiUpdate::curlHandle = NULL; 289 287 290 #ifdef HAVE_PTHREAD_H291 /** \brief The download Thread ID */292 pthread_t* GuiUpdate::downloadThreadID = new pthread_t;293 /** \brief The download Thread ID*/294 pthread_t* GuiUpdate::downloadThreadFinishID = new pthread_t;295 #endif /* HAVE_PTHREAD_H */296 288 /** 297 289 \brief A bool parameter that shows if we are downloading. … … 387 379 if(!isDownloading) 388 380 { 389 #ifdef HAVE_PTHREAD_H390 pthread_join(*downloadThreadFinishID, NULL);391 #endif /* HAVE_PTHREAD_H */392 381 #ifdef HAVE_GTK2 393 382 info->stateButton->disconnectSignal(info->buttonSignal); 394 383 info->buttonSignal = info->stateButton->connectSignal("button_press_event", info, cancelDownload); 395 384 #endif /* HAVE_GTK2 */ 396 #ifdef HAVE_PTHREAD_H397 info->stateButton->setTitle("cancel");398 #else /* HAVE_PTHREAD_H */399 385 info->stateButton->setTitle("please wait"); 400 #endif /* HAVE_PTHREAD_H */401 386 402 //! \todo check if threads really were created.403 #ifdef HAVE_PTHREAD_H404 pthread_create(downloadThreadID, NULL, downloadThread, info);405 pthread_create(downloadThreadFinishID, NULL, downloadThreadFinished, info);406 #else407 387 downloadThread(info); 408 388 downloadThreadFinished(info); 409 #endif /* HAVE_PTHREAD_H */410 389 411 390 // res = curl_easy_perform(curlHandle); … … 439 418 { 440 419 FileInfo* info =(FileInfo*)fileInfo; 441 #ifdef HAVE_PTHREAD_H442 pthread_join(*downloadThreadID, NULL);443 #ifdef HAVE_GTK2444 gdk_threads_enter();445 #endif /* HAVE_GTK2 */446 #endif /* HAVE_PTHREAD_H */447 420 if(curlHandle) 448 421 curl_easy_cleanup(curlHandle); … … 460 433 #endif /* HAVE_GTK2 */ 461 434 isDownloading = false; 462 #ifdef HAVE_PTHREAD_H463 #ifdef HAVE_GTK2464 gdk_threads_leave();465 #endif /* HAVE_GTK2 */466 #endif /* HAVE_PTHREAD_H */467 435 468 436 } … … 479 447 gint GuiUpdate::cancelDownload(GtkWidget* w, GdkEventKey* event, void* bar) 480 448 { 481 #ifdef HAVE_PTHREAD_H 482 pthread_cancel(*downloadThreadID); 483 #else 484 PRINTF(2)("Cannot cancle the Downloading process until after this File, because no threading was enabled\n"); 485 #endif /* HAVE_PTHREAD_H*/ 449 PRINTF(4)("Cannot cancle the Downloading process until after this File\n"); 486 450 } 487 451 #endif /* HAVE_GTK2 */ -
orxonox/trunk/src/lib/gui/gui/gui_update.h
r4056 r4061 82 82 static gint cancelDownload(GtkWidget* w, GdkEventKey* event, void* bar); 83 83 #endif /* HAVE_GTK2 */ 84 #ifdef HAVE_PTHREAD_H85 static pthread_t* downloadThreadID;86 static pthread_t* downloadThreadFinishID;87 #endif /* HAVE_PTHREAD_H */88 84 static bool isDownloading; 85 static bool downloadCanceled; 89 86 90 87 static bool download(void* fileInfo);
Note: See TracChangeset
for help on using the changeset viewer.