Index: orxonox/branches/gui/guicc/orxonox_gui.cc
===================================================================
--- orxonox/branches/gui/guicc/orxonox_gui.cc	(revision 2003)
+++ orxonox/branches/gui/guicc/orxonox_gui.cc	(revision 2007)
@@ -28,5 +28,5 @@
   gtk_init (&argc, &argv);
   gtk_rc_parse( "rc" );
-
+  
   orxonoxGUI = new Window("Graphical Orxonox Launcher");
   orxonoxGUI->connectSignal ("destroy", orxonoxGUI->orxonox_gui_quit);
@@ -51,27 +51,10 @@
   
   orxonoxGUI->fill (windowBox);
+  flags->setTextFromFlags (orxonoxGUI);
+
+  exec->setFilename ("test");
+  exec->readFromFile (orxonoxGUI);
   orxonoxGUI->listOptions();
-  flags->setTextFromFlags (orxonoxGUI);
-
-  /* TEST ENVIRONMENT
-  Frame* Frametest = new Frame ("Test");
-  orxonoxGUI->fill((Frame*) Frametest);
-  Box* box = new Box ('v');
-  Frametest->fill(box);
-  
-  CheckButton* button = new CheckButton("button");
-  button->connectSignal ("clicked", orxonoxGUI->orxonox_gui_quit);
-  box->fill(button);
-  Slider* slider = new Slider("slider", 0, 100);
-  slider->connectSignal ("value_changed", slider->OptionChange);
-  box->fill(slider);
-  Menu* menu = new Menu("menu1", "no output", "verbose", "debug", "lastItem");
-  menu->connectSignal ("changed", menu->OptionChange);
-  box->fill(menu);
-  Menu* menu2 = new Menu("menu2", "no output", "verbose", "debug", "lastItem");
-  menu2->connectSignal ("changed", menu->OptionChange);
-  box->fill(menu2);
-  orxonoxGUI->listOptions();
-  */
+
   orxonoxGUI->showall ();
 
@@ -206,4 +189,6 @@
    * Quits the orxonox_GUI
    */
+  exec->writeToFile (orxonoxGUI);
+
   gtk_main_quit();
   return FALSE;
Index: orxonox/branches/gui/guicc/orxonox_gui_exec.cc
===================================================================
--- orxonox/branches/gui/guicc/orxonox_gui_exec.cc	(revision 2003)
+++ orxonox/branches/gui/guicc/orxonox_gui_exec.cc	(revision 2007)
@@ -1,6 +1,10 @@
 #include "orxonox_gui_exec.h"
+#include <iostream>
+#include <string>
 
 OrxonoxGuiExec::OrxonoxGuiExec (Window* orxonoxGUI)
 {
+  configFile = (char*)malloc(256*sizeof(char));
+
   execFrame = new Frame ("Execute-Tags:");
   execBox = new Box ('v');
@@ -27,2 +31,101 @@
   return execFrame;
 }
+
+/* FILE HANDLING */
+
+void OrxonoxGuiExec::setFilename (char* filename)
+{
+  
+  if (filename)
+    sprintf(configFile, "%s", filename);
+}
+
+void OrxonoxGuiExec::writeToFile (Widget* widget)
+{
+  CONFIG_FILE = fopen (configFile, "w");
+  if (CONFIG_FILE)
+    writeFileText (widget);
+  fclose (CONFIG_FILE);
+}
+
+void OrxonoxGuiExec::writeFileText (Widget* widget)
+{
+  if (widget->is_option >= 1)
+    if  (strcmp (static_cast<Option*>(widget)->flag_name, "") || strcmp (static_cast<Option*>(widget)->flag_name_short, ""))
+      {
+	char Buffer[256];
+	char* space2under;
+	sprintf (Buffer, "%s", static_cast<Option*>(widget)->option_name);
+	if (strchr (Buffer, '_'))
+	  cout << "Warning Optionname" << Buffer << " is not Valid for Saving, because it includes an underscore" << endl; 
+	while (space2under = strchr(Buffer, ' '))
+	  {
+	    sprintf (space2under, "_%s", space2under+1);
+	  }
+	fprintf (CONFIG_FILE, "%s = %i\n", Buffer, static_cast<Option*>(widget)->value);
+      }
+  switch (widget->is_option)
+    {
+    case -1:
+      writeFileText (static_cast<Container*>(widget)->down);
+      break;
+    case -2:
+      writeFileText (static_cast<Box*>(widget)->down);
+      break;
+    } 
+  
+  if (widget->next != NULL)
+    writeFileText (widget->next);
+}
+
+void OrxonoxGuiExec::readFromFile (Widget* widget)
+{
+  CONFIG_FILE = fopen (configFile, "r");
+  if (CONFIG_FILE)
+    {
+      char Buffer[256] = "";
+      char Variable[256]= "";
+      int Value;
+      while (fscanf (CONFIG_FILE, "%s", Buffer) != EOF)
+	{
+	  if (!strcmp (Buffer, "="))
+	    {
+	      char* under2space;
+	      while (under2space = strchr(Variable, '_'))
+		{
+		  sprintf (under2space, " %s", under2space+1);
+		}
+	      
+	      fscanf (CONFIG_FILE, "%s", Buffer);
+	      Value = atoi(Buffer);
+	      readFileText (widget, Variable, Value);
+	      sprintf (Variable, "");
+	    }
+	  sprintf (Variable, "%s", Buffer);
+	}
+
+    }
+    
+}
+
+void OrxonoxGuiExec::readFileText (Widget* widget, char* variableName, int variableValue)
+{
+  if (widget->is_option >= 1)
+    if (!strcmp (static_cast<Option*>(widget)->option_name, variableName))
+	static_cast<Option*>(widget)->value = variableValue;
+
+  switch (widget->is_option)
+    {
+    case -1:
+      readFileText (static_cast<Container*>(widget)->down, variableName, variableValue);
+      break;
+    case -2:
+      readFileText (static_cast<Box*>(widget)->down, variableName, variableValue);
+      break;
+    } 
+
+  if (widget->next != NULL)
+    readFileText (widget->next, variableName, variableValue);
+
+
+}
Index: orxonox/branches/gui/guicc/orxonox_gui_exec.h
===================================================================
--- orxonox/branches/gui/guicc/orxonox_gui_exec.h	(revision 2003)
+++ orxonox/branches/gui/guicc/orxonox_gui_exec.h	(revision 2007)
@@ -3,4 +3,6 @@
 
 #include "orxonox_gui.h"
+#include <stdio.h>
+using namespace std;
 
 class OrxonoxGuiExec
@@ -14,5 +16,6 @@
   CheckButton* alwaysShow;
   Button* quit;
-    
+  char* configFile;
+  FILE* CONFIG_FILE;
  public:
   OrxonoxGuiExec (Window* orxonoxGUI);
@@ -20,4 +23,11 @@
   
   Frame* getFrame ();
+  
+  void setFilename (char* filename);
+  void writeToFile (Widget* widget);
+  void writeFileText (Widget* widget);
+  void readFromFile (Widget* widget);
+  void readFileText (Widget* widget, char* variableName, int variableValue);
+
 };
 #endif /* _ORXONOX_GUI_EXEC_H */
