summaryrefslogtreecommitdiff
path: root/indra/newview/llpanelsnapshotoptions.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview/llpanelsnapshotoptions.cpp')
-rwxr-xr-xindra/newview/llpanelsnapshotoptions.cpp54
1 files changed, 53 insertions, 1 deletions
diff --git a/indra/newview/llpanelsnapshotoptions.cpp b/indra/newview/llpanelsnapshotoptions.cpp
index 21f95f38c0..0fc9ceec83 100755
--- a/indra/newview/llpanelsnapshotoptions.cpp
+++ b/indra/newview/llpanelsnapshotoptions.cpp
@@ -31,6 +31,10 @@
#include "llsidetraypanelcontainer.h"
#include "llfloatersnapshot.h" // FIXME: create a snapshot model
+#include "llfloaterreg.h"
+#include "llfloaterfacebook.h"
+#include "llfloaterflickr.h"
+#include "llfloatertwitter.h"
/**
* Provides several ways to save a snapshot.
@@ -44,6 +48,7 @@ class LLPanelSnapshotOptions
public:
LLPanelSnapshotOptions();
~LLPanelSnapshotOptions();
+ /*virtual*/ BOOL postBuild();
/*virtual*/ void onOpen(const LLSD& key);
/*virtual*/ void onEconomyDataChange() { updateUploadCost(); }
@@ -54,6 +59,9 @@ private:
void onSaveToEmail();
void onSaveToInventory();
void onSaveToComputer();
+ void onSendToFacebook();
+ void onSendToTwitter();
+ void onSendToFlickr();
};
static LLPanelInjector<LLPanelSnapshotOptions> panel_class("llpanelsnapshotoptions");
@@ -64,7 +72,9 @@ 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));
-
+ mCommitCallbackRegistrar.add("Snapshot.SendToFacebook", boost::bind(&LLPanelSnapshotOptions::onSendToFacebook, this));
+ mCommitCallbackRegistrar.add("Snapshot.SendToTwitter", boost::bind(&LLPanelSnapshotOptions::onSendToTwitter, this));
+ mCommitCallbackRegistrar.add("Snapshot.SendToFlickr", boost::bind(&LLPanelSnapshotOptions::onSendToFlickr, this));
LLGlobalEconomy::Singleton::getInstance()->addObserver(this);
}
@@ -74,6 +84,12 @@ LLPanelSnapshotOptions::~LLPanelSnapshotOptions()
}
// virtual
+BOOL LLPanelSnapshotOptions::postBuild()
+{
+ return LLPanel::postBuild();
+}
+
+// virtual
void LLPanelSnapshotOptions::onOpen(const LLSD& key)
{
updateUploadCost();
@@ -118,3 +134,39 @@ void LLPanelSnapshotOptions::onSaveToComputer()
{
openPanel("panel_snapshot_local");
}
+
+void LLPanelSnapshotOptions::onSendToFacebook()
+{
+ LLFloaterReg::hideInstance("snapshot");
+
+ LLFloaterFacebook* facebook_floater = dynamic_cast<LLFloaterFacebook*>(LLFloaterReg::getInstance("facebook"));
+ if (facebook_floater)
+ {
+ facebook_floater->showPhotoPanel();
+ }
+ LLFloaterReg::showInstance("facebook");
+}
+
+void LLPanelSnapshotOptions::onSendToTwitter()
+{
+ LLFloaterReg::hideInstance("snapshot");
+
+ LLFloaterTwitter* twitter_floater = dynamic_cast<LLFloaterTwitter*>(LLFloaterReg::getInstance("twitter"));
+ if (twitter_floater)
+ {
+ twitter_floater->showPhotoPanel();
+ }
+ LLFloaterReg::showInstance("twitter");
+}
+
+void LLPanelSnapshotOptions::onSendToFlickr()
+{
+ LLFloaterReg::hideInstance("snapshot");
+
+ LLFloaterFlickr* flickr_floater = dynamic_cast<LLFloaterFlickr*>(LLFloaterReg::getInstance("flickr"));
+ if (flickr_floater)
+ {
+ flickr_floater->showPhotoPanel();
+ }
+ LLFloaterReg::showInstance("flickr");
+}