summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVlad Voicu <vladvoic@gmail.com>2011-05-30 20:40:31 (GMT)
committerVlad Voicu <vladvoic@gmail.com>2011-05-31 18:34:03 (GMT)
commitfc873c7c00066f787b027717fdc9870c0d61f877 (patch)
tree46dfd0173d20e0fc4d4d34eab33b6de469f3d0ce /Swift/QtUI
parent7d53b6a3b139faeb7b12ec158ac88686dd41ed55 (diff)
downloadswift-contrib-fc873c7c00066f787b027717fdc9870c0d61f877.zip
swift-contrib-fc873c7c00066f787b027717fdc9870c0d61f877.tar.bz2
Added dummy message that does not work
Diffstat (limited to 'Swift/QtUI')
-rw-r--r--Swift/QtUI/QtViewHistoryWindow.cpp22
-rw-r--r--Swift/QtUI/QtViewHistoryWindow.h1
2 files changed, 19 insertions, 4 deletions
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;