diff options
author | Vadim ProductEngine <vsavchuk@productengine.com> | 2011-07-13 12:02:03 +0300 |
---|---|---|
committer | Vadim ProductEngine <vsavchuk@productengine.com> | 2011-07-13 12:02:03 +0300 |
commit | b1473d4b6bbcbfd67af80f8f1d2f7a7584677c5c (patch) | |
tree | 816eaf1ed870e12a9dd9a35d815433c0803e2ec7 /indra | |
parent | 44c7c6feaa824f4049d326965cb066e76ebefee3 (diff) |
STORM-1502 FIXED Disable "Delete Water/Sky/Day Preset" dialogs if no user presets exist.
Diffstat (limited to 'indra')
-rw-r--r-- | indra/newview/llviewermenu.cpp | 37 | ||||
-rw-r--r-- | indra/newview/skins/default/xui/en/menu_viewer.xml | 9 |
2 files changed, 46 insertions, 0 deletions
diff --git a/indra/newview/llviewermenu.cpp b/indra/newview/llviewermenu.cpp index a37f8ad0d8..f74bcafc5c 100644 --- a/indra/newview/llviewermenu.cpp +++ b/indra/newview/llviewermenu.cpp @@ -44,6 +44,7 @@ #include "llbottomtray.h" #include "llcompilequeue.h" #include "llconsole.h" +#include "lldaycyclemanager.h" #include "lldebugview.h" #include "llenvmanager.h" #include "llfilepicker.h" @@ -100,6 +101,7 @@ #include "llworldmap.h" #include "pipeline.h" #include "llviewerjoystick.h" +#include "llwaterparammanager.h" #include "llwlanimator.h" #include "llwlparammanager.h" #include "llfloatercamera.h" @@ -7667,6 +7669,40 @@ class LLWorldEnvPreset : public view_listener_t } }; +class LLWorldEnableEnvPreset : public view_listener_t +{ + bool handleEvent(const LLSD& userdata) + { + std::string item = userdata.asString(); + + if (item == "delete_water") + { + LLWaterParamManager::preset_name_list_t user_waters; + LLWaterParamManager::instance().getUserPresetNames(user_waters); + return !user_waters.empty(); + } + else if (item == "delete_sky") + { + LLWLParamManager::preset_name_list_t user_skies; + LLWLParamManager::instance().getUserPresetNames(user_skies); + return !user_skies.empty(); + } + else if (item == "delete_day_cycle") + { + LLDayCycleManager::preset_name_list_t user_days; + LLDayCycleManager::instance().getUserPresetNames(user_days); + return !user_days.empty(); + } + else + { + llwarns << "Unknown item" << llendl; + } + + return false; + } +}; + + /// Post-Process callbacks class LLWorldPostProcess : public view_listener_t { @@ -7906,6 +7942,7 @@ void initialize_menus() view_listener_t::addMenu(new LLWorldEnvSettings(), "World.EnvSettings"); view_listener_t::addMenu(new LLWorldEnvPreset(), "World.EnvPreset"); + view_listener_t::addMenu(new LLWorldEnableEnvPreset(), "World.EnableEnvPreset"); view_listener_t::addMenu(new LLWorldPostProcess(), "World.PostProcess"); view_listener_t::addMenu(new LLWorldToggleMovementControls(), "World.Toggle.MovementControls"); diff --git a/indra/newview/skins/default/xui/en/menu_viewer.xml b/indra/newview/skins/default/xui/en/menu_viewer.xml index e00586811b..6d3bca10d9 100644 --- a/indra/newview/skins/default/xui/en/menu_viewer.xml +++ b/indra/newview/skins/default/xui/en/menu_viewer.xml @@ -557,6 +557,9 @@ <menu_item_call.on_click function="World.EnvPreset" parameter="delete_water"/> + <menu_item_call.on_enable + function="World.EnableEnvPreset" + parameter="delete_water"/> </menu_item_call> </menu> @@ -583,6 +586,9 @@ <menu_item_call.on_click function="World.EnvPreset" parameter="delete_sky"/> + <menu_item_call.on_enable + function="World.EnableEnvPreset" + parameter="delete_sky"/> </menu_item_call> </menu> @@ -609,6 +615,9 @@ <menu_item_call.on_click function="World.EnvPreset" parameter="delete_day_cycle"/> + <menu_item_call.on_enable + function="World.EnableEnvPreset" + parameter="delete_day_cycle"/> </menu_item_call> </menu> </menu> |