diff options
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; |
