made floater_snapshot links open the photo tab on the corresponding floater for ACME-1168

master
Cho 2013-11-11 23:13:01 +00:00
parent 15434d53ea
commit dbab46ae78
7 changed files with 66 additions and 0 deletions

View File

@ -46,6 +46,7 @@
#include "llviewerregion.h"
#include "llviewercontrol.h"
#include "llviewermedia.h"
#include "lltabcontainer.h"
static LLRegisterPanelClassWrapper<LLFlickrPhotoPanel> t_panel_photo("llflickrphotopanel");
static LLRegisterPanelClassWrapper<LLFlickrAccountPanel> t_panel_account("llflickraccountpanel");
@ -588,6 +589,18 @@ BOOL LLFloaterFlickr::postBuild()
return LLFloater::postBuild();
}
void LLFloaterFlickr::showPhotoPanel()
{
LLTabContainer* parent = dynamic_cast<LLTabContainer*>(mSocialPhotoPanel->getParent());
if (!parent)
{
llwarns << "Cannot find panel container" << llendl;
return;
}
parent->selectTabPanel(mSocialPhotoPanel);
}
// static
void LLFloaterFlickr::preUpdate()
{

View File

@ -110,6 +110,8 @@ public:
BOOL postBuild();
void draw();
void onCancel();
void showPhotoPanel();
static void preUpdate();
static void postUpdate();

View File

@ -46,6 +46,7 @@
#include "llviewerregion.h"
#include "llviewercontrol.h"
#include "llviewermedia.h"
#include "lltabcontainer.h"
static LLRegisterPanelClassWrapper<LLSocialStatusPanel> t_panel_status("llsocialstatuspanel");
static LLRegisterPanelClassWrapper<LLSocialPhotoPanel> t_panel_photo("llsocialphotopanel");
@ -823,6 +824,18 @@ BOOL LLFloaterSocial::postBuild()
return LLFloater::postBuild();
}
void LLFloaterSocial::showPhotoPanel()
{
LLTabContainer* parent = dynamic_cast<LLTabContainer*>(mSocialPhotoPanel->getParent());
if (!parent)
{
llwarns << "Cannot find panel container" << llendl;
return;
}
parent->selectTabPanel(mSocialPhotoPanel);
}
// static
void LLFloaterSocial::preUpdate()
{

View File

@ -150,6 +150,8 @@ public:
BOOL postBuild();
void draw();
void onCancel();
void showPhotoPanel();
static void preUpdate();
static void postUpdate();

View File

@ -46,6 +46,7 @@
#include "llviewerregion.h"
#include "llviewercontrol.h"
#include "llviewermedia.h"
#include "lltabcontainer.h"
static LLRegisterPanelClassWrapper<LLTwitterPhotoPanel> t_panel_photo("lltwitterphotopanel");
static LLRegisterPanelClassWrapper<LLTwitterAccountPanel> t_panel_account("lltwitteraccountpanel");
@ -565,6 +566,18 @@ BOOL LLFloaterTwitter::postBuild()
return LLFloater::postBuild();
}
void LLFloaterTwitter::showPhotoPanel()
{
LLTabContainer* parent = dynamic_cast<LLTabContainer*>(mSocialPhotoPanel->getParent());
if (!parent)
{
llwarns << "Cannot find panel container" << llendl;
return;
}
parent->selectTabPanel(mSocialPhotoPanel);
}
// static
void LLFloaterTwitter::preUpdate()
{

View File

@ -108,6 +108,8 @@ public:
void draw();
void onCancel();
void showPhotoPanel();
static void preUpdate();
static void postUpdate();

View File

@ -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<LLFloaterSocial*>(LLFloaterReg::getInstance("social"));
if (social_floater)
{
social_floater->showPhotoPanel();
}
LLFloaterReg::showInstance("social");
}
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");
}