diff options
author | brad kittenbrink <brad@lindenlab.com> | 2009-08-05 18:45:18 -0700 |
---|---|---|
committer | brad kittenbrink <brad@lindenlab.com> | 2009-08-05 18:45:18 -0700 |
commit | a8d216e194327c7bee8a42c983f7f2ca01adb385 (patch) | |
tree | 76819d6e78c7e7cf0c5e54d319847f4731c77205 /indra/newview/llfloaterpostprocess.cpp | |
parent | 860a82863966435bea680d8541f051e99a6c226c (diff) | |
parent | 24d146a9ff26af1f3e4cf5af2c5238ca42e2c6c7 (diff) |
Merged in my DEV-35401 "doubleton" fix.
Diffstat (limited to 'indra/newview/llfloaterpostprocess.cpp')
-rw-r--r-- | indra/newview/llfloaterpostprocess.cpp | 62 |
1 files changed, 12 insertions, 50 deletions
diff --git a/indra/newview/llfloaterpostprocess.cpp b/indra/newview/llfloaterpostprocess.cpp index a1015918d4..2ab54d6e46 100644 --- a/indra/newview/llfloaterpostprocess.cpp +++ b/indra/newview/llfloaterpostprocess.cpp @@ -36,6 +36,7 @@ #include "llsliderctrl.h" #include "llcheckboxctrl.h" +#include "llcombobox.h" #include "lluictrlfactory.h" #include "llviewerdisplay.h" #include "llpostprocess.h" @@ -44,14 +45,10 @@ #include "llviewerwindow.h" -LLFloaterPostProcess* LLFloaterPostProcess::sPostProcess = NULL; - - -LLFloaterPostProcess::LLFloaterPostProcess() - : LLFloater() +LLFloaterPostProcess::LLFloaterPostProcess(const LLSD& key) + : LLFloater(key) { - LLUICtrlFactory::getInstance()->buildFloater(this, "floater_post_process.xml"); - + //LLUICtrlFactory::getInstance()->buildFloater(this, "floater_post_process.xml"); } LLFloaterPostProcess::~LLFloaterPostProcess() @@ -87,28 +84,16 @@ BOOL LLFloaterPostProcess::postBuild() // Effect loading and saving. LLComboBox* comboBox = getChild<LLComboBox>("PPEffectsCombo"); - childSetAction("PPLoadEffect", &LLFloaterPostProcess::onLoadEffect, comboBox); + getChild<LLComboBox>("PPLoadEffect")->setCommitCallback(boost::bind(&LLFloaterPostProcess::onLoadEffect, this, comboBox)); comboBox->setCommitCallback(boost::bind(&LLFloaterPostProcess::onChangeEffectName, this, _1)); LLLineEditor* editBox = getChild<LLLineEditor>("PPEffectNameEditor"); - childSetAction("PPSaveEffect", &LLFloaterPostProcess::onSaveEffect, editBox); + getChild<LLComboBox>("PPSaveEffect")->setCommitCallback(boost::bind(&LLFloaterPostProcess::onSaveEffect, this, editBox)); syncMenu(); return TRUE; } -LLFloaterPostProcess* LLFloaterPostProcess::instance() -{ - // if we don't have our singleton instance, create it - if (!sPostProcess) - { - sPostProcess = new LLFloaterPostProcess(); - sPostProcess->openFloater(); - sPostProcess->setFocus(TRUE); - } - return sPostProcess; -} - // Bool Toggle void LLFloaterPostProcess::onBoolToggle(LLUICtrl* ctrl, void* userData) { @@ -159,33 +144,29 @@ void LLFloaterPostProcess::onColorControlIMoved(LLUICtrl* ctrl, void* userData) gPostProcess->tweaks[floatVariableName][3] = sldrCtrl->getValue(); } -void LLFloaterPostProcess::onLoadEffect(void* userData) +void LLFloaterPostProcess::onLoadEffect(LLComboBox* comboBox) { - LLComboBox* comboBox = static_cast<LLComboBox*>(userData); - LLSD::String effectName(comboBox->getSelectedValue().asString()); gPostProcess->setSelectedEffect(effectName); - sPostProcess->syncMenu(); + syncMenu(); } -void LLFloaterPostProcess::onSaveEffect(void* userData) +void LLFloaterPostProcess::onSaveEffect(LLLineEditor* editBox) { - LLLineEditor* editBox = static_cast<LLLineEditor*>(userData); - std::string effectName(editBox->getValue().asString()); if (gPostProcess->mAllEffects.has(effectName)) { LLSD payload; payload["effect_name"] = effectName; - LLNotifications::instance().add("PPSaveEffectAlert", LLSD(), payload, &LLFloaterPostProcess::saveAlertCallback); + LLNotifications::instance().add("PPSaveEffectAlert", LLSD(), payload, boost::bind(&LLFloaterPostProcess::saveAlertCallback, this, _1, _2)); } else { gPostProcess->saveEffect(effectName); - sPostProcess->syncMenu(); + syncMenu(); } } @@ -207,30 +188,11 @@ bool LLFloaterPostProcess::saveAlertCallback(const LLSD& notification, const LLS { gPostProcess->saveEffect(notification["payload"]["effect_name"].asString()); - sPostProcess->syncMenu(); + syncMenu(); } return false; } -void LLFloaterPostProcess::show() -{ - // get the instance, make sure the values are synced - // and open the menu - LLFloaterPostProcess* postProcess = instance(); - postProcess->syncMenu(); - postProcess->openFloater(); -} - -// virtual -void LLFloaterPostProcess::onClose(bool app_quitting) -{ - // just set visibility to false, don't get fancy yet - if (sPostProcess) - { - sPostProcess->setVisible(FALSE); - } -} - void LLFloaterPostProcess::syncMenu() { // add the combo boxe contents |