From e42a372592a9b6c996d989a7e38c62761f73908a Mon Sep 17 00:00:00 2001 From: Merov Linden Date: Wed, 29 Jan 2014 22:41:27 -0800 Subject: ACME : Add filters to Snapshot Advanced panel for demo --- indra/newview/llfloatersnapshot.cpp | 30 ++++++++++++++++++++-- .../skins/default/xui/en/floater_snapshot.xml | 14 ++++++++++ 2 files changed, 42 insertions(+), 2 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llfloatersnapshot.cpp b/indra/newview/llfloatersnapshot.cpp index 27a9e3da44..e3d67ee658 100755 --- a/indra/newview/llfloatersnapshot.cpp +++ b/indra/newview/llfloatersnapshot.cpp @@ -34,6 +34,7 @@ #include "llfloaterfacebook.h" #include "llfloaterflickr.h" #include "llfloatertwitter.h" +#include "llimagefiltersmanager.h" #include "llcheckboxctrl.h" #include "llcombobox.h" #include "llpostcard.h" @@ -94,6 +95,7 @@ public: } static void onClickNewSnapshot(void* data); static void onClickAutoSnap(LLUICtrl *ctrl, void* data); + static void onClickFilter(LLUICtrl *ctrl, void* data); //static void onClickAdvanceSnap(LLUICtrl *ctrl, void* data); static void onClickMore(void* data) ; static void onClickUICheck(LLUICtrl *ctrl, void* data); @@ -470,12 +472,15 @@ void LLFloaterSnapshot::Impl::updateControls(LLFloaterSnapshot* floater) default: break; } - - if (previewp) + + if (previewp) { previewp->setSnapshotType(shot_type); previewp->setSnapshotFormat(shot_format); previewp->setSnapshotBufferType(layer_type); + // Filters + const std::string& filter_name = floater->getChild("filters_combobox")->getSimple(); + previewp->setFilter(filter_name); } LLPanelSnapshot* current_panel = Impl::getActivePanel(floater); @@ -564,6 +569,17 @@ void LLFloaterSnapshot::Impl::onClickAutoSnap(LLUICtrl *ctrl, void* data) } } +// static +void LLFloaterSnapshot::Impl::onClickFilter(LLUICtrl *ctrl, void* data) +{ + LLFloaterSnapshot *view = (LLFloaterSnapshot *)data; + if (view) + { + checkAutoSnapshot(getPreviewView(view)); + updateControls(view); + } +} + void LLFloaterSnapshot::Impl::onClickMore(void* data) { BOOL visible = gSavedSettings.getBOOL("AdvanceSnapshot"); @@ -1061,6 +1077,16 @@ BOOL LLFloaterSnapshot::postBuild() getChild("auto_snapshot_check")->setValue(gSavedSettings.getBOOL("AutoSnapshot")); childSetCommitCallback("auto_snapshot_check", Impl::onClickAutoSnap, this); + + // Update filter list + std::vector filter_list = LLImageFiltersManager::getInstance()->getFiltersList(); + LLComboBox* filterbox = getChild("filters_combobox"); + for (U32 i = 0; i < filter_list.size(); i++) + { + filterbox->add(filter_list[i]); + } + childSetCommitCallback("filters_combobox", Impl::onClickFilter, this); + LLWebProfile::setImageUploadResultCallback(boost::bind(&LLFloaterSnapshot::Impl::onSnapshotUploadFinished, _1)); LLPostCard::setPostResultCallback(boost::bind(&LLFloaterSnapshot::Impl::onSendingPostcardFinished, _1)); diff --git a/indra/newview/skins/default/xui/en/floater_snapshot.xml b/indra/newview/skins/default/xui/en/floater_snapshot.xml index 019ddad33c..705225b839 100755 --- a/indra/newview/skins/default/xui/en/floater_snapshot.xml +++ b/indra/newview/skins/default/xui/en/floater_snapshot.xml @@ -381,5 +381,19 @@ top_pad="8" width="180" name="auto_snapshot_check" /> + + + -- cgit v1.2.3