diff options
| author | Catalin Badea <catalin.badea392@gmail.com> | 2012-07-20 13:14:32 (GMT) | 
|---|---|---|
| committer | Catalin Badea <catalin.badea392@gmail.com> | 2012-07-20 13:14:32 (GMT) | 
| commit | 5dae00214a546fd78c40cf49d3d6da1e41cca405 (patch) | |
| tree | 8bbd99c280b5d489f1be97321c5580c9d4f7ad37 | |
| parent | 9ccedec3844df80241c65dc6fb24d97efc2f41fc (diff) | |
| download | swift-contrib-5dae00214a546fd78c40cf49d3d6da1e41cca405.zip swift-contrib-5dae00214a546fd78c40cf49d3d6da1e41cca405.tar.bz2  | |
Set the date when selecting a contact
| -rw-r--r-- | Swift/Controllers/HistoryViewController.cpp | 2 | ||||
| -rw-r--r-- | Swift/Controllers/UIInterfaces/HistoryWindow.h | 1 | ||||
| -rw-r--r-- | Swift/QtUI/QtHistoryWindow.cpp | 4 | ||||
| -rw-r--r-- | Swift/QtUI/QtHistoryWindow.h | 1 | 
4 files changed, 8 insertions, 0 deletions
diff --git a/Swift/Controllers/HistoryViewController.cpp b/Swift/Controllers/HistoryViewController.cpp index 8efdc99..6ec8a3e 100644 --- a/Swift/Controllers/HistoryViewController.cpp +++ b/Swift/Controllers/HistoryViewController.cpp @@ -103,6 +103,8 @@ void HistoryViewController::handleSelectedContactChanged(RosterItem* newContact)  		currentItemType_ = HistoryMessage::Groupchat;  	} +	historyWindow_->setDate(currentResultDate_); +  	foreach (const HistoryMessage& message, messages) {  		addNewMessage(message, false);  	} diff --git a/Swift/Controllers/UIInterfaces/HistoryWindow.h b/Swift/Controllers/UIInterfaces/HistoryWindow.h index effff27..03f4886 100644 --- a/Swift/Controllers/UIInterfaces/HistoryWindow.h +++ b/Swift/Controllers/UIInterfaces/HistoryWindow.h @@ -17,6 +17,7 @@ namespace Swift {  			virtual void setRosterModel(Roster*) = 0;  			virtual void addMessage(const std::string &message, const std::string &senderName, bool senderIsSelf, const std::string& avatarPath, const boost::posix_time::ptime& time, bool addAtTheTop) = 0;  			virtual void resetConversationView() = 0; +			virtual void setDate(const boost::gregorian::date& date) = 0;  			boost::signal<void (RosterItem*)> onSelectedContactChanged;  			boost::signal<void (const std::string&)> onReturnPressed; diff --git a/Swift/QtUI/QtHistoryWindow.cpp b/Swift/QtUI/QtHistoryWindow.cpp index feec059..6e779ea 100644 --- a/Swift/QtUI/QtHistoryWindow.cpp +++ b/Swift/QtUI/QtHistoryWindow.cpp @@ -165,4 +165,8 @@ void QtHistoryWindow::handleReturnPressed() {  void QtHistoryWindow::handleCalendarClicked(const QDate& date) {  } +void QtHistoryWindow::setDate(const boost::gregorian::date& date) { +	ui_.calendarWidget_->setSelectedDate(QDate::fromJulianDay(date.julian_day())); +} +  } diff --git a/Swift/QtUI/QtHistoryWindow.h b/Swift/QtUI/QtHistoryWindow.h index 97b9866..721b4da 100644 --- a/Swift/QtUI/QtHistoryWindow.h +++ b/Swift/QtUI/QtHistoryWindow.h @@ -25,6 +25,7 @@ namespace Swift {  			void setRosterModel(Roster*);  			void addMessage(const std::string &message, const std::string &senderName, bool senderIsSelf, const std::string& avatarPath, const boost::posix_time::ptime& time, bool addAtTheTop);  			void resetConversationView(); +			void setDate(const boost::gregorian::date& date);  			void closeEvent(QCloseEvent* event);  			void showEvent(QShowEvent* event);  | 
 Swift