diff options
| author | Catalin Badea <catalin.badea392@gmail.com> | 2012-06-19 20:16:09 (GMT) | 
|---|---|---|
| committer | Catalin Badea <catalin.badea392@gmail.com> | 2012-06-19 20:21:54 (GMT) | 
| commit | cba5a2aa6db557102998028977e4d84d25181304 (patch) | |
| tree | 91736a7baadbbdee6a5e64396fd034fb15f43b69 /Swift/QtUI/QtHistoryWindow.cpp | |
| parent | 063e2e2f59d294bd632942266773d61f5a815e27 (diff) | |
| download | swift-contrib-cba5a2aa6db557102998028977e4d84d25181304.zip swift-contrib-cba5a2aa6db557102998028977e4d84d25181304.tar.bz2  | |
Added contact roster
Diffstat (limited to 'Swift/QtUI/QtHistoryWindow.cpp')
| -rw-r--r-- | Swift/QtUI/QtHistoryWindow.cpp | 32 | 
1 files changed, 24 insertions, 8 deletions
diff --git a/Swift/QtUI/QtHistoryWindow.cpp b/Swift/QtUI/QtHistoryWindow.cpp index 192406e..4b459de 100644 --- a/Swift/QtUI/QtHistoryWindow.cpp +++ b/Swift/QtUI/QtHistoryWindow.cpp @@ -16,25 +16,37 @@  namespace Swift { -QtHistoryWindow::QtHistoryWindow() { +QtHistoryWindow::QtHistoryWindow(SettingsProvider* settings, UIEventStream* eventStream) {  	ui_.setupUi(this);  	QtChatTheme* theme = new QtChatTheme(""); // FIXME: leak -	delete ui_.conversation; +	delete ui_.conversation_;  	conversation_ = new QtChatView(theme, this);  	QSizePolicy sizePolicy(QSizePolicy::Expanding, QSizePolicy::Preferred);  	sizePolicy.setHorizontalStretch(80);  	sizePolicy.setVerticalStretch(0);  	conversation_->setSizePolicy(sizePolicy); -	ui_.conversation = conversation_; -	ui_.bottomLayout->addWidget(conversation_); +	ui_.conversation_ = conversation_; +	ui_.bottomLayout_->addWidget(conversation_); -	conversation_->addMessage(boost::make_shared<MessageSnippet>("hey", "Me", QDateTime::currentDateTime(), "http://swarm.cs.pub.ro/~cbadea/storage/iron_man.png", false, false, theme, "id")); -	conversation_->addMessage(boost::make_shared<MessageSnippet>("hey", "You", QDateTime::currentDateTime(), "http://swarm.cs.pub.ro/~cbadea/storage/war_machine.png", true, false, theme, "id2")); -	conversation_->addMessage(boost::make_shared<MessageSnippet>("knock knock", "Me", QDateTime::currentDateTime(), "http://swarm.cs.pub.ro/~cbadea/storage/iron_man.png", false, false, theme, "id")); -	conversation_->addMessage(boost::make_shared<MessageSnippet>("who's there?", "You", QDateTime::currentDateTime(), "http://swarm.cs.pub.ro/~cbadea/storage/war_machine.png", true, false, theme, "id2")); +	delete ui_.conversationRoster_; +	conversationRoster_ = new QtRosterWidget(eventStream, settings, this); +	QSizePolicy sizePolicy2(QSizePolicy::Preferred, QSizePolicy::Expanding); +	sizePolicy2.setVerticalStretch(80); +	conversationRoster_->setSizePolicy(sizePolicy2); +	ui_.conversationRoster_ = conversationRoster_; +	ui_.bottomLeftLayout_->setDirection(QBoxLayout::BottomToTop); +	ui_.bottomLeftLayout_->addWidget(conversationRoster_); + +	conversation_->addMessage(boost::make_shared<MessageSnippet>("Hi", "Me", QDateTime::currentDateTime(), "http://swarm.cs.pub.ro/~cbadea/swift/iron-man.png", false, false, theme, "id")); +	conversation_->addMessage(boost::make_shared<MessageSnippet>("Hi", "You", QDateTime::currentDateTime(), "http://swarm.cs.pub.ro/~cbadea/swift/putin.png", true, false, theme, "id2")); +	conversation_->addMessage(boost::make_shared<MessageSnippet>("How is it going?", "Me", QDateTime::currentDateTime(), "http://swarm.cs.pub.ro/~cbadea/swift/iron-man.png", false, false, theme, "id")); +	conversation_->addMessage(boost::make_shared<MessageSnippet>("Fine, just going through some documents.", "You", QDateTime::currentDateTime(), "http://swarm.cs.pub.ro/~cbadea/swift/putin.png", true, false, theme, "id2")); +	conversation_->addMessage(boost::make_shared<MessageSnippet>("Cool. Hey, do you want to go for a beer?", "Me", QDateTime::currentDateTime(), "http://swarm.cs.pub.ro/~cbadea/swift/iron-man.png", false, false, theme, "id")); +	conversation_->addMessage(boost::make_shared<MessageSnippet>("Sure. Meet me at the pub around 10?", "You", QDateTime::currentDateTime(), "http://swarm.cs.pub.ro/~cbadea/swift/putin.png", true, false, theme, "id2")); +	conversation_->addMessage(boost::make_shared<MessageSnippet>("See you there.", "Me", QDateTime::currentDateTime(), "http://swarm.cs.pub.ro/~cbadea/swift/iron-man.png", false, false, theme, "id"));  	setWindowTitle(tr("History"));  } @@ -57,4 +69,8 @@ void QtHistoryWindow::closeEvent(QCloseEvent* event) {  	event->accept();  } +void QtHistoryWindow::setRosterModel(Roster* model) { +	conversationRoster_->setRosterModel(model); +} +  }  | 
 Swift