diff options
author | Vadim Savchuk <vsavchuk@productengine.com> | 2010-04-12 15:14:51 +0300 |
---|---|---|
committer | Vadim Savchuk <vsavchuk@productengine.com> | 2010-04-12 15:14:51 +0300 |
commit | 85f1954a1708eba2e2ea1f4e9d2c70295c128e02 (patch) | |
tree | 7da9b27b7d6f5d384594bc53ba661f5a50e1a128 /indra/newview | |
parent | b52d7ba3a7fc66ff8347283bb3dc3e6c89ae1981 (diff) |
Fixed major bug EXT-6606 (Set As Profile Pic uploads and charges user L$10 without confirmation).
Added upload confirmation dialog.
Reviewed by Mike: https://codereview.productengine.com/secondlife/r/217/
--HG--
branch : product-engine
Diffstat (limited to 'indra/newview')
-rw-r--r-- | indra/newview/llfloatersnapshot.cpp | 26 | ||||
-rw-r--r-- | indra/newview/skins/default/xui/en/notifications.xml | 12 |
2 files changed, 36 insertions, 2 deletions
diff --git a/indra/newview/llfloatersnapshot.cpp b/indra/newview/llfloatersnapshot.cpp index 03389e62d7..a6a8194685 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) 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) { @@ -1746,7 +1768,7 @@ void LLFloaterSnapshot::Impl::onCommitProfilePic(LLFloaterSnapshot* view) if(previewp) { - previewp->saveTexture(true); + previewp->confirmSavingTexture(true); } } @@ -1768,7 +1790,7 @@ void LLFloaterSnapshot::Impl::onCommitSnapshot(LLFloaterSnapshot* view, LLSnapsh } else if (type == LLSnapshotLivePreview::SNAPSHOT_TEXTURE) { - previewp->saveTexture(); + previewp->confirmSavingTexture(); } else if (type == LLSnapshotLivePreview::SNAPSHOT_POSTCARD) { diff --git a/indra/newview/skins/default/xui/en/notifications.xml b/indra/newview/skins/default/xui/en/notifications.xml index e8ba8c683d..ff8de3514f 100644 --- a/indra/newview/skins/default/xui/en/notifications.xml +++ b/indra/newview/skins/default/xui/en/notifications.xml @@ -4376,6 +4376,18 @@ Uploading in-world and web site snapshots... </notification> <notification + icon="alertmodal.tga" + name="UploadConfirmation" + type="alertmodal"> +Uploading costs L$[AMOUNT]. +Do you wish to proceed? + <usetemplate + name="okcancelbuttons" + notext="Cancel" + yestext="Upload"/> + </notification> + + <notification icon="notify.tga" name="UploadPayment" type="notify"> |