Changeset 3296 in orxonox.OLD for orxonox/branches/updater/src
- Timestamp:
- Dec 26, 2004, 11:07:25 PM (20 years ago)
- Location:
- orxonox/branches/updater/src/gui
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
orxonox/branches/updater/src/gui/orxonox_gui.cc
r3295 r3296 23 23 24 24 */ 25 26 #include <unistd.h> 25 27 26 28 #include "orxonox_gui.h" … … 99 101 flags->setTextFromFlags (orxonoxGUI); 100 102 103 // Reading Values from File 101 104 exec->setFilename ("~/.orxonox.conf"); 102 105 exec->readFromFile (orxonoxGUI); 106 // Merging changes to the Options from appended flags. 103 107 for (int optCount = 1; optCount < argc; optCount++) 104 108 orxonoxGUI->walkThrough(Widget::flagCheck, argv[optCount], 0); … … 106 110 orxonoxGUI->showall (); 107 111 108 112 // Handling special Cases. 113 if (!access(exec->getConfigFile(), F_OK) && static_cast<Option*>(orxonoxGUI->findWidgetByName("Always Show this Menu", 0))->value == 0) 114 OrxonoxGuiExec::startOrxonox(NULL, NULL); 115 else 116 { 109 117 #ifdef HAVE_GTK2 110 118 mainloopGTK(); … … 118 126 if ((c == 'y' || c == 'Y' || c== 10) && exec->shouldsave()) 119 127 exec->writeToFile (Window::mainWindow); 120 128 121 129 #endif /* HAVE_GTK2 */ 122 130 } 123 131 } -
orxonox/branches/updater/src/gui/orxonox_gui_exec.cc
r3294 r3296 78 78 79 79 /** 80 \brief Sets the location of the configuration File.\n 81 * The name will be parsed from ~/ to /home/[username] on unix and c:/Documents and Settings/username/Settings/ on Windows 80 \brief Sets the location of the configuration File. 82 81 \param filename the location of the configFile 82 83 The name will be parsed from ~/ to /home/[username] on unix and c:/Documents and Settings/username/Settings/ on Windows 83 84 */ 84 85 void OrxonoxGuiExec::setFilename (char* filename) … … 97 98 sprintf(configFile, "%s", buffer); 98 99 delete buffer; 100 } 101 102 /** 103 \returns The name of the Configuration-File 104 */ 105 char* OrxonoxGuiExec::getConfigFile(void) 106 { 107 return configFile; 99 108 } 100 109 … … 289 298 \param data additional data 290 299 */ 291 gint startOrxonox (GtkWidget *widget, Widget* data)300 gint OrxonoxGuiExec::startOrxonox (GtkWidget *widget, Widget* data) 292 301 { 293 302 cout << "Starting Orxonox" <<endl; -
orxonox/branches/updater/src/gui/orxonox_gui_exec.h
r3292 r3296 39 39 40 40 void setFilename (char* filename); 41 int shouldsave (); 41 char* getConfigFile(void); 42 int shouldsave(); 42 43 void writeToFile (Widget* widget); 43 44 void writeFileText (Widget* widget, int depth); … … 46 47 Widget* locateGroup(Widget* widget, char* groupName, int depth); 47 48 49 #ifdef HAVE_GTK2 50 static gint startOrxonox (GtkWidget *widget, Widget* data); 51 #endif /* HAVE_GTK2 */ 48 52 }; 49 #ifdef HAVE_GTK250 gint startOrxonox (GtkWidget *widget, Widget* data);51 #endif /* HAVE_GTK2 */52 53 #endif /* _ORXONOX_GUI_EXEC_H */ -
orxonox/branches/updater/src/gui/orxonox_gui_gtk.cc
r3295 r3296 149 149 gtk_widget_set_usize (this->widget, width, height); 150 150 #endif /* HAVE_GTK2 */ 151 } 152 153 /** 154 \brief searches through widgets for a Name. 155 */ 156 Widget* Widget::findWidgetByName(char* name, unsigned int depth) 157 { 158 Widget* tmp = NULL; 159 if (this->title && !strcmp(this->title, name)) 160 return this; 161 162 if (this->isOption < 0 && static_cast<Packer*>(this)->down) 163 tmp = static_cast<Packer*>(this)->down->findWidgetByName(name, depth+1); 164 if (tmp) 165 return tmp; 166 167 168 if (depth>0 && this->next) 169 return this->next->findWidgetByName(name, depth); 170 171 return NULL; 151 172 } 152 173 -
orxonox/branches/updater/src/gui/orxonox_gui_gtk.h
r3295 r3296 53 53 virtual void setTitle(char* title) = 0; //!< An abstract Function, that sets the title of Widgets. 54 54 55 Widget* findWidgetByName(char* name, unsigned int depth); 55 56 void walkThrough (void (*function)(Widget*), unsigned int depth); 56 57 void walkThrough (void (*function)(Widget*, void*), void* data, unsigned int depth);
Note: See TracChangeset
for help on using the changeset viewer.