summaryrefslogtreecommitdiff
path: root/indra/newview/llpanelsnapshotoptions.cpp
diff options
context:
space:
mode:
authorOz Linden <oz@lindenlab.com>2011-11-21 15:27:45 -0500
committerOz Linden <oz@lindenlab.com>2011-11-21 15:27:45 -0500
commitb17c52d63ee159e071298ac0a8176a57a2e9b6de (patch)
tree50ca9729e95773286496ba1d0c52a0a60ef7ab38 /indra/newview/llpanelsnapshotoptions.cpp
parent6e2c76221e9cc933eb6f40e71af359c3cf6c2063 (diff)
parentd145cbf37100d50ac6fc15c6009cb496615ed7fb (diff)
merge up to latest viewer-development
Diffstat (limited to 'indra/newview/llpanelsnapshotoptions.cpp')
-rw-r--r--indra/newview/llpanelsnapshotoptions.cpp16
1 files changed, 16 insertions, 0 deletions
diff --git a/indra/newview/llpanelsnapshotoptions.cpp b/indra/newview/llpanelsnapshotoptions.cpp
index df904b6836..554fabe5b3 100644
--- a/indra/newview/llpanelsnapshotoptions.cpp
+++ b/indra/newview/llpanelsnapshotoptions.cpp
@@ -37,14 +37,18 @@
*/
class LLPanelSnapshotOptions
: public LLPanel
+, public LLEconomyObserver
{
LOG_CLASS(LLPanelSnapshotOptions);
public:
LLPanelSnapshotOptions();
+ ~LLPanelSnapshotOptions();
/*virtual*/ void onOpen(const LLSD& key);
+ /*virtual*/ void onEconomyDataChange() { updateUploadCost(); }
private:
+ void updateUploadCost();
void openPanel(const std::string& panel_name);
void onSaveToProfile();
void onSaveToEmail();
@@ -60,11 +64,23 @@ LLPanelSnapshotOptions::LLPanelSnapshotOptions()
mCommitCallbackRegistrar.add("Snapshot.SaveToEmail", boost::bind(&LLPanelSnapshotOptions::onSaveToEmail, this));
mCommitCallbackRegistrar.add("Snapshot.SaveToInventory", boost::bind(&LLPanelSnapshotOptions::onSaveToInventory, this));
mCommitCallbackRegistrar.add("Snapshot.SaveToComputer", boost::bind(&LLPanelSnapshotOptions::onSaveToComputer, this));
+
+ LLGlobalEconomy::Singleton::getInstance()->addObserver(this);
+}
+
+LLPanelSnapshotOptions::~LLPanelSnapshotOptions()
+{
+ LLGlobalEconomy::Singleton::getInstance()->removeObserver(this);
}
// virtual
void LLPanelSnapshotOptions::onOpen(const LLSD& key)
{
+ updateUploadCost();
+}
+
+void LLPanelSnapshotOptions::updateUploadCost()
+{
S32 upload_cost = LLGlobalEconomy::Singleton::getInstance()->getPriceUpload();
getChild<LLUICtrl>("save_to_inventory_btn")->setLabelArg("[AMOUNT]", llformat("%d", upload_cost));
}