diff options
author | Kevin Smith <git@kismith.co.uk> | 2010-03-19 17:49:50 (GMT) |
---|---|---|
committer | Kevin Smith <git@kismith.co.uk> | 2010-03-19 17:49:50 (GMT) |
commit | cd1801ca176553c2c1727745228cdd2f076b62a5 (patch) | |
tree | 4804f34a5a2fbba70e7487022ddf198a5af95db4 /Swift/Controllers | |
parent | 580d3d49ea3df7bb1c00cb1052203d17ccaa9a8e (diff) | |
download | swift-cd1801ca176553c2c1727745228cdd2f076b62a5.zip swift-cd1801ca176553c2c1727745228cdd2f076b62a5.tar.bz2 |
Don't show messages forever in the EventViewer.
Diffstat (limited to 'Swift/Controllers')
-rw-r--r-- | Swift/Controllers/EventWindowController.cpp | 10 | ||||
-rw-r--r-- | Swift/Controllers/EventWindowController.h | 2 | ||||
-rw-r--r-- | Swift/Controllers/UIInterfaces/EventWindow.h | 1 |
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; }; |