diff options
Diffstat (limited to 'linden/indra/newview/llfloatertos.cpp')
-rw-r--r-- | linden/indra/newview/llfloatertos.cpp | 21 |
1 files changed, 8 insertions, 13 deletions
diff --git a/linden/indra/newview/llfloatertos.cpp b/linden/indra/newview/llfloatertos.cpp index 2684e10..f3a124a 100644 --- a/linden/indra/newview/llfloatertos.cpp +++ b/linden/indra/newview/llfloatertos.cpp | |||
@@ -151,7 +151,7 @@ BOOL LLFloaterTOS::postBuild() | |||
151 | editor->setWordWrap(TRUE); | 151 | editor->setWordWrap(TRUE); |
152 | editor->setFocus(TRUE); | 152 | editor->setFocus(TRUE); |
153 | editor->setValue(LLSD(mMessage)); | 153 | editor->setValue(LLSD(mMessage)); |
154 | LLWebBrowserCtrl* web_browser = getChild<LLWebBrowserCtrl>("tos_html"); | 154 | LLMediaCtrl* web_browser = getChild<LLMediaCtrl>("tos_html"); |
155 | if (web_browser) | 155 | if (web_browser) |
156 | { | 156 | { |
157 | //Disable for critical messages and text messages, it is reenabled later | 157 | //Disable for critical messages and text messages, it is reenabled later |
@@ -192,9 +192,7 @@ BOOL LLFloaterTOS::postBuild() | |||
192 | // Reenable the web browser | 192 | // Reenable the web browser |
193 | web_browser->setVisible( TRUE ); | 193 | web_browser->setVisible( TRUE ); |
194 | 194 | ||
195 | // start to observe it so we see navigate complete events | 195 | web_browser->addObserver(this); |
196 | web_browser->addObserver( this ); | ||
197 | |||
198 | gResponsePtr = LLIamHereTOS::build( this ); | 196 | gResponsePtr = LLIamHereTOS::build( this ); |
199 | LLHTTPClient::head( getString( "real_url" ), gResponsePtr ); | 197 | LLHTTPClient::head( getString( "real_url" ), gResponsePtr ); |
200 | } | 198 | } |
@@ -207,7 +205,7 @@ void LLFloaterTOS::setSiteIsAlive( bool alive ) | |||
207 | // only do this for TOS pages | 205 | // only do this for TOS pages |
208 | if ( mType == TOS_TOS ) | 206 | if ( mType == TOS_TOS ) |
209 | { | 207 | { |
210 | LLWebBrowserCtrl* web_browser = getChild<LLWebBrowserCtrl>("tos_html"); | 208 | LLMediaCtrl* web_browser = getChild<LLMediaCtrl>("tos_html"); |
211 | // if the contents of the site was retrieved | 209 | // if the contents of the site was retrieved |
212 | if ( alive ) | 210 | if ( alive ) |
213 | { | 211 | { |
@@ -229,12 +227,6 @@ void LLFloaterTOS::setSiteIsAlive( bool alive ) | |||
229 | 227 | ||
230 | LLFloaterTOS::~LLFloaterTOS() | 228 | LLFloaterTOS::~LLFloaterTOS() |
231 | { | 229 | { |
232 | // stop obsaerving events | ||
233 | LLWebBrowserCtrl* web_browser = getChild<LLWebBrowserCtrl>("tos_html"); | ||
234 | if ( web_browser ) | ||
235 | { | ||
236 | web_browser->remObserver( this ); | ||
237 | }; | ||
238 | 230 | ||
239 | // tell the responder we're not here anymore | 231 | // tell the responder we're not here anymore |
240 | if ( gResponsePtr ) | 232 | if ( gResponsePtr ) |
@@ -297,8 +289,10 @@ void LLFloaterTOS::onCancel( void* userdata ) | |||
297 | } | 289 | } |
298 | 290 | ||
299 | //virtual | 291 | //virtual |
300 | void LLFloaterTOS::onNavigateComplete( const EventType& eventIn ) | 292 | void LLFloaterTOS::handleMediaEvent(LLPluginClassMedia* /*self*/, EMediaEvent event) |
301 | { | 293 | { |
294 | if(event == MEDIA_EVENT_NAVIGATE_COMPLETE) | ||
295 | { | ||
302 | // skip past the loading screen navigate complete | 296 | // skip past the loading screen navigate complete |
303 | if ( ++mLoadCompleteCount == 2 ) | 297 | if ( ++mLoadCompleteCount == 2 ) |
304 | { | 298 | { |
@@ -306,5 +300,6 @@ void LLFloaterTOS::onNavigateComplete( const EventType& eventIn ) | |||
306 | // enable Agree to TOS radio button now that page has loaded | 300 | // enable Agree to TOS radio button now that page has loaded |
307 | LLCheckBoxCtrl * tos_agreement = getChild<LLCheckBoxCtrl>("agree_chk"); | 301 | LLCheckBoxCtrl * tos_agreement = getChild<LLCheckBoxCtrl>("agree_chk"); |
308 | tos_agreement->setEnabled( true ); | 302 | tos_agreement->setEnabled( true ); |
309 | }; | 303 | } |
304 | } | ||
310 | } | 305 | } |