diff options
author | Steven Bennetts <steve@lindenlab.com> | 2009-08-03 22:25:48 +0000 |
---|---|---|
committer | Steven Bennetts <steve@lindenlab.com> | 2009-08-03 22:25:48 +0000 |
commit | db5cda26676f376f18816013c0c5e3fbad5b20d0 (patch) | |
tree | b50e52262d34f55b4eaf35a3a1952007ef0a69de /indra/newview/llnavigationbar.cpp | |
parent | 3c85899ee0db4a90d03ec687e514a31c1befe34e (diff) |
merge https://svn.aws.productengine.com/secondlife/export-from-ll/viewer-2-0@1211 https://svn.aws.productengine.com/secondlife/pe/stable-1@1228 -> viewer-2.0.0-3
QA:
New movement and camera controls. Test all movement and camera behavior against spec and expected behaviors, including sitting & standing.
Many other changes to the bottom bar.
Changes to local chat behavior.
Diffstat (limited to 'indra/newview/llnavigationbar.cpp')
-rw-r--r-- | indra/newview/llnavigationbar.cpp | 46 |
1 files changed, 29 insertions, 17 deletions
diff --git a/indra/newview/llnavigationbar.cpp b/indra/newview/llnavigationbar.cpp index 58ec2d24a8..06cab9afb0 100644 --- a/indra/newview/llnavigationbar.cpp +++ b/indra/newview/llnavigationbar.cpp @@ -47,12 +47,15 @@ #include "lllocationinputctrl.h" #include "llteleporthistory.h" #include "llsearcheditor.h" +#include "llsidetray.h" #include "llslurl.h" #include "llurlsimstring.h" #include "llviewerinventory.h" #include "llviewermenu.h" #include "llviewerparcelmgr.h" #include "llworldmap.h" +#include "llappviewer.h" +#include "llviewercontrol.h" //-- LLTeleportHistoryMenuItem ----------------------------------------------- @@ -190,6 +193,9 @@ LLNavigationBar::LLNavigationBar() // navigation bar can never get a tab setFocusRoot(FALSE); + + // set a listener function for LoginComplete event + LLAppViewer::instance()->setOnLoginCompletedCallback(boost::bind(&LLNavigationBar::handleLoginComplete, this)); } LLNavigationBar::~LLNavigationBar() @@ -253,7 +259,7 @@ void LLNavigationBar::draw() LLPanel::draw(); } -BOOL LLNavigationBar::handleRightMouseDown(S32 x, S32 y, MASK mask) +BOOL LLNavigationBar::handleRightMouseUp(S32 x, S32 y, MASK mask) { // *HACK. We should use mCmbLocation's right click callback instead. @@ -271,7 +277,7 @@ BOOL LLNavigationBar::handleRightMouseDown(S32 x, S32 y, MASK mask) } return TRUE; } - return LLPanel:: handleRightMouseDown(x, y, mask); + return LLPanel:: handleRightMouseUp(x, y, mask); } void LLNavigationBar::onBackButtonClicked() @@ -410,21 +416,26 @@ void LLNavigationBar::onRegionNameResponse( } // Location is valid. Add it to the typed locations history. + // If user has typed text this variable will contain -1. S32 selected_item = mCmbLocation->getCurrentIndex(); - if (selected_item == -1) // user has typed text - { - LLLocationHistory* lh = LLLocationHistory::getInstance(); - mCmbLocation->add(typed_location); - lh->addItem(typed_location); - lh->save(); - } + + /* + LLLocationHistory* lh = LLLocationHistory::getInstance(); + lh->addItem(selected_item == -1 ? typed_location : mCmbLocation->getSelectedItemLabel()); + lh->save(); + */ // Teleport to the location. LLVector3d region_pos = from_region_handle(region_handle); LLVector3d global_pos = region_pos + (LLVector3d) local_coords; + llinfos << "Teleporting to: " << global_pos << llendl; gAgent.teleportViaLocation(global_pos); + + LLLocationHistory* lh = LLLocationHistory::getInstance(); + lh->addItem(selected_item == -1 ? typed_location : mCmbLocation->getSelectedItemLabel()); + lh->save(); } void LLNavigationBar::showTeleportHistoryMenu() @@ -456,18 +467,16 @@ void LLNavigationBar::onLocationContextMenuItemClicked(const LLSD& userdata) std::string item = userdata.asString(); LLLineEditor* location_entry = mCmbLocation->getTextEntry(); - if (item == std::string("copy_url")) + if (item == std::string("show_coordinates")) { - std::string sl_url = gAgent.getSLURL(); - LLView::getWindow()->copyTextToClipboard(utf8str_to_wstring(sl_url)); - - LLSD args; - args["SLURL"] = sl_url; - LLNotifications::instance().add("CopySLURL", args); + gSavedSettings.setBOOL("ShowCoordinatesOption",!gSavedSettings.getBOOL("ShowCoordinatesOption")); } else if (item == std::string("landmark")) { - LLFloaterReg::showInstance("add_landmark"); + LLSideTray::getInstance()->showPanel("panel_places", LLSD().insert("type", "create_landmark")); + + // Floater "Add Landmark" functionality moved to Side Tray + //LLFloaterReg::showInstance("add_landmark"); } else if (item == std::string("cut")) { @@ -519,6 +528,9 @@ bool LLNavigationBar::onLocationContextMenuItemEnabled(const LLSD& userdata) else if(item == std::string("can_landmark")) { return !LLLandmarkActions::landmarkAlreadyExists(); + }else if(item == std::string("show_coordinates")){ + + return gSavedSettings.getBOOL("ShowCoordinatesOption"); } return false; |