From 84933b3c92b46a432a02df76df1be6d1b75cae04 Mon Sep 17 00:00:00 2001 From: Kitty Barnett <develop@catznip.com> Date: Wed, 8 Feb 2012 16:49:33 +0100 Subject: [PATCH] - fixed : various issues and enhancements relating to @showloc -> general block on showing the "agent" and "create_landmark" side panel -> World / Place Profile isn't blocked/grayed out -> World / About Land isn't grayed out -> World / Region isn't grayed out -> "Add Landmark" on the Places / Gear menu isn't blocked/grayed out -> "Add Landmark" on the Places / Add menu isn't blocked/grayed out -> region name is visible on the world map -> don't gray out access to "About Land" if the user is allowed to see it --HG-- branch : RLVa --- indra/llui/llfloaterreg.cpp | 8 +++ indra/llui/llfloaterreg.h | 4 ++ indra/llui/llui.cpp | 3 + indra/newview/app_settings/commands.xml | 4 +- indra/newview/llfloatersidepanelcontainer.cpp | 26 +++++++- indra/newview/llfloatersidepanelcontainer.h | 14 ++++ indra/newview/llfloaterworldmap.cpp | 65 ++++++++++++++----- indra/newview/lllocationinputctrl.cpp | 14 ++-- indra/newview/llpanellandmarks.cpp | 30 +++++++-- indra/newview/llpanelplaceprofile.cpp | 4 +- indra/newview/llpaneltopinfobar.cpp | 46 +++++++++---- indra/newview/llviewermenu.cpp | 22 ++++++- indra/newview/llworldmapview.cpp | 12 ++-- indra/newview/rlvui.cpp | 22 ++++++- indra/newview/rlvui.h | 3 + .../skins/default/xui/en/menu_land.xml | 3 + .../default/xui/en/menu_place_add_button.xml | 3 + .../xui/en/menu_places_gear_folder.xml | 3 + .../xui/en/menu_places_gear_landmark.xml | 3 + .../skins/default/xui/en/menu_viewer.xml | 8 +++ 20 files changed, 240 insertions(+), 57 deletions(-) diff --git a/indra/llui/llfloaterreg.cpp b/indra/llui/llfloaterreg.cpp index b9c305f3670..7f3013d5531 100644 --- a/indra/llui/llfloaterreg.cpp +++ b/indra/llui/llfloaterreg.cpp @@ -242,6 +242,14 @@ LLFloaterReg::const_instance_list_t& LLFloaterReg::getFloaterList(const std::str // Visibility Management +// [RLVa:KB] - Checked: 2012-02-07 (RLVa-1.4.5) | Added: RLVa-1.4.5 +//static +bool LLFloaterReg::canShowInstance(const std::string& name, const LLSD& key) +{ + return mValidateSignal(name, key); +} +// [/RLVa:KB] + //static LLFloater* LLFloaterReg::showInstance(const std::string& name, const LLSD& key, BOOL focus) { diff --git a/indra/llui/llfloaterreg.h b/indra/llui/llfloaterreg.h index 4c3caf8e321..28434020af5 100644 --- a/indra/llui/llfloaterreg.h +++ b/indra/llui/llfloaterreg.h @@ -112,6 +112,10 @@ class LLFloaterReg static const_instance_list_t& getFloaterList(const std::string& name); // Visibility Management +// [RLVa:KB] - Checked: 2012-02-07 (RLVa-1.4.5) | Added: RLVa-1.4.5 + // return false if floater can not be shown (=doesn't pass the validation filter) + static bool canShowInstance(const std::string& name, const LLSD& key = LLSD()); +// [/RLVa:KB] // return NULL if instance not found or can't create instance (no builder) static LLFloater* showInstance(const std::string& name, const LLSD& key = LLSD(), BOOL focus = FALSE); // Close a floater (may destroy or set invisible) diff --git a/indra/llui/llui.cpp b/indra/llui/llui.cpp index 6b74c5a6be0..2951cd9159b 100644 --- a/indra/llui/llui.cpp +++ b/indra/llui/llui.cpp @@ -1647,6 +1647,9 @@ void LLUI::initClass(const settings_map_t& settings, // Used by menus along with Floater.Toggle to display visibility as a check-mark LLUICtrl::EnableCallbackRegistry::defaultRegistrar().add("Floater.Visible", boost::bind(&LLFloaterReg::instanceVisible, _2, LLSD())); LLUICtrl::EnableCallbackRegistry::defaultRegistrar().add("Floater.IsOpen", boost::bind(&LLFloaterReg::instanceVisible, _2, LLSD())); +// [RLVa:KB] - Checked: 2012-02-07 (RLVa-1.4.5) | Added: RLVa-1.4.5 + LLUICtrl::EnableCallbackRegistry::defaultRegistrar().add("Floater.CanShow", boost::bind(&LLFloaterReg::canShowInstance, _2, LLSD())); +// [/RLVa:KB] // Parse the master list of commands LLCommandManager::load(); diff --git a/indra/newview/app_settings/commands.xml b/indra/newview/app_settings/commands.xml index 2cf9b736be2..7b3ec27d967 100644 --- a/indra/newview/app_settings/commands.xml +++ b/indra/newview/app_settings/commands.xml @@ -7,8 +7,8 @@ tooltip_ref="Command_AboutLand_Tooltip" execute_function="Floater.ToggleOrBringToFront" execute_parameters="about_land" - is_enabled_function="RLV.EnableIfNot" - is_enabled_parameters="showloc" + is_enabled_function="Floater.CanShow" + is_enabled_parameters="about_land" is_running_function="Floater.IsOpen" is_running_parameters="about_land" /> diff --git a/indra/newview/llfloatersidepanelcontainer.cpp b/indra/newview/llfloatersidepanelcontainer.cpp index be7a53491d8..21e42fe5250 100644 --- a/indra/newview/llfloatersidepanelcontainer.cpp +++ b/indra/newview/llfloatersidepanelcontainer.cpp @@ -36,6 +36,10 @@ //static const std::string LLFloaterSidePanelContainer::sMainPanelName("main_panel"); +// [RLVa:KB] - Checked: 2012-02-07 (RLVa-1.4.5) | Added: RLVa-1.4.5 +LLFloaterSidePanelContainer::validate_signal_t LLFloaterSidePanelContainer::mValidateSignal; +// [/RLVa:KB] + LLFloaterSidePanelContainer::LLFloaterSidePanelContainer(const LLSD& key, const Params& params) : LLFloater(key, params) { @@ -80,10 +84,25 @@ LLPanel* LLFloaterSidePanelContainer::openChildPanel(const std::string& panel_na return panel; } +// [RLVa:KB] - Checked: 2012-02-07 (RLVa-1.4.5) | Added: RLVa-1.4.5 +bool LLFloaterSidePanelContainer::canShowPanel(const std::string& floater_name, const LLSD& key) +{ + return mValidateSignal(floater_name, sMainPanelName, key); +} + +bool LLFloaterSidePanelContainer::canShowPanel(const std::string& floater_name, const std::string& panel_name, const LLSD& key) +{ + return mValidateSignal(floater_name, panel_name, key); +} +// [/RLVa:KB] + void LLFloaterSidePanelContainer::showPanel(const std::string& floater_name, const LLSD& key) { LLFloaterSidePanelContainer* floaterp = LLFloaterReg::getTypedInstance<LLFloaterSidePanelContainer>(floater_name); - if (floaterp) +// if (floaterp) +// [RLVa:KB] - Checked: 2012-02-07 (RLVa-1.4.5) | Added: RLVa-1.4.5 + if ( (floaterp) && (mValidateSignal(floater_name, sMainPanelName, key)) ) +// [/RLVa:KB] { floaterp->openChildPanel(sMainPanelName, key); } @@ -92,7 +111,10 @@ void LLFloaterSidePanelContainer::showPanel(const std::string& floater_name, con void LLFloaterSidePanelContainer::showPanel(const std::string& floater_name, const std::string& panel_name, const LLSD& key) { LLFloaterSidePanelContainer* floaterp = LLFloaterReg::getTypedInstance<LLFloaterSidePanelContainer>(floater_name); - if (floaterp) +// if (floaterp) +// [RLVa:KB] - Checked: 2012-02-07 (RLVa-1.4.5) | Added: RLVa-1.4.5 + if ( (floaterp) && (mValidateSignal(floater_name, panel_name, key)) ) +// [/RLVa:KB] { floaterp->openChildPanel(panel_name, key); } diff --git a/indra/newview/llfloatersidepanelcontainer.h b/indra/newview/llfloatersidepanelcontainer.h index 10d85867ce5..fa8ceb680bb 100644 --- a/indra/newview/llfloatersidepanelcontainer.h +++ b/indra/newview/llfloatersidepanelcontainer.h @@ -53,6 +53,11 @@ class LLFloaterSidePanelContainer : public LLFloater LLPanel* openChildPanel(const std::string& panel_name, const LLSD& params); +// [RLVa:KB] - Checked: 2012-02-07 (RLVa-1.4.5) | Added: RLVa-1.4.5 + static bool canShowPanel(const std::string& floater_name, const LLSD& key); + static bool canShowPanel(const std::string& floater_name, const std::string& panel_name, const LLSD& key); +// [/RLVa:KB] + static void showPanel(const std::string& floater_name, const LLSD& key); static void showPanel(const std::string& floater_name, const std::string& panel_name, const LLSD& key); @@ -76,6 +81,15 @@ class LLFloaterSidePanelContainer : public LLFloater } return panel; } + +// [RLVa:KB] - Checked: 2012-02-07 (RLVa-1.4.5) | Added: RLVa-1.4.5 + // Used to determine whether a sidepanel can be shown +public: + typedef boost::signals2::signal<bool(const std::string&, const std::string&, const LLSD&), boost_boolean_combiner> validate_signal_t; + static boost::signals2::connection setValidateCallback(const validate_signal_t::slot_type& cb) { return mValidateSignal.connect(cb); } +private: + static validate_signal_t mValidateSignal; +// [/RLVa:KB] }; #endif // LL_LLFLOATERSIDEPANELCONTAINER_H diff --git a/indra/newview/llfloaterworldmap.cpp b/indra/newview/llfloaterworldmap.cpp index ac9407df6f1..3d679cc886d 100755 --- a/indra/newview/llfloaterworldmap.cpp +++ b/indra/newview/llfloaterworldmap.cpp @@ -673,7 +673,10 @@ void LLFloaterWorldMap::trackLocation(const LLVector3d& pos_global) std::string tooltip(""); mTrackedStatus = LLTracker::TRACKING_LOCATION; - LLTracker::trackLocation(pos_global, full_name, tooltip); +// [RLVa:KB] - Checked: 2012-02-08 (RLVa-1.4.5) | Added: RLVa-1.4.5 + LLTracker::trackLocation(pos_global, (!gRlvHandler.hasBehaviour(RLV_BHVR_SHOWLOC)) ? full_name : RlvStrings::getString(RLV_STRING_HIDDEN).c_str(), tooltip); +// [/RLVa:KB] +// LLTracker::trackLocation(pos_global, full_name, tooltip); LLWorldMap::getInstance()->cancelTracking(); // The floater is taking over the tracking LLVector3d coord_pos = LLTracker::getTrackedPositionGlobal(); @@ -688,9 +691,25 @@ void LLFloaterWorldMap::trackLocation(const LLVector3d& pos_global) // enable/disable teleport destination coordinates void LLFloaterWorldMap::enableTeleportCoordsDisplay( bool enabled ) { - childSetEnabled("teleport_coordinate_x", enabled ); - childSetEnabled("teleport_coordinate_y", enabled ); - childSetEnabled("teleport_coordinate_z", enabled ); +// [RLVa:KB] - Checked: 2012-02-08 (RLVa-1.4.5) | Added: RLVa-1.4.5 + LLUICtrl* pCtrl = getChild<LLUICtrl>("events_label"); + pCtrl->setVisible(!gRlvHandler.hasBehaviour(RLV_BHVR_SHOWLOC)); + + pCtrl = getChild<LLUICtrl>("teleport_coordinate_x"); + pCtrl->setVisible(!gRlvHandler.hasBehaviour(RLV_BHVR_SHOWLOC)); + pCtrl->setEnabled(enabled); + + pCtrl = getChild<LLUICtrl>("teleport_coordinate_y"); + pCtrl->setVisible(!gRlvHandler.hasBehaviour(RLV_BHVR_SHOWLOC)); + pCtrl->setEnabled(enabled); + + pCtrl = getChild<LLUICtrl>("teleport_coordinate_z"); + pCtrl->setVisible(!gRlvHandler.hasBehaviour(RLV_BHVR_SHOWLOC)); + pCtrl->setEnabled(enabled); +// [/RLVa:KB] +// childSetEnabled("teleport_coordinate_x", enabled ); +// childSetEnabled("teleport_coordinate_y", enabled ); +// childSetEnabled("teleport_coordinate_z", enabled ); } // update display of teleport destination coordinates - pos is in global coordinates @@ -729,7 +748,22 @@ void LLFloaterWorldMap::updateLocation() // Make sure we know where we are before setting the current user position std::string agent_sim_name; gotSimName = LLWorldMap::getInstance()->simNameFromPosGlobal( agentPos, agent_sim_name ); - if ( gotSimName ) +// [RLVa:KB] - Checked: 2012-02-08 (RLVa-1.4.5) | Added: RLVa-1.4.5 + if (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWLOC)) + { + mSetToUserPosition = FALSE; + + // Fill out the location field + getChild<LLUICtrl>("location")->setValue(RlvStrings::getString(RLV_STRING_HIDDEN_REGION)); + + // update the coordinate display with location of avatar in region + updateTeleportCoordsDisplay( agentPos ); + + mSLURL = LLSLURL(); + } + else if (gotSimName) +// [/RLVa:KB] +// if ( gotSimName ) { mSetToUserPosition = FALSE; @@ -774,7 +808,16 @@ void LLFloaterWorldMap::updateLocation() updateTeleportCoordsDisplay( coord_pos ); // simNameFromPosGlobal can fail, so don't give the user an invalid SLURL - if ( gotSimName ) +// [RLVa:KB] - Checked: 2012-02-08 (RLVa-1.4.5) | Added: RLVa-1.4.5 + if (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWLOC)) + { + mSLURL = LLSLURL(); + + childSetValue("location", RlvStrings::getString(RLV_STRING_HIDDEN_REGION)); + } + else if (gotSimName) +// [/RLVa:KB] +// if ( gotSimName ) { mSLURL = LLSLURL(sim_name, pos_global); } @@ -782,16 +825,6 @@ void LLFloaterWorldMap::updateLocation() { // Empty SLURL will disable the "Copy SLURL to clipboard" button mSLURL = LLSLURL(); } - -// [RLVa:KB] - Checked: 2009-07-04 (RLVa-1.0.0a) -/* - if (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWLOC)) - { - childSetValue("location", RlvStrings::getString(RLV_STRING_HIDDEN_REGION)); - mSLURL.clear(); - } -*/ -// [/RLVa:KB] } } diff --git a/indra/newview/lllocationinputctrl.cpp b/indra/newview/lllocationinputctrl.cpp index f97077e87ee..2a6561d3d48 100644 --- a/indra/newview/lllocationinputctrl.cpp +++ b/indra/newview/lllocationinputctrl.cpp @@ -603,7 +603,7 @@ void LLLocationInputCtrl::reshape(S32 width, S32 height, BOOL called_from_parent void LLLocationInputCtrl::onInfoButtonClicked() { -// [RLVa:KB] - Checked: 2010-04-05 (RLVa-1.2.0d) | Added: RLVa-1.2.0d +// [RLVa:KB] - Checked: 2010-04-05 (RLVa-1.4.5) | Added: RLVa-1.2.0 if (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWLOC)) return; // [/RLVa:KB] @@ -613,7 +613,7 @@ void LLLocationInputCtrl::onInfoButtonClicked() void LLLocationInputCtrl::onForSaleButtonClicked() { -// [RLVa:KB] - Checked: 2010-04-05 (RLVa-1.2.0d) | Added: RLVa-1.2.0d +// [RLVa:KB] - Checked: 2010-04-05 (RLVa-1.4.5) | Added: RLVa-1.2.0 if (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWLOC)) return; // [/RLVa:KB] @@ -623,7 +623,7 @@ void LLLocationInputCtrl::onForSaleButtonClicked() void LLLocationInputCtrl::onAddLandmarkButtonClicked() { -// [RLVa:KB] - Checked: 2010-04-05 (RLVa-1.2.0d) | Added: RLVa-1.2.0d +// [RLVa:KB] - Checked: 2010-04-05 (RLVa-1.4.5) | Added: RLVa-1.2.0 if (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWLOC)) return; // [/RLVa:KB] @@ -744,7 +744,7 @@ void LLLocationInputCtrl::onTextEditorRightClicked(S32 x, S32 y, MASK mask) void LLLocationInputCtrl::refresh() { -// [RLVa:KB] - Checked: 2010-04-05 (RLVa-1.2.0d) | Added: RLVa-1.2.0d +// [RLVa:KB] - Checked: 2010-04-05 (RLVa-1.4.5) | Added: RLVa-1.2.0 mInfoBtn->setEnabled(!gRlvHandler.hasBehaviour(RLV_BHVR_SHOWLOC)); // [/RLVa:KB] @@ -1021,7 +1021,7 @@ void LLLocationInputCtrl::enableAddLandmarkButton(bool val) // depending on whether current parcel has been landmarked. void LLLocationInputCtrl::updateAddLandmarkButton() { -// [RLVa:KB] - Checked: 2010-04-05 (RLVa-1.2.0d) | Added: RLVa-1.2.0d +// [RLVa:KB] - Checked: 2010-04-05 (RLVa-1.4.5) | Added: RLVa-1.2.0 mAddLandmarkBtn->setVisible(!gRlvHandler.hasBehaviour(RLV_BHVR_SHOWLOC)); // [/RLVa:KB] enableAddLandmarkButton(LLLandmarkActions::hasParcelLandmark()); @@ -1053,7 +1053,7 @@ void LLLocationInputCtrl::updateContextMenu(){ { landmarkItem->setLabel(LLTrans::getString("EditLandmarkNavBarMenu")); } -// [RLVa:KB] - Checked: 2010-04-05 (RLVa-1.2.0d) | Added: RLVa-1.2.0d +// [RLVa:KB] - Checked: 2010-04-05 (RLVa-1.4.5) | Added: RLVa-1.2.0 landmarkItem->setEnabled(!gRlvHandler.hasBehaviour(RLV_BHVR_SHOWLOC)); // [/RLVa:KB] } @@ -1111,7 +1111,7 @@ void LLLocationInputCtrl::onLocationContextMenuItemClicked(const LLSD& userdata) } else if (item == "landmark") { -// [RLVa:KB] - Checked: 2010-04-05 (RLVa-1.2.0d) | Added: RLVa-1.2.0d +// [RLVa:KB] - Checked: 2010-04-05 (RLVa-1.4.5) | Added: RLVa-1.2.0 if (!gRlvHandler.hasBehaviour(RLV_BHVR_SHOWLOC)) { // [/RLVa:KB] diff --git a/indra/newview/llpanellandmarks.cpp b/indra/newview/llpanellandmarks.cpp index c7454e85a91..4c801f9807a 100644 --- a/indra/newview/llpanellandmarks.cpp +++ b/indra/newview/llpanellandmarks.cpp @@ -55,6 +55,9 @@ #include "lltoggleablemenu.h" #include "llviewermenu.h" #include "llviewerregion.h" +// [RLVa:KB] +#include "rlvhandler.h" +// [/RLVa:KB] // Not yet implemented; need to remove buildPanel() from constructor when we switch //static LLRegisterPanelClassWrapper<LLLandmarksPanel> t_landmarks("panel_landmarks"); @@ -779,15 +782,22 @@ void LLLandmarksPanel::onAddAction(const LLSD& userdata) const std::string command_name = userdata.asString(); if("add_landmark" == command_name) { - LLViewerInventoryItem* landmark = LLLandmarkActions::findLandmarkForAgentPos(); - if(landmark) +// [RLVa:KB] - Checked: 2012-02-08 (RLVa-1.4.5) | Added: RLVa-1.4.5 + if (!gRlvHandler.hasBehaviour(RLV_BHVR_SHOWLOC)) { - LLNotificationsUtil::add("LandmarkAlreadyExists"); - } - else - { - LLFloaterSidePanelContainer::showPanel("places", LLSD().with("type", "create_landmark")); +// [/RLVa:KB] + LLViewerInventoryItem* landmark = LLLandmarkActions::findLandmarkForAgentPos(); + if(landmark) + { + LLNotificationsUtil::add("LandmarkAlreadyExists"); + } + else + { + LLFloaterSidePanelContainer::showPanel("places", LLSD().with("type", "create_landmark")); + } +// [RLVa:KB] - Checked: 2012-02-08 (RLVa-1.4.5) | Added: RLVa-1.4.5 } +// [/RLVa:KB] } else if ("category" == command_name) { @@ -1057,6 +1067,12 @@ bool LLLandmarksPanel::isActionEnabled(const LLSD& userdata) const } return false; } +// [RLVa:KB] - Checked: 2012-02-08 (RLVa-1.4.5) | Added: RLVa-1.4.5 + else if("add_landmark" == command_name) + { + return !gRlvHandler.hasBehaviour(RLV_BHVR_SHOWLOC); + } +// [/RLVa:KB] else { llwarns << "Unprocessed command has come: " << command_name << llendl; diff --git a/indra/newview/llpanelplaceprofile.cpp b/indra/newview/llpanelplaceprofile.cpp index bc3839bab59..917db44af69 100644 --- a/indra/newview/llpanelplaceprofile.cpp +++ b/indra/newview/llpanelplaceprofile.cpp @@ -598,7 +598,7 @@ void LLPanelPlaceProfile::displaySelectedParcelInfo(LLParcel* parcel, LLPanelPlaceInfo::processParcelInfo(parcel_data); // mYouAreHerePanel->setVisible(is_current_parcel); -// [RLVa:KB] - Checked: 2010-09-02 (RLVa-1.2.1b) | Added: RLVa-1.2.1b +// [RLVa:KB] - Checked: 2010-09-02 (RLVa-1.4.5) | Added: RLVa-1.2.1 mYouAreHerePanel->setVisible(is_current_parcel && (!gRlvHandler.hasBehaviour(RLV_BHVR_SHOWLOC))); // [/RLVa:KB] getChild<LLAccordionCtrlTab>("sales_tab")->setVisible(for_sale); @@ -668,7 +668,7 @@ void LLPanelPlaceProfile::updateYouAreHereBanner(void* userdata) LLAgentUI::checkAgentDistance(self->mPosRegion, radius); // self->mYouAreHerePanel->setVisible(display_banner); -// [RLVa:KB] - Checked: 2010-09-02 (RLVa-1.2.1b) | Added: RLVa-1.2.1b +// [RLVa:KB] - Checked: 2010-09-02 (RLVa-1.4.5) | Added: RLVa-1.2.1 self->mYouAreHerePanel->setVisible(display_banner && (!gRlvHandler.hasBehaviour(RLV_BHVR_SHOWLOC))); // [/RLVa:KB] } diff --git a/indra/newview/llpaneltopinfobar.cpp b/indra/newview/llpaneltopinfobar.cpp index eb4c7572d43..0a289e64325 100644 --- a/indra/newview/llpaneltopinfobar.cpp +++ b/indra/newview/llpaneltopinfobar.cpp @@ -44,6 +44,9 @@ #include "llviewermenu.h" #include "llviewerparcelmgr.h" #include "llviewerregion.h" +// [RLVa:KB] - Checked: 2012-02-08 (RLVa-1.4.5) | Added: RLVa-1.4.5 +#include "rlvhandler.h" +// [/RLVa:KB] class LLPanelTopInfoBar::LLParcelChangeObserver : public LLParcelObserver { @@ -450,28 +453,47 @@ void LLPanelTopInfoBar::onContextMenuItemClicked(const LLSD::String& item) { if (item == "landmark") { - LLViewerInventoryItem* landmark = LLLandmarkActions::findLandmarkForAgentPos(); - - if(landmark == NULL) - { - LLFloaterSidePanelContainer::showPanel("places", LLSD().with("type", "create_landmark")); - } - else +// [RLVa:KB] - Checked: 2012-02-08 (RLVa-1.4.5) | Added: RLVa-1.4.5 + if (!gRlvHandler.hasBehaviour(RLV_BHVR_SHOWLOC)) { - LLFloaterSidePanelContainer::showPanel("places", LLSD().with("type", "landmark").with("id",landmark->getUUID())); +// [/RLVa:KB] + LLViewerInventoryItem* landmark = LLLandmarkActions::findLandmarkForAgentPos(); + + if(landmark == NULL) + { + LLFloaterSidePanelContainer::showPanel("places", LLSD().with("type", "create_landmark")); + } + else + { + LLFloaterSidePanelContainer::showPanel("places", LLSD().with("type", "landmark").with("id",landmark->getUUID())); + } +// [RLVa:KB] - Checked: 2012-02-08 (RLVa-1.4.5) | Added: RLVa-1.4.5 } +// [/RLVa:KB] } else if (item == "copy") { - LLSLURL slurl; - LLAgentUI::buildSLURL(slurl, false); - LLUIString location_str(slurl.getSLURLString()); +// [RLVa:KB] - Checked: 2012-02-08 (RLVa-1.4.5) | Added: RLVa-1.4.5 + if (!gRlvHandler.hasBehaviour(RLV_BHVR_SHOWLOC)) + { +// [/RLVa:KB] + LLSLURL slurl; + LLAgentUI::buildSLURL(slurl, false); + LLUIString location_str(slurl.getSLURLString()); - gClipboard.copyFromString(location_str); + gClipboard.copyFromString(location_str); +// [RLVa:KB] - Checked: 2012-02-08 (RLVa-1.4.5) | Added: RLVa-1.4.5 + } +// [/RLVa:KB] } } void LLPanelTopInfoBar::onInfoButtonClicked() { +// [RLVa:KB] - Checked: 2012-02-08 (RLVa-1.4.5) | Added: RLVa-1.4.5 + if (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWLOC)) + return; +// [/RLVa:KB] + LLFloaterSidePanelContainer::showPanel("places", LLSD().with("type", "agent")); } diff --git a/indra/newview/llviewermenu.cpp b/indra/newview/llviewermenu.cpp index 411d30a3167..254a798a6a1 100644 --- a/indra/newview/llviewermenu.cpp +++ b/indra/newview/llviewermenu.cpp @@ -5461,7 +5461,7 @@ class LLWorldCreateLandmark : public view_listener_t { bool handleEvent(const LLSD& userdata) { -// [RLVa:KB] - Checked: 2010-09-28 (RLVa-1.2.1f) | Added: RLVa-1.0.0a +// [RLVa:KB] - Checked: 2010-09-28 (RLVa-1.4.5) | Added: RLVa-1.0.0 if (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWLOC)) return true; // [/RLVa:KB] @@ -5476,12 +5476,24 @@ class LLWorldPlaceProfile : public view_listener_t { bool handleEvent(const LLSD& userdata) { +// [RLVa:KB] - Checked: 2012-02-08 (RLVa-1.4.5) | Added: RLVa-1.4.5 + if (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWLOC)) + return true; +// [/RLVa:KB] + LLFloaterSidePanelContainer::showPanel("places", LLSD().with("type", "agent")); return true; } }; +// [RLVa:KB] - Checked: 2012-02-08 (RLVa-1.4.5) | Added: RLVa-1.4.5 +bool enable_place_profile() +{ + return LLFloaterSidePanelContainer::canShowPanel("places", LLSD().with("type", "agent")); +} +// [/RLVa:KB] + void handle_look_at_selection(const LLSD& param) { const F32 PADDING_FACTOR = 1.75f; @@ -7286,7 +7298,7 @@ class LLWorldEnableCreateLandmark : public view_listener_t bool handleEvent(const LLSD& userdata) { // return !LLLandmarkActions::landmarkAlreadyExists(); -// [RLVa:KB] - Checked: 2010-09-28 (RLVa-1.2.1f) | Added: RLVa-1.2.1f +// [RLVa:KB] - Checked: 2010-09-28 (RLVa-1.4.5) | Added: RLVa-1.2.1 return (!LLLandmarkActions::landmarkAlreadyExists()) && (!gRlvHandler.hasBehaviour(RLV_BHVR_SHOWLOC)); // [/RLVa:KB] } @@ -8293,6 +8305,9 @@ void show_topinfobar_context_menu(LLView* ctrl, S32 x, S32 y) { landmark_item->setLabel(LLTrans::getString("EditLandmarkNavBarMenu")); } +// [RLVa:KB] - Checked: 2012-02-07 (RLVa-1.4.5) | Added: RLVa-1.4.5 + landmark_item->setEnabled(!gRlvHandler.hasBehaviour(RLV_BHVR_SHOWLOC)); +// [/RLVa:KB] if(gMenuHolder->hasVisibleMenu()) { @@ -8419,6 +8434,9 @@ void initialize_menus() view_listener_t::addMenu(new LLWorldSetBusy(), "World.SetBusy"); view_listener_t::addMenu(new LLWorldEnableCreateLandmark(), "World.EnableCreateLandmark"); +// [RLVa:KB] + enable.add("World.EnablePlaceProfile", boost::bind(&enable_place_profile)); +// [/RLVa:KB] view_listener_t::addMenu(new LLWorldEnableSetHomeLocation(), "World.EnableSetHomeLocation"); view_listener_t::addMenu(new LLWorldEnableTeleportHome(), "World.EnableTeleportHome"); view_listener_t::addMenu(new LLWorldEnableBuyLand(), "World.EnableBuyLand"); diff --git a/indra/newview/llworldmapview.cpp b/indra/newview/llworldmapview.cpp index 4e48df0bfb5..c47738bf179 100644 --- a/indra/newview/llworldmapview.cpp +++ b/indra/newview/llworldmapview.cpp @@ -460,7 +460,10 @@ void LLWorldMapView::draw() { mesg = info->getName(); } - if (!mesg.empty()) +// if (!mesg.empty()) +// [RLVa:KB] - Checked: 2012-02-08 (RLVa-1.4.5) | Added: RLVa-1.4.5 + if ( (!mesg.empty()) && (!gRlvHandler.hasBehaviour(RLV_BHVR_SHOWLOC)) ) +// [/RLVa:KB] { font->renderUTF8( mesg, 0, @@ -998,11 +1001,8 @@ void LLWorldMapView::drawTracking(const LLVector3d& pos_global, const LLColor4& text_y = llclamp(text_y + vert_offset, TEXT_PADDING + vert_offset, getRect().getHeight() - llround(font->getLineHeight()) - TEXT_PADDING - vert_offset); // if (label != "") -// [RLVa:KB] - Checked: 2009-07-04 (RLVa-1.0.0a) | Added: RLVa-1.0.0a - if (label != "") -/* +// [RLVa:KB] - Checked: 2009-07-04 (RLVa-1.4.5) | Added: RLVa-1.0.0 if ( (label != "") && (!gRlvHandler.hasBehaviour(RLV_BHVR_SHOWLOC)) ) -*/ // [/RLVa:KB] { font->renderUTF8( @@ -1063,7 +1063,7 @@ BOOL LLWorldMapView::handleToolTip( S32 x, S32 y, MASK mask ) { LLViewerRegion *region = gAgent.getRegion(); -// [RLVa:KB] - Checked: 2010-04-19 (RLVa-1.2.0f) | Modified: RLVa-1.2.0f +// [RLVa:KB] - Checked: 2010-04-19 (RLVa-1.4.5) | Modified: RLVa-1.4.5 std::string message = llformat("%s (%s)", (!gRlvHandler.hasBehaviour(RLV_BHVR_SHOWLOC)) ? info->getName().c_str() : RlvStrings::getString(RLV_STRING_HIDDEN_REGION).c_str(), info->getAccessString().c_str()); diff --git a/indra/newview/rlvui.cpp b/indra/newview/rlvui.cpp index b25f0aaad35..476140c7ea6 100644 --- a/indra/newview/rlvui.cpp +++ b/indra/newview/rlvui.cpp @@ -306,9 +306,15 @@ void RlvUIEnabler::onToggleShowLoc() // Start or stop filtering the "About Land" and "Region / Estate" floaters if ( (!fEnable) && (!m_ConnFloaterShowLoc.connected()) ) + { m_ConnFloaterShowLoc = LLFloaterReg::setValidateCallback(boost::bind(&RlvUIEnabler::filterFloaterShowLoc, this, _1, _2)); + m_ConnPanelShowLoc = LLFloaterSidePanelContainer::setValidateCallback(boost::bind(&RlvUIEnabler::filterPanelShowLoc, this, _1, _2, _3)); + } else if ( (fEnable) && (m_ConnFloaterShowLoc.connected()) ) + { m_ConnFloaterShowLoc.disconnect(); + m_ConnPanelShowLoc.disconnect(); + } } // Checked: 2010-02-28 (RLVa-1.4.0a) | Added: RLVa-1.2.0a @@ -466,7 +472,7 @@ bool RlvUIEnabler::filterFloaterGeneric(const std::string& strName, const LLSD&) return m_FilteredFloaters.end() == m_FilteredFloaters.find(strName); } -// Checked: 2010-04-22 (RLVa-1.2.0f) | Added: RLVa-1.2.0f +// Checked: 2010-04-22 (RLVa-1.4.5) | Added: RLVa-1.2.0 bool RlvUIEnabler::filterFloaterShowLoc(const std::string& strName, const LLSD&) { if ("about_land" == strName) @@ -478,6 +484,20 @@ bool RlvUIEnabler::filterFloaterShowLoc(const std::string& strName, const LLSD&) return true; } +// Checked: 2012-02-07 (RLVa-1.4.5) | Added: RLVa-1.4.5 +bool RlvUIEnabler::filterPanelShowLoc(const std::string& strFloater, const std::string&, const LLSD& sdKey) +{ + if ("places" == strFloater) + { + const std::string strType = sdKey["type"].asString(); + if ("create_landmark" == strType) + return false; + else if ("agent" == strType) + return canViewParcelProperties(); + } + return true; +} + // Checked: 2010-03-01 (RLVa-1.2.0b) | Added: RLVa-1.2.0a bool RlvUIEnabler::filterFloaterViewXXX(const std::string& strName, const LLSD&) { diff --git a/indra/newview/rlvui.h b/indra/newview/rlvui.h index 6ea6657580a..08168899fc5 100644 --- a/indra/newview/rlvui.h +++ b/indra/newview/rlvui.h @@ -72,6 +72,9 @@ class RlvUIEnabler : public LLSingleton<RlvUIEnabler> bool filterFloaterViewXXX(const std::string&, const LLSD&); boost::signals2::connection m_ConnFloaterViewXXX; // viewnote, viewscript, viewtexture + bool filterPanelShowLoc(const std::string&, const std::string&, const LLSD& ); + boost::signals2::connection m_ConnPanelShowLoc; // showloc + /* * Helper functions */ diff --git a/indra/newview/skins/default/xui/en/menu_land.xml b/indra/newview/skins/default/xui/en/menu_land.xml index cc6d8ad9c1d..a5bf849e603 100644 --- a/indra/newview/skins/default/xui/en/menu_land.xml +++ b/indra/newview/skins/default/xui/en/menu_land.xml @@ -8,6 +8,9 @@ <menu_item_call.on_click function="Floater.Show" parameter="about_land" /> + <menu_item_call.on_enable + function="Floater.CanShow" + parameter="about_land" /> </menu_item_call> <!-- <menu_item_call label="Go Here" diff --git a/indra/newview/skins/default/xui/en/menu_place_add_button.xml b/indra/newview/skins/default/xui/en/menu_place_add_button.xml index e3a39a12427..bdd4e230b94 100644 --- a/indra/newview/skins/default/xui/en/menu_place_add_button.xml +++ b/indra/newview/skins/default/xui/en/menu_place_add_button.xml @@ -23,5 +23,8 @@ <on_click function="Places.LandmarksGear.Add.Action" parameter="add_landmark" /> + <on_enable + function="Places.LandmarksGear.Enable" + parameter="add_landmark" /> </menu_item_call> </menu> diff --git a/indra/newview/skins/default/xui/en/menu_places_gear_folder.xml b/indra/newview/skins/default/xui/en/menu_places_gear_folder.xml index 1aeb166e015..4d59ab06317 100644 --- a/indra/newview/skins/default/xui/en/menu_places_gear_folder.xml +++ b/indra/newview/skins/default/xui/en/menu_places_gear_folder.xml @@ -13,6 +13,9 @@ <on_click function="Places.LandmarksGear.Add.Action" parameter="add_landmark" /> + <on_enable + function="Places.LandmarksGear.Enable" + parameter="add_landmark" /> </menu_item_call> <menu_item_call label="Add Folder" diff --git a/indra/newview/skins/default/xui/en/menu_places_gear_landmark.xml b/indra/newview/skins/default/xui/en/menu_places_gear_landmark.xml index ff5fdd37953..28c74a3d5d1 100644 --- a/indra/newview/skins/default/xui/en/menu_places_gear_landmark.xml +++ b/indra/newview/skins/default/xui/en/menu_places_gear_landmark.xml @@ -48,6 +48,9 @@ <on_click function="Places.LandmarksGear.Add.Action" parameter="add_landmark" /> + <on_enable + function="Places.LandmarksGear.Enable" + parameter="add_landmark" /> </menu_item_call> <menu_item_call label="Add Folder" diff --git a/indra/newview/skins/default/xui/en/menu_viewer.xml b/indra/newview/skins/default/xui/en/menu_viewer.xml index 35995947ded..6e8c615de13 100644 --- a/indra/newview/skins/default/xui/en/menu_viewer.xml +++ b/indra/newview/skins/default/xui/en/menu_viewer.xml @@ -390,6 +390,8 @@ name="Place Profile"> <menu_item_call.on_click function="World.PlaceProfile" /> + <menu_item_call.on_enable + function="World.EnablePlaceProfile" /> </menu_item_call> <menu_item_call label="About land" @@ -397,6 +399,9 @@ <menu_item_call.on_click function="Floater.Show" parameter="about_land" /> + <menu_item_call.on_enable + function="Floater.CanShow" + parameter="about_land" /> </menu_item_call> <menu_item_call label="Region / Estate" @@ -404,6 +409,9 @@ <menu_item_call.on_click function="Floater.Show" parameter="region_info" /> + <menu_item_call.on_enable + function="Floater.CanShow" + parameter="region_info" /> </menu_item_call> <menu_item_call label="My land holdings..." -- GitLab