summaryrefslogtreecommitdiff
path: root/indra/newview/llfloatereditwater.cpp
diff options
context:
space:
mode:
authorVadim ProductEngine <vsavchuk@productengine.com>2011-05-26 23:09:30 +0300
committerVadim ProductEngine <vsavchuk@productengine.com>2011-05-26 23:09:30 +0300
commitbbde07245bdcedd05bd37863d573c94c2af4c6f7 (patch)
treebb4025ca5146f35e3738585a46fe74c30220612a /indra/newview/llfloatereditwater.cpp
parentebfbf2a561a98e5af4dde319edb49a663e27de26 (diff)
STORM-1285 WIP Connected "Create/Edit Water / Sky / Day Cycle" floaters (not functional) to the main menu.
Diffstat (limited to 'indra/newview/llfloatereditwater.cpp')
-rw-r--r--indra/newview/llfloatereditwater.cpp73
1 files changed, 73 insertions, 0 deletions
diff --git a/indra/newview/llfloatereditwater.cpp b/indra/newview/llfloatereditwater.cpp
new file mode 100644
index 0000000000..4007c27066
--- /dev/null
+++ b/indra/newview/llfloatereditwater.cpp
@@ -0,0 +1,73 @@
+/**
+ * @file llfloatereditwater.cpp
+ * @brief Floater to create or edit a water preset
+ *
+ * $LicenseInfo:firstyear=2011&license=viewerlgpl$
+ * Second Life Viewer Source Code
+ * Copyright (C) 2011, Linden Research, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation;
+ * version 2.1 of the License only.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ *
+ * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
+ * $/LicenseInfo$
+ */
+
+#include "llviewerprecompiledheaders.h"
+
+#include "llfloatereditwater.h"
+
+// libs
+#include "llbutton.h"
+
+// newview
+
+LLFloaterEditWater::LLFloaterEditWater(const LLSD &key)
+: LLFloater(key)
+{
+}
+
+// virtual
+BOOL LLFloaterEditWater::postBuild()
+{
+ getChild<LLButton>("cancel")->setCommitCallback(boost::bind(&LLFloaterEditWater::onBtnCancel, this));
+
+ // Disable some non-functional controls.
+ getChildView("water_preset_combo")->setEnabled(FALSE);
+ getChildView("save")->setEnabled(FALSE);
+
+ return TRUE;
+}
+
+// virtual
+void LLFloaterEditWater::onOpen(const LLSD& key)
+{
+ std::string param = key.asString();
+ std::string floater_title = getString(std::string("title_") + param);
+ std::string hint = getString(std::string("hint_" + param));
+
+ // Update floater title.
+ setTitle(floater_title);
+
+ // Update the hint at the top.
+ getChild<LLUICtrl>("hint")->setValue(hint);
+
+ // Hide the hint to the right of the combo if we're invoked to create a new preset.
+ getChildView("note")->setVisible(param == "edit");
+}
+
+void LLFloaterEditWater::onBtnCancel()
+{
+ closeFloater();
+}