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.cpp32
1 files changed, 22 insertions, 10 deletions
diff --git a/indra/newview/llpanelsnapshotinventory.cpp b/indra/newview/llpanelsnapshotinventory.cpp
index 3092ea3b18..96b17acc40 100644
--- a/indra/newview/llpanelsnapshotinventory.cpp
+++ b/indra/newview/llpanelsnapshotinventory.cpp
@@ -50,7 +50,7 @@ class LLPanelSnapshotInventoryBase
public:
LLPanelSnapshotInventoryBase();
- /*virtual*/ BOOL postBuild();
+ /*virtual*/ bool postBuild();
protected:
void onSend();
/*virtual*/ LLSnapshotModel::ESnapshotType getSnapshotType();
@@ -63,7 +63,7 @@ class LLPanelSnapshotInventory
public:
LLPanelSnapshotInventory();
- /*virtual*/ BOOL postBuild();
+ /*virtual*/ bool postBuild();
/*virtual*/ void onOpen(const LLSD& key);
void onResolutionCommit(LLUICtrl* ctrl);
@@ -85,7 +85,7 @@ class LLPanelOutfitSnapshotInventory
public:
LLPanelOutfitSnapshotInventory();
- /*virtual*/ BOOL postBuild();
+ /*virtual*/ bool postBuild();
/*virtual*/ void onOpen(const LLSD& key);
private:
@@ -107,7 +107,7 @@ LLPanelSnapshotInventoryBase::LLPanelSnapshotInventoryBase()
{
}
-BOOL LLPanelSnapshotInventoryBase::postBuild()
+bool LLPanelSnapshotInventoryBase::postBuild()
{
return LLPanelSnapshot::postBuild();
}
@@ -124,10 +124,10 @@ LLPanelSnapshotInventory::LLPanelSnapshotInventory()
}
// virtual
-BOOL LLPanelSnapshotInventory::postBuild()
+bool LLPanelSnapshotInventory::postBuild()
{
- getChild<LLSpinCtrl>(getWidthSpinnerName())->setAllowEdit(FALSE);
- getChild<LLSpinCtrl>(getHeightSpinnerName())->setAllowEdit(FALSE);
+ getChild<LLSpinCtrl>(getWidthSpinnerName())->setAllowEdit(false);
+ getChild<LLSpinCtrl>(getHeightSpinnerName())->setAllowEdit(false);
getChild<LLUICtrl>(getImageSizeComboName())->setCommitCallback(boost::bind(&LLPanelSnapshotInventory::onResolutionCommit, this, _1));
return LLPanelSnapshotInventoryBase::postBuild();
@@ -148,14 +148,26 @@ void LLPanelSnapshotInventory::updateControls(const LLSD& info)
void LLPanelSnapshotInventory::onResolutionCommit(LLUICtrl* ctrl)
{
- BOOL current_window_selected = (getChild<LLComboBox>(getImageSizeComboName())->getCurrentIndex() == 3);
+ bool current_window_selected = (getChild<LLComboBox>(getImageSizeComboName())->getCurrentIndex() == 3);
getChild<LLSpinCtrl>(getWidthSpinnerName())->setVisible(!current_window_selected);
getChild<LLSpinCtrl>(getHeightSpinnerName())->setVisible(!current_window_selected);
}
void LLPanelSnapshotInventoryBase::onSend()
{
- S32 expected_upload_cost = LLAgentBenefitsMgr::current().getTextureUploadCost();
+ S32 w = 0;
+ S32 h = 0;
+
+ if( mSnapshotFloater )
+ {
+ LLSnapshotLivePreview* preview = mSnapshotFloater->getPreviewView();
+ if( preview )
+ {
+ preview->getSize(w, h);
+ }
+ }
+
+ S32 expected_upload_cost = LLAgentBenefitsMgr::current().getTextureUploadCost(w, h);
if (can_afford_transaction(expected_upload_cost))
{
if (mSnapshotFloater)
@@ -183,7 +195,7 @@ LLPanelOutfitSnapshotInventory::LLPanelOutfitSnapshotInventory()
}
// virtual
-BOOL LLPanelOutfitSnapshotInventory::postBuild()
+bool LLPanelOutfitSnapshotInventory::postBuild()
{
return LLPanelSnapshotInventoryBase::postBuild();
}