summaryrefslogtreecommitdiff
path: root/indra/newview/llpanelsnapshotinventory.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview/llpanelsnapshotinventory.cpp')
-rw-r--r--indra/newview/llpanelsnapshotinventory.cpp22
1 files changed, 19 insertions, 3 deletions
diff --git a/indra/newview/llpanelsnapshotinventory.cpp b/indra/newview/llpanelsnapshotinventory.cpp
index 408eb8fbf3..b2952834fb 100644
--- a/indra/newview/llpanelsnapshotinventory.cpp
+++ b/indra/newview/llpanelsnapshotinventory.cpp
@@ -35,6 +35,8 @@
#include "llpanelsnapshot.h"
#include "llsnapshotlivepreview.h"
#include "llviewercontrol.h" // gSavedSettings
+#include "llstatusbar.h" // can_afford_transaction()
+#include "llnotificationsutil.h"
/**
* The panel provides UI for saving snapshot as an inventory texture.
@@ -153,10 +155,24 @@ void LLPanelSnapshotInventory::onResolutionCommit(LLUICtrl* ctrl)
void LLPanelSnapshotInventoryBase::onSend()
{
- if (mSnapshotFloater)
+ S32 expected_upload_cost = LLGlobalEconomy::Singleton::getInstance()->getPriceUpload();
+ if (can_afford_transaction(expected_upload_cost))
+ {
+ if (mSnapshotFloater)
+ {
+ mSnapshotFloater->saveTexture();
+ mSnapshotFloater->postSave();
+ }
+ }
+ else
{
- mSnapshotFloater->saveTexture();
- mSnapshotFloater->postSave();
+ LLSD args;
+ args["COST"] = llformat("%d", expected_upload_cost);
+ LLNotificationsUtil::add("ErrorPhotoCannotAfford", args);
+ if (mSnapshotFloater)
+ {
+ mSnapshotFloater->inventorySaveFailed();
+ }
}
}