diff options
Diffstat (limited to 'indra/newview/llfloatersnapshot.cpp')
-rw-r--r-- | indra/newview/llfloatersnapshot.cpp | 26 |
1 files changed, 24 insertions, 2 deletions
diff --git a/indra/newview/llfloatersnapshot.cpp b/indra/newview/llfloatersnapshot.cpp index cd4876834e..d08c6531ce 100644 --- a/indra/newview/llfloatersnapshot.cpp +++ b/indra/newview/llfloatersnapshot.cpp @@ -168,6 +168,8 @@ public: void setSnapshotBufferType(LLViewerWindow::ESnapshotType type) { mSnapshotBufferType = type; } void updateSnapshot(BOOL new_snapshot, BOOL new_thumbnail = FALSE, F32 delay = 0.f); LLFloaterPostcard* savePostcard(); + void confirmSavingTexture(bool set_as_profile_pic = false); + bool onSavingTextureConfirmed(const LLSD& notification, const LLSD& response, bool set_as_profile_pic); void saveTexture(bool set_as_profile_pic = false); BOOL saveLocal(); void saveWeb(std::string url); @@ -983,6 +985,26 @@ void profile_pic_upload_callback(const LLUUID& uuid, void *user_data, S32 status floater->setAsProfilePic(uuid); } +void LLSnapshotLivePreview::confirmSavingTexture(bool set_as_profile_pic) +{ + LLSD args; + args["AMOUNT"] = "10"; // *TODO: there's currently no way to avoid hardcoding the upload price + LLNotificationsUtil::add("UploadConfirmation", args, LLSD(), + boost::bind(&LLSnapshotLivePreview::onSavingTextureConfirmed, this, _1, _2, set_as_profile_pic)); +} + +bool LLSnapshotLivePreview::onSavingTextureConfirmed(const LLSD& notification, const LLSD& response, bool set_as_profile_pic) +{ + S32 option = LLNotificationsUtil::getSelectedOption(notification, response); + + if (option == 0) + { + saveTexture(set_as_profile_pic); + } + + return false; +} + void LLSnapshotLivePreview::saveTexture(bool set_as_profile_pic) { @@ -1748,7 +1770,7 @@ void LLFloaterSnapshot::Impl::onCommitProfilePic(LLFloaterSnapshot* view) if(previewp) { - previewp->saveTexture(true); + previewp->confirmSavingTexture(true); } } @@ -1770,7 +1792,7 @@ void LLFloaterSnapshot::Impl::onCommitSnapshot(LLFloaterSnapshot* view, LLSnapsh } else if (type == LLSnapshotLivePreview::SNAPSHOT_TEXTURE) { - previewp->saveTexture(); + previewp->confirmSavingTexture(); } else if (type == LLSnapshotLivePreview::SNAPSHOT_POSTCARD) { |