aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden/indra/newview/llpanellogin.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'linden/indra/newview/llpanellogin.cpp')
-rw-r--r--linden/indra/newview/llpanellogin.cpp113
1 files changed, 28 insertions, 85 deletions
diff --git a/linden/indra/newview/llpanellogin.cpp b/linden/indra/newview/llpanellogin.cpp
index 0b91091..d00ccd9 100644
--- a/linden/indra/newview/llpanellogin.cpp
+++ b/linden/indra/newview/llpanellogin.cpp
@@ -302,6 +302,17 @@ LLPanelLogin::LLPanelLogin(const LLRect &rect,
302 // make links open in external browser 302 // make links open in external browser
303 web_browser->setOpenInExternalBrowser( true ); 303 web_browser->setOpenInExternalBrowser( true );
304 304
305 // force the size to be correct (XML doesn't seem to be sufficient to do this) (with some padding so the other login screen doesn't show through)
306 LLRect htmlRect = getRect();
307#if USE_VIEWER_AUTH
308 htmlRect.setCenterAndSize( getRect().getCenterX() - 2, getRect().getCenterY(), getRect().getWidth() + 6, getRect().getHeight());
309#else
310 htmlRect.setCenterAndSize( getRect().getCenterX() - 2, getRect().getCenterY() + 40, getRect().getWidth() + 6, getRect().getHeight() - 78 );
311#endif
312 web_browser->setRect( htmlRect );
313 web_browser->reshape( htmlRect.getWidth(), htmlRect.getHeight(), TRUE );
314 reshape( getRect().getWidth(), getRect().getHeight(), 1 );
315
305 // kick off a request to grab the url manually 316 // kick off a request to grab the url manually
306 gResponsePtr = LLIamHereLogin::build( this ); 317 gResponsePtr = LLIamHereLogin::build( this );
307 std::string login_page = gSavedSettings.getString("LoginPage"); 318 std::string login_page = gSavedSettings.getString("LoginPage");
@@ -316,8 +327,6 @@ LLPanelLogin::LLPanelLogin(const LLRect &rect,
316 refreshLocation( false ); 327 refreshLocation( false );
317#endif 328#endif
318 329
319 loadNewsBar();
320
321 LLFirstUse::useLoginScreen(); 330 LLFirstUse::useLoginScreen();
322} 331}
323 332
@@ -400,20 +409,13 @@ void LLPanelLogin::draw()
400 S32 width = getRect().getWidth(); 409 S32 width = getRect().getWidth();
401 S32 height = getRect().getHeight(); 410 S32 height = getRect().getHeight();
402 411
403 S32 news_bar_height = 0;
404 LLMediaCtrl* news_bar = getChild<LLMediaCtrl>("news_bar");
405 if (news_bar)
406 {
407 news_bar_height = news_bar->getRect().getHeight();
408 }
409
410 if ( mHtmlAvailable ) 412 if ( mHtmlAvailable )
411 { 413 {
412#if !USE_VIEWER_AUTH 414#if !USE_VIEWER_AUTH
413 // draw a background box in black 415 // draw a background box in black
414 gl_rect_2d( 0, height - 264 + news_bar_height, width, 264, LLColor4( 0.0f, 0.0f, 0.0f, 1.f ) ); 416 gl_rect_2d( 0, height - 264, width, 264, LLColor4( 0.0f, 0.0f, 0.0f, 1.f ) );
415 // draw the bottom part of the background image - just the blue background to the native client UI 417 // draw the bottom part of the background image - just the blue background to the native client UI
416 mLogoImage->draw(0, -264 + news_bar_height, width + 8, mLogoImage->getHeight()); 418 mLogoImage->draw(0, -264, width + 8, mLogoImage->getHeight());
417#endif 419#endif
418 } 420 }
419 else 421 else
@@ -723,9 +725,20 @@ void LLPanelLogin::refreshLocation( bool force_visible )
723 } 725 }
724 726
725 BOOL show_start = TRUE; 727 BOOL show_start = TRUE;
726 728 BOOL show_grid_manager = TRUE;
729
727 if ( ! force_visible ) 730 if ( ! force_visible )
731 {
728 show_start = gSavedSettings.getBOOL("ShowStartLocation"); 732 show_start = gSavedSettings.getBOOL("ShowStartLocation");
733 }
734 if (gSavedSettings.getBOOL("ForceShowGrid"))
735 {
736 force_visible = true;
737 }
738 if ( force_visible )
739 {
740 show_grid_manager = gSavedSettings.getBOOL("ShowGridManager");
741 }
729 742
730// [RLVa:KB] - Alternate: Snowglobe-1.2.4 | Checked: 2009-07-08 (RLVa-1.0.0e) 743// [RLVa:KB] - Alternate: Snowglobe-1.2.4 | Checked: 2009-07-08 (RLVa-1.0.0e)
731 // TODO-RLVa: figure out some way to make this work with RLV_EXTENSION_STARTLOCATION 744 // TODO-RLVa: figure out some way to make this work with RLV_EXTENSION_STARTLOCATION
@@ -744,7 +757,9 @@ void LLPanelLogin::refreshLocation( bool force_visible )
744 BOOL show_server = gSavedSettings.getBOOL("ForceShowGrid"); 757 BOOL show_server = gSavedSettings.getBOOL("ForceShowGrid");
745 sInstance->childSetVisible("server_combo", show_server); 758 sInstance->childSetVisible("server_combo", show_server);
746#else*/ 759#else*/
747 sInstance->childSetVisible("server_combo", TRUE); 760 sInstance->childSetVisible("server_combo", show_grid_manager);
761 sInstance->childSetVisible("grid_btn", show_grid_manager);
762 sInstance->childSetVisible("grid_text", show_grid_manager);
748//#endif 763//#endif
749 764
750#endif 765#endif
@@ -1140,75 +1155,3 @@ void LLPanelLogin::onServerComboLostFocus(LLFocusableElement* fe, void*)
1140} 1155}
1141*/ 1156*/
1142 1157
1143
1144bool LLPanelLogin::loadNewsBar()
1145{
1146 std::string news_url = gSavedSettings.getString("NewsBarURL");
1147
1148 if (news_url.empty())
1149 {
1150 return false;
1151 }
1152
1153 LLMediaCtrl* news_bar = getChild<LLMediaCtrl>("news_bar");
1154
1155 if (!news_bar)
1156 {
1157 return false;
1158 }
1159
1160 // *HACK: Not sure how else to make LLMediaCtrl respect user's
1161 // preference when opening links with target="_blank". -Jacek
1162 if (gSavedSettings.getBOOL("UseExternalBrowser"))
1163 {
1164 news_bar->setOpenInExternalBrowser( true );
1165 news_bar->setOpenInInternalBrowser( false );
1166 }
1167 else
1168 {
1169 news_bar->setOpenInExternalBrowser( false );
1170 news_bar->setOpenInInternalBrowser( true );
1171 }
1172
1173
1174 std::ostringstream full_url;
1175
1176 full_url << news_url;
1177
1178 // Append a "?" if the URL doesn't already have query params.
1179 if (LLURI(news_url).queryMap().size() == 0)
1180 {
1181 full_url << "?";
1182 }
1183
1184 std::string channel = gSavedSettings.getString("VersionChannelName");
1185 std::string skin = gSavedSettings.getString("SkinCurrent");
1186
1187 std::string version =
1188 llformat("%d.%d.%d",
1189 ViewerVersion::getImpMajorVersion(),
1190 ViewerVersion::getImpMinorVersion(),
1191 ViewerVersion::getImpPatchVersion());
1192 if (!ViewerVersion::getImpTestVersion().empty())
1193 {
1194 version += " " + ViewerVersion::getImpTestVersion();
1195 }
1196
1197 char* curl_channel = curl_escape(channel.c_str(), 0);
1198 char* curl_version = curl_escape(version.c_str(), 0);
1199 char* curl_skin = curl_escape(skin.c_str(), 0);
1200
1201 full_url << "&channel=" << curl_channel;
1202 full_url << "&version=" << curl_version;
1203 full_url << "&skin=" << curl_skin;
1204
1205 curl_free(curl_channel);
1206 curl_free(curl_version);
1207 curl_free(curl_skin);
1208
1209 LL_DEBUGS("NewsBar")<< "news bar setup to navigate to: " << full_url.str() << LL_ENDL;
1210 news_bar->navigateTo( full_url.str() );
1211
1212
1213 return true;
1214}