diff options
Diffstat (limited to 'Swift/QtUI')
-rw-r--r-- | Swift/QtUI/QtHistoryWindow.cpp | 15 | ||||
-rw-r--r-- | Swift/QtUI/QtHistoryWindow.h | 3 |
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); |