Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: orxonox.OLD/orxonox/branches/updater/src/gui/orxonox_gui_update.h @ 3263

Last change on this file since 3263 was 3263, checked in by bensch, 19 years ago

orxonox/branches/updater: now the Data-bar downloads something, and the Progress is displayed. (not very nice, but it works).

NOT THREAD SAVE <<

File size: 2.3 KB
Line 
1/*!
2  \file orxonox_gui_update.h
3  \brief File that holds the class that creates the update-menu.
4*/
5
6#ifndef _ORXONOX_GUI_UPDATE_H
7#define _ORXONOX_GUI_UPDATE_H
8
9#include "orxonox_gui.h"
10#include <stdio.h>
11using namespace std;
12
13//! Class that creates the execute-Options.
14class OrxonoxGuiUpdate
15{
16 private:
17  Frame* updateFrame;          //!< The Frame that holds the updateOptions.
18  Box* updateBox;              //!< The Box that holds the updateOptions.
19  CheckButton* autoUpdate;     //!< A Checkbutton to enable the automatic Updating.
20
21 
22  Button* updateDataWindowButton;//!< A Button to update the Data of orxonox.
23  Window* updateDataWindow;    //!< A Window for the data-update.
24  Box* updateDataBox;          //!< A Box for the Window for the Data-update.
25  ProgressBar* updateDataBar;  //!< A Bar to display the progress of the download.
26  Button* updateDataBegin;     //!< A Button to start the process.
27
28  Button* updateSourceWindowButton;//!< A Button to update the Source of orxonox. \todo tricky
29  Window* updateSourceWindow;  //!< A Window for the Source-update.
30  Box* updateSourceBox;  //!< A Box for the Window for the Source-update.
31  ProgressBar* updateSourceBar;//!< A Bar to display the progress of the download.
32
33  Button* test;  //!< will be deleted soon.
34 
35#ifdef HAVE_GTK2
36  static gint updateDataFunc (GtkWidget* w, GdkEventKey* event, void* bar);
37  static gint updateSourceFunc (GtkWidget* w, GdkEventKey* event, void* bar);
38#endif /* HAVE_GTK2 */
39
40#ifdef HAVE_CURL
41  struct FileInfo
42  {
43    char* fileOnNet;
44    char* fileOnDisk;
45    ProgressBar* Bar;
46  };
47
48  static size_t curlWriteFunc (void* ptr, size_t size, size_t nmemb, FILE* stream);
49  static size_t curlReadFunc (void* ptr, size_t size, size_t nmemb, FILE* stream);
50  static int curlProgressFunc (ProgressBar* Bar, double totalSize, double progress, double upTotal, double upProgress);
51
52  static void* downloadThread (void* fileInfo);
53 
54#endif /* HAVE_CURL */
55
56 public:
57  OrxonoxGuiUpdate ();
58  ~OrxonoxGuiUpdate ();
59 
60  Widget* getWidget ();
61 
62  void updateWindowCreate (void);
63  Button* updateWindowGetButton(void);
64
65  void updateDataWindowCreate (void);
66  Button* updateDataWindowGetButton(void);
67
68  void updateSourceWindowCreate (void);
69  Button* updateSourceWindowGetButton(void);
70};
71
72
73
74#endif /* _ORXONOX_GUI_UPDATE_H */
Note: See TracBrowser for help on using the repository browser.