Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

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

Last change on this file since 3316 was 3315, checked in by bensch, 20 years ago

orxonox/branches/updater: code-standartisation updated in all files.

  1. member → this→member
  2. function (bla) → function(bla)
  3. other small fixes
File size: 3.2 KB
Line 
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*/
25
26#include <unistd.h>
27
28#include "orxonox_gui.h"
29#include "orxonox_gui_video.h"
30#include "orxonox_gui_audio.h"
31#include "orxonox_gui_exec.h"
32#include "orxonox_gui_flags.h"
33#include "orxonox_gui_banner.h"
34#include "orxonox_gui_keys.h"
35#include "orxonox_gui_update.h"
36
37  Window* orxonoxGUI;
38  OrxonoxGuiVideo* video;
39  OrxonoxGuiAudio* audio;
40  OrxonoxGuiExec* exec;
41  OrxonoxGuiFlags* flags;
42  OrxonoxGuiBanner* banner;
43  OrxonoxGuiKeys* keys;
44  OrxonoxGuiUpdate* update;
45int verbose = 4;
46
47int main(int argc, char *argv[])
48{
49  OrxonoxGui* orxonoxgui = new OrxonoxGui(argc, argv);
50  return 0;
51}
52
53/* ORXONOXGUI */
54
55/**
56   \brief Initializes the Gui
57*/
58OrxonoxGui::OrxonoxGui(int argc, char *argv[])
59{
60  initGUI(argc, argv);
61
62  orxonoxGUI = new Window( "Grafical OrxOnoX loader, "PACKAGE_VERSION);
63 
64  Box* windowBox = new Box ('h');
65
66  banner = new OrxonoxGuiBanner();
67  windowBox->fill (banner->getWidget());
68 
69  Box* optionBox = new Box('v');
70 
71  Box* avBox = new Box('h');
72
73  video = new OrxonoxGuiVideo();
74  avBox->fill(video->getWidget());
75  audio = new OrxonoxGuiAudio();
76  avBox->fill(audio->getWidget());
77     
78  optionBox->fill(avBox);
79
80  keys = new OrxonoxGuiKeys();
81  optionBox->fill(keys->getWidget());
82
83  exec = new OrxonoxGuiExec();
84  optionBox->fill(exec->getWidget());
85
86  flags = new OrxonoxGuiFlags();
87
88  optionBox->fill(flags->getWidget());
89  windowBox->fill(optionBox);
90
91  update = new OrxonoxGuiUpdate();
92  optionBox->fill(update->getWidget());
93 
94  orxonoxGUI->fill(windowBox);
95  flags->setTextFromFlags(orxonoxGUI);
96
97  // Reading Values from File
98  exec->setFilename("~/.orxonox.conf");
99  exec->readFromFile(orxonoxGUI);
100  // Merging changes to the Options from appended flags.
101  for (int optCount = 1; optCount < argc; optCount++)
102    orxonoxGUI->walkThrough(Widget::flagCheck, argv[optCount], 0);
103
104
105  orxonoxGUI->showall();
106
107  //// Handling special Cases. ///
108
109  // case update //
110#ifdef HAVE_CURL
111  if (static_cast<Option*>(orxonoxGUI->findWidgetByName("auto update", 0))->value == 1)
112    {
113      update->checkForUpdates();
114    }
115#endif /* HAVE_CURL */
116
117  // case start-with-gui.
118  if (!access(exec->getConfigFile(), F_OK) && static_cast<Option*>(orxonoxGUI->findWidgetByName("Always Show this Menu", 0))->value == 0)
119    OrxonoxGuiExec::startOrxonox(NULL, exec);
120  else
121    {
122      mainloopGUI();
123    }
124
125}
126
127
128/**
129   \breif Destructor.
130*/
131OrxonoxGui::~OrxonoxGui(void)
132{
133 
134}
Note: See TracBrowser for help on using the repository browser.