Index: code/branches/notifications/data/gui/scripts/GUISheet.lua
===================================================================
--- code/branches/notifications/data/gui/scripts/GUISheet.lua	(revision 7394)
+++ code/branches/notifications/data/gui/scripts/GUISheet.lua	(revision 7395)
@@ -40,4 +40,8 @@
 end
 
+-- Override this function if you need to do work just after the sheet has been hidden
+function P:afterHide()
+end
+
 function P:load()
     -- Load the layout that describes the sheet
Index: code/branches/notifications/data/gui/scripts/MiscConfigMenu.lua
===================================================================
--- code/branches/notifications/data/gui/scripts/MiscConfigMenu.lua	(revision 7394)
+++ code/branches/notifications/data/gui/scripts/MiscConfigMenu.lua	(revision 7395)
@@ -51,5 +51,5 @@
     table.insert(P.nameList, "Number of Bots")
     table.insert(P.nameList, "UnderAttack: game time")
-    table.insert(P.nameList, "TeamDeathmatch: Numer of teams")
+    table.insert(P.nameList, "TeamDeathmatch: Number of teams")
     table.insert(P.nameList, "Playername")
     table.insert(P.nameList, "Chat: display time")
Index: code/branches/notifications/data/gui/scripts/NotificationLayer.lua
===================================================================
--- code/branches/notifications/data/gui/scripts/NotificationLayer.lua	(revision 7394)
+++ code/branches/notifications/data/gui/scripts/NotificationLayer.lua	(revision 7395)
@@ -1,11 +1,15 @@
 -- NotificationLayer.lua
 
-local P = createMenuSheet("NotificationLayer")
+local P = createMenuSheet("NotificationLayer", true, TriBool.True, TriBool.True)
 
 P.queueList = {}
-P.nameList = {}
-P.visible = nil
 P.editMode = false
-P.editList = {}
+
+P.sampleWindow = nil
+
+function P.onLoad()
+    orxonox.NotificationManager:getInstance():loadQueues()
+    P.sampleWindow = winMgr:createWindow("MenuWidgets/StaticText", "orxonox/NotificationLayer/Root/SampleWindow")
+end
 
 function P.createQueue(name, size)
@@ -18,36 +22,33 @@
     queue:setSize(CEGUI.UVector2(CEGUI.UDim(1.0, 0), CEGUI.UDim(0, P.queueHeightHelper(queue, size))))
 
-    P.setVisible(queue, false)
-
-    table.insert(P.queueList, queue)
-    table.insert(P.nameList, name)
-    --TODO: Check name for uniqueness.
+    local queueTuple =
+    {
+        ["window"]  = queue,
+        ["name"]    = name,
+        ["edit"]    = nil,
+        ["visible"] = false
+    }
+
+    P.queueList[name] = queueTuple -- name access
+    P.setVisible(queueTuple, false)
 end
 
 function P.removeQueue(name)
-    local queue = nil
-
-    for k,v in pairs(P.nameList) do
-        if v == name then
-            P.nameList[k] = nil
-            queue = P.queueList[k]
-            P.queueList[k] = nil
-            break
-        end
-    end
+    local queue = P.queueList[name]
 
     if queue ~= nil then
-        winMgr:destroyWindow(queue)
-    end
+        winMgr:destroyWindow(queue.window)
+    end
+    queue = nil
 end
 
 function P.pushNotification(queueName, notification)
-    local queue = P.nameToQueueHelper(queueName)
-    if queue == nil then
-        cout(0, "Queue is nil!")
+    local queue = P.queueList[queueName]
+    if queue == nil then
+        cout(0, "0Queue is nil! " .. queueName)
         return
     end
     item = CEGUI.createListboxTextItem(notification)
-    local listbox = CEGUI.toListbox(queue)
+    local listbox = CEGUI.toListbox(queue.window)
     if listbox:getItemCount() == 0 then
         listbox:addItem(item)
@@ -56,5 +57,5 @@
     end
 
-    if P.visible == false then
+    if queue.visible == false then
         P.setVisible(queue, true)
     end
@@ -62,10 +63,10 @@
 
 function P.popNotification(queueName)
-    local queue = P.nameToQueueHelper(queueName)
-    if queue == nil then
-        cout(0, "Queue is nil!")
-        return
-    end
-    local listbox = CEGUI.toListbox(queue)
+    local queue = P.queueList[queueName]
+    if queue == nil then
+        cout(0, "1Queue is nil! " .. queueName)
+        return
+    end
+    local listbox = CEGUI.toListbox(queue.window)
     listbox:removeItem(listbox:getListboxItemFromIndex(listbox:getItemCount()-1))
 
@@ -76,10 +77,10 @@
 
 function P.removeNotification(queueName, index)
-    local queue = P.nameToQueueHelper(queueName)
-    if queue == nil then
-        cout(0, "Queue is nil!")
-        return
-    end
-    local listbox = CEGUI.toListbox(queue)
+    local queue = P.queueList[queueName]
+    if queue == nil then
+        cout(0, "2Queue is nil! " .. queueName)
+        return
+    end
+    local listbox = CEGUI.toListbox(queue.window)
     listbox:removeItem(listbox:getListboxItemFromIndex(tonumber(index)))
 
@@ -90,41 +91,215 @@
 
 function P.clearQueue(name)
-    local queue = P.nameToQueueHelper(name)
-    if queue == nil then
-        cout(0, "Queue is nil!")
-        return
-    end
-    local listbox = CEGUI.toListbox(queue)
-    CEGUI.toListbox(queue):resetList()
+    local queue = P.queueList[name]
+    if queue == nil then
+        cout(0, "3Queue is nil! " .. name)
+        return
+    end
+    local listbox = CEGUI.toListbox(queue.window)
+    CEGUI.toListbox(queue.window):resetList()
 
     P.setVisible(queue, false)
 end
 
-function P.changePosition(name, xPos, yPos)
-    local queue = P.nameToQueueHelper(name)
-    if queue == nil then
-        cout(0, "Queue is nil!")
-        return
-    end
-    queue:setPosition(CEGUI.UVector2(CEGUI.UDim(tonumber(xPos), 0), CEGUI.UDim(tonumber(yPos), 0)))
-    queue:setWidth(CEGUI.UDim(1.0, -xPos))
-end
-
 function P.changeSize(name, size)
-    local queue = P.nameToQueueHelper(name)
-    if queue == nil then
-        cout(0, "Queue is nil!")
-        return
-    end
-    queue:setHeight(CEGUI.UDim(0, P.queueHeightHelper(queue, size)))
+    local queue = P.queueList[name]
+    if queue == nil then
+        cout(0, "5Queue is nil! " .. name)
+        return
+    end
+    queue.window:setHeight(CEGUI.UDim(0, P.queueHeightHelper(queue.window, size)))
 end
 
 function P.setVisible(queue, visible)
-    queue:setVisible(visible)
-    P.visible = visible
+    if queue == nil then
+        cout(0, "6Queue is nil! " .. queue.name)
+        return
+    end
+    queue.window:setVisible(visible)
+    queue.visible = visible
 end
 
 function P.enterEditMode()
     P.editMode = true
+
+    local root = winMgr:getWindow("orxonox/NotificationLayer/Root")
+
+    --Add control frame window.
+    local window = winMgr:createWindow("MenuWidgets/FrameWindow", "orxonox/NotificationLayer/Root/EditMode/ControlWindow")
+    local frame = tolua.cast(window, "CEGUI::FrameWindow")
+    frame:setCloseButtonEnabled(false)
+    frame:setText("NotificationLayer Control Window")
+    frame:setSize(CEGUI.UVector2(CEGUI.UDim(0.7, 0), CEGUI.UDim(0.2, 0)))
+    root:addChildWindow(window)
+    local pane = winMgr:createWindow("MenuWidgets/ScrollablePane", "orxonox/NotificationLayer/Root/EditMode/ControlWindow/ScrollingPane")
+    pane:setSize(CEGUI.UVector2(CEGUI.UDim(1,-20), CEGUI.UDim(1,-30)))
+    pane:setPosition(CEGUI.UVector2(CEGUI.UDim(0, 10), CEGUI.UDim(0, 26)))
+    window:addChildWindow(pane)
+
+    vertOffset = 0
+    horzOffset = 0
+    local newQueueTitle = winMgr:createWindow("MenuWidgets/StaticText", "orxonox/NotificationLayer/Root/EditMode/ControlWindow/NewQueueTitle")
+    newQueueTitle:setText("Create a new NotificationQueue:")
+    local size = getMinTextSize(newQueueTitle)
+    local textHeight = size[1]
+    newQueueTitle:setSize(CEGUI.UVector2(CEGUI.UDim(0, size[2]), CEGUI.UDim(0, textHeight)))
+    newQueueTitle:setPosition(CEGUI.UVector2(CEGUI.UDim(0, horzOffset), CEGUI.UDim(0, vertOffset)))
+    pane:addChildWindow(newQueueTitle)
+    horzOffset = horzOffset + size[2] + 5
+    local newQueueName = winMgr:createWindow("MenuWidgets/Editbox", "orxonox/NotificationLayer/Root/EditMode/ControlWindow/NewQueueName")
+    newQueueName:setProperty("ReadOnly", "set:False")
+    newQueueName:setSize(CEGUI.UVector2(CEGUI.UDim(0, size[2]), CEGUI.UDim(0, textHeight)))
+    newQueueName:setPosition(CEGUI.UVector2(CEGUI.UDim(0, horzOffset), CEGUI.UDim(0, vertOffset)))
+    horzOffset = horzOffset + size[2] + 5
+    pane:addChildWindow(newQueueName)
+    local create = winMgr:createWindow("MenuWidgets/Button", "orxonox/NotificationLayer/Root/EditMode/ControlWindow/CreateNewQueue")
+    create:setText("create")
+    P.sampleWindow:setText("create")
+    size = getMinTextSize(P.sampleWindow)
+    create:setSize(CEGUI.UVector2(CEGUI.UDim(0, size[2]+20), CEGUI.UDim(0, textHeight)))
+    create:setPosition(CEGUI.UVector2(CEGUI.UDim(0, horzOffset), CEGUI.UDim(0, vertOffset)))
+    orxonox.GUIManager:subscribeEventHelper(create, "Clicked", P.name .. ".createNewQueue_clicked")
+    pane:addChildWindow(create)
+    horzOffset = horzOffset + size[2]+20 + 5
+    vertOffset = vertOffset + textHeight + 5
+
+    horzOffset = 0
+    local leave = winMgr:createWindow("MenuWidgets/Button", "orxonox/NotificationLayer/Root/EditMode/ControlWindow/LeaveEditModeButton")
+    leave:setText("leave Edit Mode")
+    P.sampleWindow:setText("leave Edit Mode")
+    size = getMinTextSize(P.sampleWindow)
+    leave:setSize(CEGUI.UVector2(CEGUI.UDim(0, size[2]+20), CEGUI.UDim(0, textHeight)))
+    leave:setPosition(CEGUI.UVector2(CEGUI.UDim(0, horzOffset), CEGUI.UDim(0, vertOffset)))
+    orxonox.GUIManager:subscribeEventHelper(leave, "Clicked", P.name .. ".leaveEditMode_clicked")
+    pane:addChildWindow(leave)
+    horzOffset = horzOffset + size[2]+20 + 5
+    vertOffset = vertOffset + textHeight + 5
+
+    --Replace all queues with FrameWindows
+    for k,v in pairs(P.queueList) do
+        if v ~= nil then
+            local queue = P.queueList[k]
+            root:removeChildWindow(queue.window)
+            
+            local window = P.createQueueEditFrame(queue.name)
+            window:setArea(queue.window:getArea())
+            
+            queue.edit = window
+        end
+    end
+end
+
+function P.createQueueEditFrame(name)
+    local root = winMgr:getWindow("orxonox/NotificationLayer/Root")
+    window = winMgr:createWindow("MenuWidgets/FrameWindow", "orxonox/NotificationLayer/Root/EditMode/" .. name)
+    local frame = tolua.cast(window, "CEGUI::FrameWindow")
+    frame:setCloseButtonEnabled(false)
+    frame:setText("NotificationQueue \"" .. name .. "\"")
+    root:addChildWindow(window)
+    local pane = winMgr:createWindow("MenuWidgets/ScrollablePane", "orxonox/NotificationLayer/Root/EditMode/" .. name .. "/ScrollingPane")
+    pane:setSize(CEGUI.UVector2(CEGUI.UDim(1,-20), CEGUI.UDim(1,-30)))
+    pane:setPosition(CEGUI.UVector2(CEGUI.UDim(0, 10), CEGUI.UDim(0, 26)))
+    window:addChildWindow(pane)
+
+    local horzOffset = 0
+    local vertOffset = 0
+
+    local targetsTitle = winMgr:createWindow("MenuWidgets/StaticText", "orxonox/NotificationLayer/Root/EditMode/" .. name .. "/TargetsTitle")
+    targetsTitle:setText("Targets:")
+    local size = getMinTextSize(targetsTitle)
+    local textHeight = size[1]
+    targetsTitle:setSize(CEGUI.UVector2(CEGUI.UDim(0, size[2]), CEGUI.UDim(0, textHeight)))
+    targetsTitle:setPosition(CEGUI.UVector2(CEGUI.UDim(0, horzOffset), CEGUI.UDim(0, vertOffset)))
+    pane:addChildWindow(targetsTitle)
+    horzOffset = horzOffset + size[2] + 5
+    local targets = winMgr:createWindow("MenuWidgets/Editbox", "orxonox/NotificationLayer/Root/EditMode/" .. name .. "/Targets")
+    targets:setProperty("ReadOnly", "set:False")
+    local targetsText = orxonox.NotificationManager:getInstance():getQueue(name):getTargets()
+    targets:setText(targetsText)
+    P.sampleWindow:setText(targetsText)
+    size = getMinTextSize(P.sampleWindow)
+    targets:setSize(CEGUI.UVector2(CEGUI.UDim(0, size[2]*2+20), CEGUI.UDim(0, textHeight)))
+    targets:setPosition(CEGUI.UVector2(CEGUI.UDim(0, horzOffset), CEGUI.UDim(0, vertOffset)))
+    cout(0, horzOffset .. "|" .. targets:getXPosition():asAbsolute(1) .. "|" .. size[2]*2+20)
+    horzOffset = horzOffset + size[2]*2+20 + 5
+    pane:addChildWindow(targets)
+    local save = winMgr:createWindow("MenuWidgets/Button", "orxonox/NotificationLayer/Root/EditMode/" .. name .. "/Targets/Save")
+    save:setText("save")
+    P.sampleWindow:setText("save")
+    size = getMinTextSize(P.sampleWindow)
+    local saveTextWidth = size[2]+20
+    save:setSize(CEGUI.UVector2(CEGUI.UDim(0, saveTextWidth), CEGUI.UDim(0, textHeight)))
+    save:setPosition(CEGUI.UVector2(CEGUI.UDim(0, horzOffset), CEGUI.UDim(0, vertOffset)))
+    cout(0, horzOffset .. "|" .. save:getXPosition():asAbsolute(1))
+    orxonox.GUIManager:subscribeEventHelper(save, "Clicked", P.name .. ".saveTargets_clicked")
+    pane:addChildWindow(save)
+    horzOffset = horzOffset + saveTextWidth
+    vertOffset = vertOffset + textHeight + 5
+
+    horzOffset = 0
+    local sizeTitle = winMgr:createWindow("MenuWidgets/StaticText", "orxonox/NotificationLayer/Root/EditMode/" .. name .. "/SizeTitle")
+    sizeTitle:setText("Size:")
+    size = getMinTextSize(sizeTitle)
+    sizeTitle:setSize(CEGUI.UVector2(CEGUI.UDim(0, size[2]), CEGUI.UDim(0, textHeight)))
+    sizeTitle:setPosition(CEGUI.UVector2(CEGUI.UDim(0, horzOffset), CEGUI.UDim(0, vertOffset)))
+    pane:addChildWindow(sizeTitle)
+    horzOffset = horzOffset + size[2] + 5
+    local queueSize = winMgr:createWindow("MenuWidgets/Editbox", "orxonox/NotificationLayer/Root/EditMode/" .. name .. "/Size")
+    queueSize:setProperty("ReadOnly", "set:False")
+    local maxSize = orxonox.NotificationManager:getInstance():getQueue(name):getMaxSize()
+    queueSize:setText(maxSize)
+    P.sampleWindow:setText(maxSize)
+    size = getMinTextSize(P.sampleWindow)
+    queueSize:setSize(CEGUI.UVector2(CEGUI.UDim(0, size[2]*2+20), CEGUI.UDim(0, textHeight)))
+    queueSize:setPosition(CEGUI.UVector2(CEGUI.UDim(0, horzOffset), CEGUI.UDim(0, vertOffset)))
+    horzOffset = horzOffset + size[2]*2+20 + 5
+    pane:addChildWindow(queueSize)
+    save = winMgr:createWindow("MenuWidgets/Button", "orxonox/NotificationLayer/Root/EditMode/" .. name .. "/Size/Save")
+    save:setText("save")
+    P.sampleWindow:setText("save")
+    size = getMinTextSize(P.sampleWindow)
+    local saveTextWidth = size[2]+20
+    save:setSize(CEGUI.UVector2(CEGUI.UDim(0, saveTextWidth), CEGUI.UDim(0, textHeight)))
+    save:setPosition(CEGUI.UVector2(CEGUI.UDim(0, horzOffset), CEGUI.UDim(0, vertOffset)))
+    orxonox.GUIManager:subscribeEventHelper(save, "Clicked", P.name .. ".saveSize_clicked")
+    pane:addChildWindow(save)
+    horzOffset = horzOffset + saveTextWidth
+    vertOffset = vertOffset + textHeight + 5
+
+    horzOffset = 0
+    local displayTimeTitle = winMgr:createWindow("MenuWidgets/StaticText", "orxonox/NotificationLayer/Root/EditMode/" .. name .. "/DisplayTimeTitle")
+    displayTimeTitle:setText("Display time:")
+    size = getMinTextSize(displayTimeTitle)
+    displayTimeTitle:setSize(CEGUI.UVector2(CEGUI.UDim(0, size[2]), CEGUI.UDim(0, textHeight)))
+    displayTimeTitle:setPosition(CEGUI.UVector2(CEGUI.UDim(0, horzOffset), CEGUI.UDim(0, vertOffset)))
+    pane:addChildWindow(displayTimeTitle)
+    horzOffset = horzOffset + size[2] + 5
+    local displayTime = winMgr:createWindow("MenuWidgets/Editbox", "orxonox/NotificationLayer/Root/EditMode/" .. name .. "/DisplayTime")
+    displayTime:setProperty("ReadOnly", "set:False")
+    local time = orxonox.NotificationManager:getInstance():getQueue(name):getDisplayTime()
+    displayTime:setText(time)
+    P.sampleWindow:setText(time)
+    size = getMinTextSize(P.sampleWindow)
+    displayTime:setSize(CEGUI.UVector2(CEGUI.UDim(0, size[2]*2+20), CEGUI.UDim(0, textHeight)))
+    displayTime:setPosition(CEGUI.UVector2(CEGUI.UDim(0, horzOffset), CEGUI.UDim(0, vertOffset)))
+    horzOffset = horzOffset + size[2]*2+20 + 5
+    pane:addChildWindow(displayTime)
+    save = winMgr:createWindow("MenuWidgets/Button", "orxonox/NotificationLayer/Root/EditMode/" .. name .. "/DisplayTime/Save")
+    save:setText("save")
+    P.sampleWindow:setText("save")
+    size = getMinTextSize(P.sampleWindow)
+    local saveTextWidth = size[2]+20
+    save:setSize(CEGUI.UVector2(CEGUI.UDim(0, saveTextWidth), CEGUI.UDim(0, textHeight)))
+    save:setPosition(CEGUI.UVector2(CEGUI.UDim(0, horzOffset), CEGUI.UDim(0, vertOffset)))
+    orxonox.GUIManager:subscribeEventHelper(save, "Clicked", P.name .. ".saveDisplayTime_clicked")
+    pane:addChildWindow(save)
+    horzOffset = horzOffset + saveTextWidth
+    vertOffset = vertOffset + textHeight + 5
+
+    return window
+end
+
+function P.leaveEditMode()
+    P.editMode = false
 
     local root = winMgr:getWindow("orxonox/NotificationLayer/Root")
@@ -132,45 +307,114 @@
     for k,v in pairs(P.queueList) do
         if v ~= nil then
-            root:removeChildWindow(v)
-            local frame = winMgr:createWindow("MenuWidgets/FrameWindow", "orxonox/NotificationLayer/Root/EditMode/" .. P.nameList[k])
-            frame:setArea(v:getArea())
-            root:addChildWindow(frame)
-            P.editList[k] = frame
+            root:addChildWindow(v.window)
+            v.window:setArea(v.edit:getArea())
+            winMgr:destroyWindow(v.edit)
+            v.edit = nil
         end
     end
-end
-
-function P.leaveEditMode()
-    P.editMode = false
-
-    local root = winMgr:getWindow("orxonox/NotificationLayer/Root")
-    --Replace all queues with FrameWindows
-    for k,v in pairs(P.queueList) do
-        if v ~= nil then
-            root:addChildWindow(v)
-            v:setArea(P.editList[k]:getArea())
-            winMgr:destroyWindow(P.editList[k])
-            P.editList[k] = nil
-        end
-    end
-
-    showMenuSheet(P.name, false, true)
-end
-
-function P.onHide()
+
+    --Remove control window
+    winMgr:destroyWindow(winMgr:getWindow("orxonox/NotificationLayer/Root/EditMode/ControlWindow"))
+end
+
+function P.afterHide()
     if P.editMode then
         P.leaveEditMode()
-    end
-end
-
-function P.nameToQueueHelper(name)
-    local queue = nil
-    for k,v in pairs(P.nameList) do
-        if v == name then
-            queue = P.queueList[k]
-            break
-        end
-    end
-    return queue
+        showMenuSheet(P.name, false, true)
+    end
+end
+
+function P. saveTargets_clicked(e)
+    local we = CEGUI.toWindowEventArgs(e)
+    local name = we.window:getName()
+
+    local match = string.gmatch(name, "EditMode/.*/Targets/Save")
+    local nameStr = match()
+    local queueName = string.sub(nameStr, 10, string.len(nameStr)-13)
+
+    local window = winMgr:getWindow("orxonox/NotificationLayer/Root/EditMode/" .. queueName .. "/Targets")
+    local save = winMgr:getWindow("orxonox/NotificationLayer/Root/EditMode/" .. queueName .. "/Targets/Save")
+    local width = window:getXPosition():asAbsolute(1)
+
+    local queue = orxonox.NotificationManager:getInstance():getQueue(queueName)
+    queue:setTargets(window:getText())
+    local targets = queue:getTargets()
+
+    window:setText(targets)
+    P.sampleWindow:setText(targets)
+    local size = getMinTextSize(P.sampleWindow)
+    window:setWidth(CEGUI.UDim(0, size[2]*2+20))
+    cout(0, width .. "|" .. size[2]*2+20 .. "|" .. window:getWidth():asAbsolute(1) .. "|" .. save:getXPosition():asAbsolute(1))
+    save:setXPosition(CEGUI.UDim(0, save:getXPosition():asAbsolute(1)-width+window:getWidth():asAbsolute(1)))
+end
+
+function P. saveSize_clicked(e)
+    local we = CEGUI.toWindowEventArgs(e)
+    local name = we.window:getName()
+
+    local match = string.gmatch(name, "EditMode/.*/Size/Save")
+    local nameStr = match()
+    local queueName = string.sub(nameStr, 10, string.len(nameStr)-10)
+
+    local window = winMgr:getWindow("orxonox/NotificationLayer/Root/EditMode/" .. queueName .. "/Size")
+    local save = winMgr:getWindow("orxonox/NotificationLayer/Root/EditMode/" .. queueName .. "/Size/Save")
+    local width = window:getXPosition():asAbsolute(1)
+
+    local queue = orxonox.NotificationManager:getInstance():getQueue(queueName)
+    queue:setMaxSize(tonumber(window:getText()))
+    local maxSize = queue:getMaxSize()
+
+    window:setText(maxSize)
+    P.sampleWindow:setText(maxSize)
+    local size = getMinTextSize(P.sampleWindow)
+    window:setWidth(CEGUI.UDim(0, size[2]*2+20))
+    save:setXPosition(CEGUI.UDim(0, save:getXPosition():asAbsolute(1)-width+window:getWidth():asAbsolute(1)))
+end
+
+function P. saveDisplayTime_clicked(e)
+    local we = CEGUI.toWindowEventArgs(e)
+    local name = we.window:getName()
+
+    local match = string.gmatch(name, "EditMode/.*/DisplayTime/Save")
+    local nameStr = match()
+    local queueName = string.sub(nameStr, 10, string.len(nameStr)-17)
+
+    local window = winMgr:getWindow("orxonox/NotificationLayer/Root/EditMode/" .. queueName .. "/DisplayTime")
+    local save = winMgr:getWindow("orxonox/NotificationLayer/Root/EditMode/" .. queueName .. "/DisplayTime/Save")
+    local width = window:getXPosition():asAbsolute(1)
+
+    local queue = orxonox.NotificationManager:getInstance():getQueue(queueName)
+    queue:setDisplayTime(tonumber(window:getText()))
+    local time = queue:getDisplayTime()
+
+    window:setText(time)
+    P.sampleWindow:setText(time)
+    local size = getMinTextSize(P.sampleWindow)
+    window:setWidth(CEGUI.UDim(0, size[2]*2+20))
+    save:setXPosition(CEGUI.UDim(0, save:getXPosition():asAbsolute(1)-width+window:getWidth():asAbsolute(1)))
+end
+
+function P.createNewQueue_clicked(e)
+    local window = winMgr:getWindow("orxonox/NotificationLayer/Root/EditMode/ControlWindow/NewQueueName")
+    local name = window:getText()
+    orxonox.NotificationManager:getInstance():createQueue(name)
+
+    local queue = P.queueList[name]
+    if queue == nil then
+        cout(0, "7Queue is nil! " .. name)
+        return
+    end
+    
+    local frame = P.createQueueEditFrame(name)
+    local root = winMgr:getWindow("orxonox/NotificationLayer/Root")
+    root:removeChildWindow(queue.window)
+    frame:setArea(queue.window:getArea())
+    queue.edit = frame
+    
+    window:setText("")
+end
+
+function P.leaveEditMode_clicked(e)
+    hideMenuSheet(P.name)
 end
 
@@ -188,3 +432,2 @@
 
 return P
-
Index: code/branches/notifications/data/gui/scripts/SheetManager.lua
===================================================================
--- code/branches/notifications/data/gui/scripts/SheetManager.lua	(revision 7394)
+++ code/branches/notifications/data/gui/scripts/SheetManager.lua	(revision 7395)
@@ -185,4 +185,6 @@
         hideCursor()
     end
+
+    sheetTuple.sheet:afterHide()
 end
 
Index: code/branches/notifications/src/modules/notifications/CMakeLists.txt
===================================================================
--- code/branches/notifications/src/modules/notifications/CMakeLists.txt	(revision 7394)
+++ code/branches/notifications/src/modules/notifications/CMakeLists.txt	(revision 7395)
@@ -13,4 +13,5 @@
   TOLUA_FILES
     NotificationManager.h
+    NotificationQueue.h
   PCH_FILE
     NotificationsPrecompiledHeaders.h
Index: code/branches/notifications/src/modules/notifications/NotificationManager.cc
===================================================================
--- code/branches/notifications/src/modules/notifications/NotificationManager.cc	(revision 7394)
+++ code/branches/notifications/src/modules/notifications/NotificationManager.cc	(revision 7395)
@@ -28,5 +28,5 @@
 
 /**
-    @file
+    @file NotificationManager.cc
     @brief Implementation of the NotificationManager class.
 */
@@ -43,4 +43,6 @@
 #include "NotificationQueue.h"
 
+#include "ToluaBindNotifications.h"
+
 namespace orxonox
 {
@@ -49,4 +51,7 @@
     const std::string NotificationManager::NONE("none");
 
+    // Register tolua_open function when loading the library.
+    DeclareToluaInterface(Notifications);
+
     ManageScopedSingleton(NotificationManager, ScopeID::Graphics, false);
 
@@ -65,12 +70,6 @@
 
         ModifyConsoleCommand("enterEditMode").setObject(this);
-
-        if(GameMode::showsGraphics())
-        {
-            GUIManager::getInstance().loadGUI("NotificationLayer");
-
-            // Create first queue:
-            this->queues_.push_back(new NotificationQueue("all"));
-        }
+        
+        COUT(3) << "NotificatioManager created." << std::endl;
     }
 
@@ -82,10 +81,19 @@
     {
         ModifyConsoleCommand("enterEditMode").setObject(NULL);
+
+        for(std::multimap<std::time_t, Notification*>::iterator it = this->allNotificationsList_.begin(); it != this->allNotificationsList_.end(); it++)
+            it->second->destroy();
+        
+        COUT(3) << "NotificationManager destroyed." << std::endl;
     }
 
     void NotificationManager::preDestroy(void)
     {
-        for(std::vector<NotificationQueue*>::iterator it = this->queues_.begin(); it != this->queues_.end(); it++)
-            (*it)->destroy();
+        for(std::map<const std::string, NotificationQueue*>::iterator it = this->queues_.begin(); it != this->queues_.end(); )
+        {
+            NotificationQueue* queue = (*it).second;
+            it++;
+            queue->destroy();
+        }
         this->queues_.clear();
     }
@@ -101,17 +109,16 @@
     bool NotificationManager::registerNotification(Notification* notification)
     {
-
-        if(notification == NULL) //!< A NULL-Notification cannot be registered.
+        if(notification == NULL) // A NULL-Notification cannot be registered.
             return false;
 
         std::time_t time = std::time(0); //TODO: Doesn't this expire? //!< Get current time.
 
-        this->allNotificationsList_.insert(std::pair<std::time_t,Notification*>(time,notification));
-
-        if(notification->getSender() == NONE) // If the sender has no specific name, then the Notification is only added to the list of all Notifications.
+        this->allNotificationsList_.insert(std::pair<std::time_t, Notification*>(time, notification));
+
+        if(notification->getSender() == NotificationManager::NONE) // If the sender has no specific name, then the Notification is only added to the list of all Notifications.
             return true;
 
         bool all = false;
-        if(notification->getSender() == ALL) // If all are the sender, then the Notifications is added to every NotificationListener.
+        if(notification->getSender() == NotificationManager::ALL) // If all are the sender, then the Notifications is added to every NotificationListener.
             all = true;
 
@@ -119,8 +126,12 @@
         for(std::map<NotificationListener*,int>::iterator it = this->listenerList_.begin(); it != this->listenerList_.end(); it++) // Iterate through all listeners.
         {
-            std::set<std::string> set = it->first->getTargetsSet();
-            if(all || set.find(notification->getSender()) != set.end() || set.find(ALL) != set.end()) //TODO: Make sure this works.
+            std::set<std::string, NotificationListenerStringCompare> set = it->first->getTargetsSet();
+            bool bAll = set.find(NotificationManager::ALL) != set.end();
+            if(all || bAll || set.find(notification->getSender()) != set.end()) //TODO: Make sure this works.
             {
-                this->notificationLists_[it->second]->insert(std::pair<std::time_t,Notification*>(time,notification)); // Insert the Notification in the Notifications list of the current NotificationListener.
+                if(!bAll)
+                {
+                    this->notificationLists_[it->second]->insert(std::pair<std::time_t, Notification*>(time, notification)); // Insert the Notification in the Notifications list of the current NotificationListener.
+                }
                 it->first->update(notification, time); // Update the listener.
                 std::map<Notification*, unsigned int>::iterator counterIt = this->listenerCounter_.find(notification);
@@ -132,5 +143,5 @@
         }
 
-        COUT(4) << "Notification registered with the NotificationManager." << std::endl;
+        COUT(4) << "Notification (&" << notification << ") registered with the NotificationManager." << std::endl;
 
         return true;
@@ -154,13 +165,5 @@
             this->listenerCounter_[notification] = this->listenerCounter_[notification] - 1;
 
-        // If the Notification is no longer present in any of the NotificationListeners it can be removed from the map of all Notifications and be destroyed.
-        if(this->listenerCounter_[notification] == (unsigned int) 0)
-        {
-            this->removeNotification(notification, this->allNotificationsList_);
-            this->listenerCounter_.erase(notification);
-            notification->destroy();
-        }
-
-        COUT(4) << "Notification unregistered with the NotificationManager." << std::endl;
+        COUT(4) << "Notification (&" << notification << ")unregistered with the NotificationManager from listener (&" << listener << ")" << std::endl;
     }
 
@@ -175,5 +178,4 @@
         Returns true if successful.
     */
-    //TODO: Needed?
     bool NotificationManager::removeNotification(Notification* notification, std::multimap<std::time_t, Notification*>& map)
     {
@@ -206,23 +208,24 @@
         this->listenerList_[listener] = index; // Add the NotificationListener to the list of listeners.
 
-        std::set<std::string> set = listener->getTargetsSet(); //TODO: Does this work?
+        std::set<std::string, NotificationListenerStringCompare> set = listener->getTargetsSet();
 
         // If all senders are the target of the listener, then the list of notification for that specific listener is te same as the list of all Notifications.
-        if(set.find(ALL) != set.end())
-        {
+        bool bAll = set.find(NotificationManager::ALL) != set.end();
+        std::multimap<std::time_t, Notification*> map;
+        if(bAll)
             this->notificationLists_[index] = &this->allNotificationsList_;
-            COUT(4) << "NotificationListener registered with the NotificationManager." << std::endl;
-            return true;
-        }
-
-        this->notificationLists_[index] = new std::multimap<std::time_t,Notification*>;
-        std::multimap<std::time_t,Notification*> map = *this->notificationLists_[index];
+        else
+        {
+            this->notificationLists_[index] = new std::multimap<std::time_t, Notification*>;
+            map = *this->notificationLists_[index];
+        }
 
         // Iterate through all Notifications to determine whether any of them should belong to the newly registered NotificationListener.
-        for(std::multimap<std::time_t,Notification*>::iterator it = this->allNotificationsList_.begin(); it != this->allNotificationsList_.end(); it++)
-        {
-            if(set.find(it->second->getSender()) != set.end()) // Checks whether the overlay has the sender of the current notification as target.
+        for(std::multimap<std::time_t, Notification*>::iterator it = this->allNotificationsList_.begin(); it != this->allNotificationsList_.end(); it++)
+        {
+            if(bAll || set.find(it->second->getSender()) != set.end()) // Checks whether the listener has the sender of the current notification as target.
             {
-                map.insert(std::pair<std::time_t, Notification*>(it->first, it->second));
+                if(!bAll)
+                    map.insert(std::pair<std::time_t, Notification*>(it->first, it->second));
                 std::map<Notification*, unsigned int>::iterator counterIt = this->listenerCounter_.find(it->second);
                 if(counterIt == this->listenerCounter_.end())
@@ -288,24 +291,46 @@
             return false;
 
-        std::multimap<std::time_t,Notification*>* notifications = this->notificationLists_[this->listenerList_[listener]]; // The Notifications for the input NotificationListener.
-
-        if(notifications == NULL) // Returns NULL, if there are no Notifications.
-            return true;
+        std::multimap<std::time_t, Notification*>* notifications = this->notificationLists_[this->listenerList_[listener]]; // The Notifications for the input NotificationListener.
+
+        if(notifications == NULL) // Returns false, if there are no Notifications.
+            return false;
 
         std::multimap<std::time_t,Notification*>::iterator it, itLowest, itHighest;
         itLowest = notifications->lower_bound(timeFrameStart);
-        itHighest = notifications->upper_bound(timeFrameStart);
+        itHighest = notifications->upper_bound(timeFrameEnd);
 
         for(it = itLowest; it != itHighest; it++) // Iterate through the Notifications from the start of the time Frame to the end of it.
-        {
-            map->insert(std::pair<std::time_t,Notification*>(it->first,it->second)); // Add the found Notifications to the map.
-        }
+            map->insert(std::pair<std::time_t, Notification*>(it->first,it->second)); // Add the found Notifications to the map.
 
         return true;
     }
 
-    void NotificationManager::createQueue(const std::string& name, const std::string& targets, unsigned int size, unsigned int displayTime)
-    {
-        this->queues_.push_back(new NotificationQueue(name, targets, size, displayTime));
+    void NotificationManager::loadQueues(void)
+    {
+        new NotificationQueue("all");
+    }
+
+    void NotificationManager::createQueue(const std::string& name)
+    {
+        new NotificationQueue(name);
+    }
+
+    NotificationQueue* NotificationManager::getQueue(const std::string & name)
+    {
+        std::map<const std::string, NotificationQueue*>::iterator it = this->queues_.find(name);
+        if(it == this->queues_.end())
+            return NULL;
+
+        return (*it).second;
+    }
+
+    bool NotificationManager::registerQueue(NotificationQueue* queue)
+    {
+        return this->queues_.insert(std::pair<const std::string, NotificationQueue*>(queue->getName(), queue)).second;
+    }
+    
+    void NotificationManager::unregisterQueue(NotificationQueue* queue)
+    {
+        this->queues_.erase(queue->getName());
     }
 
Index: code/branches/notifications/src/modules/notifications/NotificationManager.h
===================================================================
--- code/branches/notifications/src/modules/notifications/NotificationManager.h	(revision 7394)
+++ code/branches/notifications/src/modules/notifications/NotificationManager.h	(revision 7395)
@@ -28,5 +28,5 @@
 
 /**
-    @file
+    @file NotificationManager.h
     @brief Definition of the NotificationManager class.
 */
@@ -40,5 +40,4 @@
 #include <map>
 #include <string>
-#include <vector>
 
 #include "util/Singleton.h"
@@ -55,5 +54,5 @@
         Damian 'Mozork' Frick
     */
-    class _NotificationsExport NotificationManager  // tolua_export
+    class _NotificationsExport NotificationManager // tolua_export
         : public Singleton<NotificationManager>, public OrxonoxClass
     { // tolua_export
@@ -75,5 +74,5 @@
             void unregisterListener(NotificationListener* listener); //!< Unregisters a NotificationListener withing the NotificationManager.
 
-            bool getNotifications(NotificationListener* listener, std::multimap<std::time_t,Notification*>* map, const std::time_t & timeFrameStart, const std::time_t & timeFrameEnd); //!< Returns the Notifications for a specific NotificationListener in a specified timeframe.
+            bool getNotifications(NotificationListener* listener, std::multimap<std::time_t, Notification*>* map, const std::time_t & timeFrameStart, const std::time_t & timeFrameEnd); //!< Returns the Notifications for a specific NotificationListener in a specified timeframe.
 
             /**
@@ -84,21 +83,29 @@
             @return Returns true if successful.
             */
-            bool getNotifications(NotificationListener* listener, std::multimap<std::time_t,Notification*>* map, int timeDelay)
+            bool getNotifications(NotificationListener* listener, std::multimap<std::time_t, Notification*>* map, int timeDelay)
                 { return this->getNotifications(listener, map, std::time(0)-timeDelay, std::time(0)); }
 
             void enterEditMode(void);
 
-            void createQueue(const std::string& name, const std::string& targets, unsigned int size, unsigned int displayTime); // tolua_export
+            // tolua_begin
+            void loadQueues(void);
+            
+            void createQueue(const std::string& name);
+            orxonox::NotificationQueue* getQueue(const std::string & name);
+            // tolua_end
+
+            bool registerQueue(NotificationQueue* queue);
+            void unregisterQueue(NotificationQueue* queue);
 
         private:
             static NotificationManager* singletonPtr_s;
 
-            std::vector<NotificationQueue*> queues_; //!< The list of NotificationQueues created by the NotificationManager.
+            std::map<const std::string, NotificationQueue*> queues_; //!< The list of NotificationQueues created by the NotificationManager.
 
             int highestIndex_; //!< This variable holds the highest index (resp. key) in notificationLists_s, to secure that no key appears twice.
 
-            std::multimap<std::time_t,Notification*> allNotificationsList_; //!< Container where all notifications are stored.
-            std::map<NotificationListener*,int> listenerList_; //!< Container where all NotificationListeners are stored with a number as identifier.
-            std::map<int,std::multimap<std::time_t,Notification*>*> notificationLists_; //!< Container where all Notifications, for each identifier (associated with a NotificationListener), are stored.
+            std::multimap<std::time_t, Notification*> allNotificationsList_; //!< Container where all notifications are stored.
+            std::map<NotificationListener*, int> listenerList_; //!< Container where all NotificationListeners are stored with a number as identifier.
+            std::map<int,std::multimap<std::time_t, Notification*>*> notificationLists_; //!< Container where all Notifications, for each identifier (associated with a NotificationListener), are stored.
             std::map<Notification*, unsigned int> listenerCounter_; //!< A container to store the number of NotificationListeners a Notification is registered with.
 
Index: code/branches/notifications/src/modules/notifications/NotificationQueue.cc
===================================================================
--- code/branches/notifications/src/modules/notifications/NotificationQueue.cc	(revision 7394)
+++ code/branches/notifications/src/modules/notifications/NotificationQueue.cc	(revision 7395)
@@ -35,4 +35,5 @@
 
 #include <map>
+#include <sstream>
 
 #include "core/CoreIncludes.h"
@@ -62,8 +63,23 @@
         this->setDisplayTime(displayTime);
 
+        bool queueRegistered = NotificationManager::getInstance().registerQueue(this);
+        this->registered_ = true;
+        if(!queueRegistered)
+        {
+            this->registered_ = false;
+            COUT(1) << "Error: Notification Queue '" << this->getName() << "' could not be registered." << std::endl;
+            return;
+        }
+
         this->create();
-
-        NotificationManager::getInstance().registerListener(this);
-        this->registered_ = true;
+        
+        bool listenerRegistered = NotificationManager::getInstance().registerListener(this);
+        if(!listenerRegistered)
+        {
+            this->registered_ = false;
+            NotificationManager::getInstance().unregisterQueue(this);
+            COUT(1) << "Error: Notification Queue '" << this->getName() << "' could not be registered." << std::endl;
+            return;
+        }
 
         COUT(3) << "NotificationQueue '" << this->getName() << "' created." << std::endl;
@@ -77,8 +93,12 @@
     {
         this->targets_.clear();
-        this->clear();
 
         if(this->registered_)
+        {
+            this->clear();
+            
             NotificationManager::getInstance().unregisterListener(this);
+            NotificationManager::getInstance().unregisterQueue(this);
+        }
     }
 
@@ -100,5 +120,5 @@
     void NotificationQueue::create(void)
     {
-        GUIManager::getInstance().getLuaState()->doString("NotificationLayer.createQueue(\"" + this->getName() + "\", " + multi_cast<std::string>(this->getMaxSize()) + ")");
+        GUIManager::getInstance().getLuaState()->doString("NotificationLayer.createQueue(\"" + this->getName() +  "\", " + multi_cast<std::string>(this->getMaxSize()) + ")");
     }
 
@@ -144,13 +164,15 @@
         }
 
-        if(notifications->empty())
-            return;
-
-        for(std::multimap<std::time_t, Notification*>::iterator it = notifications->begin(); it != notifications->end(); it++) // Add all Notifications.
-            this->push(it->second, it->first);
+        if(!notifications->empty())
+        {
+            for(std::multimap<std::time_t, Notification*>::iterator it = notifications->begin(); it != notifications->end(); it++) // Add all Notifications.
+            {
+                this->push(it->second, it->first);
+            }
+        }
 
         delete notifications;
 
-        COUT(4) << "NotificationQueue '" << this->getName() << "' updated." << std::endl;
+        COUT(3) << "NotificationQueue '" << this->getName() << "' updated." << std::endl; //TODO: Level 4.
     }
 
@@ -167,5 +189,5 @@
         this->push(notification, time);
 
-        COUT(4) << "NotificationQueue '" << this->getName() << "' updated. A new Notification has been added." << std::endl;
+        COUT(3) << "NotificationQueue '" << this->getName() << "' updated. A new Notification has been added." << std::endl; //TODO: Level 4.
     }
 
@@ -253,5 +275,4 @@
     bool NotificationQueue::setName(const std::string& name)
     {
-        //TODO: Test uniqueness of name.
         this->name_ = name;
         return true;
@@ -268,4 +289,7 @@
     void NotificationQueue::setMaxSize(unsigned int size)
     {
+        if(this->maxSize_ == size)
+            return;
+        
         this->maxSize_ = size;
         this->sizeChanged();
@@ -292,6 +316,11 @@
     void NotificationQueue::setDisplayTime(unsigned int time)
     {
+        if(this->displayTime_ == time)
+            return;
+
         this->displayTime_ = time;
-        this->update();
+
+        if(this->registered_)
+            this->update();
     }
 
@@ -299,28 +328,21 @@
     @brief
         Produces all targets concatinated as string, with kommas (',') as seperators.
-    @param string
-        Pointer to a string which will be used by the method to fill with the concatination of the targets.
-    @return
-        Returns true if successful.
-    */
-    bool NotificationQueue::getTargets(std::string* string) const
-    {
-        if(string == NULL)
-        {
-            COUT(4) << "Input string must have memory allocated." << std::endl;
-            return false;
-        }
-        string->clear();
+    @return
+        Returns the targets as a string.
+    */
+    const std::string& NotificationQueue::getTargets(void) const
+    {
+        std::stringstream stream;
         bool first = true;
-        for(std::set<std::string>::const_iterator it = this->targets_.begin(); it != this->targets_.end(); it++) // Iterate through the set of targets.
+        for(std::set<std::string, NotificationListenerStringCompare>::const_iterator it = this->targets_.begin(); it != this->targets_.end(); it++) // Iterate through the set of targets.
         {
             if(!first)
-                *string += ',';
+                stream << ',';
             else
                 first = false;
-            *string += *it;
-        }
-
-        return true;
+            stream << *it;
+        }
+
+        return *(new std::string(stream.str()));
     }
 
@@ -352,4 +374,10 @@
         }
 
+        if(this->registered_)
+        {
+            NotificationManager::getInstance().unregisterListener(this);
+            NotificationManager::getInstance().registerListener(this);
+        }
+
         return true;
     }
Index: code/branches/notifications/src/modules/notifications/NotificationQueue.h
===================================================================
--- code/branches/notifications/src/modules/notifications/NotificationQueue.h	(revision 7394)
+++ code/branches/notifications/src/modules/notifications/NotificationQueue.h	(revision 7395)
@@ -46,6 +46,6 @@
 #include "NotificationManager.h"
 
-namespace orxonox
-{
+namespace orxonox // tolua_export
+{ // tolua_export
 
     //! Container to allow easy handling.
@@ -68,6 +68,7 @@
         Damian 'Mozork' Frick
     */
-    class _NotificationsExport NotificationQueue : public Tickable, public NotificationListener
-    {
+    class _NotificationsExport NotificationQueue // tolua_export
+        : public Tickable, public NotificationListener
+    { // tolua_export
 
         public:
@@ -80,4 +81,5 @@
             void update(Notification* notification, const std::time_t & time); //!< Adds a Notification to the queue.
 
+            // tolua_begin
             /**
             @brief Get the name of the NotificationQueue.
@@ -87,4 +89,5 @@
                 { return this->name_; }
 
+            void setMaxSize(unsigned int size); //!< Sets the maximum number of displayed Notifications.
             /**
             @brief Returns the maximum number of Notifications displayed.
@@ -93,4 +96,14 @@
             inline unsigned int getMaxSize() const
                 { return this->maxSize_; }
+
+            void setDisplayTime(unsigned int time); //!< Sets the maximum number of seconds a Notification is displayed.
+            /**
+            @brief Returns the time interval the Notification is displayed.
+            @return Returns the display time.
+            */
+            inline float getDisplayTime() const
+                { return this->displayTime_; }
+            // tolua_end
+
             /**
             @brief Returns the current number of Notifications displayed.
@@ -99,10 +112,4 @@
             inline unsigned int getSize() const
                 { return this->size_; }
-            /**
-            @brief Returns the time interval the Notification is displayed.
-            @return Returns the display time.
-            */
-            inline float getDisplayTime() const
-                { return this->displayTime_; }
 
             /**
@@ -110,7 +117,11 @@
             @return Retuns a set of string holding the different targets.
             */
-            inline const std::set<std::string> & getTargetsSet()
+            inline const std::set<std::string, NotificationListenerStringCompare> & getTargetsSet()
                 { return this->targets_; }
-            bool getTargets(std::string* string) const; //!< Returns a string consisting of the concatination of the targets.
+
+            // tolua_begin
+            bool setTargets(const std::string & targets); //!< Set the targets of this NotificationQueue.
+            const std::string& getTargets(void) const; //!< Returns a string consisting of the concatination of the targets.
+            // tolua_end
 
         private:
@@ -124,5 +135,5 @@
             unsigned int displayTime_; //!< The time a Notification is displayed.
 
-            std::set<std::string> targets_; //!< The targets the Queue displays Notifications of.
+            std::set<std::string, NotificationListenerStringCompare> targets_; //!< The targets the Queue displays Notifications of.
 
             std::multiset<NotificationContainer*, NotificationContainerCompare> ordering_; //!< The NotificationContainers ordered by the time they were registered. //TODO: Would set work as well?
@@ -139,9 +150,4 @@
             bool setName(const std::string& name); //!< Sets the name of the NotificationQueue.
 
-            void setMaxSize(unsigned int size); //!< Sets the maximum number of displayed Notifications.
-            void setDisplayTime(unsigned int time); //!< Sets the maximum number of seconds a Notification is displayed.
-
-            bool setTargets(const std::string & targets); //!< Set the targets of this NotificationQueue.
-
             void sizeChanged(void); //!< Adjusts the NotificationQueue, when the maximum size has changed.
 
@@ -152,7 +158,7 @@
             void clear(void); //!< Clears the queue by removing all Notifications.
 
-    };
+    }; // tolua_export
 
-}
+} // tolua_export
 
 #endif /* _NotificationOverlay_H__ */
Index: code/branches/notifications/src/orxonox/interfaces/NotificationListener.h
===================================================================
--- code/branches/notifications/src/orxonox/interfaces/NotificationListener.h	(revision 7394)
+++ code/branches/notifications/src/orxonox/interfaces/NotificationListener.h	(revision 7395)
@@ -49,4 +49,15 @@
     /**
     @brief
+        Struct that overloads the compare operation between two PickupIdentifier pointers.
+    */
+    //TODO: 
+    struct NotificationListenerStringCompare
+    {
+        bool operator() (const std::string& lhs, const std::string& rhs) const
+            { return lhs.compare(rhs) < 0; }
+    };
+
+    /**
+    @brief
         NotificationListener interface.
     @author
@@ -59,5 +70,5 @@
             virtual ~NotificationListener() {}
 
-            virtual const std::set<std::string> & getTargetsSet() = 0;
+            virtual const std::set<std::string, NotificationListenerStringCompare> & getTargetsSet() = 0;
             virtual void update(void) = 0;
             virtual void update(Notification* notification, const std::time_t & time) = 0;
