Index: /orxonox/trunk/src/lib/event/key_mapper.cc
===================================================================
--- /orxonox/trunk/src/lib/event/key_mapper.cc	(revision 5014)
+++ /orxonox/trunk/src/lib/event/key_mapper.cc	(revision 5015)
@@ -128,9 +128,11 @@
   int* index;
 
-  while(iniParser->nextVar())
+  iniParser->getFirstVar();
+  while(iniParser->getCurrentName())
   {
     PRINTF(3)("Keys: Parsing %s, %s now.\n", iniParser->getCurrentName(), iniParser->getCurrentValue());
     index = nameToIndex (iniParser->getCurrentValue());
     this->mapKeys(iniParser->getCurrentName(), index[1]);
+    iniParser->nextVar();
   }
 
@@ -143,9 +145,11 @@
   }
 
-  while( iniParser->nextVar())
+  iniParser->getFirstVar();
+  while(iniParser->getCurrentName())
   {
     PRINTF(3)("MISC: Parsing %s, %s now.\n", iniParser->getCurrentName(), iniParser->getCurrentValue());
     index = nameToIndex (iniParser->getCurrentValue());
     this->mapKeys(iniParser->getCurrentName(), index[1]);
+    iniParser->nextVar();
   }
 }
Index: /orxonox/trunk/src/lib/gui/gui_exec.cc
===================================================================
--- /orxonox/trunk/src/lib/gui/gui_exec.cc	(revision 5014)
+++ /orxonox/trunk/src/lib/gui/gui_exec.cc	(revision 5015)
@@ -265,11 +265,40 @@
 void GuiExec::readFromFile(Widget* widget)
 {
-  IniParser iniParser(this->confFile);
+
+  char* fileName = ResourceManager::homeDirCheck(confFile);
+  IniParser iniParser(fileName);
+  delete fileName;
   if (!iniParser.isOpen())
     return;
 
-//   const char* name;
-//   while (name = iniParser.nextSection())
-//     printf("%s\n", name);
+  iniParser.getFirstSection();
+  Widget* groupWidget = widget;
+  const char* groupName;
+  const char* widgetName;
+  VarInfo varInfo;
+  while (groupName = iniParser.getCurrentSection())
+  {
+    if((groupWidget = locateGroup(widget, groupName, 1))==NULL)
+    {
+      PRINTF(2)("!!There is no group called %s in this GUI.\n First best Widget will get the Infos assigned.\n Config-File will be updated in next Save\n", groupName);
+      groupWidget = widget;
+      continue;
+    }
+    else
+      PRINT(0)("Group %s located.\n", static_cast<Packer*>(groupWidget)->groupName);
+
+    iniParser.getFirstVar();
+    while(iniParser.getCurrentName())
+    {
+      varInfo.variableName = iniParser.getCurrentName();
+      varInfo.variableValue = iniParser.getCurrentValue();
+      groupWidget->walkThrough(this->readFileText, &varInfo, 0);
+      iniParser.nextVar();
+    }
+
+    iniParser.nextSection();
+  }
+  widget->walkThrough(widget->setOptions, 0);
+
 //
 //
@@ -342,14 +371,7 @@
    @todo do this in gui-gtk.
 */
-Widget* GuiExec::locateGroup(Widget* widget, char* groupName, int depth)
+Widget* GuiExec::locateGroup(Widget* widget, const char* groupName, int depth)
 {
   Widget* tmp;
-
-  // removes the trailing and ending [ ].
-  if(!strncmp(groupName, "[", 1))
-    {
-      groupName = groupName+1;
-      groupName[strlen(groupName)-1] = '\0';
-    }
 
   if(widget->optionType < GUI_NOTHING)
Index: /orxonox/trunk/src/lib/gui/gui_exec.h
===================================================================
--- /orxonox/trunk/src/lib/gui/gui_exec.h	(revision 5014)
+++ /orxonox/trunk/src/lib/gui/gui_exec.h	(revision 5015)
@@ -28,6 +28,6 @@
   struct VarInfo
   {
-    char* variableName;        //!< The Name of this variable;
-    char* variableValue;       //!< The Value this variable gets.
+    const char* variableName;  //!< The Name of this variable;
+    const char* variableValue; //!< The Value this variable gets.
   };
 
@@ -35,5 +35,5 @@
   GuiExec();
   ~GuiExec();
-  
+
   void setConfDir(const char* confDir);
   void setConfFile(const char* confFile);
@@ -44,5 +44,5 @@
   void readFromFile(Widget* widget);
   static void readFileText(Widget* widget, void* varInfo);
-  Widget* locateGroup(Widget* widget, char* groupName, int depth);
+  Widget* locateGroup(Widget* widget, const char* groupName, int depth);
 
 #ifdef HAVE_GTK2
@@ -55,5 +55,5 @@
 };
 
-//! A simple hashtable 
+//! A simple hashtable
 struct HashTable
 {
Index: /orxonox/trunk/src/lib/gui/gui_gtk.cc
===================================================================
--- /orxonox/trunk/src/lib/gui/gui_gtk.cc	(revision 5014)
+++ /orxonox/trunk/src/lib/gui/gui_gtk.cc	(revision 5015)
@@ -1,3 +1,3 @@
-/* 
+/*
    orxonox - the future of 3D-vertical-scrollers
 
@@ -16,5 +16,5 @@
    You should have received a copy of the GNU General Public License
    along with this program; if not, write to the Free Software Foundation,
-   Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  
+   Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
 
 
@@ -82,29 +82,29 @@
       PRINT(0)("  #############################\n");
       Window::mainWindow->walkThrough(Widget::listOptionsAndGroups, 1);
-      
+
       PRINT(0)("\nDo you want change any of the above values now? [Yn] ");
       scanf("%s", ans);
       if (ans[0] =='n' || ans[0]=='N')
-	break;
-      
+        break;
+
       PRINT(0)("\n Listing all groups\n");
       PRINT(0)("  #################\n");
       int groupCount = 0;
       Window::mainWindow->walkThrough(Widget::listGroups, &groupCount, 1);
-      
+
       PRINT(0)("\nIn which Group? [1-%d] ", groupCount);
       Packer* group;
       while(true)
-	{
-	  scanf("%s", ans);
-	  int ansIp = atoi(ans);
-	  if (ansIp <= groupCount)
-	    {
-	      group = static_cast<Packer*>(Window::mainWindow->findGroupByNumber(&ansIp, 1));
-	      break;
-	    }
-	  else
-	    PRINT(0)("\nChoose a smaller Number please: [1-%d] ", groupCount);
-	}
+        {
+          scanf("%s", ans);
+          int ansIp = atoi(ans);
+          if (ansIp <= groupCount)
+            {
+              group = static_cast<Packer*>(Window::mainWindow->findGroupByNumber(&ansIp, 1));
+              break;
+            }
+          else
+            PRINT(0)("\nChoose a smaller Number please: [1-%d] ", groupCount);
+        }
       PRINT(0)("\n\nGroup: [%s]\n\n", group->groupName);
       int optionCount = 0;
@@ -113,18 +113,18 @@
       Option* option;
       while(true)
-	{
-	  scanf("%s", ans);
-	  int ansIp = atoi(ans);
-	  if (ansIp <= groupCount)
-	    {
-	      option = static_cast<Option*>(group->findOptionByNumber(&ansIp, 0));
-	      break;
-	    }
-	  else
-	    PRINT(0)("\nChoose a smaler Number please: [1-%d] ", optionCount);
-	}
+        {
+          scanf("%s", ans);
+          int ansIp = atoi(ans);
+          if (ansIp <= groupCount)
+            {
+              option = static_cast<Option*>(group->findOptionByNumber(&ansIp, 0));
+              break;
+            }
+          else
+            PRINT(0)("\nChoose a smaler Number please: [1-%d] ", optionCount);
+        }
       PRINT(0)("\n\n:: %s ::\n", option->title);
       option->changeOption();
-      
+
       // here follows the rest.... this will be nasty.
       //! @todo finish it.
@@ -132,5 +132,5 @@
     }
 #endif /* HAVE_GTK2 */
-  
+
 }
 
@@ -162,5 +162,5 @@
       delete []this->title;
     }
-  
+
   PRINTF(5)("deleting the Widget part.\n");
 
@@ -232,7 +232,7 @@
       Widget* tmp = static_cast<Packer*>(this)->down->findWidgetByName(name, depth+1);
       if (tmp)
-	return tmp;
-    }
-  
+        return tmp;
+    }
+
   if (depth>0 && this->next)
     return this->next->findWidgetByName(name, depth);
@@ -243,5 +243,5 @@
 /**
  *  Moves through all the Widgets downwards from this and executes the function on them.
- * @param function must be of type void and takes a Widget* as an Input. 
+ * @param function must be of type void and takes a Widget* as an Input.
  * @param depth the current depth. if > 0 then the next Widget will also be walked through.
 */
@@ -252,5 +252,5 @@
     {
       static_cast<Packer*>(this)->down->walkThrough(function, depth+1);
-    } 
+    }
 
   if (this->next && depth != 0)
@@ -275,5 +275,5 @@
 }
 
-/** 
+/**
   *  This is for listing the options of "widget"
   * @param widget specifies the widget that should be listed
@@ -289,5 +289,5 @@
 }
 
-/** 
+/**
   *  This is for listing the options of "widget"
   * @param widget specifies the widget that should be listed
@@ -299,5 +299,5 @@
 }
 
-/** 
+/**
   *  This is for listing the options of "widget"
   * @param widget specifies the widget that should be listed
@@ -306,5 +306,5 @@
 void Widget::listOptions(Widget* widget, void* data)
 {
-  
+
   if (widget->optionType > GUI_NOTHING)
     {
@@ -312,10 +312,10 @@
       *count = *count +1;
       PRINT(0)(" %d:%s is %s\n", *count,
-	       static_cast<Option*>(widget)->title,
-	       static_cast<Option*>(widget)->save());
-    }
-}
-
-/** 
+               static_cast<Option*>(widget)->title,
+               static_cast<Option*>(widget)->save());
+    }
+}
+
+/**
   *  This is for listing the options of "widget"
   * @param widget specifies the widget that should be listed
@@ -330,36 +330,36 @@
       Option* option = (Option*)widget;
       if (option->flagName || option->flagNameShort)
-	{
-	  PRINT(0)("  ");
-	  if (option->flagNameShort)
-	    {
-	      PRINT(0)("-%s", option->flagNameShort);
-	      helpLen += strlen(option->flagNameShort)+1;
-	    }
-	  if (option->flagName)
-	    {
-	      if (helpLen > 0)
-		{
-		  PRINT(0)("|");
-		  helpLen++;
-		}
-	      PRINT(0)("--%s:", option->flagName);
-	      helpLen += strlen(option->flagName)+2;
-	    }
-	  while ((helpLen ++) < 29)
-	    PRINT(0)(" ");
-	  if (option->shortDescription)
-	    PRINT(0)("%s\n", option->shortDescription);
-	  else
-	    PRINT(0)("\n");
-	}
-    }
-}
-
-/** 
+        {
+          PRINT(0)("  ");
+          if (option->flagNameShort)
+            {
+              PRINT(0)("-%s", option->flagNameShort);
+              helpLen += strlen(option->flagNameShort)+1;
+            }
+          if (option->flagName)
+            {
+              if (helpLen > 0)
+                {
+                  PRINT(0)("|");
+                  helpLen++;
+                }
+              PRINT(0)("--%s:", option->flagName);
+              helpLen += strlen(option->flagName)+2;
+            }
+          while ((helpLen ++) < 29)
+            PRINT(0)(" ");
+          if (option->shortDescription)
+            PRINT(0)("%s\n", option->shortDescription);
+          else
+            PRINT(0)("\n");
+        }
+    }
+}
+
+/**
   *  Finds an Option by a given number(the n'th option found away from this Widget)
   * @param number The Count of options to wait(by reference)
   * @param depth The depth of the sarch. if 0 it will not search next pointer
-    
+
     @todo should return Option* would be much sexier.
 */
@@ -370,7 +370,7 @@
       --*number;
       if (*number <= 0)
-	{
-	  return this;
-	}
+        {
+          return this;
+        }
     }
   if (this->optionType < GUI_NOTHING && static_cast<Packer*>(this)->down)
@@ -378,5 +378,5 @@
       Widget* tmp = static_cast<Packer*>(this)->down->findOptionByNumber(number, depth+1);
       if (tmp)
-	return tmp;
+        return tmp;
     }
   if (depth>0 && this->next)
@@ -386,5 +386,5 @@
 }
 
-/** 
+/**
   *  This is for listing the groups of "widget"
   * @param widget specifies the widget that should be listed
@@ -396,5 +396,5 @@
 }
 
-/** 
+/**
   *  This is for listing the Groups of "widget". It also displays the n'th number found.
   * @param widget specifies the widget that should be listed
@@ -408,5 +408,5 @@
 }
 
-/** 
+/**
   *  Finds a Group by a given number(the n'th Group found away from this Widget)
   * @param number The Count of options to wait(by reference)
@@ -419,7 +419,7 @@
       --*number;
       if (*number <= 0)
-	{
-	  return this;
-	}
+        {
+          return this;
+        }
     }
   if (this->optionType < GUI_NOTHING && static_cast<Packer*>(this)->down)
@@ -427,5 +427,5 @@
       Widget* tmp = static_cast<Packer*>(this)->down->findGroupByNumber(number, depth+1);
       if (tmp)
-	return tmp;
+        return tmp;
     }
   if (depth>0 && this->next)
@@ -462,5 +462,5 @@
 {
   if (widget->optionType > GUI_NOTHING)
-    {      
+    {
       Option* option =(Option*)widget;
       char* name =(char*)flagName;
@@ -469,45 +469,45 @@
       // check if long flag matches
       if ((option->flagName && strlen(name) > 2 &&
-	   !strncmp(name+2, option->flagName, strlen(option->flagName)) &&
-	   (name[strlen(option->flagName)+2] == '\0' || name[strlen(option->flagName)+2] == '=') ))
-	{
-	  found = true;
-	  if (name[strlen(option->flagName)+2] == '=')
-	    {
-	      value = name+strlen(option->flagName)+3;
-	    }
-	}
+           !strncmp(name+2, option->flagName, strlen(option->flagName)) &&
+           (name[strlen(option->flagName)+2] == '\0' || name[strlen(option->flagName)+2] == '=') ))
+        {
+          found = true;
+          if (name[strlen(option->flagName)+2] == '=')
+            {
+              value = name+strlen(option->flagName)+3;
+            }
+        }
       // check if short flag matches
       else if (option->flagNameShort && strlen(name)>1 &&
-	       !strncmp(name+1, option->flagNameShort, strlen(option->flagNameShort)) &&
-	       (name[strlen(option->flagNameShort)+1] == '\0' || name[strlen(option->flagNameShort)+1] == '='))
-	{
-	  found = true;
-	  if (name[strlen(option->flagNameShort)+1] == '=')
-	    {
-	      value = name+strlen(option->flagNameShort)+2;
-	    }	  
-	}
+               !strncmp(name+1, option->flagNameShort, strlen(option->flagNameShort)) &&
+               (name[strlen(option->flagNameShort)+1] == '\0' || name[strlen(option->flagNameShort)+1] == '='))
+        {
+          found = true;
+          if (name[strlen(option->flagNameShort)+1] == '=')
+            {
+              value = name+strlen(option->flagNameShort)+2;
+            }
+        }
 
       if (found)
-	{
-	  PRINT(4)("found matching Flag %s\n", name);
-	  if (value)
-	    {
-	      PRINT(4)("with Value %s\n", value);
-	      option->value = atoi(value);
-	    }
-	  else
-	    {
-	      option->value = !option->defaultValue;
-	    }
-	  option->redraw();
-	}
-
-    }
-}
-
-#ifdef HAVE_GTK2
-/** 
+        {
+          PRINT(4)("found matching Flag %s\n", name);
+          if (value)
+            {
+              PRINT(4)("with Value %s\n", value);
+              option->value = atoi(value);
+            }
+          else
+            {
+              option->value = !option->defaultValue;
+            }
+          option->redraw();
+        }
+
+    }
+}
+
+#ifdef HAVE_GTK2
+/**
   *  Connect any signal to any given Sub-widget
 */
@@ -581,9 +581,9 @@
 */
 Packer::~Packer()
-{ 
+{
   PRINTF(5)("deleting the Packer part.\n");
   if (this->groupName)
     delete []this->groupName;
-  
+
   //deleting recursively.
   if (this->down)
@@ -620,5 +620,5 @@
 */
 Container::~Container()
-{ 
+{
   PRINTF(5)("deleting the Container part.\n");
 }
@@ -663,5 +663,5 @@
  *  The main Window of Th Gui
 */
-Window* Window::mainWindow = NULL;      
+Window* Window::mainWindow = NULL;
 
 /**
@@ -683,5 +683,5 @@
 #if !defined(__WIN32__)
   //  gtk_window_set_decorated(GTK_WINDOW(widget), FALSE);
-#endif 
+#endif
   gtk_container_set_border_width(GTK_CONTAINER(widget), 3);
 #endif /* HAVE_GTK2 */
@@ -715,5 +715,5 @@
       Widget* tmpWindow = mainWindow;
       while(tmpWindow->next)
-	tmpWindow = tmpWindow->next;
+        tmpWindow = tmpWindow->next;
       tmpWindow->next = windowToAdd;
       windowToAdd->isOpen = false;
@@ -904,5 +904,5 @@
 }
 
-/** 
+/**
   *  Fills a box with a given Widget.
   * @param lowerWidget the next Widget that should be appendet to this Box
@@ -922,5 +922,5 @@
       tmp = this->down;
       while(tmp->next != NULL)
-	tmp = tmp->next;
+        tmp = tmp->next;
       tmp->next = lowerWidget;
     }
@@ -939,5 +939,5 @@
   this->flagName = NULL;
   this->flagNameShort = NULL;
-  
+
   this->shortDescription = NULL;
   this->longDescription = NULL;
@@ -951,5 +951,5 @@
 */
 Option::~Option()
-{ 
+{
   PRINTF(5)("deleting the Option Part.\n");
   if (this->flagName)
@@ -995,5 +995,5 @@
 }
 
-/** 
+/**
   *  see Option::setFlagName(char* flagname, int defaultvalue)
   * @param flagname the Name that will be displayed in the output
@@ -1062,8 +1062,8 @@
  * @param loadString the string from which to load the data from
 */
-void Option::load(char* loadString)
+void Option::load(const char* loadString)
 {
   this->value = atoi(loadString);
-  PRINT(5)("Loading %s: %s %d\n", this->title, loadString, value); 
+  PRINT(5)("Loading %s: %s %d\n", this->title, loadString, value);
   this->redraw();
 }
@@ -1078,5 +1078,5 @@
 
 #ifdef HAVE_GTK2
-/** 
+/**
   *  Signal OptionChange writes the Value from the Option to its Object-Database.
   * @param widget The widget(Option) that has a changed Value
@@ -1156,5 +1156,5 @@
 /////////////////
 /**
- *  Creates a new CheckButton with an ame 
+ *  Creates a new CheckButton with an ame
  * @param buttonName The name the CheckButton should display.
 */
@@ -1182,5 +1182,5 @@
   if (this->title)
     PRINTF(5)("deleting the CheckButton: %s\n", this->title);
-  else 
+  else
     PRINTF(5)("deleting the CheckButton.\n");
 }
@@ -1334,8 +1334,8 @@
   return value;
 }
-void Slider::load(char* loadString)
+void Slider::load(const char* loadString)
 {
   this->fValue = atof(loadString);
-  PRINT(5)("Loading %s: %s %f\n", this->title, loadString, fValue); 
+  PRINT(5)("Loading %s: %s %f\n", this->title, loadString, fValue);
   this->redraw();
 }
@@ -1355,5 +1355,5 @@
 }
 
-/** 
+/**
   *  Creates a Menu-Item-list out of multiple input.
     !! Consider, that the last input argument has to be "lastItem" for this to work!!
@@ -1389,7 +1389,7 @@
       //! @todo destroy menu
       /*
-	#ifdef HAVE_GTK2
-	gtk_widget_destroy(this->currItem->item);
-	#endif /* HAVE_GTK2 */
+        #ifdef HAVE_GTK2
+        gtk_widget_destroy(this->currItem->item);
+        #endif /* HAVE_GTK2 */
       MenuItem* tmpItem = this->currItem;
       this->currItem = this->currItem->next;
@@ -1432,5 +1432,5 @@
       return tmpName;
     }
-  else 
+  else
     return NULL;
 }
@@ -1440,5 +1440,5 @@
  * @param loadString the string from which to load the data from
 */
-void Menu::load(char* loadString)
+void Menu::load(const char* loadString)
 {
   MenuItem* tmpItem = firstItem;
@@ -1447,5 +1447,5 @@
     {
       if (!strcmp(loadString, tmpItem->name))
-	{foundItem = true; break;}
+        {foundItem = true; break;}
       tmpItem = tmpItem->next;
     }
@@ -1457,5 +1457,5 @@
       PRINTF(2)("%s has not been found in the Itemlist of %s\n", loadString, this->title);
     }
-  PRINTF(5)( "Loading %s: setting to %d\n", this->title, this->value); 
+  PRINTF(5)( "Loading %s: setting to %d\n", this->title, this->value);
   this->redraw();
 }
@@ -1601,7 +1601,7 @@
  * @param loadString the string from which to load the data from
 */
-void OptionLabel::load(char* loadString)
-{
-  PRINTF(5)("Loading %s: setting to %s\n", this->title, loadString); 
+void OptionLabel::load(const char* loadString)
+{
+  PRINTF(5)("Loading %s: setting to %s\n", this->title, loadString);
   this->setValue(loadString);
 }
@@ -1617,10 +1617,10 @@
 {
   this->optionType = GUI_NOTHING;
-  
+
 #ifdef HAVE_GTK2
   this->widget = gtk_label_new("");
   gtk_label_set_line_wrap(GTK_LABEL(this->widget), TRUE);
 #endif /* HAVE_GTK2 */
-  
+
   if (text)
     this->setTitle(text);
@@ -1658,5 +1658,5 @@
 }
 
-/** 
+/**
   *  appends some Text to a Label
   * @param textToAppend The text that will be appended to this Label
@@ -1667,5 +1667,5 @@
     {
       char* tmpTitle = new char[strlen(this->title)+strlen(textToAppend)+1];
-      strcpy(tmpTitle, title);  
+      strcpy(tmpTitle, title);
       strcat(tmpTitle, textToAppend);
       delete []this->title;
@@ -1674,5 +1674,5 @@
   else
     this->title = new char[strlen(textToAppend)];
-  
+
 #ifdef HAVE_GTK2
   gtk_label_set_text(GTK_LABEL(this->widget), title);
@@ -1680,8 +1680,8 @@
 }
 
-/** 
+/**
   *  Appends some integer to the Label
   * @param intToAppend The Int that will be added.
-    
+
     it does this by just converting the int into a char* and send it to appendText
 */
@@ -1805,5 +1805,5 @@
 }
 
-/** 
+/**
   *  Initializes a new Image
   * @param name the name to set to the Image
@@ -1919,5 +1919,5 @@
 #ifdef HAVE_GTK2
       if(this->okFunc((const char*)gtk_file_selection_get_filename(GTK_FILE_SELECTION(this->widget)), this->okObject))
-	 this->close();
+         this->close();
 #endif /* HAVE_GTK2 */
     }
Index: /orxonox/trunk/src/lib/gui/gui_gtk.h
===================================================================
--- /orxonox/trunk/src/lib/gui/gui_gtk.h	(revision 5014)
+++ /orxonox/trunk/src/lib/gui/gui_gtk.h	(revision 5015)
@@ -6,6 +6,6 @@
 #define _GUI_GTK_H
 
-#if HAVE_CONFIG_H 
-#include <config.h> 
+#if HAVE_CONFIG_H
+#include <config.h>
 #endif
 
@@ -34,11 +34,11 @@
 // enumerator for different GuiOption-Types
 enum GUI_OPTION {GUI_BOX = -2,
-		 GUI_CONTAINER = -1,
-		 GUI_NOTHING = 0,
-		 GUI_BOOL = 1,
-		 GUI_INT = 2,
-		 GUI_FLOAT = 3,
-		 GUI_CHAR = 4,
-		 GUI_CHAR_ARRAY = 5};
+                 GUI_CONTAINER = -1,
+                 GUI_NOTHING = 0,
+                 GUI_BOOL = 1,
+                 GUI_INT = 2,
+                 GUI_FLOAT = 3,
+                 GUI_CHAR = 4,
+                 GUI_CHAR_ARRAY = 5};
 
 extern char* executable;
@@ -77,5 +77,5 @@
    static void redrawOptions(Widget* widget);
    static void flagCheck(Widget* widget, void* flagName);
-  
+
 #ifdef HAVE_GTK2
   // Connection - Functions
@@ -140,5 +140,5 @@
   int borderwidth;          //!< The width of The Container Boarder.
   int policy;               //!< The Update Policy of a Container.
-  
+
  public:
   Container();
@@ -164,5 +164,5 @@
   Window(const char* windowName = NULL);
   virtual ~Window();
-  
+
   virtual void setTitle(const char* title);
   void showall();
@@ -216,5 +216,5 @@
   Box(char boxtype = 'h');
   virtual ~Box();
-  
+
   virtual void fill(Widget* lowerWidget);
 };
@@ -228,5 +228,5 @@
  protected:
   bool saveable;              //!< Options can be Saved.
-  
+
  public:
   Option();
@@ -243,5 +243,5 @@
   void saveability(bool isSaveable = true);
   virtual char* save();
-  virtual void load(char* loadString);
+  virtual void load(const char* loadString);
 
   bool isSaveable();
@@ -254,5 +254,5 @@
   virtual void changeOption() = 0; //!< What to do, if an Option is Changed. eacht option decides for itself.
 #ifdef HAVE_GTK2
-    // Signals  
+    // Signals
   static gint OptionChange(GtkWidget* widget, Widget* option); //!< Signal for Options that change.
 #endif /* HAVE_GTK2 */
@@ -263,5 +263,5 @@
  * Buttons are mainly there for executing some action like Starting the Programm, or Quiting it.
  */
-class Button : public Option 
+class Button : public Option
 {
  public:
@@ -310,5 +310,5 @@
 
   virtual char* save();
-  virtual void load(char* loadString);
+  virtual void load(const char* loadString);
 };
 
@@ -334,5 +334,5 @@
   MenuItem* firstItem;                  //!< Pointer to the first Item.
   MenuItem* currItem;                   //!< Pointer to the current Item.
-  
+
  public:
   Menu(const char* menuName);
@@ -342,6 +342,6 @@
 
   virtual char* save();
-  virtual void load(char* loadString);
-  
+  virtual void load(const char* loadString);
+
   void addItem(char* itemName);
   virtual void redraw();
@@ -355,9 +355,9 @@
   OptionLabel(const char* label, const char* value);
   virtual ~OptionLabel();
-  
+
   void setValue(const char* newValue);
 
   virtual char* save();
-  virtual void load(char* loadString);
+  virtual void load(const char* loadString);
 
   virtual void redraw();
@@ -373,9 +373,9 @@
   EntryField(const char* name = NULL);
   virtual ~EntryField();
-  
+
   void setValue(const char* newValue);
   virtual char* save();
-  virtual void load(char* loadString);
-  
+  virtual void load(const char* loadString);
+
   virtual void redraw();
   virtual void changeOption();
@@ -388,5 +388,5 @@
   Label(const char* text = NULL);
   virtual ~Label();
-  
+
   virtual void setTitle(const char* text);
   void ereaseText();
@@ -415,6 +415,6 @@
 };
 
-//! Image is the keeper of one Image 
-/** 
+//! Image is the keeper of one Image
+/**
  * Images are mighty cool.
  * Images can help you lighten up the Programming process, and will give everyone a better impression of the Software.
Index: /orxonox/trunk/src/lib/util/ini_parser.cc
===================================================================
--- /orxonox/trunk/src/lib/util/ini_parser.cc	(revision 5014)
+++ /orxonox/trunk/src/lib/util/ini_parser.cc	(revision 5015)
@@ -23,6 +23,4 @@
 #include "list.h"
 #include "stdlibincl.h"
-
-#include "resource_manager.h"
 #include "debug.h"
 
@@ -53,4 +51,7 @@
 }
 
+/**
+ * removes all the sections. This is like delete, but even cooler :)
+ */
 void IniParser::deleteSections()
 {
@@ -80,4 +81,6 @@
   }
   delete this->sections;
+  this->currentEntry = NULL;
+  this->currentSection = NULL;
   this->sections = NULL;
 }
@@ -88,20 +91,17 @@
  * @return true on success false otherwise;
 */
-bool IniParser::openFile(const char* filename)
+bool IniParser::openFile(const char* fileName)
 {
   FILE*    stream;           //!< The stream we use to read the file.
 
-
-  if( filename == NULL)
-    return false;
-  char* tmpName = ResourceManager::homeDirCheck(filename);
 
   if (sections != NULL)
     deleteSections();
-
-  if( (stream = fopen (tmpName, "r")) == NULL)
-  {
-    PRINTF(1)("IniParser could not open %s\n", filename);
-    delete tmpName;
+  if( fileName == NULL)
+    return false;
+
+  if( (stream = fopen (fileName, "r")) == NULL)
+  {
+    PRINTF(1)("IniParser could not open %s\n", fileName);
     return false;
   }
@@ -189,4 +189,5 @@
     {
       this->currentSection = sectionEnum;
+      this->currentEntry = NULL;
       delete sectionIt;
       return true;
@@ -200,4 +201,16 @@
 
 /**
+ * moves to the first section
+ */
+void IniParser::getFirstSection()
+{
+  if (this->sections)
+    this->currentSection = this->sections->firstElement();
+  else
+    this->currentSection = NULL;
+  this->currentEntry = NULL;
+}
+
+/**
  * searches the next section
  * @returns the name of the section if found, NULL otherwise
@@ -210,6 +223,12 @@
   {
     if (this->sections)
-      this->currentSection = sections->nextElement(this->currentSection);
-  }
+    {
+      if (this->currentSection == this->sections->lastElement())
+        this->currentSection = NULL;
+      else
+        this->currentSection = this->sections->nextElement(this->currentSection);
+    }
+  }
+
   if (this->currentSection != NULL)
     return this->currentSection->name;
@@ -219,22 +238,28 @@
 
 /**
+ * moves to the first Variable of the current Section
+ */
+void IniParser::getFirstVar()
+{
+  if (this->currentSection)
+    this->currentEntry = this->currentSection->entries->firstElement();
+  else
+    this->currentEntry = NULL;
+}
+
+/**
  *  gets the next VarName=VarValue pair from the parsing stream
- * @param name: a pointer to the Name of the next Var
- * @param value: a pointer to the Value of the next Var
  * @return true on success, false otherwise (in the latter case name and value will be NULL)
  */
 bool IniParser::nextVar()
 {
-  if (this->currentSection == NULL)
-    return false;
-  if(this->currentEntry == this->currentSection->entries->lastElement())
+  if (this->currentSection == NULL
+      || this->currentEntry == NULL
+      || this->currentEntry == this->currentSection->entries->lastElement())
   {
     this->currentEntry = NULL;
     return false;
   }
-  if (this->currentEntry == NULL)
-    this->currentEntry = this->currentSection->entries->firstElement();
-  else
-    this->currentEntry = this->currentSection->entries->nextElement(this->currentEntry);
+  this->currentEntry = this->currentSection->entries->nextElement(this->currentEntry);
 
   if (this->currentEntry == NULL)
Index: /orxonox/trunk/src/lib/util/ini_parser.h
===================================================================
--- /orxonox/trunk/src/lib/util/ini_parser.h	(revision 5014)
+++ /orxonox/trunk/src/lib/util/ini_parser.h	(revision 5015)
@@ -43,14 +43,23 @@
     bool openFile(const char* name);
 
-    bool getSection( const char* sectionName);
+    bool getSection(const char* sectionName);
+
+    void getFirstSection();
     const char* nextSection();
 
+    /** @returns true if the file is opened, false otherwise*/
     bool isOpen() const { return (sections != NULL)?true:false; };
 
     const char* getVar(const char* entryName, const char* sectionName, const char* defaultValue = "") const;
+
+    void getFirstVar();
     bool nextVar();
 
-    const char* getCurrentName() const { return (currentEntry!=NULL)?currentEntry->name:NULL; };
-    const char* getCurrentValue() const { return (currentEntry!=NULL)?currentEntry->value:NULL; };
+    /** @returns the name of the Current selected Section */
+    const char* getCurrentSection() const { return (this->currentSection!=NULL)?this->currentSection->name:NULL; };
+    /** @returns the current entries Name, or NULL if we havn't selected a Entry */
+    const char* getCurrentName() const { return (this->currentEntry!=NULL)?this->currentEntry->name:NULL; };
+    /** @returns the current entries Value, or NULL if we havn't selected a Entry */
+    const char* getCurrentValue() const { return (this->currentEntry!=NULL)?this->currentEntry->value:NULL; };
 
     void debug() const;
Index: /orxonox/trunk/src/orxonox.cc
===================================================================
--- /orxonox/trunk/src/orxonox.cc	(revision 5014)
+++ /orxonox/trunk/src/orxonox.cc	(revision 5015)
@@ -124,6 +124,5 @@
 const char* Orxonox::getConfigFile ()
 {
-  this->configFileName = new char[strlen(DEFAULT_CONFIG_FILE)];
-  strcpy (this->configFileName, DEFAULT_CONFIG_FILE);
+  this->configFileName = ResourceManager::homeDirCheck(DEFAULT_CONFIG_FILE);
   this->iniParser = new IniParser(this->configFileName);
 }
