summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVlad Voicu <vladvoic@gmail.com>2011-05-31 19:30:55 (GMT)
committerVlad Voicu <vladvoic@gmail.com>2011-05-31 19:30:55 (GMT)
commit4c7bc4e22039f5b6c98eea584ec7103bfe04c155 (patch)
tree985dde55252b5c01143051abd90fe086f9d271ac
parentfc873c7c00066f787b027717fdc9870c0d61f877 (diff)
downloadswift-contrib-vladv/history.zip
swift-contrib-vladv/history.tar.bz2
Added dummy messages that workvladv/history
-rw-r--r--Swift/QtUI/QtViewHistoryWindow.cpp12
-rw-r--r--Swift/QtUI/QtViewHistoryWindow.ui23
2 files changed, 16 insertions, 19 deletions
diff --git a/Swift/QtUI/QtViewHistoryWindow.cpp b/Swift/QtUI/QtViewHistoryWindow.cpp
index b862971..e81eabd 100644
--- a/Swift/QtUI/QtViewHistoryWindow.cpp
+++ b/Swift/QtUI/QtViewHistoryWindow.cpp
@@ -26,12 +26,12 @@ namespace Swift {
QtViewHistoryWindow::QtViewHistoryWindow() {
ui.setupUi(this);
- QStandardItemModel *dummyModel = new QStandardItemModel(1, 1);
+ QStandardItemModel *dummyModel = new QStandardItemModel(2, 2);
QStandardItem *item = new QStandardItem(QString("test row, test column"));
+ QStandardItem *item2 = new QStandardItem(QString("test row2, test column2"));
dummyModel->setItem(0, 0, item);
- QTreeView *userHistory = new QTreeView();
- userHistory->setModel(dummyModel);
- ui.userHistory_ = userHistory;
+ dummyModel->setItem(0, 1, item2);
+ ui.userHistory_->setModel(dummyModel);
addDummyMessage();
connect(ui.periodPickerBefore_, SIGNAL(valueChanged(int)), this, SLOT(handleBeforeSliderValueChanged(int)));
connect(ui.periodPickerAfter_, SIGNAL(valueChanged(int)), this, SLOT(handleAfterSliderValueChanged(int)));
@@ -42,14 +42,14 @@ 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);
+ QtChatView* messageLog_ = new QtChatView(theme, NULL);
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_;
+ ui.chatView_->addWidget(messageLog_);
}
void QtViewHistoryWindow::show() {
diff --git a/Swift/QtUI/QtViewHistoryWindow.ui b/Swift/QtUI/QtViewHistoryWindow.ui
index 736776f..e90d03f 100644
--- a/Swift/QtUI/QtViewHistoryWindow.ui
+++ b/Swift/QtUI/QtViewHistoryWindow.ui
@@ -17,29 +17,26 @@
<item>
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
- <widget class="QWidget" name="chatView_" native="true"/>
- </item>
- <item>
- <spacer name="horizontalSpacer">
- <property name="orientation">
- <enum>Qt::Horizontal</enum>
+ <layout class="QVBoxLayout" name="chatView_">
+ <property name="leftMargin">
+ <number>0</number>
</property>
- <property name="sizeHint" stdset="0">
- <size>
- <width>40</width>
- <height>20</height>
- </size>
+ <property name="rightMargin">
+ <number>0</number>
</property>
- </spacer>
+ </layout>
</item>
<item>
<widget class="QTreeView" name="userHistory_">
<property name="maximumSize">
<size>
- <width>350</width>
+ <width>400</width>
<height>800</height>
</size>
</property>
+ <attribute name="headerDefaultSectionSize">
+ <number>100</number>
+ </attribute>
</widget>
</item>
</layout>