Changeset 3275 in orxonox.OLD for orxonox/branches
- Timestamp:
- Dec 25, 2004, 12:46:25 AM (20 years ago)
- Location:
- orxonox/branches/updater/src/gui
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
orxonox/branches/updater/src/gui/orxonox_gui_gtk.cc
r3271 r3275 174 174 /** 175 175 \brief Moves through all the Widgets downwards from this and executes the function on them. 176 \param Function must be of type void and takes a Widget* as an Input.176 \param function must be of type void and takes a Widget* as an Input. 177 177 */ 178 178 void Widget::walkThrough (void (*function)(Widget*)) … … 1151 1151 1152 1152 /** 1153 \br eif Creates a new ProgressBar.1153 \brief Creates a new ProgressBar. 1154 1154 */ 1155 1155 ProgressBar::ProgressBar (void) … … 1159 1159 1160 1160 /** 1161 \br eif Creates a new ProgressBar.1161 \brief Creates a new ProgressBar. 1162 1162 \param label The name you want to get the ProgressBar. 1163 1163 */ … … 1169 1169 1170 1170 /** 1171 \ destructs a ProgressBar1171 \brief destructs a ProgressBar 1172 1172 */ 1173 1173 ProgressBar::~ProgressBar () -
orxonox/branches/updater/src/gui/orxonox_gui_gtk.h
r3263 r3275 11 11 #endif 12 12 13 //! verbose level, soon obsolete 13 14 extern int verbose; // soon obsolete here 14 15 … … 245 246 void setTitle(char* title); 246 247 247 bool isActive(); 248 bool isActive(); //!< a Bool value to see, if this CheckButton is active. 248 249 void redraw (); 249 250 }; -
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 { -
orxonox/branches/updater/src/gui/orxonox_gui_update.h
r3274 r3275 15 15 #endif /* HAVE_CURL */ 16 16 #ifdef HAVE_PTHREAD_H 17 #define _MULTI_THREADED 17 18 #include <pthread.h> 18 19 #endif /* HAVE_PTHREAD_H */ … … 70 71 #ifdef HAVE_PTHREAD_H 71 72 static pthread_t* downloadThreadID; 73 static pthread_t* downloadThreadFinishID; 72 74 #endif /* HAVE_PTHREAD_H */ 73 75 static bool isDownloading; … … 86 88 Widget* getWidget (); 87 89 88 void updateWindowCreate (void);89 Button* updateWindowGetButton(void);90 // void updateWindowCreate (void); 91 // Button* updateWindowGetButton(void); 90 92 91 93 void updateDataWindowCreate (void);
Note: See TracChangeset
for help on using the changeset viewer.