Changeset 3268 in orxonox.OLD for orxonox/branches/updater/src/gui
- Timestamp:
- Dec 24, 2004, 4:25:41 PM (20 years ago)
- 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)1 AM_CXXFLAGS=$(GTK2_CFLAGS) $(CURL_CFLAGS) $(MSBITFIELDS) 2 #AM_LDFLAGS=$(GTK2_LIBS) 3 LIBS=$(GTK2_LIBS) $(CURL_LIBS) 4 4 5 5 bin_PROGRAMS=gui -
orxonox/branches/updater/src/gui/Makefile.in
r3262 r3268 113 113 EGREP = @EGREP@ 114 114 EXEEXT = @EXEEXT@ 115 GTHREAD_CFLAGS = @GTHREAD_CFLAGS@116 GTHREAD_LIBS = @GTHREAD_LIBS@117 115 GTK2_CFLAGS = @GTK2_CFLAGS@ 118 116 GTK2_LIBS = @GTK2_LIBS@ 119 117 HAVE_CURL_FALSE = @HAVE_CURL_FALSE@ 120 118 HAVE_CURL_TRUE = @HAVE_CURL_TRUE@ 121 HAVE_GTHREAD_FALSE = @HAVE_GTHREAD_FALSE@122 HAVE_GTHREAD_TRUE = @HAVE_GTHREAD_TRUE@123 119 HAVE_GTK2_FALSE = @HAVE_GTK2_FALSE@ 124 120 HAVE_GTK2_TRUE = @HAVE_GTK2_TRUE@ … … 129 125 LDFLAGS = @LDFLAGS@ 130 126 LIBOBJS = @LIBOBJS@ 131 #AM_LDFLAGS=$(GTK2_LIBS) $(GTHREAD_LIBS)132 LIBS = $(GTK2_LIBS) $( GTHREAD_LIBS) $(CURL_LIBS)127 #AM_LDFLAGS=$(GTK2_LIBS) 128 LIBS = $(GTK2_LIBS) $(CURL_LIBS) 133 129 LTLIBOBJS = @LTLIBOBJS@ 134 130 MAKEINFO = @MAKEINFO@ … … 188 184 target_os = @target_os@ 189 185 target_vendor = @target_vendor@ 190 AM_CXXFLAGS = $(GTK2_CFLAGS) $( GTHREAD_CFLAGS) $(CURL_CFLAGS) $(MSBITFIELDS)186 AM_CXXFLAGS = $(GTK2_CFLAGS) $(CURL_CFLAGS) $(MSBITFIELDS) 191 187 gui_SOURCES = orxonox_gui.cc \ 192 188 orxonox_gui_gtk.cc \ -
orxonox/branches/updater/src/gui/orxonox_gui_gtk.cc
r3263 r3268 47 47 bool initGTK(int argc, char *argv[]) 48 48 { 49 #ifdef HAVE_GTHREAD50 PRINTF(3)("Initializing the ThreadSystem of the GUI\n");51 g_thread_init(NULL);52 gdk_threads_init();53 #endif /* HAVE_GTHREAD */54 49 gtk_init (&argc, &argv); 55 50 gtk_rc_parse( "rc" ); … … 61 56 bool mainloopGTK(void) 62 57 { 63 gdk_threads_enter();64 58 PRINTF(1)("test\n"); 65 59 gtk_main(); 66 gdk_threads_leave();67 60 } 68 61 #endif /* HAVE_GTK2 */ … … 1210 1203 this->progress = this->totalSize; 1211 1204 1205 1212 1206 #ifdef HAVE_GTK2 1213 1207 gtk_progress_set_value(GTK_PROGRESS(widget), this->progress*100.0/this->totalSize); 1208 while (gtk_events_pending()) 1209 gtk_main_iteration_do(TRUE); 1214 1210 #endif /* HAVE_GTK2 */ 1215 1211 PRINTF(3)("Progress: %f\n", progress*100.0/totalSize); -
orxonox/branches/updater/src/gui/orxonox_gui_update.cc
r3267 r3268 158 158 info->Bar = (ProgressBar*)bar; 159 159 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); 170 161 } 171 162 … … 198 189 int OrxonoxGuiUpdate::curlProgressFunc (ProgressBar* Bar, double totalSize, double progress, double upTotal, double upProgress) 199 190 { 200 gdk_threads_enter();201 191 Bar->setProgress(progress); 202 192 Bar->setTotalSize(totalSize); 203 gdk_threads_leave();204 193 return 0; 205 206 } 207 208 GThread* OrxonoxGuiUpdate::downloadThreadID = NULL; 209 210 void* OrxonoxGuiUpdate::downloadThread (void* fileInfo) 194 } 195 196 197 void* OrxonoxGuiUpdate::download (void* fileInfo) 211 198 { 212 199 … … 241 228 curl_easy_cleanup(curl); 242 229 } 243 downloadThreadID = NULL;244 230 return NULL; 245 231 } 232 233 #ifdef HAVE_GTK2 234 gint OrxonoxGuiUpdate::cancelDownload(GtkWidget* w, GdkEventKey* event, void* bar) 235 { 236 } 237 #endif /* HAVE_GTK2 */ 246 238 247 239 #endif /* HAVE_CURL */ -
orxonox/branches/updater/src/gui/orxonox_gui_update.h
r3267 r3268 53 53 static int curlProgressFunc (ProgressBar* Bar, double totalSize, double progress, double upTotal, double upProgress); 54 54 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 */ 58 59 #endif /* HAVE_CURL */ 59 60
Note: See TracChangeset
for help on using the changeset viewer.