Pulled llnotifications.h dependency from LLFloater. llnotifications.h includes llevents.h, which can cause conflicts with llevent.h (Legacy events vs non-legacy)

This commit is contained in:
Shyotl
2013-06-20 00:45:12 -05:00
parent 8d0a514712
commit e015771c64
14 changed files with 22 additions and 32 deletions

View File

@@ -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()
{

View File

@@ -40,7 +40,8 @@
#include "llpanel.h"
#include "lluuid.h"
#include "lltabcontainer.h"
#include "llnotifications.h"
#include "llnotificationcontext.h"
#include "llnotificationptr.h"
#include <set>
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();

View File

@@ -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<void (const LLSD&, const LLSD&)> LLNotificationResponder
typedef LLFunctorRegistry<LLNotificationResponder> LLNotificationFunctorRegistry;
typedef LLFunctorRegistration<LLNotificationResponder> 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<LLNotificationContext, LLUUID>
{
public:
LLNotificationContext() : LLInstanceTracker<LLNotificationContext, LLUUID>(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

View File

@@ -58,6 +58,8 @@
#include "llnotificationsutil.h"
#include "llfasttimer.h"
#include "llnotifications.h"
// LLLayoutStack
#include "llresizebar.h"
#include "llcriticaldamp.h"

View File

@@ -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)

View File

@@ -71,6 +71,8 @@
#include "llviewerregion.h"
#include "llwindow.h"
#include "llnotifications.h"
const char* market_panel = "market_panel";
class LLPanelDirMarket : public LLPanelDirFind

View File

@@ -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)

View File

@@ -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)

View File

@@ -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)

View File

@@ -48,6 +48,7 @@
#include "llpreview.h" // For LLMultiPreview
#include "lltrans.h"
#include "llvoavatarself.h"
#include "llnotifications.h"
extern LLUUID gAgentID;

View File

@@ -45,6 +45,7 @@
#include "llscrollingpanelparam.h"
#include "llradiogroup.h"
#include "llnotificationsutil.h"
#include "llnotifications.h"
#include "llcolorswatch.h"
#include "lltexturectrl.h"

View File

@@ -47,6 +47,7 @@
#include "llavatarnamecache.h"
#include "llvoavatar.h"
#include "llcallingcard.h"
#include "llnotifications.h"
LLPanelGeneral::LLPanelGeneral()
{

View File

@@ -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);
}
}

View File

@@ -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_*