diff options
author | Jacek Antonelli | 2008-09-06 18:24:57 -0500 |
---|---|---|
committer | Jacek Antonelli | 2008-09-06 18:25:07 -0500 |
commit | 798d367d54a6c6379ad355bd8345fa40e31e7fe9 (patch) | |
tree | 1921f1708cd0240648c97bc02df2c2ab5f2fc41e /linden/indra/newview/llfloatertos.cpp | |
parent | Second Life viewer sources 1.20.15 (diff) | |
download | meta-impy-798d367d54a6c6379ad355bd8345fa40e31e7fe9.zip meta-impy-798d367d54a6c6379ad355bd8345fa40e31e7fe9.tar.gz meta-impy-798d367d54a6c6379ad355bd8345fa40e31e7fe9.tar.bz2 meta-impy-798d367d54a6c6379ad355bd8345fa40e31e7fe9.tar.xz |
Second Life viewer sources 1.21.0-RC
Diffstat (limited to 'linden/indra/newview/llfloatertos.cpp')
-rw-r--r-- | linden/indra/newview/llfloatertos.cpp | 58 |
1 files changed, 20 insertions, 38 deletions
diff --git a/linden/indra/newview/llfloatertos.cpp b/linden/indra/newview/llfloatertos.cpp index e4073f1..f37388a 100644 --- a/linden/indra/newview/llfloatertos.cpp +++ b/linden/indra/newview/llfloatertos.cpp | |||
@@ -74,7 +74,7 @@ LLFloaterTOS* LLFloaterTOS::show(ETOSType type, const std::string & message) | |||
74 | 74 | ||
75 | 75 | ||
76 | LLFloaterTOS::LLFloaterTOS(ETOSType type, const std::string & message) | 76 | LLFloaterTOS::LLFloaterTOS(ETOSType type, const std::string & message) |
77 | : LLModalDialog( " ", 100, 100 ), | 77 | : LLModalDialog( std::string(" "), 100, 100 ), |
78 | mType(type), | 78 | mType(type), |
79 | mMessage(message), | 79 | mMessage(message), |
80 | mWebBrowserWindowId( 0 ), | 80 | mWebBrowserWindowId( 0 ), |
@@ -127,50 +127,38 @@ BOOL LLFloaterTOS::postBuild() | |||
127 | { | 127 | { |
128 | childSetAction("Continue", onContinue, this); | 128 | childSetAction("Continue", onContinue, this); |
129 | childSetAction("Cancel", onCancel, this); | 129 | childSetAction("Cancel", onCancel, this); |
130 | childSetCommitCallback("tos_agreement", updateAgree, this); | 130 | childSetCommitCallback("agree_chk", updateAgree, this); |
131 | 131 | ||
132 | if ( mType != TOS_TOS ) | 132 | if ( mType != TOS_TOS ) |
133 | { | 133 | { |
134 | // this displays the critical message | 134 | // this displays the critical message |
135 | LLTextEditor *Editor = getChild<LLTextEditor>("tos_text"); | 135 | LLTextEditor *editor = getChild<LLTextEditor>("tos_text"); |
136 | if (Editor) | 136 | editor->setHandleEditKeysDirectly( TRUE ); |
137 | { | 137 | editor->setEnabled( FALSE ); |
138 | Editor->setHandleEditKeysDirectly( TRUE ); | 138 | editor->setWordWrap(TRUE); |
139 | Editor->setEnabled( FALSE ); | 139 | editor->setFocus(TRUE); |
140 | Editor->setReadOnlyFgColor(LLColor4::white); | 140 | editor->setValue(LLSD(mMessage)); |
141 | Editor->setWordWrap(TRUE); | 141 | |
142 | Editor->setFocus(TRUE); | ||
143 | } | ||
144 | childSetValue("tos_text", LLSD(mMessage)); | ||
145 | return TRUE; | 142 | return TRUE; |
146 | } | 143 | } |
147 | 144 | ||
148 | // disable Agree to TOS radio button until the page has fully loaded | 145 | // disable Agree to TOS radio button until the page has fully loaded |
149 | LLRadioGroup* tos_agreement = getChild<LLRadioGroup>("tos_agreement"); | 146 | LLCheckBoxCtrl* tos_agreement = getChild<LLCheckBoxCtrl>("agree_chk"); |
150 | if ( tos_agreement ) | 147 | tos_agreement->setEnabled( false ); |
151 | { | ||
152 | tos_agreement->setEnabled( false ); | ||
153 | }; | ||
154 | 148 | ||
155 | // hide the SL text widget if we're displaying TOS with using a browser widget. | 149 | // hide the SL text widget if we're displaying TOS with using a browser widget. |
156 | LLTextEditor *editor = getChild<LLTextEditor>("tos_text"); | 150 | LLTextEditor *editor = getChild<LLTextEditor>("tos_text"); |
157 | if ( editor ) | 151 | editor->setVisible( FALSE ); |
158 | { | ||
159 | editor->setVisible( FALSE ); | ||
160 | }; | ||
161 | 152 | ||
162 | LLWebBrowserCtrl* web_browser = getChild<LLWebBrowserCtrl>("tos_html"); | 153 | LLWebBrowserCtrl* web_browser = getChild<LLWebBrowserCtrl>("tos_html"); |
163 | if ( web_browser ) | 154 | if ( web_browser ) |
164 | { | 155 | { |
165 | // start to observe it so we see navigate complete events | 156 | // start to observe it so we see navigate complete events |
166 | if ( web_browser ) | 157 | web_browser->addObserver( this ); |
167 | { | ||
168 | web_browser->addObserver( this ); | ||
169 | }; | ||
170 | 158 | ||
171 | gResponsePtr = LLIamHere::build( this ); | 159 | gResponsePtr = LLIamHere::build( this ); |
172 | LLHTTPClient::get( getString( "real_url" ), gResponsePtr ); | 160 | LLHTTPClient::get( getString( "real_url" ), gResponsePtr ); |
173 | }; | 161 | } |
174 | 162 | ||
175 | return TRUE; | 163 | return TRUE; |
176 | } | 164 | } |
@@ -194,11 +182,8 @@ void LLFloaterTOS::setSiteIsAlive( bool alive ) | |||
194 | { | 182 | { |
195 | // normally this is set when navigation to TOS page navigation completes (so you can't accept before TOS loads) | 183 | // normally this is set when navigation to TOS page navigation completes (so you can't accept before TOS loads) |
196 | // but if the page is unavailable, we need to do this now | 184 | // but if the page is unavailable, we need to do this now |
197 | LLRadioGroup* tos_agreement = getChild<LLRadioGroup>("tos_agreement"); | 185 | LLCheckBoxCtrl* tos_agreement = getChild<LLCheckBoxCtrl>("agree_chk"); |
198 | if ( tos_agreement ) | 186 | tos_agreement->setEnabled( true ); |
199 | { | ||
200 | tos_agreement->setEnabled( true ); | ||
201 | }; | ||
202 | 187 | ||
203 | if ( web_browser ) | 188 | if ( web_browser ) |
204 | { | 189 | { |
@@ -236,8 +221,8 @@ void LLFloaterTOS::draw() | |||
236 | void LLFloaterTOS::updateAgree(LLUICtrl*, void* userdata ) | 221 | void LLFloaterTOS::updateAgree(LLUICtrl*, void* userdata ) |
237 | { | 222 | { |
238 | LLFloaterTOS* self = (LLFloaterTOS*) userdata; | 223 | LLFloaterTOS* self = (LLFloaterTOS*) userdata; |
239 | std::string agree = self->childGetValue("tos_agreement").asString(); | 224 | bool agree = self->childGetValue("agree_chk").asBoolean(); |
240 | self->childSetEnabled("Continue", (agree == "radio_agree") ); | 225 | self->childSetEnabled("Continue", agree); |
241 | } | 226 | } |
242 | 227 | ||
243 | // static | 228 | // static |
@@ -286,10 +271,7 @@ void LLFloaterTOS::onNavigateComplete( const EventType& eventIn ) | |||
286 | { | 271 | { |
287 | llinfos << "NAVIGATE COMPLETE" << llendl; | 272 | llinfos << "NAVIGATE COMPLETE" << llendl; |
288 | // enable Agree to TOS radio button now that page has loaded | 273 | // enable Agree to TOS radio button now that page has loaded |
289 | LLRadioGroup* tos_agreement = getChild<LLRadioGroup>("tos_agreement"); | 274 | LLCheckBoxCtrl * tos_agreement = getChild<LLCheckBoxCtrl>("agree_chk"); |
290 | if ( tos_agreement ) | 275 | tos_agreement->setEnabled( true ); |
291 | { | ||
292 | tos_agreement->setEnabled( true ); | ||
293 | }; | ||
294 | }; | 276 | }; |
295 | } | 277 | } |