summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'Swift/Controllers')
-rw-r--r--Swift/Controllers/EventWindowController.cpp10
-rw-r--r--Swift/Controllers/EventWindowController.h2
-rw-r--r--Swift/Controllers/UIInterfaces/EventWindow.h1
3 files changed, 13 insertions, 0 deletions
diff --git a/Swift/Controllers/EventWindowController.cpp b/Swift/Controllers/EventWindowController.cpp
index 4bc5c22..a6611fc 100644
--- a/Swift/Controllers/EventWindowController.cpp
+++ b/Swift/Controllers/EventWindowController.cpp
@@ -11,8 +11,18 @@ EventWindowController::EventWindowController(EventController* eventController, E
eventController_->onEventQueueEventAdded.connect(boost::bind(&EventWindowController::handleEventQueueEventAdded, this, _1));
}
+EventWindowController::~EventWindowController() {
+ delete window_;
+}
+
void EventWindowController::handleEventQueueEventAdded(boost::shared_ptr<Event> event) {
+ event->onConclusion.connect(boost::bind(&EventWindowController::handleEventConcluded, this, event));
window_->addEvent(event, true);
}
+void EventWindowController::handleEventConcluded(boost::shared_ptr<Event> event) {
+ window_->removeEvent(event);
+ window_->addEvent(event, false);
+}
+
}
diff --git a/Swift/Controllers/EventWindowController.h b/Swift/Controllers/EventWindowController.h
index 0c06f49..c612265 100644
--- a/Swift/Controllers/EventWindowController.h
+++ b/Swift/Controllers/EventWindowController.h
@@ -10,8 +10,10 @@ namespace Swift {
class EventWindowController {
public:
EventWindowController(EventController* eventController, EventWindowFactory* windowFactory);
+ ~EventWindowController();
private:
void handleEventQueueEventAdded(boost::shared_ptr<Event> event);
+ void handleEventConcluded(boost::shared_ptr<Event> event);
EventController* eventController_;
EventWindowFactory* windowFactory_;
diff --git a/Swift/Controllers/UIInterfaces/EventWindow.h b/Swift/Controllers/UIInterfaces/EventWindow.h
index 6cc5bbd..95bd7dd 100644
--- a/Swift/Controllers/UIInterfaces/EventWindow.h
+++ b/Swift/Controllers/UIInterfaces/EventWindow.h
@@ -6,6 +6,7 @@
namespace Swift {
class EventWindow {
public:
+ virtual ~EventWindow() {};
virtual void addEvent(boost::shared_ptr<Event> event, bool active) = 0;
virtual void removeEvent(boost::shared_ptr<Event> event) = 0;
};