From 7d53b6a3b139faeb7b12ec158ac88686dd41ed55 Mon Sep 17 00:00:00 2001 From: Vlad Voicu Date: Mon, 30 May 2011 21:02:15 +0300 Subject: History Window mockup diff --git a/Swift/QtUI/QtViewHistoryWindow.cpp b/Swift/QtUI/QtViewHistoryWindow.cpp index 71f77b8..56543a2 100644 --- a/Swift/QtUI/QtViewHistoryWindow.cpp +++ b/Swift/QtUI/QtViewHistoryWindow.cpp @@ -6,10 +6,19 @@ #include #include +#include +#include #include "QtViewHistoryWindow.h" #include "QtChatView.h" #include "QtChatTheme.h" +#include "MessageSnippet.h" +#include "QtSwiftUtil.h" +#include +#include + +#include +#include namespace Swift { @@ -17,7 +26,15 @@ QtViewHistoryWindow::QtViewHistoryWindow() { ui.setupUi(this); QtChatTheme *theme = new QtChatTheme(""); // Where should I get the theme path from? messageLog_ = new QtChatView(theme, this); - ui.chatView_->addWidget(messageLog_); + 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; + connect(ui.periodPickerBefore_, SIGNAL(valueChanged(int)), this, SLOT(handleBeforeSliderValueChanged(int))); + connect(ui.periodPickerAfter_, SIGNAL(valueChanged(int)), this, SLOT(handleAfterSliderValueChanged(int))); show(); } @@ -30,4 +47,42 @@ void QtViewHistoryWindow::setEnabled(bool enabled) { QWidget::setEnabled(enabled); } +std::string QtViewHistoryWindow::getLabel(const int value) { + std::string labelText; + switch (value / 16) { + case 0: + labelText = "1 day"; + break; + case 1: + labelText = "3 days"; + break; + case 2: + labelText = "1 week"; + break; + case 3: + labelText = "2 weeks"; + break; + case 4: + labelText = "1 month"; + break; + case 5: + labelText = "3 months"; + break; + case 6: + labelText = "1 year"; + break; + } + return labelText; +} + +void QtViewHistoryWindow::handleBeforeSliderValueChanged(const int value) { + QString labelText = P2QSTRING(getLabel(value)); + ui.beforePeriodLabel_->setText(labelText); +} + +void QtViewHistoryWindow::handleAfterSliderValueChanged(const int value) { + QString labelText = P2QSTRING(getLabel(value)); + ui.afterPeriodLabel_->setText(labelText); +} + } diff --git a/Swift/QtUI/QtViewHistoryWindow.h b/Swift/QtUI/QtViewHistoryWindow.h index 145731c..1ed5757 100644 --- a/Swift/QtUI/QtViewHistoryWindow.h +++ b/Swift/QtUI/QtViewHistoryWindow.h @@ -21,8 +21,12 @@ namespace Swift { QtViewHistoryWindow(); void show(); void setEnabled(bool enabled); + private slots: + void handleBeforeSliderValueChanged(const int value); + void handleAfterSliderValueChanged(const int value); private: + std::string getLabel(const int value); QtChatView* messageLog_; Ui::QtViewHistoryWindow ui; JID jid_; diff --git a/Swift/QtUI/QtViewHistoryWindow.ui b/Swift/QtUI/QtViewHistoryWindow.ui index 17a5b6b..736776f 100644 --- a/Swift/QtUI/QtViewHistoryWindow.ui +++ b/Swift/QtUI/QtViewHistoryWindow.ui @@ -6,174 +6,184 @@ 0 0 - 990 - 614 + 1237 + 899 Form - - - - 930 - 1100 - 131 - 17 - - - - Search keywords: - - - - - - 930 - 1120 - 651 - 31 - - - - - - - 1350 - 1100 - 61 - 16 - - - - Today - - - - - - 1590 - 620 - 256 - 531 - - - - - - - 1420 - 1100 - 160 - 16 - - - - Qt::Horizontal - - - - - - 100 - 30 - 871 - 571 - - - - - - - - - 610 - 20 - 251 - 471 - + + + + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + 350 + 800 + + + + + + + + + + + + + + Search keywords: + + + + + + + + 0 + 0 + + + + + 350 + 50 + + + + 24 + + + + + + + + + + + + 16777215 + 30 + + + + + + + + 0 + + + + + Before + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + After - - - - 20 - 20 - 581 - 471 - + + + + + + + 0 + + + + + Qt::Horizontal - - - - - 20 - 500 - 841 - 61 - + + + + + true + + + + + + + Qt::Horizontal + + + + + + + + + 0 + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + 100 + 50 + + + + Search - - - - - - - 0 - 20 - 841 - 31 - - - - - - - 0 - 0 - 131 - 17 - - - - Search keywords: - - - - - - 490 - 0 - 160 - 16 - - - - Qt::Horizontal - - - - - - 410 - 0 - 61 - 16 - - - - Today - - - - - - - - - + + + + -- cgit v0.10.2-6-g49f6