diff options
Diffstat (limited to 'linden/indra/newview/lightshare.cpp')
-rw-r--r-- | linden/indra/newview/lightshare.cpp | 37 |
1 files changed, 31 insertions, 6 deletions
diff --git a/linden/indra/newview/lightshare.cpp b/linden/indra/newview/lightshare.cpp index e7c3410..b2bbb96 100644 --- a/linden/indra/newview/lightshare.cpp +++ b/linden/indra/newview/lightshare.cpp | |||
@@ -48,6 +48,7 @@ const std::string WindlightMessage::sSkyPresetName = "(Region settings)"; | |||
48 | 48 | ||
49 | WindlightMessage* WindlightMessage::sMostRecent = NULL; | 49 | WindlightMessage* WindlightMessage::sMostRecent = NULL; |
50 | LLTimer* WindlightMessage::sIgnoreTimer = new LLTimer(); | 50 | LLTimer* WindlightMessage::sIgnoreTimer = new LLTimer(); |
51 | bool WindlightMessage::sIgnoreRegion = false; | ||
51 | 52 | ||
52 | 53 | ||
53 | WindlightMessage::WindlightMessage( LLMessageSystem* msg ) : | 54 | WindlightMessage::WindlightMessage( LLMessageSystem* msg ) : |
@@ -132,6 +133,13 @@ void WindlightMessage::processWindlight(LLMessageSystem* msg, void**) | |||
132 | return; | 133 | return; |
133 | } | 134 | } |
134 | 135 | ||
136 | if(sIgnoreRegion) | ||
137 | { | ||
138 | // We are ignoring new settings until user enters a new region. | ||
139 | delete wl; | ||
140 | return; | ||
141 | } | ||
142 | |||
135 | if( sMostRecent == NULL ) | 143 | if( sMostRecent == NULL ) |
136 | { | 144 | { |
137 | // No most recent, so store this and create notification | 145 | // No most recent, so store this and create notification |
@@ -160,13 +168,23 @@ bool WindlightMessage::applyCallback(const LLSD& notification, | |||
160 | { | 168 | { |
161 | S32 option = LLNotification::getSelectedOption(notification, response); | 169 | S32 option = LLNotification::getSelectedOption(notification, response); |
162 | 170 | ||
163 | if( option == 0 ) // "Apply" | 171 | switch(option) |
164 | { | 172 | { |
165 | sMostRecent->apply(); | 173 | case 0:{ |
166 | } | 174 | // "Apply" |
167 | else if( option == 2 ) // "Ignore" | 175 | sMostRecent->apply(); |
168 | { | 176 | break; |
169 | resetIgnoreTimer(); | 177 | } |
178 | case 1:{ | ||
179 | // "Not Now", ignore until the region stops spamming | ||
180 | resetIgnoreTimer(); | ||
181 | break; | ||
182 | } | ||
183 | case 2:{ | ||
184 | // "Ignore", ignore all until user leaves the region | ||
185 | sIgnoreRegion = true; | ||
186 | break; | ||
187 | } | ||
170 | } | 188 | } |
171 | 189 | ||
172 | delete sMostRecent; | 190 | delete sMostRecent; |
@@ -177,6 +195,13 @@ bool WindlightMessage::applyCallback(const LLSD& notification, | |||
177 | 195 | ||
178 | 196 | ||
179 | // static | 197 | // static |
198 | void WindlightMessage::resetRegion() | ||
199 | { | ||
200 | sIgnoreRegion = false; | ||
201 | } | ||
202 | |||
203 | |||
204 | // static | ||
180 | void WindlightMessage::resetIgnoreTimer() | 205 | void WindlightMessage::resetIgnoreTimer() |
181 | { | 206 | { |
182 | F32 time = gSavedSettings.getF32("LightShareIgnoreTimer"); | 207 | F32 time = gSavedSettings.getF32("LightShareIgnoreTimer"); |