summaryrefslogtreecommitdiff
path: root/indra/newview/llpanelsnapshotoptions.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview/llpanelsnapshotoptions.cpp')
-rw-r--r--indra/newview/llpanelsnapshotoptions.cpp19
1 files changed, 16 insertions, 3 deletions
diff --git a/indra/newview/llpanelsnapshotoptions.cpp b/indra/newview/llpanelsnapshotoptions.cpp
index 28e1f33b16..962d3bba16 100644
--- a/indra/newview/llpanelsnapshotoptions.cpp
+++ b/indra/newview/llpanelsnapshotoptions.cpp
@@ -30,6 +30,7 @@
#include "llsidetraypanelcontainer.h"
#include "llfloatersnapshot.h" // FIXME: create a snapshot model
+#include "llsnapshotlivepreview.h"
#include "llfloaterreg.h"
#include "llagentbenefits.h"
@@ -46,7 +47,7 @@ class LLPanelSnapshotOptions
public:
LLPanelSnapshotOptions();
~LLPanelSnapshotOptions();
- /*virtual*/ BOOL postBuild();
+ /*virtual*/ bool postBuild();
/*virtual*/ void onOpen(const LLSD& key);
private:
@@ -75,7 +76,7 @@ LLPanelSnapshotOptions::~LLPanelSnapshotOptions()
}
// virtual
-BOOL LLPanelSnapshotOptions::postBuild()
+bool LLPanelSnapshotOptions::postBuild()
{
mSnapshotFloater = getParentByType<LLFloaterSnapshotBase>();
return LLPanel::postBuild();
@@ -89,7 +90,19 @@ void LLPanelSnapshotOptions::onOpen(const LLSD& key)
void LLPanelSnapshotOptions::updateUploadCost()
{
- S32 upload_cost = LLAgentBenefitsMgr::current().getTextureUploadCost();
+ S32 w = 0;
+ S32 h = 0;
+
+ if( mSnapshotFloater )
+ {
+ LLSnapshotLivePreview* preview = mSnapshotFloater->getPreviewView();
+ if( preview )
+ {
+ preview->getSize(w, h);
+ }
+ }
+
+ S32 upload_cost = LLAgentBenefitsMgr::current().getTextureUploadCost(w, h);
getChild<LLUICtrl>("save_to_inventory_btn")->setLabelArg("[AMOUNT]", llformat("%d", upload_cost));
}