Changeset 3284 in orxonox.OLD for orxonox/branches/updater
- Timestamp:
- Dec 26, 2004, 12:53:21 AM (20 years ago)
- Location:
- orxonox/branches/updater/src/gui
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
orxonox/branches/updater/src/gui/orxonox_gui_update.cc
r3283 r3284 288 288 if (!isDownloading) 289 289 { 290 isDownloading = true; 290 pthread_join(*downloadThreadFinishID, NULL); 291 292 info->stateButton->disconnectSignal(info->buttonSignal); 293 info->buttonSignal = info->stateButton->connectSignal("button_press_event", info, cancelDownload); 294 #ifdef HAVE_PTHREAD_H 295 info->stateButton->setTitle("cancel"); 296 #else /* HAVE_PTHREAD_H */ 297 info->stateButton->setTitle("please wait"); 298 #endif /* HAVE_PTHREAD_H */ 299 291 300 //! \todo check if threads really were created. 292 301 #ifdef HAVE_PTHREAD_H 293 pthread_join(*downloadThreadFinishID, NULL);294 302 pthread_create(downloadThreadID, NULL, downloadThread, info); 295 303 pthread_create(downloadThreadFinishID, NULL, downloadThreadFinished, info); … … 318 326 void* OrxonoxGuiUpdate::downloadThread(void* fileInfo) 319 327 { 320 #ifdef HAVE_PTHREAD_H 321 pthread_setcancelstate(PTHREAD_CANCEL_DISABLE, NULL); 322 gdk_threads_enter(); 323 #endif /* HAVE_PTHREAD_H */ 324 FileInfo* info = (FileInfo*)fileInfo; 325 info->stateButton->disconnectSignal(info->buttonSignal); 326 info->buttonSignal = info->stateButton->connectSignal("button_press_event", info, cancelDownload); 327 #ifdef HAVE_PTHREAD_H 328 info->stateButton->setTitle("cancel"); 329 gdk_threads_leave(); 330 #else /* HAVE_PTHREAD_H */ 331 info->stateButton->setTitle("please wait"); 332 #endif /* HAVE_PTHREAD_H */ 333 pthread_setcancelstate(PTHREAD_CANCEL_ENABLE, NULL); 334 328 isDownloading = true; 335 329 curl_easy_perform(curlHandle); 336 330 } -
orxonox/branches/updater/src/gui/orxonox_gui_update.h
r3275 r3284 24 24 { 25 25 private: 26 Frame* updateFrame; //!< The Frame that holds the updateOptions.27 Box* updateBox; //!< The Box that holds the updateOptions.28 CheckButton* autoUpdate; //!< A Checkbutton to enable the automatic Updating.26 Frame* updateFrame; //!< The Frame that holds the updateOptions. 27 Box* updateBox; //!< The Box that holds the updateOptions. 28 CheckButton* autoUpdate; //!< A Checkbutton to enable the automatic Updating. 29 29 30 30 31 Button* updateDataWindowButton; //!< A Button to update the Data of orxonox.32 Window* updateDataWindow; //!< A Window for the data-update.33 Box* updateDataBox; //!< A Box for the Window for the Data-update.34 ProgressBar* updateDataBar; //!< A Bar to display the progress of the download.35 Button* updateDataBegin; //!< A Button to start the process.31 Button* updateDataWindowButton; //!< A Button to update the Data of orxonox. 32 Window* updateDataWindow; //!< A Window for the data-update. 33 Box* updateDataBox; //!< A Box for the Window for the Data-update. 34 ProgressBar* updateDataBar; //!< A Bar to display the progress of the download. 35 Button* updateDataBegin; //!< A Button to start the process. 36 36 37 Button* updateSourceWindowButton; //!< A Button to update the Source of orxonox. \todo tricky38 Window* updateSourceWindow; //!< A Window for the Source-update.39 Box* updateSourceBox; //!< A Box for the Window for the Source-update.40 ProgressBar* updateSourceBar; //!< A Bar to display the progress of the download.37 Button* updateSourceWindowButton; //!< A Button to update the Source of orxonox. \todo tricky 38 Window* updateSourceWindow; //!< A Window for the Source-update. 39 Box* updateSourceBox; //!< A Box for the Window for the Source-update. 40 ProgressBar* updateSourceBar; //!< A Bar to display the progress of the download. 41 41 42 Button* test; //!< will be deleted soon.42 Button* test; //!< will be deleted soon. 43 43 44 44 #ifdef HAVE_GTK2 … … 51 51 struct FileInfo 52 52 { 53 char* fileName; //!< The Name of the file we want to get.54 char* webRoot; //!< The Root of the File on The Web55 char* localRoot; //!< The Root directory to put the files on the local disk.56 FILE* fileHandle; //!< A fileHandler.53 char* fileName; //!< The Name of the file we want to get. 54 char* webRoot; //!< The Root of the File on The Web 55 char* localRoot; //!< The Root directory to put the files on the local disk. 56 FILE* fileHandle; //!< A fileHandler. 57 57 58 Button* stateButton; //!< A button that shows either start or cancel;59 long int buttonSignal; //!< The Signal of the stateButton.60 ProgressBar* bar; //!< The ProgressBar, that sould be updated.58 Button* stateButton; //!< A button that shows either start or cancel; 59 long int buttonSignal; //!< The Signal of the stateButton. 60 ProgressBar* bar; //!< The ProgressBar, that sould be updated. 61 61 }; 62 62 … … 88 88 Widget* getWidget (); 89 89 90 // void updateWindowCreate (void);91 // Button* updateWindowGetButton(void);92 93 90 void updateDataWindowCreate (void); 94 91 Button* updateDataWindowGetButton(void);
Note: See TracChangeset
for help on using the changeset viewer.