diff options
-rw-r--r-- | indra/newview/lllocationhistory.h | 10 | ||||
-rw-r--r-- | indra/newview/lllocationinputctrl.cpp | 4 | ||||
-rw-r--r-- | indra/newview/llnavigationbar.cpp | 16 |
3 files changed, 19 insertions, 11 deletions
diff --git a/indra/newview/lllocationhistory.h b/indra/newview/lllocationhistory.h index 5f9976f87a..65f0dd2e1b 100644 --- a/indra/newview/lllocationhistory.h +++ b/indra/newview/lllocationhistory.h @@ -41,11 +41,13 @@ #include <boost/function.hpp> class LLSD; - +/** + * This enum is responsible for identifying of history item. + */ enum ELocationType { - TYPED_REGION_SURL//region name or surl - ,LANDMARK // name of landmark - ,TELEPORT_HISTORY + TYPED_REGION_SLURL//item added after the user had typed a region name or slurl + ,LANDMARK // item has been loaded from landmark folder + ,TELEPORT_HISTORY // item from session teleport history }; class LLLocationHistoryItem { diff --git a/indra/newview/lllocationinputctrl.cpp b/indra/newview/lllocationinputctrl.cpp index e493c4bf9c..04c684b240 100644 --- a/indra/newview/lllocationinputctrl.cpp +++ b/indra/newview/lllocationinputctrl.cpp @@ -664,7 +664,7 @@ void LLLocationInputCtrl::onLocationPrearrange(const LLSD& data) value["item_type"] = TELEPORT_HISTORY; value["global_pos"] = result->mGlobalPos.getValue(); std::string region_name = result->mTitle.substr(0, result->mTitle.find(',')); - //TODO*: add Surl to teleportitem or parse region name from title + //TODO*: add slurl to teleportitem or parse region name from title value["tooltip"] = LLSLURL::buildSLURLfromPosGlobal(region_name, result->mGlobalPos, false); add(result->getTitle(), value); @@ -914,7 +914,7 @@ void LLLocationInputCtrl::rebuildLocationHistory(std::string filter) LLSD value; value["tooltip"] = it->getToolTip(); //location history can contain only typed locations - value["item_type"] = TYPED_REGION_SURL; + value["item_type"] = TYPED_REGION_SLURL; value["global_pos"] = it->mGlobalPos.getValue(); add(it->getLocation(), value); } diff --git a/indra/newview/llnavigationbar.cpp b/indra/newview/llnavigationbar.cpp index f022bfeb4f..d42e4bc250 100644 --- a/indra/newview/llnavigationbar.cpp +++ b/indra/newview/llnavigationbar.cpp @@ -449,8 +449,14 @@ void LLNavigationBar::onLocationSelection() // Will not teleport to empty location. if (typed_location.empty()) return; - + //get selected item from combobox item LLSD value = mCmbLocation->getSelectedValue(); + /* since navbar list support autocompletion it contains several types of item: landmark, teleport hystory item, + * typed by user slurl or region name. Let's find out which type of item the user has selected + * to make decision about adding this location into typed history. see mSaveToLocationHistory + * Note: + * Only TYPED_REGION_SLURL item will be added into LLLocationHistory + */ if(value.has("item_type")) { @@ -480,7 +486,7 @@ void LLNavigationBar::onLocationSelection() case TELEPORT_HISTORY: //in case of teleport item was selected, teleport by position too. - case TYPED_REGION_SURL: + case TYPED_REGION_SLURL: if(value.has("global_pos")) { gAgent.teleportViaLocation(LLVector3d(value["global_pos"])); @@ -492,7 +498,7 @@ void LLNavigationBar::onLocationSelection() break; } } - //Let's parse surl or region name + //Let's parse slurl or region name std::string region_name; LLVector3 local_coords(128, 128, 0); @@ -541,7 +547,7 @@ void LLNavigationBar::onTeleportFinished(const LLVector3d& global_agent_pos) return; LLLocationHistory* lh = LLLocationHistory::getInstance(); - //TODO*: do we need convert surl into readable format? + //TODO*: do we need convert slurl into readable format? std::string location; /*NOTE: * We can't use gAgent.getPositionAgent() in case of local teleport to build location. @@ -553,7 +559,7 @@ void LLNavigationBar::onTeleportFinished(const LLVector3d& global_agent_pos) std::string tooltip (LLSLURL::buildSLURLfromPosGlobal(gAgent.getRegion()->getName(), global_agent_pos, false)); LLLocationHistoryItem item (location, - global_agent_pos, tooltip,TYPED_REGION_SURL);// we can add into history only TYPED location + global_agent_pos, tooltip,TYPED_REGION_SLURL);// we can add into history only TYPED location //Touch it, if it is at list already, add new location otherwise if ( !lh->touchItem(item) ) { lh->addItem(item); |