From ccd1c2274c1a16d3de7a94d0697a203311433247 Mon Sep 17 00:00:00 2001 From: Callum Prentice Date: Thu, 6 Mar 2014 10:20:29 -0800 Subject: WENG-1470 (Partial) Secondlife Login Screen Redesign - more misc changes --- indra/newview/llpanellogin.cpp | 44 ++++++++++++++++++++-- indra/newview/llpanellogin.h | 2 + indra/newview/llstartup.cpp | 13 ------- indra/newview/skins/default/xui/en/panel_login.xml | 2 + 4 files changed, 45 insertions(+), 16 deletions(-) diff --git a/indra/newview/llpanellogin.cpp b/indra/newview/llpanellogin.cpp index 0c392d669b..2301494549 100755 --- a/indra/newview/llpanellogin.cpp +++ b/indra/newview/llpanellogin.cpp @@ -222,6 +222,12 @@ LLPanelLogin::LLPanelLogin(const LLRect &rect, LLComboBox* server_choice_combo = getChild("server_combo"); server_choice_combo->setCommitCallback(boost::bind(&LLPanelLogin::onSelectServer, this)); + LLComboBox* favorites_combo = getChild("start_location_combo"); + favorites_combo->setCommitCallback(boost::bind(&LLPanelLogin::onSelectFavorite, this)); + + LLLineEditor* location_edit = sInstance->getChild("location_edit"); + location_edit->setKeystrokeCallback(boost::bind(&LLPanelLogin::onLocationEditChanged, this, _1), NULL); + // Load all of the grids, sorted, and then add a bar and the current grid at the top server_choice_combo->removeall(); @@ -674,8 +680,12 @@ void LLPanelLogin::onUpdateStartSLURL(const LLSLURL& new_start_slurl) updateServer(); // to change the links and splash screen } - //location_combo->setTextEntry(new_start_slurl.getLocationString()); - location_edit->setValue(new_start_slurl.getLocationString()); + if ( new_start_slurl.getLocationString().length() ) + { + location_edit->setValue(new_start_slurl.getLocationString()); + LLButton* loc_btn = sInstance->getChild("connect_location_btn"); + loc_btn->setEnabled(true); + } } else { @@ -979,12 +989,40 @@ void LLPanelLogin::updateServer() } } +void LLPanelLogin::onLocationEditChanged(LLUICtrl* ctrl) +{ + LLLineEditor* self = (LLLineEditor*)ctrl; + + if (self ) + { + LLButton* loc_btn = getChild("connect_location_btn"); + + unsigned int field_length = self->getText().length(); + if ( field_length == 0 ) + { + loc_btn->setEnabled(false); + } + else + { + loc_btn->setEnabled(true); + } + } +} + + +void LLPanelLogin::onSelectFavorite() +{ + // enable button when item selected from combo + LLButton* fav_btn = getChild("connect_favorite_btn"); + fav_btn->setEnabled(true); +} + void LLPanelLogin::onSelectServer() { // The user twiddled with the grid choice ui. // apply the selection to the grid setting. LLPointer credential; - + LLComboBox* server_combo = getChild("server_combo"); LLSD server_combo_val = server_combo->getSelectedValue(); LL_INFOS("AppInit") << "grid "<