summaryrefslogtreecommitdiff
path: root/indra/newview/llviewertexteditor.cpp
diff options
context:
space:
mode:
authorKent Quirk <q@lindenlab.com>2009-01-05 18:59:12 +0000
committerKent Quirk <q@lindenlab.com>2009-01-05 18:59:12 +0000
commit667ca55bad0108c4bdf8f007b89e1a52fc766aad (patch)
tree7bd62ac8d9af079c3994565f3f200ccc250bbc28 /indra/newview/llviewertexteditor.cpp
parent95f365789f4cebc7bd97ccefd538f14d481a8373 (diff)
svn merge -r106715:HEAD svn+ssh://svn.lindenlab.com/svn/linden/branches/q/notifications-merge-r106715 . QAR-1149 -- Final merge of notifications to trunk.
Diffstat (limited to 'indra/newview/llviewertexteditor.cpp')
-rw-r--r--indra/newview/llviewertexteditor.cpp48
1 files changed, 20 insertions, 28 deletions
diff --git a/indra/newview/llviewertexteditor.cpp b/indra/newview/llviewertexteditor.cpp
index c2c3e7e320..50486137c1 100644
--- a/indra/newview/llviewertexteditor.cpp
+++ b/indra/newview/llviewertexteditor.cpp
@@ -1420,58 +1420,50 @@ void LLViewerTextEditor::openEmbeddedLandmark( LLInventoryItem* item )
void LLViewerTextEditor::openEmbeddedNotecard( LLInventoryItem* item )
{
- //if (saved)
- //{
- // An LLInventoryItem needs to be in an inventory to be opened.
- // This will give the item to the viewer's agent.
- // The callback will attempt to open it if its not already opened.
copyInventory(item, gInventoryCallbacks.registerCB(mInventoryCallback));
-
- //}
- //else
- //{
- // LLNotecardCopyInfo *info = new LLNotecardCopyInfo(this, item);
- // gViewerWindow->alertXml("ConfirmNotecardSave",
- // LLViewerTextEditor::onNotecardDialog, (void*)info);
- //}
}
void LLViewerTextEditor::showUnsavedAlertDialog( LLInventoryItem* item )
{
- LLNotecardCopyInfo *info = new LLNotecardCopyInfo(this, item);
- gViewerWindow->alertXml( "ConfirmNotecardSave",
- LLViewerTextEditor::onNotecardDialog, (void*)info);
+ LLSD payload;
+ payload["item_id"] = item->getUUID();
+ payload["notecard_id"] = mNotecardInventoryID;
+ LLNotifications::instance().add( "ConfirmNotecardSave", LLSD(), payload, LLViewerTextEditor::onNotecardDialog);
}
+
// static
-void LLViewerTextEditor::onNotecardDialog( S32 option, void* userdata )
+bool LLViewerTextEditor::onNotecardDialog(const LLSD& notification, const LLSD& response )
{
- LLNotecardCopyInfo *info = (LLNotecardCopyInfo *)userdata;
+ S32 option = LLNotification::getSelectedOption(notification, response);
if( option == 0 )
{
// itemptr is deleted by LLPreview::save
- LLPointer<LLInventoryItem>* itemptr = new LLPointer<LLInventoryItem>(info->mItem);
- LLPreview::save( info->mTextEd->mNotecardInventoryID, itemptr);
+ LLPointer<LLInventoryItem>* itemptr = new LLPointer<LLInventoryItem>(gInventory.getItem(notification["payload"]["item_id"].asUUID()));
+ LLPreview::save( notification["payload"]["notecard_id"].asUUID() , itemptr);
}
+ return false;
}
void LLViewerTextEditor::showCopyToInvDialog( LLInventoryItem* item )
{
- LLNotecardCopyInfo *info = new LLNotecardCopyInfo(this, item);
- gViewerWindow->alertXml( "ConfirmItemCopy",
- LLViewerTextEditor::onCopyToInvDialog, (void*)info);
+ LLSD payload;
+ payload["item_id"] = item->getUUID();
+ payload["notecard_id"] = mNotecardInventoryID;
+ LLNotifications::instance().add( "ConfirmItemCopy", LLSD(), payload,
+ boost::bind(&LLViewerTextEditor::onCopyToInvDialog, this, _1, _2));
}
-// static
-void LLViewerTextEditor::onCopyToInvDialog( S32 option, void* userdata )
+bool LLViewerTextEditor::onCopyToInvDialog(const LLSD& notification, const LLSD& response)
{
- LLNotecardCopyInfo *info = (LLNotecardCopyInfo *)userdata;
+ S32 option = LLNotification::getSelectedOption(notification, response);
if( 0 == option )
{
- info->mTextEd->copyInventory(info->mItem);
+ LLInventoryItem* itemp = gInventory.getItem(notification["payload"]["item_id"].asUUID());
+ copyInventory(itemp);
}
- delete info;
+ return false;
}