summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCatalin Badea <catalin.badea392@gmail.com>2012-07-29 16:39:43 (GMT)
committerCatalin Badea <catalin.badea392@gmail.com>2012-07-29 16:39:43 (GMT)
commit6db3199e0e2133c08609b42732194b041cd532ad (patch)
tree5f1cec69b245551ead409475f8a56abd179b3a7d /Swift/QtUI
parentfd9f71dca2777b4b13deb3e375b118dd55ae2c49 (diff)
downloadswift-contrib-6db3199e0e2133c08609b42732194b041cd532ad.zip
swift-contrib-6db3199e0e2133c08609b42732194b041cd532ad.tar.bz2
Properly handle new messages.
Diffstat (limited to 'Swift/QtUI')
-rw-r--r--Swift/QtUI/QtHistoryWindow.cpp15
-rw-r--r--Swift/QtUI/QtHistoryWindow.h3
2 files changed, 18 insertions, 0 deletions
diff --git a/Swift/QtUI/QtHistoryWindow.cpp b/Swift/QtUI/QtHistoryWindow.cpp
index d9b587f..94d604e 100644
--- a/Swift/QtUI/QtHistoryWindow.cpp
+++ b/Swift/QtUI/QtHistoryWindow.cpp
@@ -212,4 +212,19 @@ void QtHistoryWindow::resetConversationViewTopInsertPoint() {
conversation_->resetTopInsertPoint();
}
+std::string QtHistoryWindow::getSearchBoxText() {
+ return ui_.searchBox_->lineEdit()->text().toStdString();
+}
+
+boost::gregorian::date QtHistoryWindow::getLastVisibleDate() {
+ if (!dates_.empty()) {
+ QDate lastDate = *dates_.rbegin();
+ int year, month, day;
+ lastDate.getDate(&year, &month, &day);
+
+ return boost::gregorian::date(year, month, day);
+ }
+ return boost::gregorian::date(boost::gregorian::not_a_date_time);
+}
+
}
diff --git a/Swift/QtUI/QtHistoryWindow.h b/Swift/QtUI/QtHistoryWindow.h
index 13d3f14..49de098 100644
--- a/Swift/QtUI/QtHistoryWindow.h
+++ b/Swift/QtUI/QtHistoryWindow.h
@@ -31,6 +31,9 @@ namespace Swift {
void closeEvent(QCloseEvent* event);
void showEvent(QShowEvent* event);
+ std::string getSearchBoxText();
+ boost::gregorian::date getLastVisibleDate();
+
signals:
void fontResized(int);