From ce0a5fe14590b8d675b885fccd5f79d7ea17a302 Mon Sep 17 00:00:00 2001 From: Christian Goetze Date: Tue, 21 Aug 2007 22:17:53 +0000 Subject: EFFECTIVE MERGE: svn merge -r 66133:68118 svn+ssh://svn/svn/linden/branches/maintenance into release Actual action: branched maintenance-r68118, merged in release, then copied result into release --- indra/newview/llpanellogin.cpp | 47 +++++++++++++++++++++++++----------------- 1 file changed, 28 insertions(+), 19 deletions(-) (limited to 'indra/newview/llpanellogin.cpp') diff --git a/indra/newview/llpanellogin.cpp b/indra/newview/llpanellogin.cpp index 6e1a1b9f09..7a05f2bdbf 100644 --- a/indra/newview/llpanellogin.cpp +++ b/indra/newview/llpanellogin.cpp @@ -119,6 +119,9 @@ LLPanelLogin::LLPanelLogin(const LLRect &rect, { llwarns << "Duplicate instance of login view deleted" << llendl; delete LLPanelLogin::sInstance; + + // Don't leave bad pointer in gFocusMgr + gFocusMgr.setDefaultKeyboardFocus(NULL); } LLPanelLogin::sInstance = this; @@ -505,9 +508,10 @@ void LLPanelLogin::show(const LLRect &rect, { // Grab focus and move cursor to first enabled control sInstance->setFocus(TRUE); - // make sure that focus always goes here - gFocusMgr.setDefaultKeyboardFocus(sInstance); } + + // Make sure that focus always goes here (and use the latest sInstance that was just created) + gFocusMgr.setDefaultKeyboardFocus(sInstance); } // static @@ -588,35 +592,40 @@ void LLPanelLogin::getFields(LLString &firstname, LLString &lastname, LLString & } -// static -void LLPanelLogin::getServer(LLString &server, S32 &domain_name) +// static. Return TRUE if user made a choice from the popup +BOOL LLPanelLogin::getServer(LLString &server, S32 &domain_name) { + BOOL user_picked = FALSE; if (!sInstance) { llwarns << "Attempted getServer with no login view shown" << llendl; - return; } - - LLComboBox* combo = LLUICtrlFactory::getComboBoxByName(sInstance, "server_combo"); - if (combo) + else { - LLSD combo_val = combo->getValue(); - if (LLSD::TypeInteger == combo_val.type()) + LLComboBox* combo = LLUICtrlFactory::getComboBoxByName(sInstance, "server_combo"); + if (combo) { - domain_name = combo->getValue().asInteger(); + LLSD combo_val = combo->getValue(); + if (LLSD::TypeInteger == combo_val.type()) + { + domain_name = combo->getValue().asInteger(); - if ((S32)USERSERVER_OTHER == domain_name) + if ((S32)USERSERVER_OTHER == domain_name) + { + server = gUserServerName; + } + } + else { - server = gUserServerName; + // no valid selection, return other + domain_name = (S32)USERSERVER_OTHER; + server = combo_val.asString(); } - } - else - { - // no valid selection, return other - domain_name = (S32)USERSERVER_OTHER; - server = combo_val.asString(); + user_picked = combo->isDirty(); } } + + return user_picked; } // static -- cgit v1.2.3