summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'Swift/QtUI/ChatList/QtChatListWindow.cpp')
-rw-r--r--Swift/QtUI/ChatList/QtChatListWindow.cpp38
1 files changed, 38 insertions, 0 deletions
diff --git a/Swift/QtUI/ChatList/QtChatListWindow.cpp b/Swift/QtUI/ChatList/QtChatListWindow.cpp
new file mode 100644
index 0000000..b9d645d
--- /dev/null
+++ b/Swift/QtUI/ChatList/QtChatListWindow.cpp
@@ -0,0 +1,38 @@
+#include "Swift/QtUI/ChatList/QtChatListWindow.h"
+
+namespace Swift {
+
+QtChatListWindow::QtChatListWindow(UIEventStream *uiEventStream, QWidget* parent) : QTreeView(parent) {
+ eventStream_ = uiEventStream;
+ model_ = new ChatListModel();
+ setModel(model_);
+ delegate_ = new ChatListDelegate();
+ setItemDelegate(delegate_);
+ setHeaderHidden(true);
+ #ifdef SWIFT_PLATFORM_MACOSX
+ setAlternatingRowColors(true);
+#endif
+ setAnimated(true);
+ setIndentation(0);
+ setRootIsDecorated(true);
+ connect(this, SIGNAL(activated(const QModelIndex&)), this, SLOT(handleItemActivated(const QModelIndex&)));
+}
+
+QtChatListWindow::~QtChatListWindow() {
+ delete model_;
+ delete delegate_;
+}
+
+void QtChatListWindow::handleItemActivated(const QModelIndex& item) {
+
+}
+
+void QtChatListWindow::addMUCBookmark(boost::shared_ptr<MUCBookmark> bookmark) {
+ model_->addMUCBookmark(bookmark);
+}
+
+void QtChatListWindow::removeMUCBookmark(boost::shared_ptr<MUCBookmark> bookmark) {
+ model_->removeMUCBookmark(bookmark);
+}
+
+}