summaryrefslogtreecommitdiff
path: root/indra/newview/llfloaterworldmap.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview/llfloaterworldmap.cpp')
-rw-r--r--indra/newview/llfloaterworldmap.cpp40
1 files changed, 14 insertions, 26 deletions
diff --git a/indra/newview/llfloaterworldmap.cpp b/indra/newview/llfloaterworldmap.cpp
index d653d44f8c..b7e8835fb8 100644
--- a/indra/newview/llfloaterworldmap.cpp
+++ b/indra/newview/llfloaterworldmap.cpp
@@ -49,6 +49,7 @@
#include "llfirstuse.h"
#include "llfloaterreg.h" // getTypedInstance()
#include "llfocusmgr.h"
+#include "llinventorymodel.h"
#include "lllandmarklist.h"
#include "lllineeditor.h"
#include "llregionhandle.h"
@@ -57,7 +58,7 @@
#include "lltabcontainer.h"
#include "lltextbox.h"
#include "lltracker.h"
-#include "llinventorymodel.h"
+#include "lltrans.h"
#include "llviewerinventory.h" // LLViewerInventoryItem
#include "llviewermenu.h"
#include "llviewerregion.h"
@@ -151,7 +152,6 @@ LLFloaterWorldMap::LLFloaterWorldMap(const LLSD& key)
mFriendObserver(NULL),
mCompletingRegionName(""),
mWaitingForTracker(FALSE),
- mExactMatch(FALSE),
mIsClosing(FALSE),
mSetToUserPosition(TRUE),
mTrackedLocation(0,0,0),
@@ -903,7 +903,6 @@ void LLFloaterWorldMap::clearLocationSelection(BOOL clear_ui)
}
LLWorldMap::getInstance()->mIsTrackingCommit = FALSE;
mCompletingRegionName = "";
- mExactMatch = FALSE;
}
@@ -1163,7 +1162,6 @@ void LLFloaterWorldMap::onLocationCommit()
LLStringUtil::toLower(str);
mCompletingRegionName = str;
LLWorldMap::getInstance()->mIsTrackingCommit = TRUE;
- mExactMatch = FALSE;
if (str.length() >= 3)
{
LLWorldMap::getInstance()->sendNamedRegionRequest(str);
@@ -1418,11 +1416,10 @@ void LLFloaterWorldMap::updateSims(bool found_null_sim)
LLScrollListCtrl *list = getChild<LLScrollListCtrl>("search_results");
list->operateOnAll(LLCtrlListInterface::OP_DELETE);
- LLSD selected_value = list->getSelectedValue();
-
S32 name_length = mCompletingRegionName.length();
- BOOL match_found = FALSE;
+ LLSD match;
+
S32 num_results = 0;
std::map<U64, LLSimInfo*>::const_iterator it;
for (it = LLWorldMap::getInstance()->mSimInfoMap.begin(); it != LLWorldMap::getInstance()->mSimInfoMap.end(); ++it)
@@ -1434,15 +1431,11 @@ void LLFloaterWorldMap::updateSims(bool found_null_sim)
if (sim_name_lower.substr(0, name_length) == mCompletingRegionName)
{
- if (LLWorldMap::getInstance()->mIsTrackingCommit)
+ if (sim_name_lower == mCompletingRegionName)
{
- if (sim_name_lower == mCompletingRegionName)
- {
- selected_value = sim_name;
- match_found = TRUE;
- }
+ match = sim_name;
}
-
+
LLSD value;
value["id"] = sim_name;
value["columns"][0]["column"] = "sim_name";
@@ -1451,29 +1444,24 @@ void LLFloaterWorldMap::updateSims(bool found_null_sim)
num_results++;
}
}
-
- list->selectByValue(selected_value);
if (found_null_sim)
{
mCompletingRegionName = "";
}
- if (match_found)
- {
- mExactMatch = TRUE;
- childSetFocus("search_results");
- onCommitSearchResult();
- }
- else if (!mExactMatch && num_results > 0)
+ // if match found, highlight it and go
+ if (!match.isUndefined())
{
- list->selectFirstItem(); // select first item by default
+ list->selectByValue(match);
childSetFocus("search_results");
onCommitSearchResult();
}
- else if (num_results == 0)
+
+ // if we found nothing, say "none"
+ if (num_results == 0)
{
- list->setCommentText(std::string("None found."));
+ list->setCommentText(LLTrans::getString("worldmap_results_none_found"));
list->operateOnAll(LLCtrlListInterface::OP_DESELECT);
}
}