summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKevin Smith <git@kismith.co.uk>2011-11-01 23:04:03 (GMT)
committerKevin Smith <git@kismith.co.uk>2011-11-01 23:04:03 (GMT)
commit16d50c0df983e96a28a6572da27b3633b40a41d7 (patch)
tree9b7a74f074e33d00966b2e8bf71d31162fa619dc /Swift/QtUI/ChatList/QtChatListWindow.cpp
parenta710cb325c7827679c35c61ab41b821a5bc77673 (diff)
downloadswift-16d50c0df983e96a28a6572da27b3633b40a41d7.zip
swift-16d50c0df983e96a28a6572da27b3633b40a41d7.tar.bz2
Having a play with a compact roster mode
Diffstat (limited to 'Swift/QtUI/ChatList/QtChatListWindow.cpp')
-rw-r--r--Swift/QtUI/ChatList/QtChatListWindow.cpp30
1 files changed, 19 insertions, 11 deletions
diff --git a/Swift/QtUI/ChatList/QtChatListWindow.cpp b/Swift/QtUI/ChatList/QtChatListWindow.cpp
index e5c63f6..8de5720 100644
--- a/Swift/QtUI/ChatList/QtChatListWindow.cpp
+++ b/Swift/QtUI/ChatList/QtChatListWindow.cpp
@@ -9,24 +9,26 @@
#include <QMenu>
#include <QContextMenuEvent>
-#include "Swift/QtUI/ChatList/ChatListMUCItem.h"
-#include "Swift/QtUI/ChatList/ChatListRecentItem.h"
-#include "Swift/QtUI/QtAddBookmarkWindow.h"
-#include "Swift/QtUI/QtEditBookmarkWindow.h"
-#include "Swift/Controllers/UIEvents/JoinMUCUIEvent.h"
-#include "Swift/Controllers/UIEvents/RequestChatUIEvent.h"
-#include "Swift/Controllers/UIEvents/AddMUCBookmarkUIEvent.h"
-#include "Swift/Controllers/UIEvents/RemoveMUCBookmarkUIEvent.h"
-#include "Swift/Controllers/UIEvents/EditMUCBookmarkUIEvent.h"
+#include <Swift/QtUI/ChatList/ChatListMUCItem.h>
+#include <Swift/QtUI/ChatList/ChatListRecentItem.h>
+#include <Swift/QtUI/QtAddBookmarkWindow.h>
+#include <Swift/QtUI/QtEditBookmarkWindow.h>
+#include <Swift/Controllers/UIEvents/JoinMUCUIEvent.h>
+#include <Swift/Controllers/UIEvents/RequestChatUIEvent.h>
+#include <Swift/Controllers/UIEvents/AddMUCBookmarkUIEvent.h>
+#include <Swift/Controllers/UIEvents/RemoveMUCBookmarkUIEvent.h>
+#include <Swift/Controllers/UIEvents/EditMUCBookmarkUIEvent.h>
+#include <Swift/QtUI/QtUIPreferences.h>
namespace Swift {
-QtChatListWindow::QtChatListWindow(UIEventStream *uiEventStream, QWidget* parent) : QTreeView(parent) {
+QtChatListWindow::QtChatListWindow(UIEventStream *uiEventStream, QtUIPreferences* uiPreferences, QWidget* parent) : QTreeView(parent) {
eventStream_ = uiEventStream;
+ uiPreferences_ = uiPreferences;
bookmarksEnabled_ = false;
model_ = new ChatListModel();
setModel(model_);
- delegate_ = new ChatListDelegate();
+ delegate_ = new ChatListDelegate(uiPreferences_->getCompactRosters());
setItemDelegate(delegate_);
setHeaderHidden(true);
#ifdef SWIFT_PLATFORM_MACOSX
@@ -39,6 +41,7 @@ QtChatListWindow::QtChatListWindow(UIEventStream *uiEventStream, QWidget* parent
setupContextMenus();
connect(this, SIGNAL(activated(const QModelIndex&)), this, SLOT(handleItemActivated(const QModelIndex&)));
connect(this, SIGNAL(clicked(const QModelIndex&)), this, SLOT(handleClicked(const QModelIndex&)));
+ connect(uiPreferences_, SIGNAL(onCompactRostersChanged(bool)), this, SLOT(handleCompactRostersToggled(bool)));
}
QtChatListWindow::~QtChatListWindow() {
@@ -48,6 +51,11 @@ QtChatListWindow::~QtChatListWindow() {
delete emptyMenu_;
}
+void QtChatListWindow::handleCompactRostersToggled(bool compact) {
+ delegate_->setCompact(compact);
+ repaint();
+}
+
void QtChatListWindow::setBookmarksEnabled(bool enabled) {
bookmarksEnabled_ = enabled;
}