diff options
author | Christian Goetze <cg@lindenlab.com> | 2007-08-21 22:17:53 +0000 |
---|---|---|
committer | Christian Goetze <cg@lindenlab.com> | 2007-08-21 22:17:53 +0000 |
commit | ce0a5fe14590b8d675b885fccd5f79d7ea17a302 (patch) | |
tree | 3388e6f8ff02292ec4521d278c841801462945b8 /indra/newview/llpanellogin.cpp | |
parent | b699ae454d8477d19342d320758cd993d1d28cec (diff) |
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
Diffstat (limited to 'indra/newview/llpanellogin.cpp')
-rw-r--r-- | indra/newview/llpanellogin.cpp | 47 |
1 files changed, 28 insertions, 19 deletions
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 |