summaryrefslogtreecommitdiff
path: root/indra/newview/llpanelsnapshotoptions.cpp
diff options
context:
space:
mode:
authorKitty Barnett <develop@catznip.com>2024-09-30 15:54:20 +0200
committerKitty Barnett <develop@catznip.com>2024-09-30 15:54:20 +0200
commited2d4f02d93459bf114ebeab8727d507b7bfc0ef (patch)
treea216907e2c01db7932c83e212319cb7a8c790013 /indra/newview/llpanelsnapshotoptions.cpp
parenta8d8314cb9af193ea7ce95456fb308217ba28e3c (diff)
parenta409503653bebacbc498409806f9e1a4b97ed6ac (diff)
Merge branch 'develop' into rlva/base
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());