Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Dec 25, 2004, 12:46:25 AM (19 years ago)
Author:
bensch
Message:

orxonox/branches/updater: doxygen tags

File:
1 edited

Legend:

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

    r3274 r3275  
    6666}
    6767
     68/**
     69   \brief Creates a window, and all it contains for the Data-update.
     70*/
    6871void OrxonoxGuiUpdate::updateDataWindowCreate (void)
    6972{
     
    101104
    102105/**
    103    \returns A Pointer to the Button of the UpdaterWindow
     106   \returns A Pointer to the Button of the UpdaterDataWindow
    104107*/
    105108Button* OrxonoxGuiUpdate::updateDataWindowGetButton(void)
     
    108111}
    109112
     113/**
     114   \brief Creates a window, and all it contains for the Source-update.
     115*/
    110116void OrxonoxGuiUpdate::updateSourceWindowCreate (void)
    111117{
     
    136142}
    137143
     144/**
     145   \returns A Pointer to the Button of the UpdaterSourceWindow
     146*/
    138147Button* OrxonoxGuiUpdate::updateSourceWindowGetButton(void)
    139148{
     
    175184
    176185#ifdef HAVE_CURL
     186/**
     187   \brief The Function Curl calls to write out the File.
     188   \param ptr A Pointer to the date to write.
     189   \param size The size in bytes of one nmemb to write.
     190   \param nmemb The Count of size to write.
     191   \param stream Filehandler to write to.
     192*/
    177193size_t OrxonoxGuiUpdate::curlWriteFunc (void* ptr, size_t size, size_t nmemb, FILE* stream)
    178194{
     
    180196}
    181197
     198/**
     199   \brief The Function Curl calls to write out the File.
     200   \param ptr A Pointer to the date to write to.
     201   \param size The size in bytes of one nmemb to write.
     202   \param nmemb The Count of size to write.
     203   \param stream Filehandler to get data from.
     204*/
    182205size_t OrxonoxGuiUpdate::curlReadFunc (void* ptr, size_t size, size_t nmemb, FILE* stream)
    183206{
     
    186209
    187210
     211/**
     212   \brief An update Function for the GUI, to show the progress.
     213   \param Bar th ProgressBar to update
     214   \param totalSize The total size of the download in bytes.
     215   \param progress The current Progress of the download in bytes.
     216   \param upTotal not needed
     217   \param upProgress not needed
     218*/
    188219int OrxonoxGuiUpdate::curlProgressFunc (ProgressBar* Bar, double totalSize, double progress, double upTotal, double upProgress)
    189220{
     
    198229}
    199230
     231/**
     232   \brief THe Curl handle for only one CURL
     233*/
    200234CURL* OrxonoxGuiUpdate::curlHandle = NULL;
    201235
    202236#ifdef HAVE_PTHREAD_H
     237/** \brief The download Thread ID */
    203238pthread_t* OrxonoxGuiUpdate::downloadThreadID = new pthread_t;
     239/**   \brief The download Thread ID*/
     240pthread_t* OrxonoxGuiUpdate::downloadThreadFinishID = new pthread_t;
    204241#endif /* HAVE_PTHREAD_H */
     242/**
     243   \brief A bool parameter that shows if we are downloading.
     244*/
    205245bool OrxonoxGuiUpdate::isDownloading = false;
    206246
     247/**
     248   \brief Initializes a Download
     249   \param fileInfo the FileInfo.
     250*/
    207251bool OrxonoxGuiUpdate::download (void* fileInfo)
    208252{
     
    238282      if (!isDownloading)
    239283        {
     284          isDownloading = true;
    240285          //! \todo check if threads really were created.
    241286#ifdef HAVE_PTHREAD_H
     287          pthread_join(*downloadThreadFinishID, NULL);
    242288          pthread_create(downloadThreadID, NULL, downloadThread, info);
    243 
    244           pthread_t finish;
    245           pthread_create(&finish, NULL, downloadThreadFinished, info); 
     289          pthread_create(downloadThreadFinishID, NULL, downloadThreadFinished, info); 
    246290#else
    247291          downloadThread(info);
     
    259303  return true;
    260304}
     305
     306/**
     307   \brief The downloading process (either threaded or not).
     308   \param fileInfo the FileInfo.
     309*/
    261310void* OrxonoxGuiUpdate::downloadThread(void* fileInfo)
    262311{
    263312  pthread_setcancelstate(PTHREAD_CANCEL_DISABLE, NULL);
    264313  gdk_threads_enter();
    265   isDownloading = true;
    266314  FileInfo* info = (FileInfo*)fileInfo;
    267315  info->stateButton->disconnectSignal(info->buttonSignal);
     
    275323}
    276324
     325/**
     326   \brief Finishes a downloading process.
     327   \param fileInfo the FileInfo.
     328*/
    277329void* OrxonoxGuiUpdate::downloadThreadFinished(void* fileInfo)
    278330{
     
    300352
    301353#ifdef HAVE_GTK2
     354/**
     355   \brief canceles a downloading session.
     356   \param w The widget, that executed this Function.
     357   \param event The event that trigered this Function.
     358   \param bar The Bar, that triggered this event.
     359
     360   \todo canceling a session in non-threaded mode.
     361*/
    302362gint OrxonoxGuiUpdate::cancelDownload(GtkWidget* w, GdkEventKey* event, void* bar)
    303363{
Note: See TracChangeset for help on using the changeset viewer.