From 68c3c87eb33ec28bbf66390901931fe70efb3360 Mon Sep 17 00:00:00 2001 From: David Seikel Date: Tue, 1 Mar 2011 21:25:50 +1000 Subject: Revert "Added a "news bar" at the bottom of the login screen." Seems like something that is better done in the login page for us, and stops people bitching about how insecure this viewer is due to sending stuff to the impy server. They are still sensative after the Emerald fiasco. This reverts commit 373179115193077d258881d54cc1c07edf99c3a5. --- linden/indra/newview/app_settings/settings.xml | 11 --- linden/indra/newview/llpanellogin.cpp | 96 +++------------------- linden/indra/newview/llpanellogin.h | 3 - .../skins/default/xui/en-us/panel_login.xml | 23 ++---- 4 files changed, 21 insertions(+), 112 deletions(-) diff --git a/linden/indra/newview/app_settings/settings.xml b/linden/indra/newview/app_settings/settings.xml index 5077a74..5d52329 100644 --- a/linden/indra/newview/app_settings/settings.xml +++ b/linden/indra/newview/app_settings/settings.xml @@ -832,17 +832,6 @@ Value 1 - NewsBarURL - - Comment - URL to load in the news bar on the login screen - Persist - 1 - Type - String - Value - http://app.kokuaviewer.org/news/ - ObjectIMColor Comment diff --git a/linden/indra/newview/llpanellogin.cpp b/linden/indra/newview/llpanellogin.cpp index d81cfa1..00d9332 100644 --- a/linden/indra/newview/llpanellogin.cpp +++ b/linden/indra/newview/llpanellogin.cpp @@ -302,6 +302,17 @@ LLPanelLogin::LLPanelLogin(const LLRect &rect, // make links open in external browser web_browser->setOpenInExternalBrowser( true ); + // 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) + LLRect htmlRect = getRect(); +#if USE_VIEWER_AUTH + htmlRect.setCenterAndSize( getRect().getCenterX() - 2, getRect().getCenterY(), getRect().getWidth() + 6, getRect().getHeight()); +#else + htmlRect.setCenterAndSize( getRect().getCenterX() - 2, getRect().getCenterY() + 40, getRect().getWidth() + 6, getRect().getHeight() - 78 ); +#endif + web_browser->setRect( htmlRect ); + web_browser->reshape( htmlRect.getWidth(), htmlRect.getHeight(), TRUE ); + reshape( getRect().getWidth(), getRect().getHeight(), 1 ); + // kick off a request to grab the url manually gResponsePtr = LLIamHereLogin::build( this ); std::string login_page = gSavedSettings.getString("LoginPage"); @@ -316,8 +327,6 @@ LLPanelLogin::LLPanelLogin(const LLRect &rect, refreshLocation( false ); #endif - loadNewsBar(); - LLFirstUse::useLoginScreen(); } @@ -410,20 +419,13 @@ void LLPanelLogin::draw() S32 width = getRect().getWidth(); S32 height = getRect().getHeight(); - S32 news_bar_height = 0; - LLMediaCtrl* news_bar = getChild("news_bar"); - if (news_bar) - { - news_bar_height = news_bar->getRect().getHeight(); - } - if ( mHtmlAvailable ) { #if !USE_VIEWER_AUTH // draw a background box in black - gl_rect_2d( 0, height - 264 + news_bar_height, width, 264, LLColor4( 0.0f, 0.0f, 0.0f, 1.f ) ); + gl_rect_2d( 0, height - 264, width, 264, LLColor4( 0.0f, 0.0f, 0.0f, 1.f ) ); // draw the bottom part of the background image - just the blue background to the native client UI - mLogoImage->draw(0, -264 + news_bar_height, width + 8, mLogoImage->getHeight()); + mLogoImage->draw(0, -264, width + 8, mLogoImage->getHeight()); #endif } else @@ -1162,75 +1164,3 @@ void LLPanelLogin::onServerComboLostFocus(LLFocusableElement* fe, void*) } } */ - - -bool LLPanelLogin::loadNewsBar() -{ - std::string news_url = gSavedSettings.getString("NewsBarURL"); - - if (news_url.empty()) - { - return false; - } - - LLMediaCtrl* news_bar = getChild("news_bar"); - - if (!news_bar) - { - return false; - } - - // *HACK: Not sure how else to make LLMediaCtrl respect user's - // preference when opening links with target="_blank". -Jacek - if (gSavedSettings.getBOOL("UseExternalBrowser")) - { - news_bar->setOpenInExternalBrowser( true ); - news_bar->setOpenInInternalBrowser( false ); - } - else - { - news_bar->setOpenInExternalBrowser( false ); - news_bar->setOpenInInternalBrowser( true ); - } - - - std::ostringstream full_url; - - full_url << news_url; - - // Append a "?" if the URL doesn't already have query params. - if (LLURI(news_url).queryMap().size() == 0) - { - full_url << "?"; - } - - std::string channel = gSavedSettings.getString("VersionChannelName"); - std::string skin = gSavedSettings.getString("SkinCurrent"); - - std::string version = - llformat("%d.%d.%d", - ViewerVersion::getImpMajorVersion(), - ViewerVersion::getImpMinorVersion(), - ViewerVersion::getImpPatchVersion()); - if (!ViewerVersion::getImpTestVersion().empty()) - { - version += " " + ViewerVersion::getImpTestVersion(); - } - - char* curl_channel = curl_escape(channel.c_str(), 0); - char* curl_version = curl_escape(version.c_str(), 0); - char* curl_skin = curl_escape(skin.c_str(), 0); - - full_url << "&channel=" << curl_channel; - full_url << "&version=" << curl_version; - full_url << "&skin=" << curl_skin; - - curl_free(curl_channel); - curl_free(curl_version); - curl_free(curl_skin); - - news_bar->navigateTo( full_url.str() ); - - - return true; -} diff --git a/linden/indra/newview/llpanellogin.h b/linden/indra/newview/llpanellogin.h index 5830b52..c99fa30 100644 --- a/linden/indra/newview/llpanellogin.h +++ b/linden/indra/newview/llpanellogin.h @@ -87,9 +87,6 @@ public: // inherited from LLViewerMediaObserver /*virtual*/ void handleMediaEvent(LLPluginClassMedia* self, EMediaEvent event); - /// Load the news bar web page, return true if successful. - bool loadNewsBar(); - private: static void onClickConnect(void*); static void onClickGrid(void*); diff --git a/linden/indra/newview/skins/default/xui/en-us/panel_login.xml b/linden/indra/newview/skins/default/xui/en-us/panel_login.xml index 13e8ff6..75c635e 100644 --- a/linden/indra/newview/skins/default/xui/en-us/panel_login.xml +++ b/linden/indra/newview/skins/default/xui/en-us/panel_login.xml @@ -5,7 +5,7 @@ follows="left|top|right|bottom" mouse_opaque="true" >