summaryrefslogtreecommitdiff
path: root/indra/newview/llfloaterwindlight.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview/llfloaterwindlight.cpp')
-rw-r--r--indra/newview/llfloaterwindlight.cpp52
1 files changed, 26 insertions, 26 deletions
diff --git a/indra/newview/llfloaterwindlight.cpp b/indra/newview/llfloaterwindlight.cpp
index 4e27774029..8ae291f24c 100644
--- a/indra/newview/llfloaterwindlight.cpp
+++ b/indra/newview/llfloaterwindlight.cpp
@@ -233,16 +233,8 @@ void LLFloaterWindLight::onClickHelp(void* data)
{
LLFloaterWindLight* self = LLFloaterWindLight::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);
- }
- }
+ const std::string xml_alert = *(std::string*)data;
+ LLNotifications::instance().add(self->contextualNotification(xml_alert));
}
void LLFloaterWindLight::initHelpBtn(const std::string& name, const std::string& xml_alert)
@@ -250,11 +242,14 @@ void LLFloaterWindLight::initHelpBtn(const std::string& name, const std::string&
childSetAction(name, onClickHelp, new std::string(xml_alert));
}
-void LLFloaterWindLight::newPromptCallback(S32 option, const std::string& text, void* userData)
+bool LLFloaterWindLight::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) {
@@ -303,9 +298,10 @@ void LLFloaterWindLight::newPromptCallback(S32 option, const std::string& text,
}
else
{
- gViewerWindow->alertXml("ExistsSkyPresetAlert");
+ LLNotifications::instance().add("ExistsSkyPresetAlert");
}
}
+ return false;
}
void LLFloaterWindLight::syncMenu()
@@ -784,8 +780,7 @@ void LLFloaterWindLight::onStarAlphaMoved(LLUICtrl* ctrl, void* userData)
void LLFloaterWindLight::onNewPreset(void* userData)
{
- gViewerWindow->alertXmlEditText("NewSkyPreset", LLStringUtil::format_map_t(),
- NULL, NULL, newPromptCallback, NULL);
+ LLNotifications::instance().add("NewSkyPreset", LLSD(), LLSD(), newPromptCallback);
}
void LLFloaterWindLight::onSavePreset(void* userData)
@@ -805,18 +800,19 @@ void LLFloaterWindLight::onSavePreset(void* userData)
comboBox->getSelectedItemLabel());
if(sIt != sDefaultPresets.end() && !gSavedSettings.getBOOL("SkyEditPresets"))
{
- gViewerWindow->alertXml("WLNoEditDefault");
+ LLNotifications::instance().add("WLNoEditDefault");
return;
}
LLWLParamManager::instance()->mCurParams.mName =
comboBox->getSelectedItemLabel();
- gViewerWindow->alertXml("WLSavePresetAlert", saveAlertCallback, sWindLight);
+ LLNotifications::instance().add("WLSavePresetAlert", LLSD(), LLSD(), saveAlertCallback);
}
-void LLFloaterWindLight::saveAlertCallback(S32 option, void* userdata)
+bool LLFloaterWindLight::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)
{
@@ -827,7 +823,7 @@ void LLFloaterWindLight::saveAlertCallback(S32 option, void* userdata)
// comment this back in to save to file
param_mgr->savePreset(param_mgr->mCurParams.mName);
}
-
+ return false;
}
void LLFloaterWindLight::onDeletePreset(void* userData)
@@ -840,17 +836,20 @@ void LLFloaterWindLight::onDeletePreset(void* userData)
return;
}
- LLStringUtil::format_map_t args;
- args["[SKY]"] = combo_box->getSelectedValue().asString();
- gViewerWindow->alertXml("WLDeletePresetAlert", args, deleteAlertCallback, sWindLight);
+ LLSD args;
+ args["SKY"] = combo_box->getSelectedValue().asString();
+ LLNotifications::instance().add("WLDeletePresetAlert", args, LLSD(),
+ boost::bind(&LLFloaterWindLight::deleteAlertCallback, sWindLight, _1, _2));
}
-void LLFloaterWindLight::deleteAlertCallback(S32 option, void* userdata)
+bool LLFloaterWindLight::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)
{
- LLComboBox* combo_box = sWindLight->getChild<LLComboBox>(
+ LLComboBox* combo_box = getChild<LLComboBox>(
"WLPresetsCombo");
LLFloaterDayCycle* day_cycle = NULL;
LLComboBox* key_combo = NULL;
@@ -870,8 +869,8 @@ void LLFloaterWindLight::deleteAlertCallback(S32 option, void* userdata)
std::set<std::string>::iterator sIt = sDefaultPresets.find(name);
if(sIt != sDefaultPresets.end())
{
- gViewerWindow->alertXml("WLNoEditDefault");
- return;
+ LLNotifications::instance().add("WLNoEditDefault");
+ return false;
}
LLWLParamManager::instance()->removeParamSet(name, true);
@@ -899,6 +898,7 @@ void LLFloaterWindLight::deleteAlertCallback(S32 option, void* userdata)
combo_box->setCurrentByIndex(new_index);
}
}
+ return false;
}