summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCatalin Badea <catalin.badea392@gmail.com>2012-06-11 14:40:15 (GMT)
committerCatalin Badea <catalin.badea392@gmail.com>2012-06-19 20:21:54 (GMT)
commitc5ce3d4e731058081ac62d06d15367612cc48bd8 (patch)
treeba71e5768ebb035eb4dfdb507fb5d51523e82692 /Swift/QtUI
parent8e90fc4fb400b925dfb7897b47ecb1ffd0d13538 (diff)
downloadswift-contrib-c5ce3d4e731058081ac62d06d15367612cc48bd8.zip
swift-contrib-c5ce3d4e731058081ac62d06d15367612cc48bd8.tar.bz2
Added mock-up ui
Diffstat (limited to 'Swift/QtUI')
-rw-r--r--Swift/QtUI/QtHistoryWindow.cpp33
-rw-r--r--Swift/QtUI/QtHistoryWindow.h5
-rw-r--r--Swift/QtUI/SConscript1
3 files changed, 22 insertions, 17 deletions
diff --git a/Swift/QtUI/QtHistoryWindow.cpp b/Swift/QtUI/QtHistoryWindow.cpp
index 6868ca5..aaf4d65 100644
--- a/Swift/QtUI/QtHistoryWindow.cpp
+++ b/Swift/QtUI/QtHistoryWindow.cpp
@@ -7,32 +7,31 @@
#include <QtHistoryWindow.h>
#include <QtTabbable.h>
-#include <QCloseEvent>
-#include <QTextEdit>
-#include <QVBoxLayout>
-#include <QPushButton>
-#include <QScrollBar>
-#include <QCheckBox>
-
#include <QtSwiftUtil.h>
+#include <MessageSnippet.h>
#include <string>
namespace Swift {
QtHistoryWindow::QtHistoryWindow() {
- QVBoxLayout* layout = new QVBoxLayout(this);
- layout->setSpacing(0);
- layout->setContentsMargins(0,0,0,0);
+ ui_.setupUi(this);
+
+ QtChatTheme* theme = new QtChatTheme(""); // FIXME: leak
- QWidget* bottom = new QWidget(this);
- layout->addWidget(bottom);
- bottom->setAutoFillBackground(true);
+ delete ui_.conversation;
+ conversation_ = new QtChatView(theme, this);
+ QSizePolicy sizePolicy(QSizePolicy::Expanding, QSizePolicy::Preferred);
+ sizePolicy.setHorizontalStretch(80);
+ sizePolicy.setVerticalStretch(0);
+ conversation_->setSizePolicy(sizePolicy);
- QHBoxLayout* buttonLayout = new QHBoxLayout(bottom);
- buttonLayout->setContentsMargins(10,0,20,0);
- buttonLayout->setSpacing(0);
+ ui_.conversation = conversation_;
+ ui_.bottomLayout->addWidget(conversation_);
- buttonLayout->addStretch();
+ 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"));
setWindowTitle(tr("History"));
}
diff --git a/Swift/QtUI/QtHistoryWindow.h b/Swift/QtUI/QtHistoryWindow.h
index eacba8d..08db473 100644
--- a/Swift/QtUI/QtHistoryWindow.h
+++ b/Swift/QtUI/QtHistoryWindow.h
@@ -7,6 +7,8 @@
#pragma once
#include <Swift/Controllers/UIInterfaces/HistoryWindow.h>
+#include <Swift/QtUI/ui_QtHistoryWindow.h>
+#include <QtChatView.h>
#include <QtTabbable.h>
class QTextEdit;
@@ -25,5 +27,8 @@ namespace Swift {
private:
virtual void closeEvent(QCloseEvent* event);
virtual void showEvent(QShowEvent* event);
+
+ Ui::QtHistoryWindow ui_;
+ QtChatView* conversation_;
};
}
diff --git a/Swift/QtUI/SConscript b/Swift/QtUI/SConscript
index 2da5535..02ca668 100644
--- a/Swift/QtUI/SConscript
+++ b/Swift/QtUI/SConscript
@@ -198,6 +198,7 @@ myenv.Uic4("UserSearch/QtUserSearchResultsPage.ui")
myenv.Uic4("QtBookmarkDetailWindow.ui")
myenv.Uic4("QtAffiliationEditor.ui")
myenv.Uic4("QtJoinMUCWindow.ui")
+myenv.Uic4("QtHistoryWindow.ui")
myenv.Qrc("DefaultTheme.qrc")
myenv.Qrc("Swift.qrc")