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.cpp45
1 files changed, 5 insertions, 40 deletions
diff --git a/indra/newview/llpanelsnapshotoptions.cpp b/indra/newview/llpanelsnapshotoptions.cpp
index 962d3bba16..eadf8df188 100644
--- a/indra/newview/llpanelsnapshotoptions.cpp
+++ b/indra/newview/llpanelsnapshotoptions.cpp
@@ -30,12 +30,8 @@
#include "llsidetraypanelcontainer.h"
#include "llfloatersnapshot.h" // FIXME: create a snapshot model
-#include "llsnapshotlivepreview.h"
#include "llfloaterreg.h"
-#include "llagentbenefits.h"
-
-
/**
* Provides several ways to save a snapshot.
*/
@@ -46,12 +42,9 @@ class LLPanelSnapshotOptions
public:
LLPanelSnapshotOptions();
- ~LLPanelSnapshotOptions();
- /*virtual*/ bool postBuild();
- /*virtual*/ void onOpen(const LLSD& key);
+ bool postBuild() override;
private:
- void updateUploadCost();
void openPanel(const std::string& panel_name);
void onSaveToProfile();
void onSaveToEmail();
@@ -65,14 +58,10 @@ static LLPanelInjector<LLPanelSnapshotOptions> panel_class("llpanelsnapshotoptio
LLPanelSnapshotOptions::LLPanelSnapshotOptions()
{
- mCommitCallbackRegistrar.add("Snapshot.SaveToProfile", boost::bind(&LLPanelSnapshotOptions::onSaveToProfile, this));
- 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));
-}
-
-LLPanelSnapshotOptions::~LLPanelSnapshotOptions()
-{
+ mCommitCallbackRegistrar.add("Snapshot.SaveToProfile", { boost::bind(&LLPanelSnapshotOptions::onSaveToProfile, this) });
+ 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) });
}
// virtual
@@ -82,30 +71,6 @@ bool LLPanelSnapshotOptions::postBuild()
return LLPanel::postBuild();
}
-// virtual
-void LLPanelSnapshotOptions::onOpen(const LLSD& key)
-{
- updateUploadCost();
-}
-
-void LLPanelSnapshotOptions::updateUploadCost()
-{
- 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));
-}
-
void LLPanelSnapshotOptions::openPanel(const std::string& panel_name)
{
LLSideTrayPanelContainer* parent = dynamic_cast<LLSideTrayPanelContainer*>(getParent());