diff options
author | Nat Goodspeed <nat@lindenlab.com> | 2012-06-07 05:47:50 -0400 |
---|---|---|
committer | Nat Goodspeed <nat@lindenlab.com> | 2012-06-07 05:47:50 -0400 |
commit | ce563795e1f5d7493b975393bea9ec5cab90fd6a (patch) | |
tree | edc0b403ee80989bfa55b6d1cae3680093fb61fc /indra/newview/llpanelsnapshotoptions.cpp | |
parent | d167ebe35f8cdec1ca88e0d817e2878f14a5aa68 (diff) | |
parent | 89ea7ccfc7fd4c33eab4ad9123141fa40231a00d (diff) |
MAINT-1144: Merge llhttpclient_test.cpp fix back to tip
Diffstat (limited to 'indra/newview/llpanelsnapshotoptions.cpp')
-rw-r--r-- | indra/newview/llpanelsnapshotoptions.cpp | 16 |
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)); } |