Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: orxonox.OLD/orxonox/branches/updater/src/gui/orxonox_gui.cc @ 3286

Last change on this file since 3286 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: 3.2 KB
RevLine 
[2581]1/*
2   orxonox - the future of 3D-vertical-scrollers
3
4   Copyright (C) 2004 orx
5
6   This program is free software; you can redistribute it and/or modify
7   it under the terms of the GNU General Public License as published by
8   the Free Software Foundation; either version 2, or (at your option)
9   any later version.
10
11   This program is distributed in the hope that it will be useful,
12   but WITHOUT ANY WARRANTY; without even the implied warranty of
13   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14   GNU General Public License for more details.
15
16   You should have received a copy of the GNU General Public License
17   along with this program; if not, write to the Free Software Foundation,
18   Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 
19
20
21   ### File Specific:
22   main-programmer: Benjamin Grauer
23
24*/
[3166]25
[2018]26#include "orxonox_gui.h"
27#include "orxonox_gui_video.h"
28#include "orxonox_gui_audio.h"
29#include "orxonox_gui_exec.h"
30#include "orxonox_gui_flags.h"
[2580]31#include "orxonox_gui_banner.h"
[2613]32#include "orxonox_gui_keys.h"
[3251]33#include "orxonox_gui_update.h"
[2018]34
35  Window* orxonoxGUI;
36  OrxonoxGuiVideo* video;
37  OrxonoxGuiAudio* audio;
38  OrxonoxGuiExec* exec;
[2580]39  OrxonoxGuiFlags* flags;
40  OrxonoxGuiBanner* banner;
[2613]41  OrxonoxGuiKeys* keys;
[3251]42  OrxonoxGuiUpdate* update;
[3263]43int verbose = 4;
[2018]44
45int main( int argc, char *argv[] )
46{
47  OrxonoxGui* orxonoxgui = new OrxonoxGui(argc, argv);
48  return 0;
49}
50
51/* ORXONOXGUI */
52
[2588]53/**
[2623]54   \brief Initializes the Gui
[2588]55*/
[2018]56OrxonoxGui::OrxonoxGui (int argc, char *argv[])
57{
[3165]58#ifdef HAVE_GTK2
[3164]59  initGTK(argc, argv);
[3167]60#endif /* HAVE_GTK2 */
[3263]61
[2740]62  orxonoxGUI = new Window( "Grafical OrxOnoX loader, "PACKAGE_VERSION);
[3165]63#ifdef HAVE_GTK2
[2018]64  orxonoxGUI->connectSignal ("destroy", orxonoxGUI->orxonox_gui_quit);
65  orxonoxGUI->connectSignal ("delete_event", orxonoxGUI->orxonox_gui_quit);
[3165]66#endif /* HAVE_GTK2 */
[2018]67 
[2024]68  Box* windowBox = new Box ('h');
69
[2580]70  banner = new OrxonoxGuiBanner();
[2595]71  windowBox->fill (banner->getWidget());
[2580]72 
[2024]73  Box* optionBox = new Box ('v');
[2018]74 
75  Box* avBox = new Box ('h');
76
77  video = new OrxonoxGuiVideo ();
[2595]78  avBox->fill (video->getWidget ());
[2018]79  audio = new OrxonoxGuiAudio ();
[2595]80  avBox->fill (audio->getWidget ());
[2018]81     
[2024]82  optionBox->fill (avBox);
[2613]83
84  keys = new OrxonoxGuiKeys ();
85  optionBox->fill (keys->getWidget ());
86
[2018]87  exec = new OrxonoxGuiExec (orxonoxGUI);
[2595]88  optionBox->fill (exec->getWidget ());
[2018]89
90  flags = new OrxonoxGuiFlags (orxonoxGUI);
[2024]91
[2595]92  optionBox->fill (flags->getWidget ());
[2024]93  windowBox->fill (optionBox);
[3251]94
95  update = new OrxonoxGuiUpdate ();
[3252]96  optionBox->fill(update->getWidget());
[2018]97 
98  orxonoxGUI->fill (windowBox);
99  flags->setTextFromFlags (orxonoxGUI);
100
101  exec->setFilename ("~/.orxonox.conf");
102  exec->readFromFile (orxonoxGUI);
[3251]103
[3166]104  //  orxonoxGUI->walkThrough(orxonoxGUI->listOptions);
[2018]105
106  orxonoxGUI->showall ();
107
108 
[3165]109#ifdef HAVE_GTK2
[3164]110  mainloopGTK();
[3166]111#else /* HAVE_GTK2 */
112  cout << " Listing all the Orxonox Options: \n";
113  cout << "  #############################\n";
114  orxonoxGUI->walkThrough(orxonoxGUI->listOptions);
115
116  cout << "\nDo you want me to save the the above values now? [Yn] ";
117  char c = getchar();
118  if ((c == 'y' || c == 'Y' || c== 10) && exec->shouldsave())
119    exec->writeToFile (Window::mainWindow);
120 
121#endif /* HAVE_GTK2 */
122
[2018]123}
Note: See TracBrowser for help on using the repository browser.