diff options
Diffstat (limited to 'Swift/QtUI')
-rw-r--r-- | Swift/QtUI/QtUIFactory.cpp | 6 | ||||
-rw-r--r-- | Swift/QtUI/QtUIFactory.h | 2 | ||||
-rw-r--r-- | Swift/QtUI/QtViewHistoryWindow.cpp | 31 | ||||
-rw-r--r-- | Swift/QtUI/QtViewHistoryWindow.h | 28 | ||||
-rw-r--r-- | Swift/QtUI/Roster/QtTreeWidget.cpp | 3 | ||||
-rw-r--r-- | Swift/QtUI/SConscript | 1 |
6 files changed, 70 insertions, 1 deletions
diff --git a/Swift/QtUI/QtUIFactory.cpp b/Swift/QtUI/QtUIFactory.cpp index 40ce95e..f5772bf 100644 --- a/Swift/QtUI/QtUIFactory.cpp +++ b/Swift/QtUI/QtUIFactory.cpp @@ -7,6 +7,7 @@ #include "QtUIFactory.h" #include <QSplitter> +#include <QtDebug> #include "QtXMLConsoleWidget.h" #include "QtChatTabs.h" @@ -23,6 +24,7 @@ #include "UserSearch/QtUserSearchWindow.h" #include "QtProfileWindow.h" #include "QtContactEditWindow.h" +#include "QtViewHistoryWindow.h" #include "QtAdHocCommandWindow.h" #define CHATWINDOW_FONT_SIZE "chatWindowFontSize" @@ -124,6 +126,10 @@ ContactEditWindow* QtUIFactory::createContactEditWindow() { return new QtContactEditWindow(); } +ViewHistoryWindow* QtUIFactory::createViewHistoryWindow() { + return new QtViewHistoryWindow(); +} + void QtUIFactory::createAdHocCommandWindow(boost::shared_ptr<OutgoingAdHocCommandSession> command) { new QtAdHocCommandWindow(command); } diff --git a/Swift/QtUI/QtUIFactory.h b/Swift/QtUI/QtUIFactory.h index a576ded..895440a 100644 --- a/Swift/QtUI/QtUIFactory.h +++ b/Swift/QtUI/QtUIFactory.h @@ -39,6 +39,7 @@ namespace Swift { virtual JoinMUCWindow* createJoinMUCWindow(); virtual ProfileWindow* createProfileWindow(); virtual ContactEditWindow* createContactEditWindow(); + virtual ViewHistoryWindow* createViewHistoryWindow(); virtual void createAdHocCommandWindow(boost::shared_ptr<OutgoingAdHocCommandSession> command); private slots: @@ -51,6 +52,7 @@ namespace Swift { QSplitter* netbookSplitter; QtSystemTray* systemTray; QtChatWindowFactory* chatWindowFactory; + QtChatWindowFactory* viewHistoryFactory; QtMainWindow* lastMainWindow; QtLoginWindow* loginWindow; std::vector<QPointer<QtChatWindow> > chatWindows; diff --git a/Swift/QtUI/QtViewHistoryWindow.cpp b/Swift/QtUI/QtViewHistoryWindow.cpp new file mode 100644 index 0000000..2f3bd9e --- /dev/null +++ b/Swift/QtUI/QtViewHistoryWindow.cpp @@ -0,0 +1,31 @@ +/* + * Copyright (c) 2011 Vlad Voicu + * Licensed under the Simplified BSD license. + * See Documentation/Licenses/BSD-simplified.txt for more information. + */ + +#include "QtViewHistoryWindow.h" +#include <QWidget> +#include "QtDebug" +#include <QBoxLayout> + +namespace Swift { + +QtViewHistoryWindow::QtViewHistoryWindow() { + qDebug() << "I am here"; +} + +void QtViewHistoryWindow::show() { + QWidget::show(); + QWidget::activateWindow(); +} + +void QtViewHistoryWindow::hide() { + QWidget::hide(); +} + +void QtViewHistoryWindow::setEnabled(bool b) { + QWidget::setEnabled(b); +} + +} diff --git a/Swift/QtUI/QtViewHistoryWindow.h b/Swift/QtUI/QtViewHistoryWindow.h new file mode 100644 index 0000000..3fcd7e4 --- /dev/null +++ b/Swift/QtUI/QtViewHistoryWindow.h @@ -0,0 +1,28 @@ +/* + * Copyright (c) 2011 Vlad Voicu + * Licensed under the Simplified BSD license. + * See Documentation/Licenses/BSD-simplified.txt for more information. + */ + +#pragma once + +#include <QWidget> + +#include <Swift/Controllers/UIInterfaces/ViewHistoryWindow.h> + +#include <Swiften/JID/JID.h> + +namespace Swift { + class QtViewHistoryWindow : public QWidget, public ViewHistoryWindow { + Q_OBJECT + public: + QtViewHistoryWindow(); + void show(); + void hide(); + void setEnabled(bool b); + + private: + JID jid_; + }; +} + diff --git a/Swift/QtUI/Roster/QtTreeWidget.cpp b/Swift/QtUI/Roster/QtTreeWidget.cpp index dcf5bfc..aeaca1a 100644 --- a/Swift/QtUI/Roster/QtTreeWidget.cpp +++ b/Swift/QtUI/Roster/QtTreeWidget.cpp @@ -17,6 +17,7 @@ #include "Swift/Controllers/UIEvents/UIEventStream.h" #include "Swift/Controllers/UIEvents/RequestChatUIEvent.h" #include "Swift/Controllers/UIEvents/RequestContactEditorUIEvent.h" +#include "Swift/Controllers/UIEvents/RequestViewHistoryUIEvent.h" #include "Swift/Controllers/UIEvents/RemoveRosterItemUIEvent.h" #include "Swift/Controllers/UIEvents/RenameGroupUIEvent.h" #include "QtSwiftUtil.h" @@ -154,7 +155,7 @@ void QtTreeWidget::contextMenuEvent(QContextMenuEvent* event) { } } else if (result == viewHistory) { - //TODO Handle history request + eventStream_->send(boost::make_shared<RequestViewHistoryUIEvent>(contact->getJID())); } } else if (GroupRosterItem* group = dynamic_cast<GroupRosterItem*>(item)) { diff --git a/Swift/QtUI/SConscript b/Swift/QtUI/SConscript index 6157cab..e475388 100644 --- a/Swift/QtUI/SConscript +++ b/Swift/QtUI/SConscript @@ -90,6 +90,7 @@ sources = [ "QtAddBookmarkWindow.cpp", "QtEditBookmarkWindow.cpp", "QtContactEditWindow.cpp", + "QtViewHistoryWindow.cpp", "QtContactEditWidget.cpp", "ChatSnippet.cpp", "MessageSnippet.cpp", |