summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'Swift/Controllers')
-rw-r--r--Swift/Controllers/HistoryController.cpp13
-rw-r--r--Swift/Controllers/HistoryController.h2
-rw-r--r--Swift/Controllers/UIInterfaces/HistoryWindow.h3
-rw-r--r--Swift/Controllers/UIInterfaces/HistoryWindowFactory.h2
4 files changed, 18 insertions, 2 deletions
diff --git a/Swift/Controllers/HistoryController.cpp b/Swift/Controllers/HistoryController.cpp
index 4f97006..6d8e68e 100644
--- a/Swift/Controllers/HistoryController.cpp
+++ b/Swift/Controllers/HistoryController.cpp
@@ -18,13 +18,24 @@ HistoryController::HistoryController(UIEventStream* uiEventStream, HistoryWindow
HistoryController::~HistoryController() {
uiEventStream_->onUIEvent.disconnect(boost::bind(&HistoryController::handleUIEvent, this, _1));
delete historyWindow_;
+ delete roster_;
}
void HistoryController::handleUIEvent(boost::shared_ptr<UIEvent> rawEvent) {
boost::shared_ptr<RequestHistoryUIEvent> event = boost::dynamic_pointer_cast<RequestHistoryUIEvent>(rawEvent);
if (event != NULL) {
if (historyWindow_ == NULL) {
- historyWindow_ = historyWindowFactory_->createHistoryWindow();
+ historyWindow_ = historyWindowFactory_->createHistoryWindow(uiEventStream_);
+ roster_ = new Roster(false, true);
+ historyWindow_->setRosterModel(roster_);
+
+ JID putin("vputin@karla.com");
+ JID medvedev("dmedvedev@karla.com");
+ JID kev("kevin@doomsong.co.uk");
+ const std::set<ContactRosterItem::Feature> none;
+ roster_->addContact(putin, putin, "Vladimir Putin", "Recent", "");
+ roster_->addContact(medvedev, medvedev, "Dmitri Medvedev", "Recent", "");
+ roster_->addContact(kev, kev, "Kev", "Recent", "");
}
historyWindow_->activate();
}
diff --git a/Swift/Controllers/HistoryController.h b/Swift/Controllers/HistoryController.h
index 47ae361..320b26e 100644
--- a/Swift/Controllers/HistoryController.h
+++ b/Swift/Controllers/HistoryController.h
@@ -15,6 +15,7 @@
namespace Swift {
class HistoryWindowFactory;
class HistoryWindow;
+ class Roster;
class HistoryController {
public:
@@ -28,5 +29,6 @@ namespace Swift {
UIEventStream* uiEventStream_;
HistoryWindowFactory* historyWindowFactory_;
HistoryWindow* historyWindow_;
+ Roster* roster_;
};
}
diff --git a/Swift/Controllers/UIInterfaces/HistoryWindow.h b/Swift/Controllers/UIInterfaces/HistoryWindow.h
index cb29120..713f986 100644
--- a/Swift/Controllers/UIInterfaces/HistoryWindow.h
+++ b/Swift/Controllers/UIInterfaces/HistoryWindow.h
@@ -6,11 +6,14 @@
#pragma once
+#include <Swift/Controllers/Roster/Roster.h>
+
namespace Swift {
class HistoryWindow {
public:
virtual ~HistoryWindow() {};
virtual void activate() = 0;
+ virtual void setRosterModel(Roster*) = 0;
};
}
diff --git a/Swift/Controllers/UIInterfaces/HistoryWindowFactory.h b/Swift/Controllers/UIInterfaces/HistoryWindowFactory.h
index 135438b..e91bc37 100644
--- a/Swift/Controllers/UIInterfaces/HistoryWindowFactory.h
+++ b/Swift/Controllers/UIInterfaces/HistoryWindowFactory.h
@@ -13,6 +13,6 @@ namespace Swift {
class HistoryWindowFactory {
public:
virtual ~HistoryWindowFactory() {};
- virtual HistoryWindow* createHistoryWindow() = 0;
+ virtual HistoryWindow* createHistoryWindow(UIEventStream* eventStream) = 0;
};
}