diff options
| author | Simon Robertshaw <simon@hardwired.org.uk> | 2012-08-12 14:15:47 (GMT) |
|---|---|---|
| committer | Simon Robertshaw <simon@hardwired.org.uk> | 2012-08-12 14:15:47 (GMT) |
| commit | 5d3d1d4916cf6d126b54c8bbfb9ba67e27a2e789 (patch) | |
| tree | c25f80f42de7d771011f5809bb34ea58d6f50938 /src/search/SearchView.cpp | |
| parent | 08b4e5553aa10df74c4fdb0ba519fb700fa8100b (diff) | |
| download | powder-5d3d1d4916cf6d126b54c8bbfb9ba67e27a2e789.zip powder-5d3d1d4916cf6d126b54c8bbfb9ba67e27a2e789.tar.gz | |
Message of the day and user session check on startup
Diffstat (limited to 'src/search/SearchView.cpp')
| -rw-r--r-- | src/search/SearchView.cpp | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/search/SearchView.cpp b/src/search/SearchView.cpp index 7603bd0..5e42289 100644 --- a/src/search/SearchView.cpp +++ b/src/search/SearchView.cpp @@ -20,6 +20,7 @@ SearchView::SearchView(): previousButton = new ui::Button(ui::Point(1, YRES+MENUSIZE-18), ui::Point(50, 16), "\x96 Prev"); infoLabel = new ui::Label(ui::Point(51, YRES+MENUSIZE-18), ui::Point(XRES+BARSIZE-102, 16), "Loading..."); tagsLabel = new ui::Label(ui::Point(51, YRES+MENUSIZE-18), ui::Point(XRES+BARSIZE-102, 16), "\boPopular Tags:"); + motdLabel = new ui::Label(ui::Point(51, YRES+MENUSIZE-18), ui::Point(XRES+BARSIZE-102, 16), Client::Ref().GetMessageOfTheDay()); class SearchAction : public ui::TextboxAction { @@ -215,6 +216,11 @@ SearchView::SearchView(): CheckAccess(); } +void SearchView::NotifyMessageOfTheDay(Client * sender) +{ + motdLabel->SetText(sender->GetMessageOfTheDay()); +} + void SearchView::doSearch() { c->DoSearch(searchField->GetText()); @@ -383,6 +389,9 @@ void SearchView::NotifySaveListChanged(SearchModel * sender) vector<pair<string, int> > tags = sender->GetTagList(); //string messageOfTheDay = sender->GetMessageOfTheDay(); + RemoveComponent(motdLabel); + motdLabel->SetParentWindow(NULL); + RemoveComponent(tagsLabel); tagsLabel->SetParentWindow(NULL); @@ -460,6 +469,9 @@ void SearchView::NotifySaveListChanged(SearchModel * sender) AddComponent(tagsLabel); tagsLabel->Position.Y = tagYOffset-16; + + AddComponent(motdLabel); + motdLabel->Position.Y = tagYOffset-28; } buttonWidth = (buttonAreaWidth/savesX) - buttonPadding*2; |
