From 2fb337bc12984f9abecfbc7f3918c372a7b5ac6c Mon Sep 17 00:00:00 2001 From: "Nyx (Neal Orman)" Date: Thu, 30 Sep 2010 23:21:23 -0400 Subject: STORM-1126 WIP Windlight Estate Settings port from 1.23: second pass at getting windlight ported to V2. Lots of cleanup in the floater classes. Not sure every decision was correct but it compiles now. Doesn't link yet. (resubmitted by Vadim ProductEngine) --- indra/newview/llfloaterwater.cpp | 44 +++++++++++++++++++++++++++++++++++++++- 1 file changed, 43 insertions(+), 1 deletion(-) (limited to 'indra/newview/llfloaterwater.cpp') diff --git a/indra/newview/llfloaterwater.cpp b/indra/newview/llfloaterwater.cpp index a443b788fb..4bc8523d0a 100644 --- a/indra/newview/llfloaterwater.cpp +++ b/indra/newview/llfloaterwater.cpp @@ -45,6 +45,7 @@ #include "llfloaterdaycycle.h" #include "llboost.h" #include "llmultisliderctrl.h" +#include "llnotifications.h" #include "v4math.h" #include "llviewerdisplay.h" @@ -104,6 +105,47 @@ BOOL LLFloaterWater::postBuild() syncMenu(); return TRUE; } + +//static +LLFloaterWater* LLFloaterWater::instance() +{ + if (!sWater) + { + sWater = new LLFloaterWater(LLSD()); + } + return sWater; +} + +void LLFloaterWater::show(LLEnvKey::EScope scope) +{ + LLFloaterWater* water = instance(); + + if(scope != sScope && ((LLView*)water)->getVisible()) + { + LLNotifications::instance().add("EnvOtherScopeAlreadyOpen", LLSD(), LLSD()); + return; + } + sScope = scope; + std::string scope_str = ""; + switch(sScope) + { + case LLEnvKey::SCOPE_LOCAL: + scope_str = LLTrans::getString("LocalSettings"); + break; + case LLEnvKey::SCOPE_REGION: + scope_str = LLTrans::getString("RegionSettings"); + break; + } + std::string title = sOriginalTitle + " (" + scope_str + ")"; + water->setTitle(title); + water->syncMenu(); + + LLEnvManager::instance().startEditingScope(scope); + + water->openFloater(); + +} + void LLFloaterWater::initCallbacks(void) { LLWaterParamManager * param_mgr = LLWaterParamManager::getInstance(); @@ -620,7 +662,7 @@ void LLFloaterWater::onChangePresetName(LLUICtrl* ctrl) std::string data = ctrl->getValue().asString(); if(!data.empty()) { - LLWaterParamManager::instance()->loadPreset(data); + LLWaterParamManager::instance().loadPreset(data); syncMenu(); } } -- cgit v1.2.3