diff options
author | Debi King (Dessie) <dessie@lindenlab.com> | 2011-11-29 17:18:40 -0500 |
---|---|---|
committer | Debi King (Dessie) <dessie@lindenlab.com> | 2011-11-29 17:18:40 -0500 |
commit | ae2a1ea9f10dc9bf3cc5ef59f1428ea1e5fa6495 (patch) | |
tree | f1b2c77031b49b5e78b9baca0440f85dd4bbcd09 /indra/newview/llpanelsnapshotoptions.cpp | |
parent | aaa085cebff88af48bbe4e8a9b41b3aeb60238c2 (diff) | |
parent | 0c36f481f13493801788ef233b96a2bfe5a44060 (diff) |
merge
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)); } |