summaryrefslogtreecommitdiff
path: root/indra/newview/llpanellogin.cpp
diff options
context:
space:
mode:
authorSteven Bennetts <steve@lindenlab.com>2008-06-27 21:02:01 +0000
committerSteven Bennetts <steve@lindenlab.com>2008-06-27 21:02:01 +0000
commit926ea0b39afd04cab469ca17b28f95ebf969e669 (patch)
tree40d5653e19160f72e7a0b80fadb9bdb93ef3575c /indra/newview/llpanellogin.cpp
parent41877d457ab9542dca22b99f3eddb1bfcfe7c1d6 (diff)
QAR-669 1.20 Viewer RC11
QAR-648 1.20 Viewer RC10 merge Branch_1-20-Viewer-2 -r 88724:90511 -> release
Diffstat (limited to 'indra/newview/llpanellogin.cpp')
-rw-r--r--indra/newview/llpanellogin.cpp61
1 files changed, 28 insertions, 33 deletions
diff --git a/indra/newview/llpanellogin.cpp b/indra/newview/llpanellogin.cpp
index c252c54ad7..a8dc35f99c 100644
--- a/indra/newview/llpanellogin.cpp
+++ b/indra/newview/llpanellogin.cpp
@@ -777,9 +777,8 @@ void LLPanelLogin::getFields(std::string &firstname, std::string &lastname, std:
remember = sInstance->childGetValue("remember_check");
}
-
-// static. Return TRUE if user made a choice from the popup
-BOOL LLPanelLogin::getServer(std::string &server, S32 &domain_name)
+// static
+BOOL LLPanelLogin::isGridComboDirty()
{
BOOL user_picked = FALSE;
if (!sInstance)
@@ -789,25 +788,8 @@ BOOL LLPanelLogin::getServer(std::string &server, S32 &domain_name)
else
{
LLComboBox* combo = sInstance->getChild<LLComboBox>("server_combo");
- LLSD combo_val = combo->getValue();
- if (LLSD::TypeInteger == combo_val.type())
- {
- domain_name = combo->getValue().asInteger();
-
- if ((S32)GRID_INFO_OTHER == domain_name)
- {
- server = LLViewerLogin::getInstance()->getGridLabel();
- }
- }
- else
- {
- // no valid selection, return other
- domain_name = (S32)GRID_INFO_OTHER;
- server = combo_val.asString();
- }
user_picked = combo->isDirty();
}
-
return user_picked;
}
@@ -941,19 +923,13 @@ void LLPanelLogin::loadLoginPage()
curl_free(curl_version);
// Grid
- std::string grid;
- S32 grid_index;
- getServer( grid, grid_index );
+ char* curl_grid = curl_escape(LLViewerLogin::getInstance()->getGridLabel().c_str(), 0);
+ oStr << "&grid=" << curl_grid;
+ curl_free(curl_grid);
gViewerWindow->setMenuBackgroundColor(false, !LLViewerLogin::getInstance()->isInProductionGrid());
gLoginMenuBarView->setBackgroundColor(gMenuBarView->getBackgroundColor());
- if (!grid.empty())
- {
- char* curl_grid = curl_escape(grid.c_str(), 0);
- oStr << "&grid=" << curl_grid;
- curl_free(curl_grid);
- }
#if USE_VIEWER_AUTH
LLURLSimString::sInstance.parse();
@@ -1167,9 +1143,29 @@ void LLPanelLogin::onSelectServer(LLUICtrl*, void*)
{
// The user twiddled with the grid choice ui.
// apply the selection to the grid setting.
- std::string grid;
+ std::string grid_label;
S32 grid_index;
- getServer( grid, grid_index );
+
+ LLComboBox* combo = sInstance->getChild<LLComboBox>("server_combo");
+ LLSD combo_val = combo->getValue();
+
+ if (LLSD::TypeInteger == combo_val.type())
+ {
+ grid_index = combo->getValue().asInteger();
+
+ if ((S32)GRID_INFO_OTHER == grid_index)
+ {
+ // This happens if the user specifies a custom grid
+ // via command line.
+ grid_label = combo->getSimple();
+ }
+ }
+ else
+ {
+ // no valid selection, return other
+ grid_index = (S32)GRID_INFO_OTHER;
+ grid_label = combo_val.asString();
+ }
// This new seelction will override preset uris
// from the command line.
@@ -1178,11 +1174,10 @@ void LLPanelLogin::onSelectServer(LLUICtrl*, void*)
if(grid_index != GRID_INFO_OTHER)
{
vl->setGridChoice((EGridInfo)grid_index);
- grid = vl->getGridLabel();
}
else
{
- vl->setGridChoice(grid);
+ vl->setGridChoice(grid_label);
}
// grid changed so show new splash screen (possibly)