From dbab46ae786166ac5d6c929e2c444d8f490edd58 Mon Sep 17 00:00:00 2001 From: Cho Date: Mon, 11 Nov 2013 23:13:01 +0000 Subject: made floater_snapshot links open the photo tab on the corresponding floater for ACME-1168 --- indra/newview/llfloaterflickr.cpp | 13 +++++++++++++ indra/newview/llfloaterflickr.h | 2 ++ indra/newview/llfloatersocial.cpp | 13 +++++++++++++ indra/newview/llfloatersocial.h | 2 ++ indra/newview/llfloatertwitter.cpp | 13 +++++++++++++ indra/newview/llfloatertwitter.h | 2 ++ indra/newview/llpanelsnapshotoptions.cpp | 21 +++++++++++++++++++++ 7 files changed, 66 insertions(+) (limited to 'indra/newview') diff --git a/indra/newview/llfloaterflickr.cpp b/indra/newview/llfloaterflickr.cpp index 1edc61fcf6..7140b527b9 100644 --- a/indra/newview/llfloaterflickr.cpp +++ b/indra/newview/llfloaterflickr.cpp @@ -46,6 +46,7 @@ #include "llviewerregion.h" #include "llviewercontrol.h" #include "llviewermedia.h" +#include "lltabcontainer.h" static LLRegisterPanelClassWrapper t_panel_photo("llflickrphotopanel"); static LLRegisterPanelClassWrapper t_panel_account("llflickraccountpanel"); @@ -588,6 +589,18 @@ BOOL LLFloaterFlickr::postBuild() return LLFloater::postBuild(); } +void LLFloaterFlickr::showPhotoPanel() +{ + LLTabContainer* parent = dynamic_cast(mSocialPhotoPanel->getParent()); + if (!parent) + { + llwarns << "Cannot find panel container" << llendl; + return; + } + + parent->selectTabPanel(mSocialPhotoPanel); +} + // static void LLFloaterFlickr::preUpdate() { diff --git a/indra/newview/llfloaterflickr.h b/indra/newview/llfloaterflickr.h index 8cf2cd2dd6..e9005444d8 100644 --- a/indra/newview/llfloaterflickr.h +++ b/indra/newview/llfloaterflickr.h @@ -110,6 +110,8 @@ public: BOOL postBuild(); void draw(); void onCancel(); + + void showPhotoPanel(); static void preUpdate(); static void postUpdate(); diff --git a/indra/newview/llfloatersocial.cpp b/indra/newview/llfloatersocial.cpp index 2a74c8e3ea..31404da7d3 100644 --- a/indra/newview/llfloatersocial.cpp +++ b/indra/newview/llfloatersocial.cpp @@ -46,6 +46,7 @@ #include "llviewerregion.h" #include "llviewercontrol.h" #include "llviewermedia.h" +#include "lltabcontainer.h" static LLRegisterPanelClassWrapper t_panel_status("llsocialstatuspanel"); static LLRegisterPanelClassWrapper t_panel_photo("llsocialphotopanel"); @@ -823,6 +824,18 @@ BOOL LLFloaterSocial::postBuild() return LLFloater::postBuild(); } +void LLFloaterSocial::showPhotoPanel() +{ + LLTabContainer* parent = dynamic_cast(mSocialPhotoPanel->getParent()); + if (!parent) + { + llwarns << "Cannot find panel container" << llendl; + return; + } + + parent->selectTabPanel(mSocialPhotoPanel); +} + // static void LLFloaterSocial::preUpdate() { diff --git a/indra/newview/llfloatersocial.h b/indra/newview/llfloatersocial.h index bbe07c9704..041ae8a268 100644 --- a/indra/newview/llfloatersocial.h +++ b/indra/newview/llfloatersocial.h @@ -150,6 +150,8 @@ public: BOOL postBuild(); void draw(); void onCancel(); + + void showPhotoPanel(); static void preUpdate(); static void postUpdate(); diff --git a/indra/newview/llfloatertwitter.cpp b/indra/newview/llfloatertwitter.cpp index 1324bd5fd8..0da0d64426 100644 --- a/indra/newview/llfloatertwitter.cpp +++ b/indra/newview/llfloatertwitter.cpp @@ -46,6 +46,7 @@ #include "llviewerregion.h" #include "llviewercontrol.h" #include "llviewermedia.h" +#include "lltabcontainer.h" static LLRegisterPanelClassWrapper t_panel_photo("lltwitterphotopanel"); static LLRegisterPanelClassWrapper t_panel_account("lltwitteraccountpanel"); @@ -565,6 +566,18 @@ BOOL LLFloaterTwitter::postBuild() return LLFloater::postBuild(); } +void LLFloaterTwitter::showPhotoPanel() +{ + LLTabContainer* parent = dynamic_cast(mSocialPhotoPanel->getParent()); + if (!parent) + { + llwarns << "Cannot find panel container" << llendl; + return; + } + + parent->selectTabPanel(mSocialPhotoPanel); +} + // static void LLFloaterTwitter::preUpdate() { diff --git a/indra/newview/llfloatertwitter.h b/indra/newview/llfloatertwitter.h index 090e01872a..12e1d41210 100644 --- a/indra/newview/llfloatertwitter.h +++ b/indra/newview/llfloatertwitter.h @@ -108,6 +108,8 @@ public: void draw(); void onCancel(); + void showPhotoPanel(); + static void preUpdate(); static void postUpdate(); diff --git a/indra/newview/llpanelsnapshotoptions.cpp b/indra/newview/llpanelsnapshotoptions.cpp index 1967c50a29..4cadd837d1 100755 --- a/indra/newview/llpanelsnapshotoptions.cpp +++ b/indra/newview/llpanelsnapshotoptions.cpp @@ -32,6 +32,9 @@ #include "llfloatersnapshot.h" // FIXME: create a snapshot model #include "llfloaterreg.h" +#include "llfloatersocial.h" +#include "llfloaterflickr.h" +#include "llfloatertwitter.h" /** * Provides several ways to save a snapshot. @@ -140,17 +143,35 @@ void LLPanelSnapshotOptions::onSaveToComputer() void LLPanelSnapshotOptions::onSendToFacebook() { LLFloaterReg::hideInstance("snapshot"); + + LLFloaterSocial* social_floater = dynamic_cast(LLFloaterReg::getInstance("social")); + if (social_floater) + { + social_floater->showPhotoPanel(); + } LLFloaterReg::showInstance("social"); } void LLPanelSnapshotOptions::onSendToTwitter() { LLFloaterReg::hideInstance("snapshot"); + + LLFloaterTwitter* twitter_floater = dynamic_cast(LLFloaterReg::getInstance("twitter")); + if (twitter_floater) + { + twitter_floater->showPhotoPanel(); + } LLFloaterReg::showInstance("twitter"); } void LLPanelSnapshotOptions::onSendToFlickr() { LLFloaterReg::hideInstance("snapshot"); + + LLFloaterFlickr* flickr_floater = dynamic_cast(LLFloaterReg::getInstance("flickr")); + if (flickr_floater) + { + flickr_floater->showPhotoPanel(); + } LLFloaterReg::showInstance("flickr"); } -- cgit v1.2.3