Changeset 3275 in orxonox.OLD for orxonox/branches/updater/src/gui/orxonox_gui_update.cc
- Timestamp:
- Dec 25, 2004, 12:46:25 AM (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
orxonox/branches/updater/src/gui/orxonox_gui_update.cc
r3274 r3275 66 66 } 67 67 68 /** 69 \brief Creates a window, and all it contains for the Data-update. 70 */ 68 71 void OrxonoxGuiUpdate::updateDataWindowCreate (void) 69 72 { … … 101 104 102 105 /** 103 \returns A Pointer to the Button of the Updater Window106 \returns A Pointer to the Button of the UpdaterDataWindow 104 107 */ 105 108 Button* OrxonoxGuiUpdate::updateDataWindowGetButton(void) … … 108 111 } 109 112 113 /** 114 \brief Creates a window, and all it contains for the Source-update. 115 */ 110 116 void OrxonoxGuiUpdate::updateSourceWindowCreate (void) 111 117 { … … 136 142 } 137 143 144 /** 145 \returns A Pointer to the Button of the UpdaterSourceWindow 146 */ 138 147 Button* OrxonoxGuiUpdate::updateSourceWindowGetButton(void) 139 148 { … … 175 184 176 185 #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 */ 177 193 size_t OrxonoxGuiUpdate::curlWriteFunc (void* ptr, size_t size, size_t nmemb, FILE* stream) 178 194 { … … 180 196 } 181 197 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 */ 182 205 size_t OrxonoxGuiUpdate::curlReadFunc (void* ptr, size_t size, size_t nmemb, FILE* stream) 183 206 { … … 186 209 187 210 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 */ 188 219 int OrxonoxGuiUpdate::curlProgressFunc (ProgressBar* Bar, double totalSize, double progress, double upTotal, double upProgress) 189 220 { … … 198 229 } 199 230 231 /** 232 \brief THe Curl handle for only one CURL 233 */ 200 234 CURL* OrxonoxGuiUpdate::curlHandle = NULL; 201 235 202 236 #ifdef HAVE_PTHREAD_H 237 /** \brief The download Thread ID */ 203 238 pthread_t* OrxonoxGuiUpdate::downloadThreadID = new pthread_t; 239 /** \brief The download Thread ID*/ 240 pthread_t* OrxonoxGuiUpdate::downloadThreadFinishID = new pthread_t; 204 241 #endif /* HAVE_PTHREAD_H */ 242 /** 243 \brief A bool parameter that shows if we are downloading. 244 */ 205 245 bool OrxonoxGuiUpdate::isDownloading = false; 206 246 247 /** 248 \brief Initializes a Download 249 \param fileInfo the FileInfo. 250 */ 207 251 bool OrxonoxGuiUpdate::download (void* fileInfo) 208 252 { … … 238 282 if (!isDownloading) 239 283 { 284 isDownloading = true; 240 285 //! \todo check if threads really were created. 241 286 #ifdef HAVE_PTHREAD_H 287 pthread_join(*downloadThreadFinishID, NULL); 242 288 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); 246 290 #else 247 291 downloadThread(info); … … 259 303 return true; 260 304 } 305 306 /** 307 \brief The downloading process (either threaded or not). 308 \param fileInfo the FileInfo. 309 */ 261 310 void* OrxonoxGuiUpdate::downloadThread(void* fileInfo) 262 311 { 263 312 pthread_setcancelstate(PTHREAD_CANCEL_DISABLE, NULL); 264 313 gdk_threads_enter(); 265 isDownloading = true;266 314 FileInfo* info = (FileInfo*)fileInfo; 267 315 info->stateButton->disconnectSignal(info->buttonSignal); … … 275 323 } 276 324 325 /** 326 \brief Finishes a downloading process. 327 \param fileInfo the FileInfo. 328 */ 277 329 void* OrxonoxGuiUpdate::downloadThreadFinished(void* fileInfo) 278 330 { … … 300 352 301 353 #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 */ 302 362 gint OrxonoxGuiUpdate::cancelDownload(GtkWidget* w, GdkEventKey* event, void* bar) 303 363 {
Note: See TracChangeset
for help on using the changeset viewer.