Index: orxonox/trunk/src/lib/gui/gui/Makefile.am
===================================================================
--- orxonox/trunk/src/lib/gui/gui/Makefile.am	(revision 4038)
+++ orxonox/trunk/src/lib/gui/gui/Makefile.am	(revision 4039)
@@ -24,5 +24,6 @@
 
 bin_PROGRAMS=gui
-gui_SOURCES=orxonox_gui.cc \
+gui_SOURCES=orxonox_gui_main.cc \
+	    orxonox_gui.cc \
 	    orxonox_gui_gtk.cc \
 	    orxonox_gui_element.cc \
Index: orxonox/trunk/src/lib/gui/gui/Makefile.in
===================================================================
--- orxonox/trunk/src/lib/gui/gui/Makefile.in	(revision 4038)
+++ orxonox/trunk/src/lib/gui/gui/Makefile.in	(revision 4039)
@@ -53,9 +53,10 @@
 binPROGRAMS_INSTALL = $(INSTALL_PROGRAM)
 PROGRAMS = $(bin_PROGRAMS)
-am_gui_OBJECTS = orxonox_gui.$(OBJEXT) orxonox_gui_gtk.$(OBJEXT) \
-	orxonox_gui_element.$(OBJEXT) orxonox_gui_video.$(OBJEXT) \
-	orxonox_gui_audio.$(OBJEXT) orxonox_gui_exec.$(OBJEXT) \
-	orxonox_gui_flags.$(OBJEXT) orxonox_gui_banner.$(OBJEXT) \
-	orxonox_gui_keys.$(OBJEXT) orxonox_gui_update.$(OBJEXT)
+am_gui_OBJECTS = orxonox_gui_main.$(OBJEXT) orxonox_gui.$(OBJEXT) \
+	orxonox_gui_gtk.$(OBJEXT) orxonox_gui_element.$(OBJEXT) \
+	orxonox_gui_video.$(OBJEXT) orxonox_gui_audio.$(OBJEXT) \
+	orxonox_gui_exec.$(OBJEXT) orxonox_gui_flags.$(OBJEXT) \
+	orxonox_gui_banner.$(OBJEXT) orxonox_gui_keys.$(OBJEXT) \
+	orxonox_gui_update.$(OBJEXT)
 gui_OBJECTS = $(am_gui_OBJECTS)
 gui_LDADD = $(LDADD)
@@ -71,4 +72,5 @@
 @AMDEP_TRUE@	./$(DEPDIR)/orxonox_gui_gtk.Po \
 @AMDEP_TRUE@	./$(DEPDIR)/orxonox_gui_keys.Po \
+@AMDEP_TRUE@	./$(DEPDIR)/orxonox_gui_main.Po \
 @AMDEP_TRUE@	./$(DEPDIR)/orxonox_gui_update.Po \
 @AMDEP_TRUE@	./$(DEPDIR)/orxonox_gui_video.Po
@@ -198,5 +200,6 @@
 #AM_LDFLAGS=$(GTK2_LIBS)   $(GTHREAD_LIBS)
 AM_LDFLAGS = $(GTK2_LIBS) $(GTHREAD_LIBS) $(CURL_LIBS)
-gui_SOURCES = orxonox_gui.cc \
+gui_SOURCES = orxonox_gui_main.cc \
+	    orxonox_gui.cc \
 	    orxonox_gui_gtk.cc \
 	    orxonox_gui_element.cc \
@@ -304,4 +307,5 @@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/orxonox_gui_gtk.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/orxonox_gui_keys.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/orxonox_gui_main.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/orxonox_gui_update.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/orxonox_gui_video.Po@am__quote@
Index: orxonox/trunk/src/lib/gui/gui/orxonox_gui.cc
===================================================================
--- orxonox/trunk/src/lib/gui/gui/orxonox_gui.cc	(revision 4038)
+++ orxonox/trunk/src/lib/gui/gui/orxonox_gui.cc	(revision 4039)
@@ -44,10 +44,4 @@
   OrxonoxGuiUpdate* update = NULL;
 int verbose = 4;
-
-int main(int argc, char *argv[])
-{
-  OrxonoxGui* orxonoxgui = new OrxonoxGui(argc, argv);
-  return 0;
-}
 
 /* ORXONOXGUI */
Index: orxonox/trunk/src/lib/gui/gui/orxonox_gui_exec.cc
===================================================================
--- orxonox/trunk/src/lib/gui/gui/orxonox_gui_exec.cc	(revision 4038)
+++ orxonox/trunk/src/lib/gui/gui/orxonox_gui_exec.cc	(revision 4039)
@@ -346,5 +346,4 @@
 }
 
-#ifdef HAVE_GTK2
 /**
    \brief Starts ORXONOX.(not really implemented yet, but the function is there.\n
@@ -354,5 +353,9 @@
    This is a Signal and can be executed through Widget::signal_connect
 */
+#ifdef HAVE_GTK2
 int OrxonoxGuiExec::startOrxonox(GtkWidget* widget, void* data)
+#else /* HAVE_GTK2 */
+int OrxonoxGuiExec::startOrxonox(void* widget, void* data)
+#endif /* HAVE_GTK2 */
 {
   OrxonoxGuiExec* exec =(OrxonoxGuiExec*)data;
@@ -360,5 +363,6 @@
     exec->writeToFile(Window::mainWindow);
   PRINT(3)("Starting Orxonox\n");
-  system("./orxonox"); //!< \todo fix this. should execute orxonox for real(coded not over the shell)
+  system(progExecutable); //!< \todo fix this. should execute orxonox for real(coded not over the shell)
+  gtk_main_quit();
 }
 
@@ -370,5 +374,9 @@
    This is a Signal and can be executed through Widget::signal_connect
 */
+#ifdef HAVE_GTK2
 int OrxonoxGuiExec::quitOrxonox(GtkWidget* widget, void* data)
+#else /* HAVE_GTK2 */
+int OrxonoxGuiExec::quitOrxonox(void* widget, void* data)
+#endif /* HAVE_GTK2 */
 {
   OrxonoxGuiExec* exec =(OrxonoxGuiExec*)data;
@@ -378,32 +386,2 @@
   gtk_main_quit();
 }
-#else /* HAVE_GTK2 */
-/**
-   \brief Starts ORXONOX.(not really implemented yet, but the function is there.\n
-   \param widget the widget that executed the start command
-   \param data additional data
-*/
-int OrxonoxGuiExec::startOrxonox(void* widget, void* data)
-{
-  OrxonoxGuiExec* exec =(OrxonoxGuiExec*)data;
-  PRINT(3)("Starting Orxonox\n");
-  if(exec->shouldsave())
-    exec->writeToFile(Window::mainWindow);
-  system("./orxonox"); //!< \todo fix this. should execute orxonox for real(coded not over the shell)
-}
-/**
-   \brief Quits ORXONOX.
-   \param widget the widget that executed the Quit command
-   \param data additional data
-
-   This is a Signal and can be executed through Widget::signal_connect
-*/
-int OrxonoxGuiExec::quitOrxonox(void* widget, void* data)
-{
-  OrxonoxGuiExec* exec =(OrxonoxGuiExec*)data;
-  PRINT(3)("Quiting Orxonox");
-  if(exec->shouldsave())
-    exec->writeToFile(Window::mainWindow);
-}
-
-#endif /* HAVE_GTK2 */
Index: orxonox/trunk/src/lib/gui/gui/orxonox_gui_flags.cc
===================================================================
--- orxonox/trunk/src/lib/gui/gui/orxonox_gui_flags.cc	(revision 4038)
+++ orxonox/trunk/src/lib/gui/gui/orxonox_gui_flags.cc	(revision 4039)
@@ -63,5 +63,5 @@
 
   this->flagsLabel->ereaseText();
-  this->flagsLabel->appendText("orxonox");
+  this->flagsLabel->appendText(progExecutable);
   widget->walkThrough(OrxonoxGuiFlags::flagsText, &flagInfo, 0);
   //  flagsLabel->setTitle(flagText);
Index: orxonox/trunk/src/lib/gui/gui/orxonox_gui_gtk.cc
===================================================================
--- orxonox/trunk/src/lib/gui/gui/orxonox_gui_gtk.cc	(revision 4038)
+++ orxonox/trunk/src/lib/gui/gui/orxonox_gui_gtk.cc	(revision 4039)
@@ -36,4 +36,6 @@
 extern Window* orxonoxGUI;
 extern OrxonoxGuiFlags* flags;
+char* guiExecutable;
+char* progExecutable;
 
 /**
@@ -44,4 +46,10 @@
 bool initGUI(int argc, char *argv[])
 {
+  guiExecutable = new char[strlen(argv[0])+1];
+  strcpy(guiExecutable, argv[0]);
+  progExecutable = new char[strlen(guiExecutable)-2];
+  strncpy(progExecutable, guiExecutable, strlen(guiExecutable)-3);
+  progExecutable[strlen(progExecutable)]= '\0';
+
 #ifdef HAVE_GTK2
 #ifdef HAVE_GTHREAD
Index: orxonox/trunk/src/lib/gui/gui/orxonox_gui_gtk.h
===================================================================
--- orxonox/trunk/src/lib/gui/gui/orxonox_gui_gtk.h	(revision 4038)
+++ orxonox/trunk/src/lib/gui/gui/orxonox_gui_gtk.h	(revision 4039)
@@ -30,4 +30,7 @@
 #endif /* HAVE_GTK2 */
 
+extern char* guiExecutable;
+extern char* progExecutable;
+
 bool initGUI(int argc, char* argv[]);
 bool mainloopGUI(void);
