Changeset 3423 in orxonox.OLD for orxonox/trunk/src/gui/orxonox_gui.cc
- Timestamp:
- Feb 27, 2005, 7:11:19 PM (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
orxonox/trunk/src/gui/orxonox_gui.cc
r3187 r3423 24 24 */ 25 25 26 #include <unistd.h> 27 26 28 #include "orxonox_gui.h" 27 29 #include "orxonox_gui_video.h" … … 31 33 #include "orxonox_gui_banner.h" 32 34 #include "orxonox_gui_keys.h" 35 #include "orxonox_gui_update.h" 33 36 34 37 Window* orxonoxGUI; … … 39 42 OrxonoxGuiBanner* banner; 40 43 OrxonoxGuiKeys* keys; 44 OrxonoxGuiUpdate* update; 45 int verbose = 4; 41 46 42 int main( int argc, char *argv[])47 int main(int argc, char *argv[]) 43 48 { 44 49 OrxonoxGui* orxonoxgui = new OrxonoxGui(argc, argv); … … 51 56 \brief Initializes the Gui 52 57 */ 53 OrxonoxGui::OrxonoxGui 58 OrxonoxGui::OrxonoxGui(int argc, char *argv[]) 54 59 { 55 #ifdef HAVE_GTK2 56 initGTK(argc, argv); 57 #endif /* HAVE_GTK2 */ 58 orxonoxGUI = new Window( "Grafical OrxOnoX loader, "PACKAGE_VERSION); 59 #ifdef HAVE_GTK2 60 orxonoxGUI->connectSignal ("destroy", orxonoxGUI->orxonox_gui_quit); 61 orxonoxGUI->connectSignal ("delete_event", orxonoxGUI->orxonox_gui_quit); 62 #endif /* HAVE_GTK2 */ 60 initGUI(argc, argv); 61 62 orxonoxGUI = new Window( "grafical orxonox loader, "PACKAGE_VERSION); 63 63 64 64 Box* windowBox = new Box ('h'); … … 67 67 windowBox->fill (banner->getWidget()); 68 68 69 Box* optionBox = new Box 69 Box* optionBox = new Box('v'); 70 70 71 Box* avBox = new Box 71 Box* avBox = new Box('h'); 72 72 73 video = new OrxonoxGuiVideo 74 avBox->fill (video->getWidget());75 audio = new OrxonoxGuiAudio 76 avBox->fill (audio->getWidget());73 video = new OrxonoxGuiVideo(); 74 avBox->fill(video->getWidget()); 75 audio = new OrxonoxGuiAudio(); 76 avBox->fill(audio->getWidget()); 77 77 78 optionBox->fill 78 optionBox->fill(avBox); 79 79 80 keys = new OrxonoxGuiKeys 81 optionBox->fill (keys->getWidget());80 keys = new OrxonoxGuiKeys(); 81 optionBox->fill(keys->getWidget()); 82 82 83 exec = new OrxonoxGuiExec (orxonoxGUI);84 optionBox->fill (exec->getWidget());83 exec = new OrxonoxGuiExec(); 84 optionBox->fill(exec->getWidget()); 85 85 86 flags = new OrxonoxGuiFlags (orxonoxGUI); 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 96 // Reading Values from File 97 exec->setFilename("~/.orxonox.conf"); 98 exec->readFromFile(orxonoxGUI); 99 // Merging changes to the Options from appended flags. 100 for (int optCount = 1; optCount < argc; optCount++) 101 orxonoxGUI->walkThrough(Widget::flagCheck, argv[optCount], 0); 102 103 flags->setTextFromFlags(orxonoxGUI); 104 orxonoxGUI->showall(); 105 106 //// Handling special Cases. /// 107 108 // case update // 109 #ifdef HAVE_CURL 110 if (static_cast<Option*>(orxonoxGUI->findWidgetByName("auto update", 0))->value == 1) 111 { 112 update->checkForUpdates(); 113 } 114 #endif /* HAVE_CURL */ 115 116 // case start-with-gui. 117 if (!access(exec->getConfigFile(), F_OK) && static_cast<Option*>(orxonoxGUI->findWidgetByName("Always Show this Menu", 0))->value == 0) 118 OrxonoxGuiExec::startOrxonox(NULL, exec); 119 else 120 { 121 mainloopGUI(); 122 } 123 124 } 87 125 88 126 89 optionBox->fill (flags->getWidget ()); 90 windowBox->fill (optionBox); 91 92 orxonoxGUI->fill (windowBox); 93 flags->setTextFromFlags (orxonoxGUI); 94 95 exec->setFilename ("~/.orxonox.conf"); 96 exec->readFromFile (orxonoxGUI); 97 // orxonoxGUI->walkThrough(orxonoxGUI->listOptions); 98 99 orxonoxGUI->showall (); 100 101 102 #ifdef HAVE_GTK2 103 mainloopGTK(); 104 #else /* HAVE_GTK2 */ 105 cout << " Listing all the Orxonox Options: \n"; 106 cout << " #############################\n"; 107 orxonoxGUI->walkThrough(orxonoxGUI->listOptions); 108 109 cout << "\nDo you want me to save the the above values now? [Yn] "; 110 char c = getchar(); 111 if ((c == 'y' || c == 'Y' || c== 10) && exec->shouldsave()) 112 exec->writeToFile (Window::mainWindow); 113 114 #endif /* HAVE_GTK2 */ 115 127 /** 128 \brief Destructor. 129 */ 130 OrxonoxGui::~OrxonoxGui(void) 131 { 132 delete video; 133 delete audio; 134 delete exec; 135 delete flags; 136 delete banner; 137 delete keys; 138 delete update; 116 139 }
Note: See TracChangeset
for help on using the changeset viewer.