diff options
author | Lynx Linden <lynx@lindenlab.com> | 2009-12-10 19:02:33 +0000 |
---|---|---|
committer | Lynx Linden <lynx@lindenlab.com> | 2009-12-10 19:02:33 +0000 |
commit | d06ef8878388b8b9956b385a74b7114a82de2355 (patch) | |
tree | 4aa30f1b69baf683830abd7191e35ff9305d0644 /indra/newview | |
parent | 1ab022df432b529fffb3a7f0772dff16a2c195ed (diff) |
DEV-43679: Display god level warning in Search window.
If you change your god level from when you performed a search, the
search results may be inappropriate for your god level (we pass the
current god status to the search web pages). When this is the case, we
now display a warning at the bottom of the search floater to let the
user know that they should redo their search.
Diffstat (limited to 'indra/newview')
-rw-r--r-- | indra/newview/llfloatersearch.cpp | 18 | ||||
-rw-r--r-- | indra/newview/llfloatersearch.h | 8 | ||||
-rw-r--r-- | indra/newview/llviewermenu.cpp | 8 | ||||
-rw-r--r-- | indra/newview/skins/default/xui/en/floater_search.xml | 14 |
4 files changed, 44 insertions, 4 deletions
diff --git a/indra/newview/llfloatersearch.cpp b/indra/newview/llfloatersearch.cpp index 2c618263ec..c658963708 100644 --- a/indra/newview/llfloatersearch.cpp +++ b/indra/newview/llfloatersearch.cpp @@ -42,7 +42,8 @@ LLFloaterSearch::LLFloaterSearch(const LLSD& key) : LLFloater(key), LLViewerMediaObserver(), - mBrowser(NULL) + mBrowser(NULL), + mSearchGodLevel(0) { // declare a map that transforms a category name into // the URL suffix that is used to search that category @@ -86,12 +87,21 @@ void LLFloaterSearch::handleMediaEvent(LLPluginClassMedia *self, EMediaEvent eve case MEDIA_EVENT_NAVIGATE_COMPLETE: childSetText("status_text", getString("done_text")); break; - + default: break; } } +void LLFloaterSearch::godLevelChanged(U8 godlevel) +{ + // search results can change based upon god level - if the user + // changes god level, then give them a warning (we don't refresh + // the search as this might undo any page navigation or + // AJAX-driven changes since the last search). + childSetVisible("refresh_search", (godlevel != mSearchGodLevel)); +} + void LLFloaterSearch::search(const LLSD &key) { if (! mBrowser) @@ -99,6 +109,10 @@ void LLFloaterSearch::search(const LLSD &key) return; } + // reset the god level warning as we're sending the latest state + childHide("refresh_search"); + mSearchGodLevel = gAgent.getGodLevel(); + // get the URL for the search page std::string url = getString("search_url"); if (! LLStringUtil::endsWith(url, "/")) diff --git a/indra/newview/llfloatersearch.h b/indra/newview/llfloatersearch.h index 743107484f..ba817adf7f 100644 --- a/indra/newview/llfloatersearch.h +++ b/indra/newview/llfloatersearch.h @@ -66,14 +66,20 @@ public: /// "events", "groups", "wiki", "destinations", "classifieds" void search(const LLSD &key); + /// changing godmode can affect the search results that are + /// returned by the search website - use this method to tell the + /// search floater that the user has changed god level. + void godLevelChanged(U8 godlevel); + private: /*virtual*/ BOOL postBuild(); // inherited from LLViewerMediaObserver /*virtual*/ void handleMediaEvent(LLPluginClassMedia *self, EMediaEvent event); - + LLMediaCtrl *mBrowser; LLSD mCategoryPaths; + U8 mSearchGodLevel; }; #endif // LL_LLFLOATERSEARCH_H diff --git a/indra/newview/llviewermenu.cpp b/indra/newview/llviewermenu.cpp index 78322dda75..9def699708 100644 --- a/indra/newview/llviewermenu.cpp +++ b/indra/newview/llviewermenu.cpp @@ -59,6 +59,7 @@ #include "llfloaterland.h" #include "llfloaterpay.h" #include "llfloaterreporter.h" +#include "llfloatersearch.h" #include "llfloaterscriptdebug.h" #include "llfloatertools.h" #include "llfloaterworldmap.h" @@ -3408,6 +3409,13 @@ void set_god_level(U8 god_level) // changing god-level can affect which menus we see show_debug_menus(); + + // changing god-level can invalidate search results + LLFloaterSearch *search = dynamic_cast<LLFloaterSearch*>(LLFloaterReg::getInstance("search")); + if (search) + { + search->godLevelChanged(god_level); + } } #ifdef TOGGLE_HACKED_GODLIKE_VIEWER diff --git a/indra/newview/skins/default/xui/en/floater_search.xml b/indra/newview/skins/default/xui/en/floater_search.xml index 82e4d87b28..e6bdcdf78e 100644 --- a/indra/newview/skins/default/xui/en/floater_search.xml +++ b/indra/newview/skins/default/xui/en/floater_search.xml @@ -55,8 +55,20 @@ layout="topleft" left_delta="0" name="status_text" - top_pad="5" + top_pad="7" width="150" /> + <text + visible="false" + follows="bottom|right" + height="16" + left_delta="0" + name="refresh_search" + left_pad="0" + right="-10" + halign="right" + width="450"> + Redo search to reflect current God level + </text> </layout_panel> </layout_stack> </floater> |