From c5fff11a76613b366216bcd262dfddfd0cc2a6a3 Mon Sep 17 00:00:00 2001 From: Callum Prentice Date: Thu, 13 Feb 2014 16:10:52 -0800 Subject: MAINT-3675 NUI:Login screen (Work in Progress) --- indra/newview/llloginhandler.cpp | 27 - indra/newview/llpanellogin.cpp | 123 ++--- indra/newview/llpanellogin.h | 8 +- .../textures/windows/first_login_image_left.png | Bin 280886 -> 251572 bytes .../textures/windows/first_login_image_right.png | Bin 263692 -> 274356 bytes .../default/textures/windows/login_sl_logo.png | Bin 28583 -> 33742 bytes indra/newview/skins/default/xui/en/main_view.xml | 2 +- indra/newview/skins/default/xui/en/panel_login.xml | 608 ++++++++++++--------- .../skins/default/xui/en/panel_login_first.xml | 40 +- .../skins/default/xui/en/widgets/combo_box.xml | 2 +- 10 files changed, 402 insertions(+), 408 deletions(-) diff --git a/indra/newview/llloginhandler.cpp b/indra/newview/llloginhandler.cpp index 9b4f146332..39f3c0f113 100755 --- a/indra/newview/llloginhandler.cpp +++ b/indra/newview/llloginhandler.cpp @@ -96,33 +96,6 @@ bool LLLoginHandler::handle(const LLSD& tokens, return true; } - if (tokens.size() == 1 - && tokens[0].asString() == "show") - { - // We're using reg-in-client, so show the XUI login widgets - LLPanelLogin::showLoginWidgets(); - return true; - } - - if (tokens.size() == 1 - && tokens[0].asString() == "reg") - { - LLWindow* window = gViewerWindow->getWindow(); - window->incBusyCount(); - window->setCursor(UI_CURSOR_ARROW); - - // Do this first, as it may be slow and we want to keep something - // on the user's screen as long as possible - LLWeb::loadURLExternal( "http://join.eniac15.lindenlab.com/" ); - - window->decBusyCount(); - window->setCursor(UI_CURSOR_ARROW); - - // Then hide the window - window->minimize(); - return true; - } - // Make sure window is visible LLWindow* window = gViewerWindow->getWindow(); if (window->getMinimized()) diff --git a/indra/newview/llpanellogin.cpp b/indra/newview/llpanellogin.cpp index f328ffe1a0..911979721e 100755 --- a/indra/newview/llpanellogin.cpp +++ b/indra/newview/llpanellogin.cpp @@ -26,8 +26,6 @@ #include "llviewerprecompiledheaders.h" -#include - #include "llpanellogin.h" #include "lllayoutstack.h" @@ -78,33 +76,19 @@ #include "llsdserialize.h" +const S32 BLACK_BORDER_HEIGHT = 160; const S32 MAX_PASSWORD = 16; LLPanelLogin *LLPanelLogin::sInstance = NULL; BOOL LLPanelLogin::sCapslockDidNotification = FALSE; -class LLLoginRefreshHandler : public LLCommandHandler -{ -public: - // don't allow from external browsers - LLLoginRefreshHandler() : LLCommandHandler("login_refresh", UNTRUSTED_BLOCK) { } - bool handle(const LLSD& tokens, const LLSD& query_map, LLMediaCtrl* web) - { - if (LLStartUp::getStartupState() < STATE_LOGIN_CLEANUP) - { - LLPanelLogin::loadLoginPage(); - } - return true; - } -}; - class LLLoginLocationAutoHandler : public LLCommandHandler { public: // don't allow from external browsers LLLoginLocationAutoHandler() : LLCommandHandler("location_login", UNTRUSTED_BLOCK) { } bool handle(const LLSD& tokens, const LLSD& query_map, LLMediaCtrl* web) - { + { if (LLStartUp::getStartupState() < STATE_LOGIN_CLEANUP) { if ( tokens.size() == 0 || tokens.size() > 4 ) @@ -173,7 +157,7 @@ public: LLPanelLogin::autologinToLocation(slurl); }; - } + } return true; } }; @@ -191,7 +175,7 @@ LLPanelLogin::LLPanelLogin(const LLRect &rect, mCallbackData(cb_data), mListener(new LLPanelLoginListener(this)) { - setBackgroundVisible(TRUE); + setBackgroundVisible(FALSE); setBackgroundOpaque(TRUE); // instance management @@ -206,16 +190,27 @@ LLPanelLogin::LLPanelLogin(const LLRect &rect, mPasswordModified = FALSE; LLPanelLogin::sInstance = this; - buildFromFile( "panel_login_first.xml"); LLView* login_holder = gViewerWindow->getLoginPanelHolder(); if (login_holder) { - setOrigin(0,0); - reshape(rect.getWidth(), rect.getHeight()); login_holder->addChild(this); } + // Logo + mLogoImage = LLUI::getUIImage("startup_logo"); + + if (gSavedSettings.getBOOL("FirstLoginThisInstall")) + { + buildFromFile( "panel_login_first.xml"); + } + else + { + buildFromFile( "panel_login.xml"); + } + + reshape(rect.getWidth(), rect.getHeight()); + LLLineEditor* password_edit(getChild("password_edit")); password_edit->setKeystrokeCallback(onPassKey, this); // STEAM-14: When user presses Enter with this field in focus, initiate login @@ -298,8 +293,6 @@ LLPanelLogin::LLPanelLogin(const LLRect &rect, LLMediaCtrl* web_browser = getChild("login_html"); web_browser->addObserver(this); - reshapeBrowser(); - loadLoginPage(); // Show last logged in user favorites in "Start at" combo. @@ -376,21 +369,6 @@ void LLPanelLogin::addFavoritesToStartLocation() } } -// 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) -void LLPanelLogin::reshapeBrowser() -{ - LLMediaCtrl* web_browser = getChild("login_html"); - LLRect rect = gViewerWindow->getWindowRectScaled(); - LLRect html_rect; - html_rect.setCenterAndSize( - rect.getCenterX() - 2, rect.getCenterY() + 40, - rect.getWidth() + 6, rect.getHeight() - 78 ); - web_browser->setRect( html_rect ); - web_browser->reshape( html_rect.getWidth(), html_rect.getHeight(), TRUE ); - reshape( rect.getWidth(), rect.getHeight(), 1 ); -} - LLPanelLogin::~LLPanelLogin() { LLPanelLogin::sInstance = NULL; @@ -400,25 +378,6 @@ LLPanelLogin::~LLPanelLogin() gFocusMgr.setDefaultKeyboardFocus(NULL); } -// virtual -void LLPanelLogin::draw() -{ - LLPanel::draw(); -} - -// virtual -BOOL LLPanelLogin::handleKeyHere(KEY key, MASK mask) -{ - if ( KEY_F1 == key ) - { - LLViewerHelp* vhelp = LLViewerHelp::getInstance(); - vhelp->showTopic(vhelp->f1HelpTopic()); - return TRUE; - } - - return LLPanel::handleKeyHere(key, mask); -} - // virtual void LLPanelLogin::setFocus(BOOL b) { @@ -473,24 +432,6 @@ void LLPanelLogin::giveFocus() } } -// static -void LLPanelLogin::showLoginWidgets() -{ - if (sInstance) - { - // *NOTE: Mani - This may or may not be obselete code. - // It seems to be part of the defunct? reg-in-client project. - sInstance->getChildView("login_widgets")->setVisible( true); - LLMediaCtrl* web_browser = sInstance->getChild("login_html"); - sInstance->reshapeBrowser(); - // *TODO: Append all the usual login parameters, like first_login=Y etc. - std::string splash_screen_url = LLGridManager::getInstance()->getLoginPage(); - web_browser->navigateTo( splash_screen_url, "text/html" ); - LLUICtrl* username_combo = sInstance->getChild("username_combo"); - username_combo->setFocus(TRUE); - } -} - // static void LLPanelLogin::show(const LLRect &rect, void (*callback)(S32 option, void* user_data), @@ -693,7 +634,8 @@ void LLPanelLogin::updateLocationSelectorsVisibility() sInstance->getChild("start_location_panel")->setVisible(show_start); BOOL show_server = gSavedSettings.getBOOL("ForceShowGrid"); - sInstance->getChild("grid_panel")->setVisible(show_server); + //sInstance->getChild("grid_panel")->setVisible(show_server); + sInstance->getChild("server_combo")->setVisible(show_server); } } @@ -766,18 +708,19 @@ void LLPanelLogin::setLocation(const LLSLURL& slurl) LL_DEBUGS("AppInit")<<"setting Location "<onClickConnect(unused_paramter); - } -} + +void LLPanelLogin::autologinToLocation(const LLSLURL& slurl) +{ + LL_DEBUGS("AppInit")<<"automatically logging into Location "<onClickConnect(unused_paramter); + } +} + // static void LLPanelLogin::closePanel() diff --git a/indra/newview/llpanellogin.h b/indra/newview/llpanellogin.h index a614062ccd..bdce2b3a8c 100755 --- a/indra/newview/llpanellogin.h +++ b/indra/newview/llpanellogin.h @@ -49,14 +49,8 @@ public: void *callback_data); ~LLPanelLogin(); - virtual BOOL handleKeyHere(KEY key, MASK mask); - virtual void draw(); virtual void setFocus( BOOL b ); - // Show the XUI first name, last name, and password widgets. They are - // hidden on startup for reg-in-client - static void showLoginWidgets(); - static void show(const LLRect &rect, void (*callback)(S32 option, void* user_data), void* callback_data); @@ -89,7 +83,6 @@ public: private: friend class LLPanelLoginListener; - void reshapeBrowser(); void addFavoritesToStartLocation(); void addUsersWithFavoritesToUsername(); void onSelectServer(); @@ -114,6 +107,7 @@ private: static LLPanelLogin* sInstance; static BOOL sCapslockDidNotification; + bool mFirstLoginThisInstall; }; #endif diff --git a/indra/newview/skins/default/textures/windows/first_login_image_left.png b/indra/newview/skins/default/textures/windows/first_login_image_left.png index b1cb30fe67..bb485be091 100644 Binary files a/indra/newview/skins/default/textures/windows/first_login_image_left.png and b/indra/newview/skins/default/textures/windows/first_login_image_left.png differ diff --git a/indra/newview/skins/default/textures/windows/first_login_image_right.png b/indra/newview/skins/default/textures/windows/first_login_image_right.png index bdd3afdd48..87bd760671 100644 Binary files a/indra/newview/skins/default/textures/windows/first_login_image_right.png and b/indra/newview/skins/default/textures/windows/first_login_image_right.png differ diff --git a/indra/newview/skins/default/textures/windows/login_sl_logo.png b/indra/newview/skins/default/textures/windows/login_sl_logo.png index 3bc93ab24d..132912239a 100644 Binary files a/indra/newview/skins/default/textures/windows/login_sl_logo.png and b/indra/newview/skins/default/textures/windows/login_sl_logo.png differ diff --git a/indra/newview/skins/default/xui/en/main_view.xml b/indra/newview/skins/default/xui/en/main_view.xml index b1eb3caccb..9885e37cea 100755 --- a/indra/newview/skins/default/xui/en/main_view.xml +++ b/indra/newview/skins/default/xui/en/main_view.xml @@ -67,7 +67,7 @@ - - - http://secondlife.eniac15.lindenlab.com/reg-in-client/ - - - http://secondlife.com/account/request.php - - - - - - - LOG IN - - - Username: - - - - - - - - - - Password: - - - - - - - Start at: - - - - - - - - - - - - - Need help logging in? - - - Forgot your username or password? - -