1. simon_linden
  2. viewer-rabbit

Commits

dessie linden  committed 9e87c01

pushed 2-1-release tag

  • Participants
  • Parent commits 7065632
  • Branches default

Comments (0)

Files changed (2)

File indra/newview/llpanellogin.cpp

View file
 	mCallback(callback),
 	mCallbackData(cb_data),
 	mHtmlAvailable( TRUE ),
-	mLocationUpdated( FALSE ),
 	mListener(new LLPanelLoginListener(this))
 {
 	setFocusRoot(TRUE);
 		LLSLURL slurl(gSavedSettings.getString("LoginLocation"));
 		LLStartUp::setStartSLURL(slurl);
 	}
-
-	LLComboBox* location_choice_combo = sInstance->getChild<LLComboBox>("start_location_combo");
-	location_choice_combo->setFocusLostCallback(boost::bind(onLocationComboLostFocus, _1));
+	updateLocationCombo(false);
 
 	LLComboBox* server_choice_combo = sInstance->getChild<LLComboBox>("server_combo");
 	server_choice_combo->setCommitCallback(onSelectServer, NULL);
 		return;
 	}	
 	
-	if ( ! sInstance->mLocationUpdated )
+	LLComboBox* combo = sInstance->getChild<LLComboBox>("start_location_combo");
+	
+	switch(LLStartUp::getStartSLURL().getType())
 	{
-		LLComboBox* combo = sInstance->getChild<LLComboBox>("start_location_combo");
-
-		// get combo box to a known state so we can test its dirty state later
-		combo->resetDirty();
-
-		switch(LLStartUp::getStartSLURL().getType())
+		case LLSLURL::LOCATION:
 		{
-			case LLSLURL::LOCATION:
-			{
-				
-				combo->setCurrentByIndex( 2 );	
-				combo->setTextEntry(LLStartUp::getStartSLURL().getLocationString());	
-				break;
-			}
-			case LLSLURL::HOME_LOCATION:
-				combo->setCurrentByIndex(1);
-				break;
-			default:
-				combo->setCurrentByIndex(0);
-				break;
+			
+			combo->setCurrentByIndex( 2 );	
+			combo->setTextEntry(LLStartUp::getStartSLURL().getLocationString());	
+			break;
 		}
+		case LLSLURL::HOME_LOCATION:
+			combo->setCurrentByIndex(1);
+			break;
+		default:
+			combo->setCurrentByIndex(0);
+			break;
 	}
 	
 	BOOL show_start = TRUE;
 		combo_val = combo->getValue();
 	}
 	
+	combo = sInstance->getChild<LLComboBox>("start_location_combo");	
+	combo->setCurrentByIndex(1);
 	LLStartUp::setStartSLURL(LLSLURL(gSavedSettings.getString("LoginLocation")));
 	LLGridManager::getInstance()->setGridChoice(combo_val.asString());
 	// This new selection will override preset uris
 	// from the command line.
 	updateServer();
+	updateLocationCombo(false);
 	updateLoginPanelLinks();
 }
 
 	}
 }
 
-void LLPanelLogin::onLocationComboLostFocus(LLFocusableElement* fe)
-{
-	if (!sInstance)
-	{
-		return;
-	}
-
-	LLComboBox* combo = sInstance->getChild< LLComboBox> ( "start_location_combo" );
-	if ( fe == combo )
-	{
-		if ( combo->isDirty() )
-		{
-			sInstance->mLocationUpdated = TRUE;
-		}
-		else
-		{
-			sInstance->mLocationUpdated = FALSE;
-		}
-	}
-}
-
 void LLPanelLogin::updateLoginPanelLinks()
 {
 	LLSD grid_data;

File indra/newview/llpanellogin.h

View file
 	static void onPassKey(LLLineEditor* caller, void* user_data);
 	static void onSelectServer(LLUICtrl*, void*);
 	static void onServerComboLostFocus(LLFocusableElement*);
-	static void onLocationComboLostFocus(LLFocusableElement*);
 	static void updateServerCombo();
 	static void updateStartSLURL();
 	
 	static LLPanelLogin* sInstance;
 	static BOOL		sCapslockDidNotification;
 	BOOL			mHtmlAvailable;
-	BOOL			mLocationUpdated;
 };
 
 std::string load_password_from_disk(void);