From be50a053ed4ae7d0b15fc20f1c6ca0973c56ffd9 Mon Sep 17 00:00:00 2001 From: Richard Nelson Date: Thu, 12 Aug 2010 09:46:45 -0700 Subject: first pass at hints --- indra/newview/llviewermessage.cpp | 3 +++ 1 file changed, 3 insertions(+) (limited to 'indra/newview/llviewermessage.cpp') diff --git a/indra/newview/llviewermessage.cpp b/indra/newview/llviewermessage.cpp index a04c919310..9bb734a3d3 100644 --- a/indra/newview/llviewermessage.cpp +++ b/indra/newview/llviewermessage.cpp @@ -56,6 +56,7 @@ #include "llagentcamera.h" #include "llcallingcard.h" #include "llbuycurrencyhtml.h" +#include "llfirstuse.h" #include "llfloaterbuyland.h" #include "llfloaterland.h" #include "llfloaterregioninfo.h" @@ -1763,6 +1764,8 @@ void inventory_offer_handler(LLOfferInfo* info) return; } + LLFirstUse::inventoryOffer(); + // Avoid the Accept/Discard dialog if the user so desires. JC if (gSavedSettings.getBOOL("AutoAcceptNewInventory") && (info->mType == LLAssetType::AT_NOTECARD -- cgit v1.3 From 87d9a34ab869a6e31d83cae8cc55beaebc0c7ff9 Mon Sep 17 00:00:00 2001 From: Richard Linden Date: Wed, 18 Aug 2010 11:50:24 -0700 Subject: DEV-52669 FIX Inventory Notification not given if first Inventory Item comes from buying object contents --- indra/newview/llviewermessage.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'indra/newview/llviewermessage.cpp') diff --git a/indra/newview/llviewermessage.cpp b/indra/newview/llviewermessage.cpp index 9bb734a3d3..067c0f3a80 100644 --- a/indra/newview/llviewermessage.cpp +++ b/indra/newview/llviewermessage.cpp @@ -1080,6 +1080,7 @@ bool check_offer_throttle(const std::string& from_name, bool check_only) void open_inventory_offer(const uuid_vec_t& objects, const std::string& from_name) { + LLFirstUse::inventoryOffer(); for (uuid_vec_t::const_iterator obj_iter = objects.begin(); obj_iter != objects.end(); ++obj_iter) -- cgit v1.3 From af108e324ae45ba3a055e7b55bea3f3b03c7f48d Mon Sep 17 00:00:00 2001 From: Richard Linden Date: Thu, 19 Aug 2010 13:24:37 -0700 Subject: DEV-52669 FIX Inventory notification not given if first item comes from buying contents --- indra/newview/llfirstuse.cpp | 2 +- indra/newview/llfirstuse.h | 2 +- indra/newview/llfloaterbuycontents.cpp | 5 +++++ indra/newview/llsidepanelinventory.cpp | 2 +- indra/newview/llviewermessage.cpp | 14 +++++++++++--- 5 files changed, 19 insertions(+), 6 deletions(-) (limited to 'indra/newview/llviewermessage.cpp') diff --git a/indra/newview/llfirstuse.cpp b/indra/newview/llfirstuse.cpp index 1ede2be978..c153f8b787 100644 --- a/indra/newview/llfirstuse.cpp +++ b/indra/newview/llfirstuse.cpp @@ -90,7 +90,7 @@ void LLFirstUse::sit(bool enable) } // static -void LLFirstUse::inventoryOffer(bool enable) +void LLFirstUse::newInventory(bool enable) { firstUseNotification("FirstInventoryOffer", enable, "HintInventory", LLSD(), LLSD().with("target", "inventory_btn").with("direction", "left")); } diff --git a/indra/newview/llfirstuse.h b/indra/newview/llfirstuse.h index 9c4ab14006..174706f1f4 100644 --- a/indra/newview/llfirstuse.h +++ b/indra/newview/llfirstuse.h @@ -95,7 +95,7 @@ public: static void notUsingDestinationGuide(bool enable = true); static void notUsingSidePanel(bool enable = true); static void notMoving(bool enable = true); - static void inventoryOffer(bool enable = true); + static void newInventory(bool enable = true); static void receiveLindens(bool enable = true); static void useSandbox(); diff --git a/indra/newview/llfloaterbuycontents.cpp b/indra/newview/llfloaterbuycontents.cpp index 3cdd7b801b..8e93a6bf03 100644 --- a/indra/newview/llfloaterbuycontents.cpp +++ b/indra/newview/llfloaterbuycontents.cpp @@ -47,6 +47,7 @@ #include "llinventorydefines.h" #include "llinventoryfunctions.h" #include "llinventorymodel.h" // for gInventory +#include "llfirstuse.h" #include "llfloaterreg.h" #include "llfloaterinventory.h" // for LLInventoryIcon::getIcon #include "llnotificationsutil.h" @@ -289,6 +290,10 @@ void LLFloaterBuyContents::onClickBuy() // it doesn't match region info then sale is canceled. LLSelectMgr::getInstance()->sendBuy(gAgent.getID(), category_id, mSaleInfo); + // NOTE: do this here instead of on receipt of object, since contents are transfered + // via a generic BulkUpdateInventory message with no way of distinguishing it from + // other inventory operations + LLFirstUse::newInventory(); closeFloater(); } diff --git a/indra/newview/llsidepanelinventory.cpp b/indra/newview/llsidepanelinventory.cpp index aa29f6cb26..66a8a520af 100644 --- a/indra/newview/llsidepanelinventory.cpp +++ b/indra/newview/llsidepanelinventory.cpp @@ -129,7 +129,7 @@ BOOL LLSidepanelInventory::postBuild() void LLSidepanelInventory::onOpen(const LLSD& key) { - LLFirstUse::inventoryOffer(false); + LLFirstUse::newInventory(false); if(key.size() == 0) return; diff --git a/indra/newview/llviewermessage.cpp b/indra/newview/llviewermessage.cpp index 067c0f3a80..71dff61f41 100644 --- a/indra/newview/llviewermessage.cpp +++ b/indra/newview/llviewermessage.cpp @@ -937,6 +937,15 @@ protected: //one global instance to bind them LLOpenTaskOffer* gNewInventoryObserver=NULL; +class LLNewInventoryHintObserver : public LLInventoryAddedObserver +{ +protected: + /*virtual*/ void done() + { + LLFirstUse::newInventory(); + } +}; + void start_new_inventory_observer() { if (!gNewInventoryObserver) //task offer observer @@ -952,6 +961,8 @@ void start_new_inventory_observer() gInventoryMoveObserver = new LLViewerInventoryMoveFromWorldObserver; gInventory.addObserver(gInventoryMoveObserver); } + + gInventory.addObserver(new LLNewInventoryHintObserver()); } class LLDiscardAgentOffer : public LLInventoryFetchItemsObserver @@ -1080,7 +1091,6 @@ bool check_offer_throttle(const std::string& from_name, bool check_only) void open_inventory_offer(const uuid_vec_t& objects, const std::string& from_name) { - LLFirstUse::inventoryOffer(); for (uuid_vec_t::const_iterator obj_iter = objects.begin(); obj_iter != objects.end(); ++obj_iter) @@ -1765,8 +1775,6 @@ void inventory_offer_handler(LLOfferInfo* info) return; } - LLFirstUse::inventoryOffer(); - // Avoid the Accept/Discard dialog if the user so desires. JC if (gSavedSettings.getBOOL("AutoAcceptNewInventory") && (info->mType == LLAssetType::AT_NOTECARD -- cgit v1.3 From 9d64b4adf5e455336cbac0ece1598e14ebe40a48 Mon Sep 17 00:00:00 2001 From: Richard Nelson Date: Fri, 20 Aug 2010 14:48:50 -0700 Subject: DEV-52870 FIX Inventory Notification not given if first Inventory Item comes from a user sharing an object or purchase from xstreet --- indra/newview/llviewermessage.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'indra/newview/llviewermessage.cpp') diff --git a/indra/newview/llviewermessage.cpp b/indra/newview/llviewermessage.cpp index 71dff61f41..7bf1031253 100644 --- a/indra/newview/llviewermessage.cpp +++ b/indra/newview/llviewermessage.cpp @@ -1889,6 +1889,8 @@ void inventory_offer_handler(LLOfferInfo* info) LLPostponedNotification::add(p, info->mFromID, false); } } + + LLFirstUse::newInventory(); } bool lure_callback(const LLSD& notification, const LLSD& response) -- cgit v1.3 From 83bb4b9518da813a42e49366cea15e5ae9dc7507 Mon Sep 17 00:00:00 2001 From: Richard Linden Date: Thu, 16 Sep 2010 22:10:30 -0700 Subject: fixed merge --- indra/llui/lllayoutstack.cpp | 4 ++-- indra/newview/llagentui.h | 1 - indra/newview/llappviewer.cpp | 1 + indra/newview/llbottomtray.h | 1 + indra/newview/llbrowsernotification.cpp | 6 +++--- indra/newview/llimhandler.cpp | 1 + indra/newview/llnearbychathandler.cpp | 3 ++- indra/newview/llnotificationalerthandler.cpp | 2 +- indra/newview/llnotificationgrouphandler.cpp | 1 + indra/newview/llnotificationhandler.h | 18 ++++++++---------- indra/newview/llnotificationhandlerutil.cpp | 1 + indra/newview/llnotificationofferhandler.cpp | 1 + indra/newview/llnotificationscripthandler.cpp | 1 + indra/newview/llnotificationtiphandler.cpp | 3 +++ indra/newview/llsyswellwindow.cpp | 1 + indra/newview/llviewermessage.cpp | 3 +++ 16 files changed, 30 insertions(+), 18 deletions(-) (limited to 'indra/newview/llviewermessage.cpp') diff --git a/indra/llui/lllayoutstack.cpp b/indra/llui/lllayoutstack.cpp index a0275b6ed5..940c7e7e18 100644 --- a/indra/llui/lllayoutstack.cpp +++ b/indra/llui/lllayoutstack.cpp @@ -208,8 +208,8 @@ S32 LLLayoutStack::getDefaultWidth(S32 cur_width) void LLLayoutStack::movePanel(LLPanel* panel_to_move, LLPanel* target_panel, bool move_to_front) { - LayoutPanel* embedded_panel_to_move = findEmbeddedPanel(panel_to_move); - LayoutPanel* embedded_target_panel = move_to_front ? *mPanels.begin() : findEmbeddedPanel(target_panel); + LLLayoutPanel* embedded_panel_to_move = findEmbeddedPanel(panel_to_move); + LLLayoutPanel* embedded_target_panel = move_to_front ? *mPanels.begin() : findEmbeddedPanel(target_panel); if (!embedded_panel_to_move || !embedded_target_panel || embedded_panel_to_move == embedded_target_panel) { diff --git a/indra/newview/llagentui.h b/indra/newview/llagentui.h index afc0ba5d9a..be7d0c365a 100644 --- a/indra/newview/llagentui.h +++ b/indra/newview/llagentui.h @@ -26,7 +26,6 @@ #ifndef LLAGENTUI_H #define LLAGENTUI_H - class LLSLURL; class LLAgentUI diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp index 333c92e50d..3b374947a0 100644 --- a/indra/newview/llappviewer.cpp +++ b/indra/newview/llappviewer.cpp @@ -46,6 +46,7 @@ #include "llmd5.h" #include "llpumpio.h" #include "llmimetypes.h" +#include "llmodaldialog.h" #include "llslurl.h" #include "llstartup.h" #include "llfocusmgr.h" diff --git a/indra/newview/llbottomtray.h b/indra/newview/llbottomtray.h index 35e00924aa..6225d4c92c 100644 --- a/indra/newview/llbottomtray.h +++ b/indra/newview/llbottomtray.h @@ -29,6 +29,7 @@ #include "llpanel.h" #include "llimview.h" +#include "llbutton.h" class LLChicletPanel; class LLLayoutStack; diff --git a/indra/newview/llbrowsernotification.cpp b/indra/newview/llbrowsernotification.cpp index cc54d10944..8eb0bb1e0b 100644 --- a/indra/newview/llbrowsernotification.cpp +++ b/indra/newview/llbrowsernotification.cpp @@ -28,9 +28,9 @@ #include "llviewerprecompiledheaders.h" // must be first include #include "llnotificationhandler.h" -#include "llnotifications.h" -#include "llfloatermediabrowser.h" -#include "llfloaterreg.h" +//#include "llnotifications.h" +//#include "llfloatermediabrowser.h" +//#include "llfloaterreg.h" using namespace LLNotificationsUI; diff --git a/indra/newview/llimhandler.cpp b/indra/newview/llimhandler.cpp index bc76092a20..e8c905a266 100644 --- a/indra/newview/llimhandler.cpp +++ b/indra/newview/llimhandler.cpp @@ -28,6 +28,7 @@ #include "llviewerprecompiledheaders.h" // must be first include #include "llnotificationhandler.h" +#include "llchannelmanager.h" #include "llagentdata.h" #include "llnotifications.h" diff --git a/indra/newview/llnearbychathandler.cpp b/indra/newview/llnearbychathandler.cpp index 303f2abcce..83777af31a 100644 --- a/indra/newview/llnearbychathandler.cpp +++ b/indra/newview/llnearbychathandler.cpp @@ -28,7 +28,7 @@ #include "llagentdata.h" // for gAgentID #include "llnearbychathandler.h" - +#include "llchannelmanager.h" #include "llbottomtray.h" #include "llchatitemscontainerctrl.h" #include "llfirstuse.h" @@ -36,6 +36,7 @@ #include "llhints.h" #include "llnearbychat.h" #include "llrecentpeople.h" +#include "llscreenchannel.h" #include "llviewercontrol.h" diff --git a/indra/newview/llnotificationalerthandler.cpp b/indra/newview/llnotificationalerthandler.cpp index dcbf6b64ce..6b9bd0436f 100644 --- a/indra/newview/llnotificationalerthandler.cpp +++ b/indra/newview/llnotificationalerthandler.cpp @@ -28,7 +28,7 @@ #include "llviewerprecompiledheaders.h" // must be first include #include "llnotificationhandler.h" - +#include "llchannelmanager.h" #include "llnotifications.h" #include "llprogressview.h" #include "lltoastnotifypanel.h" diff --git a/indra/newview/llnotificationgrouphandler.cpp b/indra/newview/llnotificationgrouphandler.cpp index 9933a8a49c..3819cb06e8 100644 --- a/indra/newview/llnotificationgrouphandler.cpp +++ b/indra/newview/llnotificationgrouphandler.cpp @@ -26,6 +26,7 @@ #include "llviewerprecompiledheaders.h" // must be first include +#include "llchannelmanager.h" #include "llnotificationhandler.h" #include "lltoastgroupnotifypanel.h" #include "llgroupactions.h" diff --git a/indra/newview/llnotificationhandler.h b/indra/newview/llnotificationhandler.h index 28a69f2373..f20ddd20d5 100644 --- a/indra/newview/llnotificationhandler.h +++ b/indra/newview/llnotificationhandler.h @@ -27,19 +27,17 @@ #ifndef LL_LLNOTIFICATIONHANDLER_H #define LL_LLNOTIFICATIONHANDLER_H - -#include "llwindow.h" - -//#include "llnotificationsutil.h" -#include "llchannelmanager.h" -#include "llchat.h" -#include "llinstantmessage.h" -#include "llnotificationptr.h" - class LLIMFloater; +class LLChat; + +typedef boost::shared_ptr LLNotificationPtr; +enum EInstantMessage; +typedef enum e_chat_source_type EChatSourceType; namespace LLNotificationsUI { + class LLToast; + // ENotificationType enumerates all possible types of notifications that could be met // typedef enum e_notification_type @@ -103,7 +101,7 @@ protected: // at the moment, when a handlers creates a channel. virtual void initChannel()=0; - LLScreenChannelBase* mChannel; + class LLScreenChannelBase* mChannel; e_notification_type mType; }; diff --git a/indra/newview/llnotificationhandlerutil.cpp b/indra/newview/llnotificationhandlerutil.cpp index 4231a73af1..7c82ca0da9 100644 --- a/indra/newview/llnotificationhandlerutil.cpp +++ b/indra/newview/llnotificationhandlerutil.cpp @@ -34,6 +34,7 @@ #include "llfloaterreg.h" #include "llnearbychat.h" #include "llimfloater.h" +#include "llscreenchannel.h" using namespace LLNotificationsUI; diff --git a/indra/newview/llnotificationofferhandler.cpp b/indra/newview/llnotificationofferhandler.cpp index 85f95bd0c7..2c10aac06c 100644 --- a/indra/newview/llnotificationofferhandler.cpp +++ b/indra/newview/llnotificationofferhandler.cpp @@ -27,6 +27,7 @@ #include "llviewerprecompiledheaders.h" // must be first include +#include "llchannelmanager.h" #include "llnotificationhandler.h" #include "lltoastnotifypanel.h" #include "llviewercontrol.h" diff --git a/indra/newview/llnotificationscripthandler.cpp b/indra/newview/llnotificationscripthandler.cpp index b4d28bb346..89b29756fb 100644 --- a/indra/newview/llnotificationscripthandler.cpp +++ b/indra/newview/llnotificationscripthandler.cpp @@ -27,6 +27,7 @@ #include "llviewerprecompiledheaders.h" // must be first include +#include "llchannelmanager.h" #include "llnotificationhandler.h" #include "lltoastnotifypanel.h" #include "llviewercontrol.h" diff --git a/indra/newview/llnotificationtiphandler.cpp b/indra/newview/llnotificationtiphandler.cpp index 94612975a2..3c1cd107df 100644 --- a/indra/newview/llnotificationtiphandler.cpp +++ b/indra/newview/llnotificationtiphandler.cpp @@ -27,6 +27,8 @@ #include "llviewerprecompiledheaders.h" // must be first include +#include "llchannelmanager.h" +#include "llinstantmessage.h" #include "llfloaterreg.h" #include "llnearbychat.h" #include "llnotificationhandler.h" @@ -36,6 +38,7 @@ #include "llviewerwindow.h" #include "llnotificationmanager.h" #include "llpaneltiptoast.h" +#include "lltoast.h" using namespace LLNotificationsUI; diff --git a/indra/newview/llsyswellwindow.cpp b/indra/newview/llsyswellwindow.cpp index 99342bb564..ca93027352 100644 --- a/indra/newview/llsyswellwindow.cpp +++ b/indra/newview/llsyswellwindow.cpp @@ -40,6 +40,7 @@ #include "llviewerwindow.h" #include "llchiclet.h" +#include "llchannelmanager.h" #include "lltoastpanel.h" #include "llnotificationmanager.h" #include "llnotificationsutil.h" diff --git a/indra/newview/llviewermessage.cpp b/indra/newview/llviewermessage.cpp index 48d11e1f05..317d08cc52 100644 --- a/indra/newview/llviewermessage.cpp +++ b/indra/newview/llviewermessage.cpp @@ -49,6 +49,7 @@ #include "llagent.h" #include "llagentcamera.h" #include "llcallingcard.h" +#include "llchannelmanager.h" #include "llbuycurrencyhtml.h" #include "llfirstuse.h" #include "llfloaterbuyland.h" @@ -76,11 +77,13 @@ #include "llstatenums.h" #include "llstatusbar.h" #include "llimview.h" +#include "llscreenchannel.h" #include "llspeakers.h" #include "lltrans.h" #include "lltranslate.h" #include "llviewerfoldertype.h" #include "lluri.h" +#include "llviewercontrol.h" #include "llviewergenericmessage.h" #include "llviewermenu.h" #include "llviewerjoystick.h" -- cgit v1.3 From 949b60465593764118c03d0f4e112f69c41bab31 Mon Sep 17 00:00:00 2001 From: Richard Linden Date: Fri, 17 Sep 2010 15:01:44 -0700 Subject: Backed out changeset: d71309f8bd0e --- indra/llui/lllayoutstack.cpp | 4 ++-- indra/newview/llagentui.h | 1 + indra/newview/llappviewer.cpp | 1 - indra/newview/llbottomtray.h | 1 - indra/newview/llbrowsernotification.cpp | 6 +++--- indra/newview/llimhandler.cpp | 1 - indra/newview/llnearbychathandler.cpp | 3 +-- indra/newview/llnotificationalerthandler.cpp | 2 +- indra/newview/llnotificationgrouphandler.cpp | 1 - indra/newview/llnotificationhandler.h | 18 ++++++++++-------- indra/newview/llnotificationhandlerutil.cpp | 1 - indra/newview/llnotificationofferhandler.cpp | 1 - indra/newview/llnotificationscripthandler.cpp | 1 - indra/newview/llnotificationtiphandler.cpp | 3 --- indra/newview/llsyswellwindow.cpp | 1 - indra/newview/llviewermessage.cpp | 3 --- 16 files changed, 18 insertions(+), 30 deletions(-) (limited to 'indra/newview/llviewermessage.cpp') diff --git a/indra/llui/lllayoutstack.cpp b/indra/llui/lllayoutstack.cpp index 940c7e7e18..a0275b6ed5 100644 --- a/indra/llui/lllayoutstack.cpp +++ b/indra/llui/lllayoutstack.cpp @@ -208,8 +208,8 @@ S32 LLLayoutStack::getDefaultWidth(S32 cur_width) void LLLayoutStack::movePanel(LLPanel* panel_to_move, LLPanel* target_panel, bool move_to_front) { - LLLayoutPanel* embedded_panel_to_move = findEmbeddedPanel(panel_to_move); - LLLayoutPanel* embedded_target_panel = move_to_front ? *mPanels.begin() : findEmbeddedPanel(target_panel); + LayoutPanel* embedded_panel_to_move = findEmbeddedPanel(panel_to_move); + LayoutPanel* embedded_target_panel = move_to_front ? *mPanels.begin() : findEmbeddedPanel(target_panel); if (!embedded_panel_to_move || !embedded_target_panel || embedded_panel_to_move == embedded_target_panel) { diff --git a/indra/newview/llagentui.h b/indra/newview/llagentui.h index be7d0c365a..afc0ba5d9a 100644 --- a/indra/newview/llagentui.h +++ b/indra/newview/llagentui.h @@ -26,6 +26,7 @@ #ifndef LLAGENTUI_H #define LLAGENTUI_H + class LLSLURL; class LLAgentUI diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp index 3b374947a0..333c92e50d 100644 --- a/indra/newview/llappviewer.cpp +++ b/indra/newview/llappviewer.cpp @@ -46,7 +46,6 @@ #include "llmd5.h" #include "llpumpio.h" #include "llmimetypes.h" -#include "llmodaldialog.h" #include "llslurl.h" #include "llstartup.h" #include "llfocusmgr.h" diff --git a/indra/newview/llbottomtray.h b/indra/newview/llbottomtray.h index 6225d4c92c..35e00924aa 100644 --- a/indra/newview/llbottomtray.h +++ b/indra/newview/llbottomtray.h @@ -29,7 +29,6 @@ #include "llpanel.h" #include "llimview.h" -#include "llbutton.h" class LLChicletPanel; class LLLayoutStack; diff --git a/indra/newview/llbrowsernotification.cpp b/indra/newview/llbrowsernotification.cpp index 8eb0bb1e0b..cc54d10944 100644 --- a/indra/newview/llbrowsernotification.cpp +++ b/indra/newview/llbrowsernotification.cpp @@ -28,9 +28,9 @@ #include "llviewerprecompiledheaders.h" // must be first include #include "llnotificationhandler.h" -//#include "llnotifications.h" -//#include "llfloatermediabrowser.h" -//#include "llfloaterreg.h" +#include "llnotifications.h" +#include "llfloatermediabrowser.h" +#include "llfloaterreg.h" using namespace LLNotificationsUI; diff --git a/indra/newview/llimhandler.cpp b/indra/newview/llimhandler.cpp index e8c905a266..bc76092a20 100644 --- a/indra/newview/llimhandler.cpp +++ b/indra/newview/llimhandler.cpp @@ -28,7 +28,6 @@ #include "llviewerprecompiledheaders.h" // must be first include #include "llnotificationhandler.h" -#include "llchannelmanager.h" #include "llagentdata.h" #include "llnotifications.h" diff --git a/indra/newview/llnearbychathandler.cpp b/indra/newview/llnearbychathandler.cpp index 83777af31a..303f2abcce 100644 --- a/indra/newview/llnearbychathandler.cpp +++ b/indra/newview/llnearbychathandler.cpp @@ -28,7 +28,7 @@ #include "llagentdata.h" // for gAgentID #include "llnearbychathandler.h" -#include "llchannelmanager.h" + #include "llbottomtray.h" #include "llchatitemscontainerctrl.h" #include "llfirstuse.h" @@ -36,7 +36,6 @@ #include "llhints.h" #include "llnearbychat.h" #include "llrecentpeople.h" -#include "llscreenchannel.h" #include "llviewercontrol.h" diff --git a/indra/newview/llnotificationalerthandler.cpp b/indra/newview/llnotificationalerthandler.cpp index 6b9bd0436f..dcbf6b64ce 100644 --- a/indra/newview/llnotificationalerthandler.cpp +++ b/indra/newview/llnotificationalerthandler.cpp @@ -28,7 +28,7 @@ #include "llviewerprecompiledheaders.h" // must be first include #include "llnotificationhandler.h" -#include "llchannelmanager.h" + #include "llnotifications.h" #include "llprogressview.h" #include "lltoastnotifypanel.h" diff --git a/indra/newview/llnotificationgrouphandler.cpp b/indra/newview/llnotificationgrouphandler.cpp index 3819cb06e8..9933a8a49c 100644 --- a/indra/newview/llnotificationgrouphandler.cpp +++ b/indra/newview/llnotificationgrouphandler.cpp @@ -26,7 +26,6 @@ #include "llviewerprecompiledheaders.h" // must be first include -#include "llchannelmanager.h" #include "llnotificationhandler.h" #include "lltoastgroupnotifypanel.h" #include "llgroupactions.h" diff --git a/indra/newview/llnotificationhandler.h b/indra/newview/llnotificationhandler.h index f20ddd20d5..28a69f2373 100644 --- a/indra/newview/llnotificationhandler.h +++ b/indra/newview/llnotificationhandler.h @@ -27,17 +27,19 @@ #ifndef LL_LLNOTIFICATIONHANDLER_H #define LL_LLNOTIFICATIONHANDLER_H -class LLIMFloater; -class LLChat; -typedef boost::shared_ptr LLNotificationPtr; -enum EInstantMessage; -typedef enum e_chat_source_type EChatSourceType; +#include "llwindow.h" + +//#include "llnotificationsutil.h" +#include "llchannelmanager.h" +#include "llchat.h" +#include "llinstantmessage.h" +#include "llnotificationptr.h" + +class LLIMFloater; namespace LLNotificationsUI { - class LLToast; - // ENotificationType enumerates all possible types of notifications that could be met // typedef enum e_notification_type @@ -101,7 +103,7 @@ protected: // at the moment, when a handlers creates a channel. virtual void initChannel()=0; - class LLScreenChannelBase* mChannel; + LLScreenChannelBase* mChannel; e_notification_type mType; }; diff --git a/indra/newview/llnotificationhandlerutil.cpp b/indra/newview/llnotificationhandlerutil.cpp index 7c82ca0da9..4231a73af1 100644 --- a/indra/newview/llnotificationhandlerutil.cpp +++ b/indra/newview/llnotificationhandlerutil.cpp @@ -34,7 +34,6 @@ #include "llfloaterreg.h" #include "llnearbychat.h" #include "llimfloater.h" -#include "llscreenchannel.h" using namespace LLNotificationsUI; diff --git a/indra/newview/llnotificationofferhandler.cpp b/indra/newview/llnotificationofferhandler.cpp index 2c10aac06c..85f95bd0c7 100644 --- a/indra/newview/llnotificationofferhandler.cpp +++ b/indra/newview/llnotificationofferhandler.cpp @@ -27,7 +27,6 @@ #include "llviewerprecompiledheaders.h" // must be first include -#include "llchannelmanager.h" #include "llnotificationhandler.h" #include "lltoastnotifypanel.h" #include "llviewercontrol.h" diff --git a/indra/newview/llnotificationscripthandler.cpp b/indra/newview/llnotificationscripthandler.cpp index 89b29756fb..b4d28bb346 100644 --- a/indra/newview/llnotificationscripthandler.cpp +++ b/indra/newview/llnotificationscripthandler.cpp @@ -27,7 +27,6 @@ #include "llviewerprecompiledheaders.h" // must be first include -#include "llchannelmanager.h" #include "llnotificationhandler.h" #include "lltoastnotifypanel.h" #include "llviewercontrol.h" diff --git a/indra/newview/llnotificationtiphandler.cpp b/indra/newview/llnotificationtiphandler.cpp index 3c1cd107df..94612975a2 100644 --- a/indra/newview/llnotificationtiphandler.cpp +++ b/indra/newview/llnotificationtiphandler.cpp @@ -27,8 +27,6 @@ #include "llviewerprecompiledheaders.h" // must be first include -#include "llchannelmanager.h" -#include "llinstantmessage.h" #include "llfloaterreg.h" #include "llnearbychat.h" #include "llnotificationhandler.h" @@ -38,7 +36,6 @@ #include "llviewerwindow.h" #include "llnotificationmanager.h" #include "llpaneltiptoast.h" -#include "lltoast.h" using namespace LLNotificationsUI; diff --git a/indra/newview/llsyswellwindow.cpp b/indra/newview/llsyswellwindow.cpp index ca93027352..99342bb564 100644 --- a/indra/newview/llsyswellwindow.cpp +++ b/indra/newview/llsyswellwindow.cpp @@ -40,7 +40,6 @@ #include "llviewerwindow.h" #include "llchiclet.h" -#include "llchannelmanager.h" #include "lltoastpanel.h" #include "llnotificationmanager.h" #include "llnotificationsutil.h" diff --git a/indra/newview/llviewermessage.cpp b/indra/newview/llviewermessage.cpp index 317d08cc52..48d11e1f05 100644 --- a/indra/newview/llviewermessage.cpp +++ b/indra/newview/llviewermessage.cpp @@ -49,7 +49,6 @@ #include "llagent.h" #include "llagentcamera.h" #include "llcallingcard.h" -#include "llchannelmanager.h" #include "llbuycurrencyhtml.h" #include "llfirstuse.h" #include "llfloaterbuyland.h" @@ -77,13 +76,11 @@ #include "llstatenums.h" #include "llstatusbar.h" #include "llimview.h" -#include "llscreenchannel.h" #include "llspeakers.h" #include "lltrans.h" #include "lltranslate.h" #include "llviewerfoldertype.h" #include "lluri.h" -#include "llviewercontrol.h" #include "llviewergenericmessage.h" #include "llviewermenu.h" #include "llviewerjoystick.h" -- cgit v1.3 From 5b2d4a169830c10dd5bfc4c72ddd94ef80e658d3 Mon Sep 17 00:00:00 2001 From: Vadim Savchuk Date: Tue, 21 Sep 2010 19:11:40 +0300 Subject: STORM-163 FIXED Intermittent FPS drop related to "audio" (main thread hangs often on openal lock) Submitting a patch made by Aleric Inglewood (See VWR-14914). This bug happens for a lot of people, although it might be needed to have a fast multi core machine. I have seen it on 1.22.10 once, never used 1.23 sorry, and saw it often on snowglobe. I am sure it also affects 1.23 but I'd have to test that. The symptons are that on a viewer with normally a good, high FPS, sometimes it happens that the FPS dramatically drops (as low as 0.3, but it can also be anything higher, as high as 10, say). This particular jira is about a problem where the main thread is slowed down by a mutex lock in libopenal (most calls starting with 'al' in indra/llaudio/audioengine_openal.cpp and one in indra/llaudio/listener_openal.cpp). You can see that this is the case by opening the Frame Console (control-shift-2) and checking that the "audio" (and possibly misc) timings are very large compared to the Render time. --- doc/contributions.txt | 1 + indra/llaudio/llaudioengine.cpp | 73 +++++++++++++++++++++++++-------------- indra/llaudio/llaudioengine.h | 9 +++-- indra/newview/llaudiosourcevo.cpp | 59 +++++++++++++++++++------------ indra/newview/llaudiosourcevo.h | 3 +- indra/newview/llvieweraudio.cpp | 4 --- indra/newview/llviewermessage.cpp | 8 ++--- indra/newview/llviewerobject.cpp | 7 ++++ 8 files changed, 103 insertions(+), 61 deletions(-) (limited to 'indra/newview/llviewermessage.cpp') diff --git a/doc/contributions.txt b/doc/contributions.txt index d58539dd71..d3e2731566 100644 --- a/doc/contributions.txt +++ b/doc/contributions.txt @@ -66,6 +66,7 @@ Aleric Inglewood VWR-13996 VWR-14426 SNOW-766 + STORM-163 Ales Beaumont VWR-9352 SNOW-240 diff --git a/indra/llaudio/llaudioengine.cpp b/indra/llaudio/llaudioengine.cpp index 8843acc891..1cc03bddb8 100644 --- a/indra/llaudio/llaudioengine.cpp +++ b/indra/llaudio/llaudioengine.cpp @@ -97,6 +97,7 @@ void LLAudioEngine::setDefaults() } mMasterGain = 1.f; + mInternalGain = 0.f; mNextWindUpdate = 0.f; mStreamingAudioImpl = NULL; @@ -247,15 +248,6 @@ void LLAudioEngine::idle(F32 max_decode_time) // Primarily does position updating, cleanup of unused audio sources. // Also does regeneration of the current priority of each audio source. - if (getMuted()) - { - setInternalGain(0.f); - } - else - { - setInternalGain(getMasterGain()); - } - S32 i; for (i = 0; i < MAX_BUFFERS; i++) { @@ -284,6 +276,12 @@ void LLAudioEngine::idle(F32 max_decode_time) continue; } + if (sourcep->isMuted()) + { + ++iter; + continue; + } + if (!sourcep->getChannel() && sourcep->getCurrentBuffer()) { // We could potentially play this sound if its priority is high enough. @@ -336,9 +334,9 @@ void LLAudioEngine::idle(F32 max_decode_time) // attached to each channel, since only those with active channels // can have anything interesting happen with their queue? (Maybe not true) LLAudioSource *sourcep = iter->second; - if (!sourcep->mQueuedDatap) + if (!sourcep->mQueuedDatap || sourcep->isMuted()) { - // Nothing queued, so we don't care. + // Muted, or nothing queued, so we don't care. continue; } @@ -418,6 +416,10 @@ void LLAudioEngine::idle(F32 max_decode_time) for (iter = mAllSources.begin(); iter != mAllSources.end(); ++iter) { LLAudioSource *sourcep = iter->second; + if (sourcep->isMuted()) + { + continue; + } if (sourcep->isSyncMaster()) { if (sourcep->getPriority() > max_sm_priority) @@ -691,15 +693,23 @@ bool LLAudioEngine::isWindEnabled() void LLAudioEngine::setMuted(bool muted) { - mMuted = muted; + if (muted != mMuted) + { + mMuted = muted; + setMasterGain(mMasterGain); + } enableWind(!mMuted); } - void LLAudioEngine::setMasterGain(const F32 gain) { mMasterGain = gain; - setInternalGain(gain); + F32 internal_gain = getMuted() ? 0.f : gain; + if (internal_gain != mInternalGain) + { + mInternalGain = internal_gain; + setInternalGain(mInternalGain); + } } F32 LLAudioEngine::getMasterGain() @@ -1243,13 +1253,14 @@ LLAudioSource::LLAudioSource(const LLUUID& id, const LLUUID& owner_id, const F32 mOwnerID(owner_id), mPriority(0.f), mGain(gain), - mType(type), + mSourceMuted(false), mAmbient(false), mLoop(false), mSyncMaster(false), mSyncSlave(false), mQueueSounds(false), mPlayedOnce(false), + mType(type), mChannelp(NULL), mCurrentDatap(NULL), mQueuedDatap(NULL) @@ -1301,6 +1312,10 @@ void LLAudioSource::updatePriority() { mPriority = 1.f; } + else if (isMuted()) + { + mPriority = 0.f; + } else { // Priority is based on distance @@ -1349,25 +1364,33 @@ bool LLAudioSource::setupChannel() bool LLAudioSource::play(const LLUUID &audio_uuid) { + // Special abuse of play(); don't play a sound, but kill it. if (audio_uuid.isNull()) { if (getChannel()) { getChannel()->setSource(NULL); setChannel(NULL); - addAudioData(NULL, true); + if (!isMuted()) + { + mCurrentDatap = NULL; + } } + return false; } + // Reset our age timeout if someone attempts to play the source. mAgeTimer.reset(); LLAudioData *adp = gAudiop->getAudioData(audio_uuid); - - bool has_buffer = gAudiop->updateBufferForData(adp, audio_uuid); - - addAudioData(adp); + if (isMuted()) + { + return false; + } + + bool has_buffer = gAudiop->updateBufferForData(adp, audio_uuid); if (!has_buffer) { // Don't bother trying to set up a channel or anything, we don't have an audio buffer. @@ -1392,10 +1415,11 @@ bool LLAudioSource::play(const LLUUID &audio_uuid) } -bool LLAudioSource::isDone() +bool LLAudioSource::isDone() const { const F32 MAX_AGE = 60.f; const F32 MAX_UNPLAYED_AGE = 15.f; + const F32 MAX_MUTED_AGE = 11.f; if (isLoop()) { @@ -1403,7 +1427,6 @@ bool LLAudioSource::isDone() return false; } - if (hasPendingPreloads()) { return false; @@ -1420,10 +1443,10 @@ bool LLAudioSource::isDone() // This is a single-play source if (!mChannelp) { - if ((elapsed > MAX_UNPLAYED_AGE) || mPlayedOnce) + if ((elapsed > (mSourceMuted ? MAX_MUTED_AGE : MAX_UNPLAYED_AGE)) || mPlayedOnce) { // We don't have a channel assigned, and it's been - // over 5 seconds since we tried to play it. Don't bother. + // over 15 seconds since we tried to play it. Don't bother. //llinfos << "No channel assigned, source is done" << llendl; return true; } @@ -1449,7 +1472,7 @@ bool LLAudioSource::isDone() if ((elapsed > MAX_UNPLAYED_AGE) || mPlayedOnce) { - // The sound isn't playing back after 5 seconds or we're already done playing it, kill it. + // The sound isn't playing back after 15 seconds or we're already done playing it, kill it. return true; } diff --git a/indra/llaudio/llaudioengine.h b/indra/llaudio/llaudioengine.h index 6a5000d7ed..30d2490635 100644 --- a/indra/llaudio/llaudioengine.h +++ b/indra/llaudio/llaudioengine.h @@ -118,8 +118,8 @@ public: // Use these for temporarily muting the audio system. // Does not change buffers, initialization, etc. but // stops playing new sounds. - virtual void setMuted(bool muted); - virtual bool getMuted() const { return mMuted; } + void setMuted(bool muted); + bool getMuted() const { return mMuted; } #ifdef USE_PLUGIN_MEDIA LLPluginClassMedia* initializeMedia(const std::string& media_type); #endif @@ -239,6 +239,7 @@ protected: LLAudioBuffer *mBuffers[MAX_BUFFERS]; F32 mMasterGain; + F32 mInternalGain; // Actual gain set; either mMasterGain or 0 when mMuted is true. F32 mSecondaryGain[AUDIO_TYPE_COUNT]; F32 mNextWindUpdate; @@ -303,7 +304,8 @@ public: virtual void setGain(const F32 gain) { mGain = llclamp(gain, 0.f, 1.f); } const LLUUID &getID() const { return mID; } - bool isDone(); + bool isDone() const; + bool isMuted() const { return mSourceMuted; } LLAudioData *getCurrentData(); LLAudioData *getQueuedData(); @@ -325,6 +327,7 @@ protected: LLUUID mOwnerID; // owner of the object playing the sound F32 mPriority; F32 mGain; + bool mSourceMuted; bool mAmbient; bool mLoop; bool mSyncMaster; diff --git a/indra/newview/llaudiosourcevo.cpp b/indra/newview/llaudiosourcevo.cpp index 40eb5ebcd1..b37aba6c15 100644 --- a/indra/newview/llaudiosourcevo.cpp +++ b/indra/newview/llaudiosourcevo.cpp @@ -35,11 +35,8 @@ LLAudioSourceVO::LLAudioSourceVO(const LLUUID &sound_id, const LLUUID& owner_id, const F32 gain, LLViewerObject *objectp) : LLAudioSource(sound_id, owner_id, gain, LLAudioEngine::AUDIO_TYPE_SFX), - mObjectp(objectp), - mActualGain(gain) + mObjectp(objectp) { - setAmbient(FALSE); - updateGain(); update(); } @@ -54,18 +51,18 @@ LLAudioSourceVO::~LLAudioSourceVO() void LLAudioSourceVO::setGain(const F32 gain) { - mActualGain = llclamp(gain, 0.f, 1.f); - updateGain(); + mGain = llclamp(gain, 0.f, 1.f); } -void LLAudioSourceVO::updateGain() +void LLAudioSourceVO::updateMute() { - if (!mObjectp) + if (!mObjectp || mObjectp->isDead()) { + mSourceMuted = true; return; } - BOOL mute = FALSE; + bool mute = false; LLVector3d pos_global; if (mObjectp->isAttachment()) @@ -84,21 +81,21 @@ void LLAudioSourceVO::updateGain() { pos_global = mObjectp->getPositionGlobal(); } - + if (!LLViewerParcelMgr::getInstance()->canHearSound(pos_global)) { - mute = TRUE; + mute = true; } if (!mute) { if (LLMuteList::getInstance()->isMuted(mObjectp->getID())) { - mute = TRUE; + mute = true; } else if (LLMuteList::getInstance()->isMuted(mOwnerID, LLMute::flagObjectSounds)) { - mute = TRUE; + mute = true; } else if (mObjectp->isAttachment()) { @@ -110,24 +107,38 @@ void LLAudioSourceVO::updateGain() if (parent && LLMuteList::getInstance()->isMuted(parent->getID())) { - mute = TRUE; + mute = true; } } } - if (!mute) + if (mute != mSourceMuted) { - mGain = mActualGain; - } - else - { - mGain = 0.f; + mSourceMuted = mute; + if (mSourceMuted) + { + // Stop the sound. + this->play(LLUUID::null); + } + else + { + // Muted sounds keep there data at all times, because + // it's the place where the audio UUID is stored. + // However, it's possible that mCurrentDatap is + // NULL when this source did only preload sounds. + if (mCurrentDatap) + { + // Restart the sound. + this->play(mCurrentDatap->getID()); + } + } } } - void LLAudioSourceVO::update() { + updateMute(); + if (!mObjectp) { return; @@ -139,7 +150,11 @@ void LLAudioSourceVO::update() return; } - updateGain(); + if (mSourceMuted) + { + return; + } + if (mObjectp->isHUDAttachment()) { mPositionGlobal = gAgentCamera.getCameraPositionGlobal(); diff --git a/indra/newview/llaudiosourcevo.h b/indra/newview/llaudiosourcevo.h index a68f58a4b2..f1d8ef4528 100644 --- a/indra/newview/llaudiosourcevo.h +++ b/indra/newview/llaudiosourcevo.h @@ -42,11 +42,10 @@ public: /*virtual*/ void setGain(const F32 gain); private: - void updateGain(); + void updateMute(); private: LLPointer mObjectp; - F32 mActualGain; // The "real" gain, when not off due to parcel effects }; #endif // LL_LLAUDIOSOURCEVO_H diff --git a/indra/newview/llvieweraudio.cpp b/indra/newview/llvieweraudio.cpp index 750bb224b1..b19c738ed2 100644 --- a/indra/newview/llvieweraudio.cpp +++ b/indra/newview/llvieweraudio.cpp @@ -114,10 +114,6 @@ void audio_update_volume(bool force_update) gAudiop->setDopplerFactor(gSavedSettings.getF32("AudioLevelDoppler")); gAudiop->setRolloffFactor(gSavedSettings.getF32("AudioLevelRolloff")); -#ifdef kAUDIO_ENABLE_WIND - gAudiop->enableWind(!mute_audio); -#endif - gAudiop->setMuted(mute_audio); if (force_update) diff --git a/indra/newview/llviewermessage.cpp b/indra/newview/llviewermessage.cpp index c35173a7d4..2f3aeec9b3 100644 --- a/indra/newview/llviewermessage.cpp +++ b/indra/newview/llviewermessage.cpp @@ -4213,13 +4213,11 @@ void process_preload_sound(LLMessageSystem *msg, void **user_data) // Don't play sounds from a region with maturity above current agent maturity LLVector3d pos_global = objectp->getPositionGlobal(); - if( !gAgent.canAccessMaturityAtGlobal( pos_global ) ) + if (gAgent.canAccessMaturityAtGlobal(pos_global)) { - return; + // Add audioData starts a transfer internally. + sourcep->addAudioData(datap, FALSE); } - - // Add audioData starts a transfer internally. - sourcep->addAudioData(datap, FALSE); } void process_attached_sound(LLMessageSystem *msg, void **user_data) diff --git a/indra/newview/llviewerobject.cpp b/indra/newview/llviewerobject.cpp index 741a9e6ec4..fd3e80d755 100644 --- a/indra/newview/llviewerobject.cpp +++ b/indra/newview/llviewerobject.cpp @@ -4445,6 +4445,13 @@ void LLViewerObject::setAttachedSound(const LLUUID &audio_uuid, const LLUUID& ow mAudioSourcep = NULL; } + if (mAudioSourcep && mAudioSourcep->isMuted() && + mAudioSourcep->getCurrentData() && mAudioSourcep->getCurrentData()->getID() == audio_uuid) + { + //llinfos << "Already having this sound as muted sound, ignoring" << llendl; + return; + } + getAudioSource(owner_id); if (mAudioSourcep) -- cgit v1.3 From 0a938d395c6bde13ead4f789056e7f9067e4dbd0 Mon Sep 17 00:00:00 2001 From: Seth ProductEngine Date: Tue, 28 Sep 2010 19:40:31 +0300 Subject: STORM-266 FIXED displaying group notices in detached People SP. Fixed failure getting pointers to some child panels of LLSideTray while parent side panels are detached. --- indra/newview/llgroupactions.cpp | 2 +- indra/newview/llpanelgroup.cpp | 4 ++-- indra/newview/llpanellandmarks.cpp | 7 ++++++- indra/newview/llsidetray.h | 16 ++++++++++++++++ indra/newview/llviewermessage.cpp | 4 ++-- 5 files changed, 27 insertions(+), 6 deletions(-) (limited to 'indra/newview/llviewermessage.cpp') diff --git a/indra/newview/llgroupactions.cpp b/indra/newview/llgroupactions.cpp index c42b397252..5393678a6b 100644 --- a/indra/newview/llgroupactions.cpp +++ b/indra/newview/llgroupactions.cpp @@ -235,7 +235,7 @@ static bool isGroupUIVisible() { static LLPanel* panel = 0; if(!panel) - panel = LLSideTray::getInstance()->findChild("panel_group_info_sidetray"); + panel = LLSideTray::getInstance()->getPanel("panel_group_info_sidetray"); if(!panel) return false; return panel->isInVisibleChain(); diff --git a/indra/newview/llpanelgroup.cpp b/indra/newview/llpanelgroup.cpp index 62ed7acb15..76b85d5bec 100644 --- a/indra/newview/llpanelgroup.cpp +++ b/indra/newview/llpanelgroup.cpp @@ -597,7 +597,7 @@ void LLPanelGroup::showNotice(const std::string& subject, //static void LLPanelGroup::refreshCreatedGroup(const LLUUID& group_id) { - LLPanelGroup* panel = LLSideTray::getInstance()->findChild("panel_group_info_sidetray"); + LLPanelGroup* panel = LLSideTray::getInstance()->getPanel("panel_group_info_sidetray"); if(!panel) return; panel->setGroupID(group_id); @@ -612,7 +612,7 @@ void LLPanelGroup::showNotice(const std::string& subject, const std::string& inventory_name, LLOfferInfo* inventory_offer) { - LLPanelGroup* panel = LLSideTray::getInstance()->findChild("panel_group_info_sidetray"); + LLPanelGroup* panel = LLSideTray::getInstance()->getPanel("panel_group_info_sidetray"); if(!panel) return; diff --git a/indra/newview/llpanellandmarks.cpp b/indra/newview/llpanellandmarks.cpp index b09360a2d6..c4a484d368 100644 --- a/indra/newview/llpanellandmarks.cpp +++ b/indra/newview/llpanellandmarks.cpp @@ -1245,7 +1245,12 @@ void LLLandmarksPanel::doProcessParcelInfo(LLLandmark* landmark, landmark->getGlobalPos(landmark_global_pos); // let's toggle pick panel into panel places - LLPanel* panel_places = LLSideTray::getInstance()->getChild("panel_places");//-> sidebar_places + LLPanel* panel_places = LLSideTray::getInstance()->getPanel("panel_places");//-> sidebar_places + if (!panel_places) + { + llassert(NULL != panel_places); + return; + } panel_places->addChild(panel_pick); LLRect paren_rect(panel_places->getRect()); panel_pick->reshape(paren_rect.getWidth(),paren_rect.getHeight(), TRUE); diff --git a/indra/newview/llsidetray.h b/indra/newview/llsidetray.h index 4e79007c13..4c23a1920b 100644 --- a/indra/newview/llsidetray.h +++ b/indra/newview/llsidetray.h @@ -109,6 +109,22 @@ public: LLPanel* getPanel (const std::string& panel_name); LLPanel* getActivePanel (); bool isPanelActive (const std::string& panel_name); + + /* + * get the panel of given type T (don't show it or do anything else with it) + */ + template + T* getPanel(const std::string& panel_name) + { + T* panel = dynamic_cast(getPanel(panel_name)); + if (!panel) + { + llwarns << "Child named \"" << panel_name << "\" of type " << typeid(T*).name() << " not found" << llendl; + return NULL; + } + return panel; + } + /* * get currently active tab */ diff --git a/indra/newview/llviewermessage.cpp b/indra/newview/llviewermessage.cpp index 33c74e7465..26b7e0fb6d 100644 --- a/indra/newview/llviewermessage.cpp +++ b/indra/newview/llviewermessage.cpp @@ -6453,7 +6453,7 @@ void process_covenant_reply(LLMessageSystem* msg, void**) LLPanelLandCovenant::updateEstateOwnerName(owner_name); LLFloaterBuyLand::updateEstateOwnerName(owner_name); - LLPanelPlaceProfile* panel = LLSideTray::getInstance()->findChild("panel_place_profile"); + LLPanelPlaceProfile* panel = LLSideTray::getInstance()->getPanel("panel_place_profile"); if (panel) { panel->updateEstateName(estate_name); @@ -6587,7 +6587,7 @@ void onCovenantLoadComplete(LLVFS *vfs, LLPanelLandCovenant::updateCovenantText(covenant_text); LLFloaterBuyLand::updateCovenantText(covenant_text, asset_uuid); - LLPanelPlaceProfile* panel = LLSideTray::getInstance()->findChild("panel_place_profile"); + LLPanelPlaceProfile* panel = LLSideTray::getInstance()->getPanel("panel_place_profile"); if (panel) { panel->updateCovenantText(covenant_text); -- cgit v1.3