aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden/indra/newview/llpanellogin.cpp
diff options
context:
space:
mode:
authorJacek Antonelli2008-08-15 23:45:55 -0500
committerJacek Antonelli2008-08-15 23:45:55 -0500
commit9063e60aefe54f7c45aaa8cb24e8998b2c7343ab (patch)
tree1c8235465701c910a5d76448ddc8eb1f14457ebc /linden/indra/newview/llpanellogin.cpp
parentSecond Life viewer sources 1.20.9 (diff)
downloadmeta-impy-9063e60aefe54f7c45aaa8cb24e8998b2c7343ab.zip
meta-impy-9063e60aefe54f7c45aaa8cb24e8998b2c7343ab.tar.gz
meta-impy-9063e60aefe54f7c45aaa8cb24e8998b2c7343ab.tar.bz2
meta-impy-9063e60aefe54f7c45aaa8cb24e8998b2c7343ab.tar.xz
Second Life viewer sources 1.20.10
Diffstat (limited to 'linden/indra/newview/llpanellogin.cpp')
-rw-r--r--linden/indra/newview/llpanellogin.cpp61
1 files changed, 28 insertions, 33 deletions
diff --git a/linden/indra/newview/llpanellogin.cpp b/linden/indra/newview/llpanellogin.cpp
index d8da3c0..065e429 100644
--- a/linden/indra/newview/llpanellogin.cpp
+++ b/linden/indra/newview/llpanellogin.cpp
@@ -777,9 +777,8 @@ void LLPanelLogin::getFields(LLString &firstname, LLString &lastname, LLString &
777 remember = sInstance->childGetValue("remember_check"); 777 remember = sInstance->childGetValue("remember_check");
778} 778}
779 779
780 780// static
781// static. Return TRUE if user made a choice from the popup 781BOOL LLPanelLogin::isGridComboDirty()
782BOOL LLPanelLogin::getServer(LLString &server, S32 &domain_name)
783{ 782{
784 BOOL user_picked = FALSE; 783 BOOL user_picked = FALSE;
785 if (!sInstance) 784 if (!sInstance)
@@ -789,25 +788,8 @@ BOOL LLPanelLogin::getServer(LLString &server, S32 &domain_name)
789 else 788 else
790 { 789 {
791 LLComboBox* combo = sInstance->getChild<LLComboBox>("server_combo"); 790 LLComboBox* combo = sInstance->getChild<LLComboBox>("server_combo");
792 LLSD combo_val = combo->getValue();
793 if (LLSD::TypeInteger == combo_val.type())
794 {
795 domain_name = combo->getValue().asInteger();
796
797 if ((S32)GRID_INFO_OTHER == domain_name)
798 {
799 server = LLViewerLogin::getInstance()->getGridLabel();
800 }
801 }
802 else
803 {
804 // no valid selection, return other
805 domain_name = (S32)GRID_INFO_OTHER;
806 server = combo_val.asString();
807 }
808 user_picked = combo->isDirty(); 791 user_picked = combo->isDirty();
809 } 792 }
810
811 return user_picked; 793 return user_picked;
812} 794}
813 795
@@ -941,19 +923,13 @@ void LLPanelLogin::loadLoginPage()
941 curl_free(curl_version); 923 curl_free(curl_version);
942 924
943 // Grid 925 // Grid
944 LLString grid; 926 char* curl_grid = curl_escape(LLViewerLogin::getInstance()->getGridLabel().c_str(), 0);
945 S32 grid_index; 927 oStr << "&grid=" << curl_grid;
946 getServer( grid, grid_index ); 928 curl_free(curl_grid);
947 929
948 gViewerWindow->setMenuBackgroundColor(false, !LLViewerLogin::getInstance()->isInProductionGrid()); 930 gViewerWindow->setMenuBackgroundColor(false, !LLViewerLogin::getInstance()->isInProductionGrid());
949 gLoginMenuBarView->setBackgroundColor(gMenuBarView->getBackgroundColor()); 931 gLoginMenuBarView->setBackgroundColor(gMenuBarView->getBackgroundColor());
950 932
951 if (!grid.empty())
952 {
953 char* curl_grid = curl_escape(grid.c_str(), 0);
954 oStr << "&grid=" << curl_grid;
955 curl_free(curl_grid);
956 }
957 933
958#if USE_VIEWER_AUTH 934#if USE_VIEWER_AUTH
959 LLURLSimString::sInstance.parse(); 935 LLURLSimString::sInstance.parse();
@@ -1167,9 +1143,29 @@ void LLPanelLogin::onSelectServer(LLUICtrl*, void*)
1167{ 1143{
1168 // The user twiddled with the grid choice ui. 1144 // The user twiddled with the grid choice ui.
1169 // apply the selection to the grid setting. 1145 // apply the selection to the grid setting.
1170 LLString grid; 1146 LLString grid_label;
1171 S32 grid_index; 1147 S32 grid_index;
1172 getServer( grid, grid_index ); 1148
1149 LLComboBox* combo = sInstance->getChild<LLComboBox>("server_combo");
1150 LLSD combo_val = combo->getValue();
1151
1152 if (LLSD::TypeInteger == combo_val.type())
1153 {
1154 grid_index = combo->getValue().asInteger();
1155
1156 if ((S32)GRID_INFO_OTHER == grid_index)
1157 {
1158 // This happens if the user specifies a custom grid
1159 // via command line.
1160 grid_label = combo->getSimple();
1161 }
1162 }
1163 else
1164 {
1165 // no valid selection, return other
1166 grid_index = (S32)GRID_INFO_OTHER;
1167 grid_label = combo_val.asString();
1168 }
1173 1169
1174 // This new seelction will override preset uris 1170 // This new seelction will override preset uris
1175 // from the command line. 1171 // from the command line.
@@ -1178,11 +1174,10 @@ void LLPanelLogin::onSelectServer(LLUICtrl*, void*)
1178 if(grid_index != GRID_INFO_OTHER) 1174 if(grid_index != GRID_INFO_OTHER)
1179 { 1175 {
1180 vl->setGridChoice((EGridInfo)grid_index); 1176 vl->setGridChoice((EGridInfo)grid_index);
1181 grid = vl->getGridLabel();
1182 } 1177 }
1183 else 1178 else
1184 { 1179 {
1185 vl->setGridChoice(grid); 1180 vl->setGridChoice(grid_label);
1186 } 1181 }
1187 1182
1188 // grid changed so show new splash screen (possibly) 1183 // grid changed so show new splash screen (possibly)