Index: /code/branches/presentation/src/modules/notifications/NotificationQueue.cc
===================================================================
--- /code/branches/presentation/src/modules/notifications/NotificationQueue.cc	(revision 8661)
+++ /code/branches/presentation/src/modules/notifications/NotificationQueue.cc	(revision 8662)
@@ -56,5 +56,11 @@
         RegisterObject(NotificationQueue);
 
-        this->initialize();
+        this->size_ = 0;
+        this->tickTime_ = 0.0f;
+        this->maxSize_ = NotificationQueue::DEFAULT_SIZE;
+        this->displayTime_ = NotificationQueue::DEFAULT_DISPLAY_TIME;
+
+        this->creationTime_ = std::time(0);
+        
         this->registerVariables();
     }
@@ -96,14 +102,19 @@
     /**
     @brief
-        Initializes the NotificationQueue.
-    */
-    void NotificationQueue::initialize(void)
-    {
-        this->size_ = 0;
-        this->tickTime_ = 0.0f;
-        this->maxSize_ = NotificationQueue::DEFAULT_SIZE;
-        this->displayTime_ = NotificationQueue::DEFAULT_DISPLAY_TIME;
-
-        this->creationTime_ = std::time(0);
+        Is called when the name of the NotificationQueue has changed.
+        Clears and re-creates the NotificationQueue.
+    */
+    void NotificationQueue::changedName(void)
+    {
+        SUPER(NotificationQueue, changedName);
+
+        if(this->isRegistered())
+            this->clear();
+            
+        this->create();
+
+        this->targetsChanged();
+        this->maxSizeChanged();
+        this->displayTimeChanged();
     }
 
@@ -159,6 +170,4 @@
         XMLPortParam(NotificationQueue, "size", setMaxSize, getMaxSize, xmlelement, mode);
         XMLPortParam(NotificationQueue, "displayTime", setDisplayTime, getDisplayTime, xmlelement, mode);
-
-        this->create();
     }
     
Index: /code/branches/presentation/src/modules/notifications/NotificationQueue.h
===================================================================
--- /code/branches/presentation/src/modules/notifications/NotificationQueue.h	(revision 8661)
+++ /code/branches/presentation/src/modules/notifications/NotificationQueue.h	(revision 8662)
@@ -99,5 +99,6 @@
             virtual void tick(float dt); // To update from time to time.
             virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
-            void registerVariables();
+
+            virtual void changedName(void);
             
             void update(void); // Updates the NotificationQueue.
@@ -159,4 +160,6 @@
             
         protected:
+            void registerVariables();
+            
             /**
             @brief Is called when a notification was pushed.
@@ -184,7 +187,5 @@
 
         private:
-            void initialize(void); // Initializes the NotificationQueue.
-
-            time_t creationTime_; // The time this NotificationQueue was created.
+            time_t creationTime_; //!< The time this NotificationQueue was created.
             
             unsigned int maxSize_; //!< The maximal number of Notifications displayed.
Index: /code/branches/presentation/src/modules/notifications/NotificationQueueCEGUI.cc
===================================================================
--- /code/branches/presentation/src/modules/notifications/NotificationQueueCEGUI.cc	(revision 8661)
+++ /code/branches/presentation/src/modules/notifications/NotificationQueueCEGUI.cc	(revision 8662)
@@ -65,5 +65,5 @@
     NotificationQueueCEGUI::~NotificationQueueCEGUI()
     {
-        if(GameMode::showsGraphics())
+        if(this->isRegistered() && GameMode::showsGraphics())
             GUIManager::getInstance().getLuaState()->doString(NotificationQueueCEGUI::NOTIFICATION_LAYER + ".removeQueue(\"" + this->getName() +  "\")");
     }
@@ -103,4 +103,15 @@
     }
 
+    void NotificationQueueCEGUI::changedName(void)
+    {
+        SUPER(NotificationQueueCEGUI, changedName);
+
+        this->positionChanged();
+        this->fontSizeChanged();
+        this->fontColorChanged();
+        this->alignmentChanged();
+        this->displaySizeChanged();
+    }
+
     /**
     @brief
@@ -113,5 +124,5 @@
     {
         // Remove the NotificationQueue in lua.
-        if(GameMode::showsGraphics() && !noGraphics)
+        if(this->isRegistered() && GameMode::showsGraphics() && !noGraphics)
             GUIManager::getInstance().getLuaState()->doString(NotificationQueueCEGUI::NOTIFICATION_LAYER + ".removeQueue(\"" + this->getName() +  "\")");
 
@@ -151,5 +162,5 @@
     void NotificationQueueCEGUI::displaySizeChanged(void)
     {
-        if(GameMode::showsGraphics())
+        if(this->isRegistered() && GameMode::showsGraphics())
         {
             if(this->displaySize_.z == 0.0 && this->displaySize_.w == 0.0)
@@ -191,5 +202,5 @@
     void NotificationQueueCEGUI::positionChanged(void)
     {
-        if(GameMode::showsGraphics())
+        if(this->isRegistered() && GameMode::showsGraphics())
             GUIManager::getInstance().getLuaState()->doString(NotificationQueueCEGUI::NOTIFICATION_LAYER + ".moveQueue(\"" + this->getName() + "\", " + multi_cast<std::string>(this->position_.x) + ", " + multi_cast<std::string>(this->position_.y) + ", " + multi_cast<std::string>(this->position_.z) + ", " + multi_cast<std::string>(this->position_.w) + ")");
     }
@@ -218,5 +229,5 @@
     void NotificationQueueCEGUI::alignmentChanged(void)
     {
-        if(GameMode::showsGraphics())
+        if(this->isRegistered() && GameMode::showsGraphics())
             GUIManager::getInstance().getLuaState()->doString(NotificationQueueCEGUI::NOTIFICATION_LAYER + ".changeQueueAlignment(\"" + this->getName() + "\", \"" + this->alignment_ + "\")");
     }
@@ -243,5 +254,5 @@
     void NotificationQueueCEGUI::fontSizeChanged(void)
     {
-        if(GameMode::showsGraphics())
+        if(this->isRegistered() && GameMode::showsGraphics())
             GUIManager::getInstance().getLuaState()->doString(NotificationQueueCEGUI::NOTIFICATION_LAYER + ".changeQueueFontSize(\"" + this->getName() + "\", " + multi_cast<std::string>(this->fontSize_) + ")");
     }
@@ -274,5 +285,5 @@
         this->fontColorStr_ = stream.str();
 
-        if(GameMode::showsGraphics())
+        if(this->isRegistered() && GameMode::showsGraphics())
             GUIManager::getInstance().getLuaState()->doString(NotificationQueueCEGUI::NOTIFICATION_LAYER + ".changeQueueFontColor(\"" + this->getName() + "\", \"" + this->fontColorStr_ + "\")");
     }
@@ -303,5 +314,5 @@
     {
          // Push the Notification to the GUI.
-        if(GameMode::showsGraphics())
+        if(this->isRegistered() && GameMode::showsGraphics())
             GUIManager::getInstance().getLuaState()->doString(NotificationQueueCEGUI::NOTIFICATION_LAYER + ".pushNotification(\"" + this->getName() + "\", \"" + notification->getMessage() + "\")");
     }
@@ -314,5 +325,5 @@
     {
         // Pops the Notification from the GUI.
-        if(GameMode::showsGraphics())
+        if(this->isRegistered() && GameMode::showsGraphics())
             GUIManager::getInstance().getLuaState()->doString(NotificationQueueCEGUI::NOTIFICATION_LAYER + ".popNotification(\"" + this->getName() + "\")");
     }
@@ -325,5 +336,5 @@
     {
         // Removes the Notification from the GUI.
-        if(GameMode::showsGraphics())
+        if(this->isRegistered() && GameMode::showsGraphics())
             GUIManager::getInstance().getLuaState()->doString(NotificationQueueCEGUI::NOTIFICATION_LAYER + ".removeNotification(\"" + this->getName() + "\", " + multi_cast<std::string>(index) + ")");
     }
@@ -340,5 +351,5 @@
 
         // Clear the NotificationQueue in the GUI.
-        if(GameMode::showsGraphics() && !noGraphics)
+        if(this->isRegistered() && GameMode::showsGraphics() && !noGraphics)
             GUIManager::getInstance().getLuaState()->doString(NotificationQueueCEGUI::NOTIFICATION_LAYER + ".clearQueue(\"" + this->getName() + "\")");
     }
@@ -350,4 +361,7 @@
     void NotificationQueueCEGUI::create(void)
     {
+        if(this->isRegistered() && GameMode::showsGraphics())
+            GUIManager::getInstance().getLuaState()->doString(NotificationQueueCEGUI::NOTIFICATION_LAYER + ".removeQueue(\"" + this->getName() +  "\")");
+        
         this->NotificationQueue::create();
         
Index: /code/branches/presentation/src/modules/notifications/NotificationQueueCEGUI.h
===================================================================
--- /code/branches/presentation/src/modules/notifications/NotificationQueueCEGUI.h	(revision 8661)
+++ /code/branches/presentation/src/modules/notifications/NotificationQueueCEGUI.h	(revision 8662)
@@ -74,5 +74,6 @@
 
             virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
-            void registerVariables();
+
+            virtual void changedName(void);
 
             void destroy(bool noGraphics = false); // Destroys the NotificationQueue.
@@ -133,4 +134,6 @@
             
         protected:
+            void registerVariables();
+            
             virtual void create(void); // Creates the NotificationQueue in lua.
             
