From fc873c7c00066f787b027717fdc9870c0d61f877 Mon Sep 17 00:00:00 2001
From: Vlad Voicu <vladvoic@gmail.com>
Date: Mon, 30 May 2011 23:40:31 +0300
Subject: Added dummy message that does not work


diff --git a/Swift/QtUI/QtViewHistoryWindow.cpp b/Swift/QtUI/QtViewHistoryWindow.cpp
index 56543a2..b862971 100644
--- a/Swift/QtUI/QtViewHistoryWindow.cpp
+++ b/Swift/QtUI/QtViewHistoryWindow.cpp
@@ -18,26 +18,40 @@
 #include <QStandardItemModel>
 
 #include <boost/bind.hpp>
-#include <cstdio>
+#include <stdio.h>
+
+#include "boost/date_time/posix_time/posix_time.hpp"
 
 namespace Swift {
 
 QtViewHistoryWindow::QtViewHistoryWindow() {
 	ui.setupUi(this);
-	QtChatTheme *theme = new QtChatTheme(""); // Where should I get the theme path from?
-	messageLog_ = new QtChatView(theme, this);
-	ui.chatView_ = messageLog_;
 	QStandardItemModel *dummyModel = new QStandardItemModel(1, 1);
 	QStandardItem *item = new QStandardItem(QString("test row, test column"));
 	dummyModel->setItem(0, 0, item);
 	QTreeView *userHistory = new QTreeView();
 	userHistory->setModel(dummyModel);
 	ui.userHistory_ = userHistory;
+	addDummyMessage();
 	connect(ui.periodPickerBefore_, SIGNAL(valueChanged(int)), this, SLOT(handleBeforeSliderValueChanged(int)));
 	connect(ui.periodPickerAfter_, SIGNAL(valueChanged(int)), this, SLOT(handleAfterSliderValueChanged(int)));
 	show();
 }
 
+void QtViewHistoryWindow::addDummyMessage() {
+	QtChatTheme *theme = new QtChatTheme(""); // Where should I get the theme path from?
+	QString *htmlString = new QString("test");
+	boost::posix_time::ptime time = boost::posix_time::microsec_clock::universal_time();
+	QtChatView* messageLog_ = new QtChatView(theme, 0);
+	std::string id = "test";
+	std::string path = "";
+	messageLog_->addMessage(boost::shared_ptr <ChatSnippet>(new MessageSnippet(*htmlString, *htmlString, B2QDATE(time), P2QSTRING(path), true, false, theme, P2QSTRING(id))));
+	messageLog_->addMessage(boost::shared_ptr <ChatSnippet>(new MessageSnippet(*htmlString, *htmlString, B2QDATE(time), P2QSTRING(path), true, false, theme, P2QSTRING(id))));
+	messageLog_->addMessage(boost::shared_ptr <ChatSnippet>(new MessageSnippet(*htmlString, *htmlString, B2QDATE(time), P2QSTRING(path), true, false, theme, P2QSTRING(id))));
+	messageLog_->addMessage(boost::shared_ptr <ChatSnippet>(new MessageSnippet(*htmlString, *htmlString, B2QDATE(time), P2QSTRING(path), true, false, theme, P2QSTRING(id))));
+	ui.chatView_ = messageLog_;
+}
+
 void QtViewHistoryWindow::show() {
 	QWidget::show();
 	QWidget::activateWindow();
diff --git a/Swift/QtUI/QtViewHistoryWindow.h b/Swift/QtUI/QtViewHistoryWindow.h
index 1ed5757..d1a0203 100644
--- a/Swift/QtUI/QtViewHistoryWindow.h
+++ b/Swift/QtUI/QtViewHistoryWindow.h
@@ -26,6 +26,7 @@ namespace Swift {
 			void handleAfterSliderValueChanged(const int value);
 
 		private:
+			void addDummyMessage();
 			std::string getLabel(const int value);
 			QtChatView* messageLog_;
 			Ui::QtViewHistoryWindow ui;
-- 
cgit v0.10.2-6-g49f6