From 2ede27a5e266794fc3d034f12344a580260a3546 Mon Sep 17 00:00:00 2001 From: James Cook Date: Mon, 23 Nov 2009 15:29:01 -0800 Subject: Context menu item to show/hide nav bar parcel property icons. --- indra/newview/app_settings/settings.xml | 13 ++++++- indra/newview/lllocationinputctrl.cpp | 44 +++++++++++++++------- indra/newview/skins/default/xui/en/menu_navbar.xml | 17 +++++---- 3 files changed, 51 insertions(+), 23 deletions(-) (limited to 'indra') diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml index 21ccf2ac91..85a465c073 100644 --- a/indra/newview/app_settings/settings.xml +++ b/indra/newview/app_settings/settings.xml @@ -7712,7 +7712,7 @@ NavBarShowCoordinates Comment - Show Coordinates in Location Input Field + Show coordinates in navigation bar Persist 1 Type @@ -7720,6 +7720,17 @@ Value 0 + NavBarShowParcelProperties + + Comment + Show parcel property icons in navigation bar + Persist + 1 + Type + Boolean + Value + 1 + ShowCrosshairs Comment diff --git a/indra/newview/lllocationinputctrl.cpp b/indra/newview/lllocationinputctrl.cpp index be96d7b43a..5d2a0aa382 100644 --- a/indra/newview/lllocationinputctrl.cpp +++ b/indra/newview/lllocationinputctrl.cpp @@ -596,6 +596,16 @@ void LLLocationInputCtrl::refreshLocation() void LLLocationInputCtrl::refreshParcelIcons() { + static LLUICachedControl show_properties("NavBarShowParcelProperties", false); + if (!show_properties) + { + for (S32 i = 0; i < ICON_COUNT; ++i) + { + mParcelIcon[i]->setVisible(false); + } + return; + } + LLViewerParcelMgr* vpm = LLViewerParcelMgr::getInstance(); // *TODO buy //bool allow_buy = vpm->canAgentBuyParcel( vpm->getAgentParcel(), false); @@ -754,11 +764,17 @@ void LLLocationInputCtrl::onLocationContextMenuItemClicked(const LLSD& userdata) { std::string item = userdata.asString(); - if (item == std::string("show_coordinates")) + if (item == "show_coordinates") { gSavedSettings.setBOOL("NavBarShowCoordinates",!gSavedSettings.getBOOL("NavBarShowCoordinates")); } - else if (item == std::string("landmark")) + else if (item == "show_properties") + { + gSavedSettings.setBOOL("NavBarShowParcelProperties", + !gSavedSettings.getBOOL("NavBarShowParcelProperties")); + refreshParcelIcons(); + } + else if (item == "landmark") { LLViewerInventoryItem* landmark = LLLandmarkActions::findLandmarkForAgentPos(); @@ -772,23 +788,23 @@ void LLLocationInputCtrl::onLocationContextMenuItemClicked(const LLSD& userdata) LLSD().insert("type", "landmark").insert("id",landmark->getUUID())); } } - else if (item == std::string("cut")) + else if (item == "cut") { mTextEntry->cut(); } - else if (item == std::string("copy")) + else if (item == "copy") { mTextEntry->copy(); } - else if (item == std::string("paste")) + else if (item == "paste") { mTextEntry->paste(); } - else if (item == std::string("delete")) + else if (item == "delete") { mTextEntry->deleteSelection(); } - else if (item == std::string("select_all")) + else if (item == "select_all") { mTextEntry->selectAll(); } @@ -798,28 +814,28 @@ bool LLLocationInputCtrl::onLocationContextMenuItemEnabled(const LLSD& userdata) { std::string item = userdata.asString(); - if (item == std::string("can_cut")) + if (item == "can_cut") { return mTextEntry->canCut(); } - else if (item == std::string("can_copy")) + else if (item == "can_copy") { return mTextEntry->canCopy(); } - else if (item == std::string("can_paste")) + else if (item == "can_paste") { return mTextEntry->canPaste(); } - else if (item == std::string("can_delete")) + else if (item == "can_delete") { return mTextEntry->canDeselect(); } - else if (item == std::string("can_select_all")) + else if (item == "can_select_all") { return mTextEntry->canSelectAll(); } - else if(item == std::string("show_coordinates")){ - + else if(item == "show_coordinates") + { return gSavedSettings.getBOOL("NavBarShowCoordinates"); } diff --git a/indra/newview/skins/default/xui/en/menu_navbar.xml b/indra/newview/skins/default/xui/en/menu_navbar.xml index 89469fb013..e17eeb46f6 100644 --- a/indra/newview/skins/default/xui/en/menu_navbar.xml +++ b/indra/newview/skins/default/xui/en/menu_navbar.xml @@ -10,7 +10,6 @@ width="128"> + + + +