From e015771c644bbd1a3c0aa96a5e1437b7f7bf6b5e Mon Sep 17 00:00:00 2001 From: Shyotl Date: Thu, 20 Jun 2013 00:45:12 -0500 Subject: [PATCH] Pulled llnotifications.h dependency from LLFloater. llnotifications.h includes llevents.h, which can cause conflicts with llevent.h (Legacy events vs non-legacy) --- indra/llui/llfloater.cpp | 5 +++++ indra/llui/llfloater.h | 8 +++----- indra/llui/llnotifications.h | 21 +-------------------- indra/llui/llpanel.cpp | 2 ++ indra/newview/llfloaterdaycycle.cpp | 2 +- indra/newview/llfloaterdirectory.cpp | 2 ++ indra/newview/llfloaterenvsettings.cpp | 2 +- indra/newview/llfloaterwater.cpp | 2 +- indra/newview/llfloaterwindlight.cpp | 2 +- indra/newview/llinventoryactions.cpp | 1 + indra/newview/llpaneleditwearable.cpp | 1 + indra/newview/llpanelgeneral.cpp | 1 + indra/newview/llpanelgroup.cpp | 4 +--- indra/newview/rlvcommon.cpp | 1 + 14 files changed, 22 insertions(+), 32 deletions(-) diff --git a/indra/llui/llfloater.cpp b/indra/llui/llfloater.cpp index 516f028b1..5c9e2162f 100644 --- a/indra/llui/llfloater.cpp +++ b/indra/llui/llfloater.cpp @@ -58,6 +58,7 @@ #include "v2math.h" #include "llfasttimer.h" #include "airecursive.h" +#include "llnotifications.h" const S32 MINIMIZED_WIDTH = 160; const S32 CLOSE_BOX_FROM_TOP = 1; @@ -1410,6 +1411,10 @@ void LLFloater::closeFocusedFloater() } } +LLNotificationPtr LLFloater::addContextualNotification(const std::string& name, const LLSD& substitutions) +{ + return LLNotifications::instance().add(LLNotification::Params(name).context(mNotificationContext).substitutions(substitutions)); +} void LLFloater::onClickClose() { diff --git a/indra/llui/llfloater.h b/indra/llui/llfloater.h index 9a9fa9d19..bd826a936 100644 --- a/indra/llui/llfloater.h +++ b/indra/llui/llfloater.h @@ -40,7 +40,8 @@ #include "llpanel.h" #include "lluuid.h" #include "lltabcontainer.h" -#include "llnotifications.h" +#include "llnotificationcontext.h" +#include "llnotificationptr.h" #include class LLDragHandle; @@ -232,10 +233,7 @@ public: // handle refocusing. static void closeFocusedFloater(); - LLNotification::Params contextualNotification(const std::string& name) - { - return LLNotification::Params(name).context(mNotificationContext); - } + LLNotificationPtr addContextualNotification(const std::string& name, const LLSD& substitutions = LLSD()); void onClickClose(); void onClickMinimize(); diff --git a/indra/llui/llnotifications.h b/indra/llui/llnotifications.h index 03869ef4d..fe9049ee2 100644 --- a/indra/llui/llnotifications.h +++ b/indra/llui/llnotifications.h @@ -106,6 +106,7 @@ #include "llui.h" #include "llxmlnode.h" #include "llnotificationptr.h" +#include "llnotificationcontext.h" typedef enum e_notification_priority { @@ -121,26 +122,6 @@ typedef boost::function LLNotificationResponder typedef LLFunctorRegistry LLNotificationFunctorRegistry; typedef LLFunctorRegistration LLNotificationFunctorRegistration; -// context data that can be looked up via a notification's payload by the display logic -// derive from this class to implement specific contexts -class LLNotificationContext : public LLInstanceTracker -{ -public: - LLNotificationContext() : LLInstanceTracker(LLUUID::generateNewID()) - { - } - - virtual ~LLNotificationContext() {} - - LLSD asLLSD() const - { - return getKey(); - } - -private: - -}; - // Contains notification form data, such as buttons and text fields along with // manipulator functions class LLNotificationForm diff --git a/indra/llui/llpanel.cpp b/indra/llui/llpanel.cpp index f5950aff3..daebe75e8 100644 --- a/indra/llui/llpanel.cpp +++ b/indra/llui/llpanel.cpp @@ -58,6 +58,8 @@ #include "llnotificationsutil.h" #include "llfasttimer.h" +#include "llnotifications.h" + // LLLayoutStack #include "llresizebar.h" #include "llcriticaldamp.h" diff --git a/indra/newview/llfloaterdaycycle.cpp b/indra/newview/llfloaterdaycycle.cpp index 0873c0351..3cf67821f 100644 --- a/indra/newview/llfloaterdaycycle.cpp +++ b/indra/newview/llfloaterdaycycle.cpp @@ -123,7 +123,7 @@ void LLFloaterDayCycle::onClickHelp(void* data) LLFloaterDayCycle* self = LLFloaterDayCycle::instance(); std::string xml_alert = *(std::string *) data; - LLNotifications::instance().add(self->contextualNotification(xml_alert)); + self->addContextualNotification(xml_alert); } void LLFloaterDayCycle::initHelpBtn(const std::string& name, const std::string& xml_alert) diff --git a/indra/newview/llfloaterdirectory.cpp b/indra/newview/llfloaterdirectory.cpp index 0bd358d4c..72cfc97dc 100644 --- a/indra/newview/llfloaterdirectory.cpp +++ b/indra/newview/llfloaterdirectory.cpp @@ -71,6 +71,8 @@ #include "llviewerregion.h" #include "llwindow.h" +#include "llnotifications.h" + const char* market_panel = "market_panel"; class LLPanelDirMarket : public LLPanelDirFind diff --git a/indra/newview/llfloaterenvsettings.cpp b/indra/newview/llfloaterenvsettings.cpp index 9e59cf046..57a952244 100644 --- a/indra/newview/llfloaterenvsettings.cpp +++ b/indra/newview/llfloaterenvsettings.cpp @@ -70,7 +70,7 @@ LLFloaterEnvSettings::~LLFloaterEnvSettings() void LLFloaterEnvSettings::onClickHelp(void* data) { LLFloaterEnvSettings* self = (LLFloaterEnvSettings*)data; - LLNotifications::instance().add(self->contextualNotification("EnvSettingsHelpButton")); + self->addContextualNotification("EnvSettingsHelpButton"); } void LLFloaterEnvSettings::initCallbacks(void) diff --git a/indra/newview/llfloaterwater.cpp b/indra/newview/llfloaterwater.cpp index 5da4452e3..bb938e94a 100644 --- a/indra/newview/llfloaterwater.cpp +++ b/indra/newview/llfloaterwater.cpp @@ -174,7 +174,7 @@ void LLFloaterWater::onClickHelp(void* data) LLFloaterWater* self = LLFloaterWater::instance(); const std::string* xml_alert = (std::string*)data; - LLNotifications::instance().add(self->contextualNotification(*xml_alert)); + self->addContextualNotification(*xml_alert); } void LLFloaterWater::initHelpBtn(const std::string& name, const std::string& xml_alert) diff --git a/indra/newview/llfloaterwindlight.cpp b/indra/newview/llfloaterwindlight.cpp index 116ecbdec..278f9c084 100644 --- a/indra/newview/llfloaterwindlight.cpp +++ b/indra/newview/llfloaterwindlight.cpp @@ -231,7 +231,7 @@ void LLFloaterWindLight::onClickHelp(void* data) LLFloaterWindLight* self = LLFloaterWindLight::instance(); const std::string xml_alert = *(std::string*)data; - LLNotifications::instance().add(self->contextualNotification(xml_alert)); + self->addContextualNotification(xml_alert); } void LLFloaterWindLight::initHelpBtn(const std::string& name, const std::string& xml_alert) diff --git a/indra/newview/llinventoryactions.cpp b/indra/newview/llinventoryactions.cpp index fe07063bb..a02de1998 100644 --- a/indra/newview/llinventoryactions.cpp +++ b/indra/newview/llinventoryactions.cpp @@ -48,6 +48,7 @@ #include "llpreview.h" // For LLMultiPreview #include "lltrans.h" #include "llvoavatarself.h" +#include "llnotifications.h" extern LLUUID gAgentID; diff --git a/indra/newview/llpaneleditwearable.cpp b/indra/newview/llpaneleditwearable.cpp index f3b7f5af1..78ef25eed 100644 --- a/indra/newview/llpaneleditwearable.cpp +++ b/indra/newview/llpaneleditwearable.cpp @@ -45,6 +45,7 @@ #include "llscrollingpanelparam.h" #include "llradiogroup.h" #include "llnotificationsutil.h" +#include "llnotifications.h" #include "llcolorswatch.h" #include "lltexturectrl.h" diff --git a/indra/newview/llpanelgeneral.cpp b/indra/newview/llpanelgeneral.cpp index a044ac1a9..559dba021 100644 --- a/indra/newview/llpanelgeneral.cpp +++ b/indra/newview/llpanelgeneral.cpp @@ -47,6 +47,7 @@ #include "llavatarnamecache.h" #include "llvoavatar.h" #include "llcallingcard.h" +#include "llnotifications.h" LLPanelGeneral::LLPanelGeneral() { diff --git a/indra/newview/llpanelgroup.cpp b/indra/newview/llpanelgroup.cpp index e45f0608a..4f8f4e969 100644 --- a/indra/newview/llpanelgroup.cpp +++ b/indra/newview/llpanelgroup.cpp @@ -119,9 +119,7 @@ void LLPanelGroupTab::handleClickHelp() LLSD args; args["MESSAGE"] = help_text; LLFloater* parent_floater = gFloaterView->getParentFloater(this); - LLNotification::Params params(parent_floater->contextualNotification("GenericAlert")); - params.substitutions(args); - LLNotifications::instance().add(params); + parent_floater->addContextualNotification("GenericAlert",args); } } diff --git a/indra/newview/rlvcommon.cpp b/indra/newview/rlvcommon.cpp index a4c8ad281..f7eec9322 100644 --- a/indra/newview/rlvcommon.cpp +++ b/indra/newview/rlvcommon.cpp @@ -28,6 +28,7 @@ #include "llviewerstats.h" #include "llvoavatar.h" #include "llworld.h" +#include "llnotifications.h" #include "../lscript/lscript_byteformat.h" //Need LSCRIPTRunTimePermissionBits and SCRIPT_PERMISSION_*