From d58d2e2c20e74321e7e5ccfd3305a41f76e5e7e0 Mon Sep 17 00:00:00 2001 From: Ansariel Date: Thu, 4 Feb 2016 11:41:57 +0100 Subject: [PATCH] Consolidate check for standalone place details floater into FSFloaterPlaceDetails --- indra/newview/fsfloaterplacedetails.cpp | 15 ++++++++ indra/newview/fsfloaterplacedetails.h | 2 ++ indra/newview/llfavoritesbar.cpp | 10 ++---- indra/newview/llinventorybridge.cpp | 10 ++---- indra/newview/lllocationinputctrl.cpp | 46 ++++-------------------- indra/newview/llnetmap.cpp | 10 ++---- indra/newview/llpanellandmarks.cpp | 19 ++-------- indra/newview/llpanelplaces.cpp | 10 ++---- indra/newview/llpanelteleporthistory.cpp | 11 ++---- indra/newview/llpaneltopinfobar.cpp | 28 +++------------ indra/newview/llurldispatcher.cpp | 11 ++---- indra/newview/llviewermenu.cpp | 19 ++-------- indra/newview/llviewermessage.cpp | 19 ++-------- indra/newview/llviewertexteditor.cpp | 20 +++-------- 14 files changed, 54 insertions(+), 176 deletions(-) diff --git a/indra/newview/fsfloaterplacedetails.cpp b/indra/newview/fsfloaterplacedetails.cpp index df9671491c..315efbfc09 100644 --- a/indra/newview/fsfloaterplacedetails.cpp +++ b/indra/newview/fsfloaterplacedetails.cpp @@ -40,6 +40,7 @@ #include "llagent.h" #include "llagentpicksinfo.h" #include "llfloaterreg.h" +#include "llfloatersidepanelcontainer.h" #include "llfloaterworldmap.h" #include "llinventoryobserver.h" #include "lllandmarkactions.h" @@ -50,6 +51,7 @@ #include "llpanellandmarkinfo.h" #include "llparcel.h" #include "llteleporthistorystorage.h" +#include "llviewercontrol.h" #include "llviewermessage.h" #include "llviewermenu.h" #include "llviewerparcelmgr.h" @@ -560,6 +562,19 @@ void FSFloaterPlaceDetails::togglePickPanel(BOOL visible) } } +// static +void FSFloaterPlaceDetails::showPlaceDetails(const LLSD& key) +{ + if (gSavedSettings.getBOOL("FSUseStandalonePlaceDetailsFloater")) + { + LLFloaterReg::showInstance("fs_placedetails", key); + } + else + { + LLFloaterSidePanelContainer::showPanel("places", key); + } +} + ///////////////////////////////// // Button event handlers ///////////////////////////////// diff --git a/indra/newview/fsfloaterplacedetails.h b/indra/newview/fsfloaterplacedetails.h index cc9a8f32ed..3cb4c85594 100644 --- a/indra/newview/fsfloaterplacedetails.h +++ b/indra/newview/fsfloaterplacedetails.h @@ -63,6 +63,8 @@ public: void processParcelDetails(const LLParcelData& parcel_details); void togglePickPanel(BOOL visible); + static void showPlaceDetails(const LLSD& key); + private: enum ePlaceDisplayInfo { diff --git a/indra/newview/llfavoritesbar.cpp b/indra/newview/llfavoritesbar.cpp index 5fe055ca7a..9ab8685012 100755 --- a/indra/newview/llfavoritesbar.cpp +++ b/indra/newview/llfavoritesbar.cpp @@ -55,6 +55,7 @@ #include "llsdserialize.h" #include "llviewernetwork.h" // FIRE-10122 - User@grid stored_favorites.xml - getGrid() +#include "fsfloaterplacedetails.h" static LLDefaultChildRegistry::Register r("favorites_bar"); @@ -1263,14 +1264,7 @@ void LLFavoritesBarCtrl::doToSelected(const LLSD& userdata) // FIRE-817: Separate place details floater //LLFloaterSidePanelContainer::showPanel("places", key); - if (gSavedSettings.getBOOL("FSUseStandalonePlaceDetailsFloater")) - { - LLFloaterReg::showInstance("fs_placedetails", key); - } - else - { - LLFloaterSidePanelContainer::showPanel("places", key); - } + FSFloaterPlaceDetails::showPlaceDetails(key); // } else if (action == "copy_slurl") diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp index 89b9a8e103..f6a2937ef5 100755 --- a/indra/newview/llinventorybridge.cpp +++ b/indra/newview/llinventorybridge.cpp @@ -97,6 +97,7 @@ #include "fsgridhandler.h" #endif // +#include "fsfloaterplacedetails.h" #include @@ -5827,14 +5828,7 @@ void LLLandmarkBridge::performAction(LLInventoryModel* model, std::string action // FIRE-817: Separate place details floater //LLFloaterSidePanelContainer::showPanel("places", key); - if (gSavedSettings.getBOOL("FSUseStandalonePlaceDetailsFloater")) - { - LLFloaterReg::showInstance("fs_placedetails", key); - } - else - { - LLFloaterSidePanelContainer::showPanel("places", key); - } + FSFloaterPlaceDetails::showPlaceDetails(key); // } } diff --git a/indra/newview/lllocationinputctrl.cpp b/indra/newview/lllocationinputctrl.cpp index ab63caea8c..b0c104a2e3 100755 --- a/indra/newview/lllocationinputctrl.cpp +++ b/indra/newview/lllocationinputctrl.cpp @@ -74,6 +74,7 @@ #include "llviewernetwork.h" #endif // OPENSIM // +#include "fsfloaterplacedetails.h" //============================================================================ /* @@ -654,14 +655,7 @@ void LLLocationInputCtrl::onInfoButtonClicked() // FIRE-817: Separate place details floater //LLFloaterSidePanelContainer::showPanel("places", LLSD().with("type", "agent")); - if (gSavedSettings.getBOOL("FSUseStandalonePlaceDetailsFloater")) - { - LLFloaterReg::showInstance("fs_placedetails", LLSD().with("type", "agent")); - } - else - { - LLFloaterSidePanelContainer::showPanel("places", LLSD().with("type", "agent")); - } + FSFloaterPlaceDetails::showPlaceDetails(LLSD().with("type", "agent")); // } @@ -692,28 +686,14 @@ void LLLocationInputCtrl::onAddLandmarkButtonClicked() // FIRE-817: Separate place details floater //LLFloaterSidePanelContainer::showPanel("places", key); - if (gSavedSettings.getBOOL("FSUseStandalonePlaceDetailsFloater")) - { - LLFloaterReg::showInstance("fs_placedetails", key); - } - else - { - LLFloaterSidePanelContainer::showPanel("places", key); - } + FSFloaterPlaceDetails::showPlaceDetails(key); // } else { // FIRE-817: Separate place details floater //LLFloaterSidePanelContainer::showPanel("places", LLSD().with("type", "create_landmark")); - if (gSavedSettings.getBOOL("FSUseStandalonePlaceDetailsFloater")) - { - LLFloaterReg::showInstance("fs_placedetails", LLSD().with("type", "create_landmark")); - } - else - { - LLFloaterSidePanelContainer::showPanel("places", LLSD().with("type", "create_landmark")); - } + FSFloaterPlaceDetails::showPlaceDetails(LLSD().with("type", "create_landmark")); // } } @@ -1232,28 +1212,14 @@ void LLLocationInputCtrl::onLocationContextMenuItemClicked(const LLSD& userdata) { // FIRE-817: Separate place details floater //LLFloaterSidePanelContainer::showPanel("places", LLSD().with("type", "create_landmark")); - if (gSavedSettings.getBOOL("FSUseStandalonePlaceDetailsFloater")) - { - LLFloaterReg::showInstance("fs_placedetails", LLSD().with("type", "create_landmark")); - } - else - { - LLFloaterSidePanelContainer::showPanel("places", LLSD().with("type", "create_landmark")); - } + FSFloaterPlaceDetails::showPlaceDetails(LLSD().with("type", "create_landmark")); // } else { // FIRE-817: Separate place details floater //LLFloaterSidePanelContainer::showPanel("places", LLSD().with("type", "landmark").with("id",landmark->getUUID())); - if (gSavedSettings.getBOOL("FSUseStandalonePlaceDetailsFloater")) - { - LLFloaterReg::showInstance("fs_placedetails", LLSD().with("type", "landmark").with("id",landmark->getUUID())); - } - else - { - LLFloaterSidePanelContainer::showPanel("places", LLSD().with("type", "landmark").with("id",landmark->getUUID())); - } + FSFloaterPlaceDetails::showPlaceDetails(LLSD().with("type", "landmark").with("id",landmark->getUUID())); // } // [RLVa:KB] - Checked: 2010-04-05 (RLVa-1.2.0d) | Added: RLVa-1.2.0d diff --git a/indra/newview/llnetmap.cpp b/indra/newview/llnetmap.cpp index 1086962dce..1784577c8c 100755 --- a/indra/newview/llnetmap.cpp +++ b/indra/newview/llnetmap.cpp @@ -79,6 +79,7 @@ // [/RLVa:KB] #include "llmutelist.h" #include "lfsimfeaturehandler.h" +#include "fsfloaterplacedetails.h" // Ansariel: For accessing the radar data #include "fsradar.h" @@ -1530,14 +1531,7 @@ void LLNetMap::handleShowProfile(const LLSD& sdParam) const sdParams["y"] = mPosGlobalRightClick.mdV[VY]; sdParams["z"] = mPosGlobalRightClick.mdV[VZ]; - if (gSavedSettings.getBOOL("FSUseStandalonePlaceDetailsFloater")) - { - LLFloaterReg::showInstance("fs_placedetails", sdParams); - } - else - { - LLFloaterSidePanelContainer::showPanel("places", sdParams); - } + FSFloaterPlaceDetails::showPlaceDetails(sdParams); } } diff --git a/indra/newview/llpanellandmarks.cpp b/indra/newview/llpanellandmarks.cpp index aad7345b66..3d92f9631d 100755 --- a/indra/newview/llpanellandmarks.cpp +++ b/indra/newview/llpanellandmarks.cpp @@ -56,6 +56,7 @@ #include "lltoggleablemenu.h" #include "llviewermenu.h" #include "llviewerregion.h" +#include "fsfloaterplacedetails.h" // [RLVa:KB] #include "rlvhandler.h" // [/RLVa:KB] @@ -379,14 +380,7 @@ void LLLandmarksPanel::onSelectorButtonClicked() // FIRE-817: Separate place details floater //LLFloaterSidePanelContainer::showPanel("places", key); - if (gSavedSettings.getBOOL("FSUseStandalonePlaceDetailsFloater")) - { - LLFloaterReg::showInstance("fs_placedetails", key); - } - else - { - LLFloaterSidePanelContainer::showPanel("places", key); - } + FSFloaterPlaceDetails::showPlaceDetails(key); // } } @@ -814,14 +808,7 @@ void LLLandmarksPanel::onAddAction(const LLSD& userdata) const { // FIRE-817: Separate place details floater //LLFloaterSidePanelContainer::showPanel("places", LLSD().with("type", "create_landmark")); - if (gSavedSettings.getBOOL("FSUseStandalonePlaceDetailsFloater")) - { - LLFloaterReg::showInstance("fs_placedetails", LLSD().with("type", "create_landmark")); - } - else - { - LLFloaterSidePanelContainer::showPanel("places", LLSD().with("type", "create_landmark")); - } + FSFloaterPlaceDetails::showPlaceDetails(LLSD().with("type", "create_landmark")); // } // [RLVa:KB] - Checked: 2012-02-08 (RLVa-1.4.5) | Added: RLVa-1.4.5 diff --git a/indra/newview/llpanelplaces.cpp b/indra/newview/llpanelplaces.cpp index 8aa649d198..2a9a52a31a 100755 --- a/indra/newview/llpanelplaces.cpp +++ b/indra/newview/llpanelplaces.cpp @@ -73,6 +73,7 @@ #include "llviewerparcelmgr.h" #include "llviewerregion.h" #include "llviewerwindow.h" +#include "fsfloaterplacedetails.h" // Constants static const F32 PLACE_INFO_UPDATE_INTERVAL = 3.0; @@ -120,14 +121,7 @@ public: // FIRE-817: Separate place details floater //LLFloaterSidePanelContainer::showPanel("places", key); - if (gSavedSettings.getBOOL("FSUseStandalonePlaceDetailsFloater")) - { - LLFloaterReg::showInstance("fs_placedetails", key); - } - else - { - LLFloaterSidePanelContainer::showPanel("places", key); - } + FSFloaterPlaceDetails::showPlaceDetails(key); // return true; } diff --git a/indra/newview/llpanelteleporthistory.cpp b/indra/newview/llpanelteleporthistory.cpp index dc0d396479..394a84c015 100755 --- a/indra/newview/llpanelteleporthistory.cpp +++ b/indra/newview/llpanelteleporthistory.cpp @@ -49,6 +49,8 @@ #include "llviewercontrol.h" +#include "fsfloaterplacedetails.h" + // Maximum number of items that can be added to a list in one pass. // Used to limit time spent for items list update per frame. static const U32 ADD_LIMIT = 50; @@ -322,14 +324,7 @@ void LLTeleportHistoryFlatItem::showPlaceInfoPanel(S32 index) // FIRE-817: Separate place details floater //LLFloaterSidePanelContainer::showPanel("places", params); - if (gSavedSettings.getBOOL("FSUseStandalonePlaceDetailsFloater")) - { - LLFloaterReg::showInstance("fs_placedetails", params); - } - else - { - LLFloaterSidePanelContainer::showPanel("places", params); - } + FSFloaterPlaceDetails::showPlaceDetails(params); // } diff --git a/indra/newview/llpaneltopinfobar.cpp b/indra/newview/llpaneltopinfobar.cpp index 2dc6d9105e..b377a20dd4 100755 --- a/indra/newview/llpaneltopinfobar.cpp +++ b/indra/newview/llpaneltopinfobar.cpp @@ -47,6 +47,7 @@ // [RLVa:KB] - Checked: 2012-02-08 (RLVa-1.4.5) | Added: RLVa-1.4.5 #include "rlvhandler.h" // [/RLVa:KB] +#include "fsfloaterplacedetails.h" #include "llfloaterreg.h" @@ -477,28 +478,14 @@ void LLPanelTopInfoBar::onContextMenuItemClicked(const LLSD::String& item) { // FIRE-817: Separate place details floater //LLFloaterSidePanelContainer::showPanel("places", LLSD().with("type", "create_landmark")); - if (gSavedSettings.getBOOL("FSUseStandalonePlaceDetailsFloater")) - { - LLFloaterReg::showInstance("fs_placedetails", LLSD().with("type", "create_landmark")); - } - else - { - LLFloaterSidePanelContainer::showPanel("places", LLSD().with("type", "create_landmark")); - } + FSFloaterPlaceDetails::showPlaceDetails(LLSD().with("type", "create_landmark")); // } else { // FIRE-817: Separate place details floater //LLFloaterSidePanelContainer::showPanel("places", LLSD().with("type", "landmark").with("id",landmark->getUUID())); - if (gSavedSettings.getBOOL("FSUseStandalonePlaceDetailsFloater")) - { - LLFloaterReg::showInstance("fs_placedetails", LLSD().with("type", "landmark").with("id",landmark->getUUID())); - } - else - { - LLFloaterSidePanelContainer::showPanel("places", LLSD().with("type", "landmark").with("id",landmark->getUUID())); - } + FSFloaterPlaceDetails::showPlaceDetails(LLSD().with("type", "landmark").with("id",landmark->getUUID())); // } // [RLVa:KB] - Checked: 2012-02-08 (RLVa-1.4.5) | Added: RLVa-1.4.5 @@ -531,14 +518,7 @@ void LLPanelTopInfoBar::onInfoButtonClicked() // FIRE-817: Separate place details floater //LLFloaterSidePanelContainer::showPanel("places", LLSD().with("type", "agent")); - //if (gSavedSettings.getBOOL("FSUseStandalonePlaceDetailsFloater")) - //{ - // LLFloaterReg::showInstance("fs_placedetails", LLSD().with("type", "agent")); - //} - //else - //{ - // LLFloaterSidePanelContainer::showPanel("places", LLSD().with("type", "agent")); - //} + //FSFloaterPlaceDetails::showPlaceDetails(LLSD().with("type", "agent")); // LLFloaterReg::showInstance("about_land"); } diff --git a/indra/newview/llurldispatcher.cpp b/indra/newview/llurldispatcher.cpp index 97512fae90..6e8caa77d3 100644 --- a/indra/newview/llurldispatcher.cpp +++ b/indra/newview/llurldispatcher.cpp @@ -52,6 +52,8 @@ #include "llnotificationsutil.h" #include "llsd.h" +#include "fsfloaterplacedetails.h" + static LLURLDispatcherListener sURLDispatcherListener; class LLURLDispatcherImpl @@ -302,14 +304,7 @@ void LLURLDispatcherImpl::regionHandleCallback(U64 region_handle, const LLSLURL& // FIRE-817: Separate place details floater //LLFloaterSidePanelContainer::showPanel("places", key); - if (gSavedSettings.getBOOL("FSUseStandalonePlaceDetailsFloater")) - { - LLFloaterReg::showInstance("fs_placedetails", key); - } - else - { - LLFloaterSidePanelContainer::showPanel("places", key); - } + FSFloaterPlaceDetails::showPlaceDetails(key); // } } diff --git a/indra/newview/llviewermenu.cpp b/indra/newview/llviewermenu.cpp index 72d397fba4..99ee5ec13f 100755 --- a/indra/newview/llviewermenu.cpp +++ b/indra/newview/llviewermenu.cpp @@ -159,6 +159,7 @@ #include "llfloaterpreference.h" // Volume controls prefs #include "llcheckboxctrl.h" // Volume controls prefs #include "llscenemonitor.h" +#include "fsfloaterplacedetails.h" using namespace LLAvatarAppearanceDefines; @@ -7142,14 +7143,7 @@ class LLWorldCreateLandmark : public view_listener_t // FIRE-817: Separate place details floater //LLFloaterSidePanelContainer::showPanel("places", LLSD().with("type", "create_landmark")); - if (gSavedSettings.getBOOL("FSUseStandalonePlaceDetailsFloater")) - { - LLFloaterReg::showInstance("fs_placedetails", LLSD().with("type", "create_landmark")); - } - else - { - LLFloaterSidePanelContainer::showPanel("places", LLSD().with("type", "create_landmark")); - } + FSFloaterPlaceDetails::showPlaceDetails(LLSD().with("type", "create_landmark")); // return true; @@ -7167,14 +7161,7 @@ class LLWorldPlaceProfile : public view_listener_t // FIRE-817: Separate place details floater //LLFloaterSidePanelContainer::showPanel("places", LLSD().with("type", "agent")); - if (gSavedSettings.getBOOL("FSUseStandalonePlaceDetailsFloater")) - { - LLFloaterReg::showInstance("fs_placedetails", LLSD().with("type", "agent")); - } - else - { - LLFloaterSidePanelContainer::showPanel("places", LLSD().with("type", "agent")); - } + FSFloaterPlaceDetails::showPlaceDetails(LLSD().with("type", "agent")); // return true; diff --git a/indra/newview/llviewermessage.cpp b/indra/newview/llviewermessage.cpp index e242b758ab..2481370230 100644 --- a/indra/newview/llviewermessage.cpp +++ b/indra/newview/llviewermessage.cpp @@ -132,6 +132,7 @@ #include "fsareasearch.h" #include "fscommon.h" #include "fsdata.h" +#include "fsfloaterplacedetails.h" #include "fsradar.h" #include "fskeywords.h" // FIRE-10178: Keyword Alerts in group IM do not work unless the group is in the foreground #include "fslightshare.h" // FIRE-5118 - Lightshare support @@ -1415,14 +1416,7 @@ void open_inventory_offer(const uuid_vec_t& objects, const std::string& from_nam { // FIRE-817: Separate place details floater //LLFloaterSidePanelContainer::showPanel("places", LLSD().with("type", "landmark").with("id", item->getUUID())); - if (gSavedSettings.getBOOL("FSUseStandalonePlaceDetailsFloater")) - { - LLFloaterReg::showInstance("fs_placedetails", LLSD().with("type", "landmark").with("id", item->getUUID())); - } - else - { - LLFloaterSidePanelContainer::showPanel("places", LLSD().with("type", "landmark").with("id", item->getUUID())); - } + FSFloaterPlaceDetails::showPlaceDetails(LLSD().with("type", "landmark").with("id", item->getUUID())); // } else if("group_offer" == from_name) @@ -1435,14 +1429,7 @@ void open_inventory_offer(const uuid_vec_t& objects, const std::string& from_nam // FIRE-817: Separate place details floater //LLFloaterSidePanelContainer::showPanel("places", args); - if (gSavedSettings.getBOOL("FSUseStandalonePlaceDetailsFloater")) - { - LLFloaterReg::showInstance("fs_placedetails", args); - } - else - { - LLFloaterSidePanelContainer::showPanel("places", args); - } + FSFloaterPlaceDetails::showPlaceDetails(args); // continue; diff --git a/indra/newview/llviewertexteditor.cpp b/indra/newview/llviewertexteditor.cpp index 521fa2f622..16c35854fd 100755 --- a/indra/newview/llviewertexteditor.cpp +++ b/indra/newview/llviewertexteditor.cpp @@ -61,6 +61,8 @@ #include "llviewertexturelist.h" #include "llviewerwindow.h" +#include "fsfloaterplacedetails.h" + static LLDefaultChildRegistry::Register r("text_editor"); ///----------------------------------------------------------------------- @@ -83,14 +85,7 @@ public: // FIRE-817: Separate place details floater //LLFloaterSidePanelContainer::showPanel("places", key); - if (gSavedSettings.getBOOL("FSUseStandalonePlaceDetailsFloater")) - { - LLFloaterReg::showInstance("fs_placedetails", key); - } - else - { - LLFloaterSidePanelContainer::showPanel("places", key); - } + FSFloaterPlaceDetails::showPlaceDetails(key); // } @@ -105,14 +100,7 @@ public: // FIRE-817: Separate place details floater //LLFloaterSidePanelContainer::showPanel("places", key); - if (gSavedSettings.getBOOL("FSUseStandalonePlaceDetailsFloater")) - { - LLFloaterReg::showInstance("fs_placedetails", key); - } - else - { - LLFloaterSidePanelContainer::showPanel("places", key); - } + FSFloaterPlaceDetails::showPlaceDetails(key); // } // [/SL:KB]