diff options
author | Jacek Antonelli | 2009-04-30 13:04:20 -0500 |
---|---|---|
committer | Jacek Antonelli | 2009-04-30 13:07:16 -0500 |
commit | ca8149ca6d157eb4b5fc8ba0e5ba3a6e56f72e7e (patch) | |
tree | 8348301d0ac44a524f1819b777686bf086907d76 /linden/indra/newview/llfloaterwindlight.cpp | |
parent | Second Life viewer sources 1.22.11 (diff) | |
download | meta-impy-ca8149ca6d157eb4b5fc8ba0e5ba3a6e56f72e7e.zip meta-impy-ca8149ca6d157eb4b5fc8ba0e5ba3a6e56f72e7e.tar.gz meta-impy-ca8149ca6d157eb4b5fc8ba0e5ba3a6e56f72e7e.tar.bz2 meta-impy-ca8149ca6d157eb4b5fc8ba0e5ba3a6e56f72e7e.tar.xz |
Second Life viewer sources 1.23.0-RC
Diffstat (limited to 'linden/indra/newview/llfloaterwindlight.cpp')
-rw-r--r-- | linden/indra/newview/llfloaterwindlight.cpp | 55 |
1 files changed, 28 insertions, 27 deletions
diff --git a/linden/indra/newview/llfloaterwindlight.cpp b/linden/indra/newview/llfloaterwindlight.cpp index 37cd4ef..98b3157 100644 --- a/linden/indra/newview/llfloaterwindlight.cpp +++ b/linden/indra/newview/llfloaterwindlight.cpp | |||
@@ -17,7 +17,8 @@ | |||
17 | * There are special exceptions to the terms and conditions of the GPL as | 17 | * There are special exceptions to the terms and conditions of the GPL as |
18 | * it is applied to this Source Code. View the full text of the exception | 18 | * it is applied to this Source Code. View the full text of the exception |
19 | * in the file doc/FLOSS-exception.txt in this software distribution, or | 19 | * in the file doc/FLOSS-exception.txt in this software distribution, or |
20 | * online at http://secondlifegrid.net/programs/open_source/licensing/flossexception | 20 | * online at |
21 | * http://secondlifegrid.net/programs/open_source/licensing/flossexception | ||
21 | * | 22 | * |
22 | * By copying, modifying or distributing this software, you acknowledge | 23 | * By copying, modifying or distributing this software, you acknowledge |
23 | * that you have read and understood your obligations described above, | 24 | * that you have read and understood your obligations described above, |
@@ -233,16 +234,8 @@ void LLFloaterWindLight::onClickHelp(void* data) | |||
233 | { | 234 | { |
234 | LLFloaterWindLight* self = LLFloaterWindLight::instance(); | 235 | LLFloaterWindLight* self = LLFloaterWindLight::instance(); |
235 | 236 | ||
236 | const std::string* xml_alert = (std::string*)data; | 237 | const std::string xml_alert = *(std::string*)data; |
237 | LLAlertDialog* dialogp = gViewerWindow->alertXml(*xml_alert); | 238 | LLNotifications::instance().add(self->contextualNotification(xml_alert)); |
238 | if (dialogp) | ||
239 | { | ||
240 | LLFloater* root_floater = gFloaterView->getParentFloater(self); | ||
241 | if (root_floater) | ||
242 | { | ||
243 | root_floater->addDependentFloater(dialogp); | ||
244 | } | ||
245 | } | ||
246 | } | 239 | } |
247 | 240 | ||
248 | void LLFloaterWindLight::initHelpBtn(const std::string& name, const std::string& xml_alert) | 241 | void LLFloaterWindLight::initHelpBtn(const std::string& name, const std::string& xml_alert) |
@@ -250,11 +243,14 @@ void LLFloaterWindLight::initHelpBtn(const std::string& name, const std::string& | |||
250 | childSetAction(name, onClickHelp, new std::string(xml_alert)); | 243 | childSetAction(name, onClickHelp, new std::string(xml_alert)); |
251 | } | 244 | } |
252 | 245 | ||
253 | void LLFloaterWindLight::newPromptCallback(S32 option, const std::string& text, void* userData) | 246 | bool LLFloaterWindLight::newPromptCallback(const LLSD& notification, const LLSD& response) |
254 | { | 247 | { |
248 | std::string text = response["message"].asString(); | ||
249 | S32 option = LLNotification::getSelectedOption(notification, response); | ||
250 | |||
255 | if(text == "") | 251 | if(text == "") |
256 | { | 252 | { |
257 | return; | 253 | return false; |
258 | } | 254 | } |
259 | 255 | ||
260 | if(option == 0) { | 256 | if(option == 0) { |
@@ -303,9 +299,10 @@ void LLFloaterWindLight::newPromptCallback(S32 option, const std::string& text, | |||
303 | } | 299 | } |
304 | else | 300 | else |
305 | { | 301 | { |
306 | gViewerWindow->alertXml("ExistsSkyPresetAlert"); | 302 | LLNotifications::instance().add("ExistsSkyPresetAlert"); |
307 | } | 303 | } |
308 | } | 304 | } |
305 | return false; | ||
309 | } | 306 | } |
310 | 307 | ||
311 | void LLFloaterWindLight::syncMenu() | 308 | void LLFloaterWindLight::syncMenu() |
@@ -784,8 +781,7 @@ void LLFloaterWindLight::onStarAlphaMoved(LLUICtrl* ctrl, void* userData) | |||
784 | 781 | ||
785 | void LLFloaterWindLight::onNewPreset(void* userData) | 782 | void LLFloaterWindLight::onNewPreset(void* userData) |
786 | { | 783 | { |
787 | gViewerWindow->alertXmlEditText("NewSkyPreset", LLStringUtil::format_map_t(), | 784 | LLNotifications::instance().add("NewSkyPreset", LLSD(), LLSD(), newPromptCallback); |
788 | NULL, NULL, newPromptCallback, NULL); | ||
789 | } | 785 | } |
790 | 786 | ||
791 | void LLFloaterWindLight::onSavePreset(void* userData) | 787 | void LLFloaterWindLight::onSavePreset(void* userData) |
@@ -805,18 +801,19 @@ void LLFloaterWindLight::onSavePreset(void* userData) | |||
805 | comboBox->getSelectedItemLabel()); | 801 | comboBox->getSelectedItemLabel()); |
806 | if(sIt != sDefaultPresets.end() && !gSavedSettings.getBOOL("SkyEditPresets")) | 802 | if(sIt != sDefaultPresets.end() && !gSavedSettings.getBOOL("SkyEditPresets")) |
807 | { | 803 | { |
808 | gViewerWindow->alertXml("WLNoEditDefault"); | 804 | LLNotifications::instance().add("WLNoEditDefault"); |
809 | return; | 805 | return; |
810 | } | 806 | } |
811 | 807 | ||
812 | LLWLParamManager::instance()->mCurParams.mName = | 808 | LLWLParamManager::instance()->mCurParams.mName = |
813 | comboBox->getSelectedItemLabel(); | 809 | comboBox->getSelectedItemLabel(); |
814 | 810 | ||
815 | gViewerWindow->alertXml("WLSavePresetAlert", saveAlertCallback, sWindLight); | 811 | LLNotifications::instance().add("WLSavePresetAlert", LLSD(), LLSD(), saveAlertCallback); |
816 | } | 812 | } |
817 | 813 | ||
818 | void LLFloaterWindLight::saveAlertCallback(S32 option, void* userdata) | 814 | bool LLFloaterWindLight::saveAlertCallback(const LLSD& notification, const LLSD& response) |
819 | { | 815 | { |
816 | S32 option = LLNotification::getSelectedOption(notification, response); | ||
820 | // if they choose save, do it. Otherwise, don't do anything | 817 | // if they choose save, do it. Otherwise, don't do anything |
821 | if(option == 0) | 818 | if(option == 0) |
822 | { | 819 | { |
@@ -827,7 +824,7 @@ void LLFloaterWindLight::saveAlertCallback(S32 option, void* userdata) | |||
827 | // comment this back in to save to file | 824 | // comment this back in to save to file |
828 | param_mgr->savePreset(param_mgr->mCurParams.mName); | 825 | param_mgr->savePreset(param_mgr->mCurParams.mName); |
829 | } | 826 | } |
830 | 827 | return false; | |
831 | } | 828 | } |
832 | 829 | ||
833 | void LLFloaterWindLight::onDeletePreset(void* userData) | 830 | void LLFloaterWindLight::onDeletePreset(void* userData) |
@@ -840,17 +837,20 @@ void LLFloaterWindLight::onDeletePreset(void* userData) | |||
840 | return; | 837 | return; |
841 | } | 838 | } |
842 | 839 | ||
843 | LLStringUtil::format_map_t args; | 840 | LLSD args; |
844 | args["[SKY]"] = combo_box->getSelectedValue().asString(); | 841 | args["SKY"] = combo_box->getSelectedValue().asString(); |
845 | gViewerWindow->alertXml("WLDeletePresetAlert", args, deleteAlertCallback, sWindLight); | 842 | LLNotifications::instance().add("WLDeletePresetAlert", args, LLSD(), |
843 | boost::bind(&LLFloaterWindLight::deleteAlertCallback, sWindLight, _1, _2)); | ||
846 | } | 844 | } |
847 | 845 | ||
848 | void LLFloaterWindLight::deleteAlertCallback(S32 option, void* userdata) | 846 | bool LLFloaterWindLight::deleteAlertCallback(const LLSD& notification, const LLSD& response) |
849 | { | 847 | { |
848 | S32 option = LLNotification::getSelectedOption(notification, response); | ||
849 | |||
850 | // if they choose delete, do it. Otherwise, don't do anything | 850 | // if they choose delete, do it. Otherwise, don't do anything |
851 | if(option == 0) | 851 | if(option == 0) |
852 | { | 852 | { |
853 | LLComboBox* combo_box = sWindLight->getChild<LLComboBox>( | 853 | LLComboBox* combo_box = getChild<LLComboBox>( |
854 | "WLPresetsCombo"); | 854 | "WLPresetsCombo"); |
855 | LLFloaterDayCycle* day_cycle = NULL; | 855 | LLFloaterDayCycle* day_cycle = NULL; |
856 | LLComboBox* key_combo = NULL; | 856 | LLComboBox* key_combo = NULL; |
@@ -870,8 +870,8 @@ void LLFloaterWindLight::deleteAlertCallback(S32 option, void* userdata) | |||
870 | std::set<std::string>::iterator sIt = sDefaultPresets.find(name); | 870 | std::set<std::string>::iterator sIt = sDefaultPresets.find(name); |
871 | if(sIt != sDefaultPresets.end()) | 871 | if(sIt != sDefaultPresets.end()) |
872 | { | 872 | { |
873 | gViewerWindow->alertXml("WLNoEditDefault"); | 873 | LLNotifications::instance().add("WLNoEditDefault"); |
874 | return; | 874 | return false; |
875 | } | 875 | } |
876 | 876 | ||
877 | LLWLParamManager::instance()->removeParamSet(name, true); | 877 | LLWLParamManager::instance()->removeParamSet(name, true); |
@@ -899,6 +899,7 @@ void LLFloaterWindLight::deleteAlertCallback(S32 option, void* userdata) | |||
899 | combo_box->setCurrentByIndex(new_index); | 899 | combo_box->setCurrentByIndex(new_index); |
900 | } | 900 | } |
901 | } | 901 | } |
902 | return false; | ||
902 | } | 903 | } |
903 | 904 | ||
904 | 905 | ||