diff options
author | Jacek Antonelli | 2010-07-28 04:02:47 -0500 |
---|---|---|
committer | Jacek Antonelli | 2010-08-01 00:30:59 -0500 |
commit | 3b8cfc9fbbb8ede46b9bd34b0ad1c59a8d047e9e (patch) | |
tree | f09ca27d77b5f2595bb4a75d0bf96f4df30d55ae /linden/indra/newview/lightshare.cpp | |
parent | Refactored a bunch of messy LightShare code. (diff) | |
download | meta-impy-3b8cfc9fbbb8ede46b9bd34b0ad1c59a8d047e9e.zip meta-impy-3b8cfc9fbbb8ede46b9bd34b0ad1c59a8d047e9e.tar.gz meta-impy-3b8cfc9fbbb8ede46b9bd34b0ad1c59a8d047e9e.tar.bz2 meta-impy-3b8cfc9fbbb8ede46b9bd34b0ad1c59a8d047e9e.tar.xz |
Added confirmation dialog before applying LightShare settings.
If you are using a preset other than the default preset or
the LightShare preset, the viewer will now ask you whether
to apply settings received from the server.
Diffstat (limited to '')
-rw-r--r-- | linden/indra/newview/lightshare.cpp | 37 |
1 files changed, 34 insertions, 3 deletions
diff --git a/linden/indra/newview/lightshare.cpp b/linden/indra/newview/lightshare.cpp index 24d4139..aa5443b 100644 --- a/linden/indra/newview/lightshare.cpp +++ b/linden/indra/newview/lightshare.cpp | |||
@@ -100,14 +100,45 @@ void WindlightMessage::processWindlight(LLMessageSystem* msg, void**) | |||
100 | { | 100 | { |
101 | if( gSavedSettings.getBOOL("UseServersideWindlightSettings") ) | 101 | if( gSavedSettings.getBOOL("UseServersideWindlightSettings") ) |
102 | { | 102 | { |
103 | WindlightMessage wl = WindlightMessage(msg); | 103 | WindlightMessage* wl = new WindlightMessage(msg); |
104 | if( wl.isValid() ) | 104 | if( wl->isValid() ) |
105 | { | 105 | { |
106 | wl.apply(); | 106 | std::string water = LLWaterParamManager::instance()->mCurParams.mName; |
107 | std::string sky = LLWLParamManager::instance()->mCurParams.mName; | ||
108 | |||
109 | // If they are using the default or region settings, just apply | ||
110 | // the new settings, don't bother asking. | ||
111 | if((sky == "Default" || sky == sSkyPresetName) && | ||
112 | (water == "Default" || water == sWaterPresetName)) | ||
113 | { | ||
114 | wl->apply(); | ||
115 | delete wl; | ||
116 | } | ||
117 | else | ||
118 | { | ||
119 | LLNotifications::instance() | ||
120 | .add("ConfirmLightShare", | ||
121 | LLSD(), LLSD(), | ||
122 | boost::bind(&applyCallback, _1, _2, wl)); | ||
123 | } | ||
107 | } | 124 | } |
108 | } | 125 | } |
109 | } | 126 | } |
110 | 127 | ||
128 | // static | ||
129 | bool WindlightMessage::applyCallback(const LLSD& notification, | ||
130 | const LLSD& response, | ||
131 | WindlightMessage* wl) | ||
132 | { | ||
133 | S32 option = LLNotification::getSelectedOption(notification, response); | ||
134 | if( option == 0 ) | ||
135 | { | ||
136 | wl->apply(); | ||
137 | } | ||
138 | delete wl; | ||
139 | return false; | ||
140 | } | ||
141 | |||
111 | 142 | ||
112 | bool WindlightMessage::apply() | 143 | bool WindlightMessage::apply() |
113 | { | 144 | { |