Index: experimental/osgVisualGuiNG/main.cpp
===================================================================
--- experimental/osgVisualGuiNG/main.cpp	(revision 415)
+++ experimental/osgVisualGuiNG/main.cpp	(revision 418)
@@ -1,3 +1,4 @@
 #include "osgvisualgui.h"
+#include "debug.h"
 #include <QtGui/QApplication>
 
@@ -5,5 +6,19 @@
 {
 	QApplication a(argc, argv);
+	a.connect( &a, SIGNAL( lastWindowClosed() ), &a, SLOT( quit() ) );
+
+	QCoreApplication::setOrganizationName("osgVisual");
+	QCoreApplication::setOrganizationDomain("osgvisual.org");
+	QCoreApplication::setApplicationName("osgVisualGUI");
+
+	// DEBUG-Handler installieren
+	QTextEdit *debug = new QTextEdit;
+	debug->hide();
+	setDebugPointer( debug );
+	qInstallMsgHandler( myMessageOutput );
+	qDebug("MessageHandler installiert");
+
 	osgVisualGUI w;
+	w.setDebug(debug);
 	w.show();
 	return a.exec();
Index: experimental/osgVisualGuiNG/osgvisualgui.cpp
===================================================================
--- experimental/osgVisualGuiNG/osgvisualgui.cpp	(revision 415)
+++ experimental/osgVisualGuiNG/osgvisualgui.cpp	(revision 418)
@@ -1,8 +1,33 @@
 #include "osgvisualgui.h"
+
+#include <QSettings>
+#include <QCloseEvent>
+#include <QTextEdit>
+#include <QMessageBox>
 
 osgVisualGUI::osgVisualGUI(QWidget *parent, Qt::WFlags flags)
 	: QMainWindow(parent, flags)
 {
+	debug = NULL;
+	
+	// GUI instanziieren
 	ui.setupUi(this);
+
+	// GUI-Klassen instanziieren & connectieren
+	
+
+
+	// Toolbars initialisieren
+	void setupDockWidgets();
+	void setupToolbars();
+	void setupMenus();
+
+	// Windowgeometrie wiederherstellen
+	QSettings settings;
+	restoreGeometry(settings.value("mainwindow/maingeometry").toByteArray() );
+	restoreState( settings.value("mainwindow/DockwidgetLayout").toByteArray() );
+
+	// Und schlußendlich die GUI zeigen
+	this->show();
 }
 
@@ -11,2 +36,87 @@
 
 }
+
+void osgVisualGUI::closeEvent( QCloseEvent *event )
+{
+	// Close application
+	this->hide();
+
+	// Save geometries
+	QSettings settings;
+	settings.setValue("mainwindow/maingeometry", saveGeometry());
+	settings.setValue("mainwindow/DockwidgetLayout", saveState() );
+	
+	// Close debug widget
+	 if( debug != NULL )
+	 {
+		settings.setValue("debugwindow/geometry", debug->saveGeometry());
+		qInstallMsgHandler(0);
+		debug->close();
+	 }
+
+	 // accept event
+	 event->accept();
+}
+
+void osgVisualGUI::setDebug(QTextEdit* debug_)
+{
+	if ( debug_ != NULL )
+	{
+		debug = debug_;
+		ui.dW_Debug->setWidget(debug);
+	}
+}
+
+void osgVisualGUI::setupDockWidgets()
+{
+
+}
+
+void osgVisualGUI::setupToolbars()
+{
+
+}
+
+void osgVisualGUI::setupMenus()
+{
+	ui.menuEdit->addAction( ui.actionSettings );
+}
+
+void osgVisualGUI::on_actionToggle_top_left_corner_triggered()
+{
+	if( this->corner( Qt::TopLeftCorner ) == Qt::LeftDockWidgetArea )
+		setCorner( Qt::TopLeftCorner, Qt::BottomDockWidgetArea );
+	else if( this->corner( Qt::TopLeftCorner ) == Qt::BottomDockWidgetArea )
+		setCorner( Qt::TopLeftCorner, Qt::LeftDockWidgetArea );
+}
+
+void osgVisualGUI::on_actionToggle_top_right_corner_triggered()
+{
+	if( this->corner( Qt::TopRightCorner ) == Qt::RightDockWidgetArea )
+		setCorner( Qt::TopRightCorner, Qt::TopDockWidgetArea );
+	else if( this->corner( Qt::TopRightCorner ) == Qt::TopDockWidgetArea )
+		setCorner( Qt::TopRightCorner, Qt::RightDockWidgetArea );
+}
+
+void osgVisualGUI::on_actionToggle_bottom_left_corner_triggered()
+{
+	if( this->corner( Qt::BottomLeftCorner ) == Qt::LeftDockWidgetArea )
+		setCorner( Qt::BottomLeftCorner, Qt::BottomDockWidgetArea );
+	else if( this->corner( Qt::BottomLeftCorner ) == Qt::BottomDockWidgetArea )
+		setCorner( Qt::BottomLeftCorner, Qt::LeftDockWidgetArea );
+}
+
+void osgVisualGUI::on_actionToggle_bottom_right_corner_triggered()
+{
+	if( this->corner( Qt::BottomRightCorner ) == Qt::RightDockWidgetArea )
+		setCorner( Qt::BottomRightCorner, Qt::BottomDockWidgetArea );
+	else if( this->corner( Qt::BottomRightCorner ) == Qt::BottomDockWidgetArea )
+		setCorner( Qt::BottomRightCorner, Qt::RightDockWidgetArea );
+}
+
+void osgVisualGUI::on_actionAbout_This_Programm_triggered()
+{
+	QMessageBox::about( this, tr("About %1").arg(QApplication::applicationName()) ,
+		tr("OSG Visual is a GUI application for easy controlling and testing of the OSG-Visual programm.\n\n It is freely available unter GNU LGPL license\n\n Developement version 0.1\n\nLGPL icons created & copyright by the \"Crystal - Interaction Design Project\".\nPlease visit http://www.everaldo.com/crystal/") );
+
+}
Index: experimental/osgVisualGuiNG/osgvisualgui.h
===================================================================
--- experimental/osgVisualGuiNG/osgvisualgui.h	(revision 415)
+++ experimental/osgVisualGuiNG/osgvisualgui.h	(revision 418)
@@ -4,4 +4,6 @@
 #include <QtGui/QMainWindow>
 #include "ui_osgvisualgui.h"
+
+class QTextEdit;
 
 class osgVisualGUI : public QMainWindow
@@ -13,6 +15,32 @@
 	~osgVisualGUI();
 
+	/**
+	* Intercepts closeEvents to perform userdef actions and finally accept the event.
+	* Zu den Aktionen gehört das Speichern der Einstellungen, das Schliessen das Debugfensters etc.
+	* @return void
+	* @param event: Abzufangender CloseEvent
+	*/
+	void closeEvent( QCloseEvent *event );
+
+	void setDebug(QTextEdit* debug_);
+
 private:
+	void setupDockWidgets();
+	void setupToolbars();
+	void setupMenus();
+
 	Ui::osgVisualGUIClass ui;
+
+	/**
+	 * Pointer to the debug widget
+	 */ 
+	QTextEdit* debug;
+
+private slots:
+	void on_actionToggle_bottom_right_corner_triggered();
+	void on_actionToggle_bottom_left_corner_triggered();
+	void on_actionToggle_top_right_corner_triggered();
+	void on_actionToggle_top_left_corner_triggered();
+	void on_actionAbout_This_Programm_triggered();
 };
 
Index: experimental/osgVisualGuiNG/osgvisualgui.ui
===================================================================
--- experimental/osgVisualGuiNG/osgvisualgui.ui	(revision 415)
+++ experimental/osgVisualGuiNG/osgvisualgui.ui	(revision 418)
@@ -1,29 +1,78 @@
-<UI version="4.0" >
+<?xml version="1.0" encoding="UTF-8"?>
+<ui version="4.0">
  <class>osgVisualGUIClass</class>
- <widget class="QMainWindow" name="osgVisualGUIClass" >
-  <property name="objectName" >
-   <string notr="true">osgVisualGUIClass</string>
-  </property>
-  <property name="geometry" >
+ <widget class="QMainWindow" name="osgVisualGUIClass">
+  <property name="geometry">
    <rect>
-	<x>0</x>
-	<y>0</y>
-	<width>600</width>
-	<height>400</height>
+    <x>0</x>
+    <y>0</y>
+    <width>600</width>
+    <height>400</height>
    </rect>
   </property>
-  <property name="windowTitle" >
+  <property name="windowTitle">
    <string>osgVisualGUI</string>
   </property>
-  <widget class="QMenuBar" name="menuBar" />
-  <widget class="QToolBar" name="mainToolBar" />
-  <widget class="QWidget" name="centralWidget" />
-  <widget class="QStatusBar" name="statusBar" />
+  <widget class="QWidget" name="centralWidget"/>
+  <widget class="QMenuBar" name="menuBar">
+   <property name="geometry">
+    <rect>
+     <x>0</x>
+     <y>0</y>
+     <width>600</width>
+     <height>21</height>
+    </rect>
+   </property>
+   <widget class="QMenu" name="menuFile">
+    <property name="title">
+     <string>File</string>
+    </property>
+    <addaction name="actionQuit"/>
+   </widget>
+   <widget class="QMenu" name="menu">
+    <property name="title">
+     <string>?</string>
+    </property>
+    <addaction name="actionAbout"/>
+   </widget>
+   <widget class="QMenu" name="menuEdit">
+    <property name="title">
+     <string>Edit</string>
+    </property>
+   </widget>
+   <addaction name="menuFile"/>
+   <addaction name="menuEdit"/>
+   <addaction name="menu"/>
+  </widget>
+  <widget class="QToolBar" name="mainToolBar">
+   <attribute name="toolBarArea">
+    <enum>TopToolBarArea</enum>
+   </attribute>
+   <attribute name="toolBarBreak">
+    <bool>false</bool>
+   </attribute>
+  </widget>
+  <widget class="QStatusBar" name="statusBar"/>
+  <widget class="QDockWidget" name="dW_Debug">
+   <attribute name="dockWidgetArea">
+    <number>2</number>
+   </attribute>
+   <widget class="QWidget" name="dockWidgetContents"/>
+  </widget>
+  <action name="actionAbout">
+   <property name="text">
+    <string>About</string>
+   </property>
+  </action>
+  <action name="actionQuit">
+   <property name="text">
+    <string>Quit</string>
+   </property>
+  </action>
  </widget>
- <layoutDefault spacing="6" margin="11" />
- <pixmapfunction></pixmapfunction>
+ <layoutdefault spacing="6" margin="11"/>
  <resources>
-   <include location="osgvisualgui.qrc"/>
+  <include location="osgvisualgui.qrc"/>
  </resources>
  <connections/>
-</UI>
+</ui>
