summaryrefslogtreecommitdiff
path: root/indra/newview/lltooldraganddrop.cpp
diff options
context:
space:
mode:
authorJames Cook <james@lindenlab.com>2009-11-25 01:15:50 -0800
committerJames Cook <james@lindenlab.com>2009-11-25 01:15:50 -0800
commitcbc0783cd19f096b454cabe47174c97d3d42842b (patch)
tree96a4596d101c1d205fc4f56b0b54951dd408df80 /indra/newview/lltooldraganddrop.cpp
parent0e351bedb6ec15ecb4da6073c8db4edc34ccc0ba (diff)
Created lightweight LLNotificationsUtil::add(), switched most alerts to use it
Cuts number of includes of llnotifications.h from 300+ to 40.
Diffstat (limited to 'indra/newview/lltooldraganddrop.cpp')
-rw-r--r--indra/newview/lltooldraganddrop.cpp34
1 files changed, 17 insertions, 17 deletions
diff --git a/indra/newview/lltooldraganddrop.cpp b/indra/newview/lltooldraganddrop.cpp
index 7500cb52c8..266fa4dd74 100644
--- a/indra/newview/lltooldraganddrop.cpp
+++ b/indra/newview/lltooldraganddrop.cpp
@@ -39,7 +39,7 @@
#include "llfloaterreg.h"
#include "llinstantmessage.h"
#include "lldir.h"
-#include "llnotifications.h"
+#include "llnotificationsutil.h"
// project headers
#include "llagent.h"
@@ -1074,7 +1074,7 @@ BOOL LLToolDragAndDrop::handleDropTextureProtections(LLViewerObject* hit_obj,
hit_obj->fetchInventoryFromServer();
LLSD args;
args["ERROR_MESSAGE"] = "Unable to add texture.\nPlease wait a few seconds and try again.";
- LLNotifications::instance().add("ErrorMessage", args);
+ LLNotificationsUtil::add("ErrorMessage", args);
return FALSE;
}
if (hit_obj->getInventoryItemByAsset(item->getAssetUUID()))
@@ -1527,14 +1527,14 @@ void LLToolDragAndDrop::giveInventory(const LLUUID& to_agent,
LLSD payload;
payload["agent_id"] = to_agent;
payload["item_id"] = item->getUUID();
- LLNotifications::instance().add("CannotCopyWarning", LLSD(), payload,
+ LLNotificationsUtil::add("CannotCopyWarning", LLSD(), payload,
&LLToolDragAndDrop::handleCopyProtectedItem);
}
}
// static
bool LLToolDragAndDrop::handleCopyProtectedItem(const LLSD& notification, const LLSD& response)
{
- S32 option = LLNotification::getSelectedOption(notification, response);
+ S32 option = LLNotificationsUtil::getSelectedOption(notification, response);
LLInventoryItem* item = NULL;
switch(option)
{
@@ -1551,12 +1551,12 @@ bool LLToolDragAndDrop::handleCopyProtectedItem(const LLSD& notification, const
}
else
{
- LLNotifications::instance().add("CannotGiveItem");
+ LLNotificationsUtil::add("CannotGiveItem");
}
break;
default: // no, cancel, whatever, who cares, not yes.
- LLNotifications::instance().add("TransactionCancelled");
+ LLNotificationsUtil::add("TransactionCancelled");
break;
}
return false;
@@ -1652,18 +1652,18 @@ void LLToolDragAndDrop::giveInventoryCategory(const LLUUID& to_agent,
}
if(!complete)
{
- LLNotifications::instance().add("IncompleteInventory");
+ LLNotificationsUtil::add("IncompleteInventory");
return;
}
count = items.count() + cats.count();
if(count > MAX_ITEMS)
{
- LLNotifications::instance().add("TooManyItems");
+ LLNotificationsUtil::add("TooManyItems");
return;
}
else if(count == 0)
{
- LLNotifications::instance().add("NoItems");
+ LLNotificationsUtil::add("NoItems");
return;
}
else
@@ -1681,7 +1681,7 @@ void LLToolDragAndDrop::giveInventoryCategory(const LLUUID& to_agent,
LLSD payload;
payload["agent_id"] = to_agent;
payload["folder_id"] = cat->getUUID();
- LLNotifications::instance().add("CannotCopyCountItems", args, payload, &LLToolDragAndDrop::handleCopyProtectedCategory);
+ LLNotificationsUtil::add("CannotCopyCountItems", args, payload, &LLToolDragAndDrop::handleCopyProtectedCategory);
}
}
}
@@ -1690,7 +1690,7 @@ void LLToolDragAndDrop::giveInventoryCategory(const LLUUID& to_agent,
// static
bool LLToolDragAndDrop::handleCopyProtectedCategory(const LLSD& notification, const LLSD& response)
{
- S32 option = LLNotification::getSelectedOption(notification, response);
+ S32 option = LLNotificationsUtil::getSelectedOption(notification, response);
LLInventoryCategory* cat = NULL;
switch(option)
{
@@ -1717,12 +1717,12 @@ bool LLToolDragAndDrop::handleCopyProtectedCategory(const LLSD& notification, co
}
else
{
- LLNotifications::instance().add("CannotGiveCategory");
+ LLNotificationsUtil::add("CannotGiveCategory");
}
break;
default: // no, cancel, whatever, who cares, not yes.
- LLNotifications::instance().add("TransactionCancelled");
+ LLNotificationsUtil::add("TransactionCancelled");
break;
}
return false;
@@ -1757,12 +1757,12 @@ void LLToolDragAndDrop::commitGiveInventoryCategory(const LLUUID& to_agent,
S32 count = items.count() + cats.count();
if(count > MAX_ITEMS)
{
- LLNotifications::instance().add("TooManyItems");
+ LLNotificationsUtil::add("TooManyItems");
return;
}
else if(count == 0)
{
- LLNotifications::instance().add("NoItems");
+ LLNotificationsUtil::add("NoItems");
return;
}
else
@@ -2400,7 +2400,7 @@ EAcceptance LLToolDragAndDrop::dad3dWearItem(
// destroy clothing items.
if (!gAgentWearables.areWearablesLoaded())
{
- LLNotifications::instance().add("CanNotChangeAppearanceUntilLoaded");
+ LLNotificationsUtil::add("CanNotChangeAppearanceUntilLoaded");
return ACCEPT_NO;
}
@@ -2495,7 +2495,7 @@ EAcceptance LLToolDragAndDrop::dad3dWearCategory(
// destroy clothing items.
if (!gAgentWearables.areWearablesLoaded())
{
- LLNotifications::instance().add("CanNotChangeAppearanceUntilLoaded");
+ LLNotificationsUtil::add("CanNotChangeAppearanceUntilLoaded");
return ACCEPT_NO;
}
}