Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

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


Ignore:
Timestamp:
Dec 24, 2004, 4:25:41 PM (20 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
Files:
11 edited

Legend:

Unmodified
Added
Removed
  • orxonox/branches/updater/Makefile.in

    r3262 r3268  
    102102EGREP = @EGREP@
    103103EXEEXT = @EXEEXT@
    104 GTHREAD_CFLAGS = @GTHREAD_CFLAGS@
    105 GTHREAD_LIBS = @GTHREAD_LIBS@
    106104GTK2_CFLAGS = @GTK2_CFLAGS@
    107105GTK2_LIBS = @GTK2_LIBS@
    108106HAVE_CURL_FALSE = @HAVE_CURL_FALSE@
    109107HAVE_CURL_TRUE = @HAVE_CURL_TRUE@
    110 HAVE_GTHREAD_FALSE = @HAVE_GTHREAD_FALSE@
    111 HAVE_GTHREAD_TRUE = @HAVE_GTHREAD_TRUE@
    112108HAVE_GTK2_FALSE = @HAVE_GTK2_FALSE@
    113109HAVE_GTK2_TRUE = @HAVE_GTK2_TRUE@
  • orxonox/branches/updater/configure

    r3264 r3268  
    312312#endif"
    313313
    314 ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS build build_cpu build_vendor build_os host host_cpu host_vendor host_os target target_cpu target_vendor target_os INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA CYGPATH_W PACKAGE VERSION ACLOCAL AUTOCONF AUTOMAKE AUTOHEADER MAKEINFO AMTAR install_sh STRIP ac_ct_STRIP INSTALL_STRIP_PROGRAM mkdir_p AWK SET_MAKE am__leading_dot CXX CXXFLAGS LDFLAGS CPPFLAGS ac_ct_CXX EXEEXT OBJEXT DEPDIR am__include am__quote AMDEP_TRUE AMDEP_FALSE AMDEPBACKSLASH CXXDEPMODE am__fastdepCXX_TRUE am__fastdepCXX_FALSE CC CFLAGS ac_ct_CC CCDEPMODE am__fastdepCC_TRUE am__fastdepCC_FALSE CPP EGREP DEBUG DOXYGEN DOXYGEN_TRUE DOXYGEN_FALSE MSBITFIELDS GTK2_LIBS GTK2_CFLAGS HAVE_GTK2_TRUE HAVE_GTK2_FALSE GTHREAD_LIBS GTHREAD_CFLAGS HAVE_GTHREAD_TRUE HAVE_GTHREAD_FALSE CURL_LIBS CURL_CFLAGS HAVE_CURL_TRUE HAVE_CURL_FALSE LIBOBJS LTLIBOBJS'
     314ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS build build_cpu build_vendor build_os host host_cpu host_vendor host_os target target_cpu target_vendor target_os INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA CYGPATH_W PACKAGE VERSION ACLOCAL AUTOCONF AUTOMAKE AUTOHEADER MAKEINFO AMTAR install_sh STRIP ac_ct_STRIP INSTALL_STRIP_PROGRAM mkdir_p AWK SET_MAKE am__leading_dot CXX CXXFLAGS LDFLAGS CPPFLAGS ac_ct_CXX EXEEXT OBJEXT DEPDIR am__include am__quote AMDEP_TRUE AMDEP_FALSE AMDEPBACKSLASH CXXDEPMODE am__fastdepCXX_TRUE am__fastdepCXX_FALSE CC CFLAGS ac_ct_CC CCDEPMODE am__fastdepCC_TRUE am__fastdepCC_FALSE CPP EGREP DEBUG DOXYGEN DOXYGEN_TRUE DOXYGEN_FALSE MSBITFIELDS GTK2_LIBS GTK2_CFLAGS HAVE_GTK2_TRUE HAVE_GTK2_FALSE CURL_LIBS CURL_CFLAGS HAVE_CURL_TRUE HAVE_CURL_FALSE LIBOBJS LTLIBOBJS'
    315315ac_subst_files=''
    316316
     
    872872  --without-PACKAGE       do not use PACKAGE (same as --with-PACKAGE=no)
    873873  --without-gtk           Prevents GTK from being loaded
    874   --without-gthread       Prevents gThread from being loaded
    875874  --without-curl          Prevents libcURL from being loaded
    876875  --without-sdl-image     Prevents SDL_image from being loaded
     
    38883887fi
    38893888
    3890 ## gThread-disabled
    3891 echo "$as_me:$LINENO: checking if gThread should be enabled" >&5
    3892 echo $ECHO_N "checking if gThread should be enabled... $ECHO_C" >&6
    3893 
    3894 # Check whether --with-gthread or --without-gthread was given.
    3895 if test "${with_gthread+set}" = set; then
    3896   withval="$with_gthread"
    3897   def_gthread=no
    3898 else
    3899   def_gthread=yes
    3900 fi;
    3901 if test "$def_gthread" = yes; then
    3902   echo "yes"
    3903 fi
    3904 if test "$def_gthread" = no; then
    3905   echo "no"
    3906 fi
    3907 
    39083889## libCurl disabled?
    39093890echo "$as_me:$LINENO: checking if libcURL should be enabled" >&5
     
    66916672
    66926673
    6693 ## checking for gThread
    6694 if test "$def_gthread" = yes; then
    6695 
    6696         echo "$as_me:$LINENO: checking for gthread" >&5
    6697 echo $ECHO_N "checking for gthread... $ECHO_C" >&6
    6698         if `pkg-config --exists gthread-2.0`; then
    6699                 echo "yes"
    6700                 have_gthread=yes
    6701                 GTHREAD_LIBS=`pkg-config --libs gthread-2.0`
    6702                 GTHREAD_CFLAGS=`pkg-config --cflags gthread-2.0`
    6703 
    6704 cat >>confdefs.h <<_ACEOF
    6705 #define HAVE_GTHREAD 1
    6706 _ACEOF
    6707 
    6708         else
    6709                 echo "no"
    6710         fi
    6711 
    6712 fi
    6713 
    6714 
    6715 
    6716 
    6717 if test x$have_gthread = xyes; then
    6718   HAVE_GTHREAD_TRUE=
    6719   HAVE_GTHREAD_FALSE='#'
    6720 else
    6721   HAVE_GTHREAD_TRUE='#'
    6722   HAVE_GTHREAD_FALSE=
    6723 fi
    6724 
    6725 
    67266674## checking for libcURL
    67276675if test "$def_curl" = yes; then
     
    79877935Usually this means the macro was only invoked conditionally." >&5
    79887936echo "$as_me: error: conditional \"HAVE_GTK2\" was never defined.
    7989 Usually this means the macro was only invoked conditionally." >&2;}
    7990    { (exit 1); exit 1; }; }
    7991 fi
    7992 if test -z "${HAVE_GTHREAD_TRUE}" && test -z "${HAVE_GTHREAD_FALSE}"; then
    7993   { { echo "$as_me:$LINENO: error: conditional \"HAVE_GTHREAD\" was never defined.
    7994 Usually this means the macro was only invoked conditionally." >&5
    7995 echo "$as_me: error: conditional \"HAVE_GTHREAD\" was never defined.
    79967937Usually this means the macro was only invoked conditionally." >&2;}
    79977938   { (exit 1); exit 1; }; }
     
    86058546s,@HAVE_GTK2_TRUE@,$HAVE_GTK2_TRUE,;t t
    86068547s,@HAVE_GTK2_FALSE@,$HAVE_GTK2_FALSE,;t t
    8607 s,@GTHREAD_LIBS@,$GTHREAD_LIBS,;t t
    8608 s,@GTHREAD_CFLAGS@,$GTHREAD_CFLAGS,;t t
    8609 s,@HAVE_GTHREAD_TRUE@,$HAVE_GTHREAD_TRUE,;t t
    8610 s,@HAVE_GTHREAD_FALSE@,$HAVE_GTHREAD_FALSE,;t t
    86118548s,@CURL_LIBS@,$CURL_LIBS,;t t
    86128549s,@CURL_CFLAGS@,$CURL_CFLAGS,;t t
  • orxonox/branches/updater/configure.ac

    r3264 r3268  
    5353fi
    5454if test "$def_gtk" = no; then
    55   echo "no"
    56 fi
    57 
    58 ## gThread-disabled
    59 AC_MSG_CHECKING([if gThread should be enabled])
    60 AC_ARG_WITH([gthread],
    61         AC_HELP_STRING( [--without-gthread],
    62         [Prevents gThread from being loaded]), [def_gthread=no], [def_gthread=yes])
    63 if test "$def_gthread" = yes; then
    64   echo "yes"
    65 fi
    66 if test "$def_gthread" = no; then
    6755  echo "no"
    6856fi
     
    364352AM_CONDITIONAL(HAVE_GTK2, test x$have_gtk2 = xyes)
    365353
    366 ## checking for gThread
    367 if test "$def_gthread" = yes; then
    368 
    369         AC_MSG_CHECKING([for gthread])
    370         if `pkg-config --exists gthread-2.0`; then
    371                 echo "yes"
    372                 have_gthread=yes
    373                 GTHREAD_LIBS=`pkg-config --libs gthread-2.0`
    374                 GTHREAD_CFLAGS=`pkg-config --cflags gthread-2.0`
    375                 AC_DEFINE_UNQUOTED(HAVE_GTHREAD, 1, [if we have gThread])
    376         else
    377                 echo "no"
    378         fi
    379 
    380 fi
    381 AC_SUBST(GTHREAD_LIBS)
    382 AC_SUBST(GTHREAD_CFLAGS)
    383 AM_CONDITIONAL(HAVE_GTHREAD, test x$have_gthread = xyes)
    384 
    385354## checking for libcURL
    386355if test "$def_curl" = yes; then
  • orxonox/branches/updater/src/Makefile.in

    r3262 r3268  
    127127EGREP = @EGREP@
    128128EXEEXT = @EXEEXT@
    129 GTHREAD_CFLAGS = @GTHREAD_CFLAGS@
    130 GTHREAD_LIBS = @GTHREAD_LIBS@
    131129GTK2_CFLAGS = @GTK2_CFLAGS@
    132130GTK2_LIBS = @GTK2_LIBS@
    133131HAVE_CURL_FALSE = @HAVE_CURL_FALSE@
    134132HAVE_CURL_TRUE = @HAVE_CURL_TRUE@
    135 HAVE_GTHREAD_FALSE = @HAVE_GTHREAD_FALSE@
    136 HAVE_GTHREAD_TRUE = @HAVE_GTHREAD_TRUE@
    137133HAVE_GTK2_FALSE = @HAVE_GTK2_FALSE@
    138134HAVE_GTK2_TRUE = @HAVE_GTK2_TRUE@
  • orxonox/branches/updater/src/console/Makefile.in

    r3262 r3268  
    104104EGREP = @EGREP@
    105105EXEEXT = @EXEEXT@
    106 GTHREAD_CFLAGS = @GTHREAD_CFLAGS@
    107 GTHREAD_LIBS = @GTHREAD_LIBS@
    108106GTK2_CFLAGS = @GTK2_CFLAGS@
    109107GTK2_LIBS = @GTK2_LIBS@
    110108HAVE_CURL_FALSE = @HAVE_CURL_FALSE@
    111109HAVE_CURL_TRUE = @HAVE_CURL_TRUE@
    112 HAVE_GTHREAD_FALSE = @HAVE_GTHREAD_FALSE@
    113 HAVE_GTHREAD_TRUE = @HAVE_GTHREAD_TRUE@
    114110HAVE_GTK2_FALSE = @HAVE_GTK2_FALSE@
    115111HAVE_GTK2_TRUE = @HAVE_GTK2_TRUE@
  • 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
  • orxonox/branches/updater/src/importer/Makefile.in

    r3262 r3268  
    105105EGREP = @EGREP@
    106106EXEEXT = @EXEEXT@
    107 GTHREAD_CFLAGS = @GTHREAD_CFLAGS@
    108 GTHREAD_LIBS = @GTHREAD_LIBS@
    109107GTK2_CFLAGS = @GTK2_CFLAGS@
    110108GTK2_LIBS = @GTK2_LIBS@
    111109HAVE_CURL_FALSE = @HAVE_CURL_FALSE@
    112110HAVE_CURL_TRUE = @HAVE_CURL_TRUE@
    113 HAVE_GTHREAD_FALSE = @HAVE_GTHREAD_FALSE@
    114 HAVE_GTHREAD_TRUE = @HAVE_GTHREAD_TRUE@
    115111HAVE_GTK2_FALSE = @HAVE_GTK2_FALSE@
    116112HAVE_GTK2_TRUE = @HAVE_GTK2_TRUE@
Note: See TracChangeset for help on using the changeset viewer.