diff options
author | Kent Quirk <q@lindenlab.com> | 2009-01-05 18:59:12 +0000 |
---|---|---|
committer | Kent Quirk <q@lindenlab.com> | 2009-01-05 18:59:12 +0000 |
commit | 667ca55bad0108c4bdf8f007b89e1a52fc766aad (patch) | |
tree | 7bd62ac8d9af079c3994565f3f200ccc250bbc28 /indra/newview/llfloaterwater.cpp | |
parent | 95f365789f4cebc7bd97ccefd538f14d481a8373 (diff) |
svn merge -r106715:HEAD svn+ssh://svn.lindenlab.com/svn/linden/branches/q/notifications-merge-r106715 . QAR-1149 -- Final merge of notifications to trunk.
Diffstat (limited to 'indra/newview/llfloaterwater.cpp')
-rw-r--r-- | indra/newview/llfloaterwater.cpp | 46 |
1 files changed, 22 insertions, 24 deletions
diff --git a/indra/newview/llfloaterwater.cpp b/indra/newview/llfloaterwater.cpp index 4705b2f5ba..1a8beb7a58 100644 --- a/indra/newview/llfloaterwater.cpp +++ b/indra/newview/llfloaterwater.cpp @@ -176,15 +176,7 @@ void LLFloaterWater::onClickHelp(void* data) LLFloaterWater* self = LLFloaterWater::instance(); const std::string* xml_alert = (std::string*)data; - LLAlertDialog* dialogp = gViewerWindow->alertXml(*xml_alert); - if (dialogp) - { - LLFloater* root_floater = gFloaterView->getParentFloater(self); - if (root_floater) - { - root_floater->addDependentFloater(dialogp); - } - } + LLNotifications::instance().add(self->contextualNotification(*xml_alert)); } void LLFloaterWater::initHelpBtn(const std::string& name, const std::string& xml_alert) @@ -192,11 +184,14 @@ void LLFloaterWater::initHelpBtn(const std::string& name, const std::string& xml childSetAction(name, onClickHelp, new std::string(xml_alert)); } -void LLFloaterWater::newPromptCallback(S32 option, const std::string& text, void* userData) +bool LLFloaterWater::newPromptCallback(const LLSD& notification, const LLSD& response) { + std::string text = response["message"].asString(); + S32 option = LLNotification::getSelectedOption(notification, response); + if(text == "") { - return; + return false; } if(option == 0) { @@ -224,9 +219,10 @@ void LLFloaterWater::newPromptCallback(S32 option, const std::string& text, void } else { - gViewerWindow->alertXml("ExistsWaterPresetAlert"); + LLNotifications::instance().add("ExistsWaterPresetAlert"); } } + return false; } void LLFloaterWater::syncMenu() @@ -596,8 +592,7 @@ void LLFloaterWater::onNormalMapPicked(LLUICtrl* ctrl, void* userData) void LLFloaterWater::onNewPreset(void* userData) { - gViewerWindow->alertXmlEditText("NewWaterPreset", LLStringUtil::format_map_t(), - NULL, NULL, newPromptCallback, NULL); + LLNotifications::instance().add("NewWaterPreset", LLSD(), LLSD(), newPromptCallback); } void LLFloaterWater::onSavePreset(void* userData) @@ -619,15 +614,16 @@ void LLFloaterWater::onSavePreset(void* userData) comboBox->getSelectedItemLabel()); if(sIt != sDefaultPresets.end() && !gSavedSettings.getBOOL("WaterEditPresets")) { - gViewerWindow->alertXml("WLNoEditDefault"); + LLNotifications::instance().add("WLNoEditDefault"); return; } - gViewerWindow->alertXml("WLSavePresetAlert", saveAlertCallback, sWaterMenu); + LLNotifications::instance().add("WLSavePresetAlert", LLSD(), LLSD(), saveAlertCallback); } -void LLFloaterWater::saveAlertCallback(S32 option, void* userdata) +bool LLFloaterWater::saveAlertCallback(const LLSD& notification, const LLSD& response) { + S32 option = LLNotification::getSelectedOption(notification, response); // if they choose save, do it. Otherwise, don't do anything if(option == 0) { @@ -640,7 +636,7 @@ void LLFloaterWater::saveAlertCallback(S32 option, void* userdata) // comment this back in to save to file param_mgr->savePreset(param_mgr->mCurParams.mName); } - + return false; } void LLFloaterWater::onDeletePreset(void* userData) @@ -652,13 +648,14 @@ void LLFloaterWater::onDeletePreset(void* userData) return; } - LLStringUtil::format_map_t args; - args["[SKY]"] = combo_box->getSelectedValue().asString(); - gViewerWindow->alertXml("WLDeletePresetAlert", args, deleteAlertCallback, sWaterMenu); + LLSD args; + args["SKY"] = combo_box->getSelectedValue().asString(); + LLNotifications::instance().add("WLDeletePresetAlert", args, LLSD(), deleteAlertCallback); } -void LLFloaterWater::deleteAlertCallback(S32 option, void* userdata) +bool LLFloaterWater::deleteAlertCallback(const LLSD& notification, const LLSD& response) { + S32 option = LLNotification::getSelectedOption(notification, response); // if they choose delete, do it. Otherwise, don't do anything if(option == 0) { @@ -680,8 +677,8 @@ void LLFloaterWater::deleteAlertCallback(S32 option, void* userdata) std::set<std::string>::iterator sIt = sDefaultPresets.find(name); if(sIt != sDefaultPresets.end()) { - gViewerWindow->alertXml("WaterNoEditDefault"); - return; + LLNotifications::instance().add("WaterNoEditDefault"); + return false; } LLWaterParamManager::instance()->removeParamSet(name, true); @@ -710,6 +707,7 @@ void LLFloaterWater::deleteAlertCallback(S32 option, void* userdata) combo_box->setCurrentByIndex(new_index); } } + return false; } |