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.cpp68
1 files changed, 45 insertions, 23 deletions
diff --git a/indra/newview/llfloaterworldmap.cpp b/indra/newview/llfloaterworldmap.cpp
index 353020d9c4..4c03a15619 100644
--- a/indra/newview/llfloaterworldmap.cpp
+++ b/indra/newview/llfloaterworldmap.cpp
@@ -11,7 +11,7 @@
* The source code in this file ("Source Code") is provided by Linden Lab
* to you under the terms of the GNU General Public License, version 2.0
* ("GPL"), unless you have obtained a separate licensing agreement
- * ("Other License"), formally executed by you and Linden Lab. Terms of
+ * ("Other License"), formally executed by you and Linden Lab. Terms of
* the GPL can be found in doc/GPL-license.txt in this distribution, or
* online at http://secondlife.com/developers/opensource/gplv2
*
@@ -126,18 +126,18 @@ class LLMapInventoryObserver : public LLInventoryObserver
{
public:
LLMapInventoryObserver() {}
- virtual ~LLMapInventoryObserver() {}
- virtual void changed(U32 mask);
+ virtual ~LLMapInventoryObserver() {}
+ virtual void changed(U32 mask);
};
void LLMapInventoryObserver::changed(U32 mask)
{
- // if there's a change we're interested in.
- if((mask & (LLInventoryObserver::CALLING_CARD | LLInventoryObserver::ADD |
- LLInventoryObserver::REMOVE)) != 0)
- {
- gFloaterWorldMap->inventoryChanged();
- }
+ // if there's a change we're interested in.
+ if((mask & (LLInventoryObserver::CALLING_CARD | LLInventoryObserver::ADD |
+ LLInventoryObserver::REMOVE)) != 0)
+ {
+ gFloaterWorldMap->inventoryChanged();
+ }
}
class LLMapFriendObserver : public LLFriendObserver
@@ -177,8 +177,8 @@ LLFloaterWorldMap::LLFloaterWorldMap()
FALSE, // drag on left
TRUE, // minimize
TRUE), // close
- mInventory(NULL),
- mInventoryObserver(NULL),
+ mInventory(NULL),
+ mInventoryObserver(NULL),
mFriendObserver(NULL),
mCompletingRegionName(""),
mWaitingForTracker(FALSE),
@@ -229,12 +229,18 @@ BOOL LLFloaterWorldMap::postBuild()
{
avatar_combo->selectFirstItem();
avatar_combo->setPrearrangeCallback( onAvatarComboPrearrange );
+ avatar_combo->setTextEntryCallback( onComboTextEntry );
}
childSetAction("DoSearch", onLocationCommit, this);
childSetFocusChangedCallback("location", updateSearchEnabled);
- childSetKeystrokeCallback("location", (void (*)(LLLineEditor*,void*))updateSearchEnabled, NULL);
+
+ LLLineEditor *location_editor = LLUICtrlFactory::getLineEditorByName(this, "location");
+ if (location_editor)
+ {
+ location_editor->setKeystrokeCallback( onSearchTextEntry );
+ }
childSetCommitCallback("search_results", onCommitSearchResult, this);
childSetDoubleClickCallback("search_results", onClickTeleportBtn);
@@ -249,6 +255,7 @@ BOOL LLFloaterWorldMap::postBuild()
{
landmark_combo->selectFirstItem();
landmark_combo->setPrearrangeCallback( onLandmarkComboPrearrange );
+ landmark_combo->setTextEntryCallback( onComboTextEntry );
}
childSetAction("Go Home", onGoHome, this);
@@ -284,9 +291,9 @@ LLFloaterWorldMap::~LLFloaterWorldMap()
// All cleaned up by LLView destructor
mTabs = NULL;
- // Inventory deletes all observers on shutdown
- mInventory = NULL;
- mInventoryObserver = NULL;
+ // Inventory deletes all observers on shutdown
+ mInventory = NULL;
+ mInventoryObserver = NULL;
// avatar tracker will delete this for us.
mFriendObserver = NULL;
@@ -509,7 +516,7 @@ void LLFloaterWorldMap::draw()
}
childSetEnabled("Teleport", (BOOL)tracking_status);
-// childSetEnabled("Clear", (BOOL)tracking_status);
+// childSetEnabled("Clear", (BOOL)tracking_status);
childSetEnabled("Show Destination", (BOOL)tracking_status || gWorldMap->mIsTrackingUnknownLocation);
childSetEnabled("copy_slurl", (mSLURL.size() > 0) );
@@ -595,7 +602,7 @@ void LLFloaterWorldMap::trackLandmark( const LLUUID& landmark_item_id )
if (combo) name = combo->getSimple();
mTrackedStatus = LLTracker::TRACKING_LANDMARK;
LLTracker::trackLandmark(mLandmarkAssetIDList.get( idx ), // assetID
- mLandmarkItemIDList.get( idx ), // itemID
+ mLandmarkItemIDList.get( idx ), // itemID
name); // name
if( asset_id != sHomeID )
@@ -605,7 +612,7 @@ void LLFloaterWorldMap::trackLandmark( const LLUUID& landmark_item_id )
}
// We have to download both region info and landmark data, so set busy. JC
-// getWindow()->incBusyCount();
+// getWindow()->incBusyCount();
}
else
{
@@ -1000,7 +1007,7 @@ void LLFloaterWorldMap::clearAvatarSelection(BOOL clear_ui)
void LLFloaterWorldMap::adjustZoomSliderBounds()
{
// World size in regions
- S32 world_width_regions = gWorldMap->getWorldWidth() / REGION_WIDTH_UNITS;
+ S32 world_width_regions = gWorldMap->getWorldWidth() / REGION_WIDTH_UNITS;
S32 world_height_regions = gWorldMap->getWorldHeight() / REGION_WIDTH_UNITS;
// Pad the world size a little bit, so we have a nice border on
@@ -1044,7 +1051,7 @@ void LLFloaterWorldMap::adjustZoomSliderBounds()
// static
void LLFloaterWorldMap::onPanBtn( void* userdata )
{
- if( !gFloaterWorldMap ) return;
+ if( !gFloaterWorldMap ) return;
EPanDirection direction = (EPanDirection)(intptr_t)userdata;
@@ -1055,7 +1062,7 @@ void LLFloaterWorldMap::onPanBtn( void* userdata )
case PAN_UP: pan_y = -1; break;
case PAN_DOWN: pan_y = 1; break;
case PAN_LEFT: pan_x = 1; break;
- case PAN_RIGHT: pan_x = -1; break;
+ case PAN_RIGHT: pan_x = -1; break;
default: llassert(0); return;
}
@@ -1095,6 +1102,21 @@ void LLFloaterWorldMap::onLandmarkComboPrearrange( LLUICtrl* ctrl, void* userdat
}
+void LLFloaterWorldMap::onComboTextEntry( LLLineEditor* ctrl, void* userdata )
+{
+ // Reset the tracking whenever we start typing into any of the search fields,
+ // so that hitting <enter> does an auto-complete versus teleporting us to the
+ // previously selected landmark/friend.
+ LLTracker::clearFocus();
+}
+
+// static
+void LLFloaterWorldMap::onSearchTextEntry( LLLineEditor* ctrl, void* userdata )
+{
+ onComboTextEntry(ctrl, userdata);
+ updateSearchEnabled(ctrl, userdata);
+}
+
// static
void LLFloaterWorldMap::onLandmarkComboCommit( LLUICtrl* ctrl, void* userdata )
{
@@ -1260,7 +1282,7 @@ void LLFloaterWorldMap::onClearBtn(void* data)
self->mTrackedStatus = LLTracker::TRACKING_NOTHING;
LLTracker::stopTracking((void *)(intptr_t)TRUE);
gWorldMap->mIsTrackingUnknownLocation = FALSE;
- self->mSLURL = ""; // Clear the SLURL since it's invalid
+ self->mSLURL = ""; // Clear the SLURL since it's invalid
self->mSetToUserPosition = TRUE; // Revert back to the current user position
}
@@ -1329,7 +1351,7 @@ void LLFloaterWorldMap::centerOnTarget(BOOL animate)
else
{
// We've got the position finally, so we're no longer busy. JC
-// getWindow()->decBusyCount();
+// getWindow()->decBusyCount();
pos_global = LLTracker::getTrackedPositionGlobal() - gAgent.getCameraPositionGlobal();
}
}