コード例 #1
0
void LLWindlightRemoteCtrl::refreshPresets()
{
	// If we're teleporting or just logging in, no UI to refresh
	if (gViewerWindow->getShowProgress())
	{
		return;
	}

	LLComboBox*	presetsCombo = getChild<LLComboBox>("Presets", TRUE, TRUE);
	if (presetsCombo)
	{
		// snag current preset
		LLWLParamManager * param_mgr = LLWLParamManager::instance();
		LLWLParamSet& currentParams = param_mgr->mCurParams;
		
		// clear in case presets names have changed
		presetsCombo->clearRows();

		std::map<std::string, LLWLParamSet>::iterator mIt = 
			param_mgr->mParamList.begin();
		for(; mIt != param_mgr->mParamList.end(); mIt++) 
		{
			presetsCombo->add(mIt->first);
		}
		
		// insert separator and add World menu options
		// presetsCombo->addSeparator(ADD_BOTTOM);
		// presetsCombo->addSimpleElement(getString("atmosphere"), ADD_BOTTOM);
		// presetsCombo->addSimpleElement(getString("lighting"), ADD_BOTTOM);
		// presetsCombo->addSimpleElement(getString("clouds"), ADD_BOTTOM);
		// presetsCombo->addSimpleElement(getString("advanced_water"), ADD_BOTTOM);
		presetsCombo->addSeparator(ADD_BOTTOM);
		presetsCombo->addSimpleElement(getString("sunrise"), ADD_BOTTOM);
		presetsCombo->addSimpleElement(getString("noon"), ADD_BOTTOM);
		presetsCombo->addSimpleElement(getString("sunset"), ADD_BOTTOM);
		presetsCombo->addSimpleElement(getString("midnight"), ADD_BOTTOM);
		presetsCombo->addSimpleElement(getString("revert_region"), ADD_BOTTOM);

		if (!currentParams.mName.empty())
		{
			presetsCombo->selectByValue(LLSD(currentParams.mName));
		}
		else
		{
			presetsCombo->selectByValue(LLSD("Default"));
		}
	}
}
コード例 #2
0
ファイル: llfloaterfriends.cpp プロジェクト: Kiera/Crow
void LLPanelFriends::populateContactGroupSelect()
{
	LLComboBox* combo = getChild<LLComboBox>("buddy_group_combobox");

	if (combo)
	{
		combo->removeall();
		combo->add("All", ADD_BOTTOM);

		LLSD groups = gSavedPerAccountSettings.getLLSD("AscentContactGroups");

		S32 count = groups["ASC_MASTER_GROUP_LIST"].size();
		S32 index;
		for (index = 0; index < count; index++)
		{
			combo->addSimpleElement(groups["ASC_MASTER_GROUP_LIST"][index].asString(), ADD_BOTTOM);
		}
	}
	else
	{
		LLChat msg("Null combo");
		LLFloaterChat::addChat(msg);
	}
}
コード例 #3
0
//---------------------------------------------------------------------------
// Public methods
//---------------------------------------------------------------------------
LLPanelLogin::LLPanelLogin(const LLRect &rect,
						 void (*callback)(S32 option, void* user_data),
						 void *cb_data)
:	LLPanel(std::string("panel_login"), LLRect(0,600,800,0), FALSE),		// not bordered
	mLogoImage(),
	mCallback(callback),
	mCallbackData(cb_data),
	mHtmlAvailable( TRUE )
{
	setFocusRoot(TRUE);

	setBackgroundVisible(FALSE);
	setBackgroundOpaque(TRUE);

	// instance management
	if (LLPanelLogin::sInstance)
	{
		llwarns << "Duplicate instance of login view deleted" << llendl;
		delete LLPanelLogin::sInstance;

		// Don't leave bad pointer in gFocusMgr
		gFocusMgr.setDefaultKeyboardFocus(NULL);
	}

	LLPanelLogin::sInstance = this;

	// add to front so we are the bottom-most child
	gViewerWindow->getRootView()->addChildAtEnd(this);

	// Logo
	mLogoImage = LLUI::getUIImage("startup_logo.j2c");

	LLUICtrlFactory::getInstance()->buildPanel(this, "panel_login.xml");
	
#if USE_VIEWER_AUTH
	//leave room for the login menu bar
	setRect(LLRect(0, rect.getHeight()-18, rect.getWidth(), 0)); 
#endif
	reshape(rect.getWidth(), rect.getHeight());

#if !USE_VIEWER_AUTH
	LLComboBox* name_combo = sInstance->getChild<LLComboBox>("name_combo");
	name_combo->setCommitCallback(onSelectLoginEntry);
	name_combo->setFocusLostCallback(onLoginComboLostFocus);
	name_combo->setPrevalidate(LLLineEditor::prevalidatePrintableNotPipe);
	name_combo->setSuppressTentative(true);
	name_combo->setSuppressAutoComplete(true);

	childSetCommitCallback("remember_name_check", onNameCheckChanged);
	childSetCommitCallback("password_edit", mungePassword);
	childSetKeystrokeCallback("password_edit", onPassKey, this);
	childSetUserData("password_edit", this);

	// change z sort of clickable text to be behind buttons
	sendChildToBack(getChildView("channel_text"));
	sendChildToBack(getChildView("forgot_password_text"));

	LLLineEditor* edit = getChild<LLLineEditor>("password_edit");
	if (edit) edit->setDrawAsterixes(TRUE);

	//OGPX : This keeps the uris in a history file 
	//OGPX TODO: should this be inside an OGP only check?
	LLComboBox* regioncombo = getChild<LLComboBox>("regionuri_edit"); 
	regioncombo->setAllowTextEntry(TRUE, 256, FALSE);
	std::string  current_regionuri = gSavedSettings.getString("CmdLineRegionURI");

	// iterate on uri list adding to combobox (couldn't figure out how to add them all in one call)
	// ... and also append the command line value we might have gotten to the URLHistory
	LLSD regionuri_history = LLURLHistory::getURLHistory("regionuri");
	LLSD::array_iterator iter_history = regionuri_history.beginArray();
	LLSD::array_iterator iter_end = regionuri_history.endArray();
	for (; iter_history != iter_end; ++iter_history)
	{
		regioncombo->addSimpleElement((*iter_history).asString());
	}

	if ( LLURLHistory::appendToURLCollection("regionuri",current_regionuri)) 
	{
		// since we are in login, another read of urlhistory file is going to happen 
		// so we need to persist the new value we just added (or maybe we should do it in startup.cpp?)

		// since URL history only populated on create of sInstance, add to combo list directly
		regioncombo->addSimpleElement(current_regionuri);
	}
	
	// select which is displayed if we have a current URL.
	regioncombo->setSelectedByValue(LLSD(current_regionuri),TRUE);

	//llinfos << " url history: " << LLSDOStreamer<LLSDXMLFormatter>(LLURLHistory::getURLHistory("regionuri")) << llendl;

	LLComboBox* combo = getChild<LLComboBox>("start_location_combo");
	combo->setAllowTextEntry(TRUE, 128, FALSE);

	// The XML file loads the combo with the following labels:
	// 0 - "My Home"
	// 1 - "My Last Location"
	// 2 - "<Type region name>"

	BOOL login_last = gSavedSettings.getBOOL("LoginLastLocation");
	std::string sim_string = LLURLSimString::sInstance.mSimString;
	if (!sim_string.empty())
	{
		// Replace "<Type region name>" with this region name
		combo->remove(2);
		combo->add( sim_string );
		combo->setTextEntry(sim_string);
		combo->setCurrentByIndex( 2 );
	}
	else if (login_last)
	{
		combo->setCurrentByIndex( 1 );
	}
	else
	{
		combo->setCurrentByIndex( 0 );
	}

	combo->setCommitCallback( &set_start_location );

	childSetAction("connect_btn", onClickConnect, this);

	setDefaultBtn("connect_btn");

	// childSetAction("quit_btn", onClickQuit, this);
	childSetAction("grids_btn", onClickGrids, this);
	childSetCommitCallback("grids_combo", onSelectGrid, this);

	std::string channel = LL_CHANNEL;

	std::string version = llformat("%d.%d.%d (%d)",
		LL_VERSION_MAJOR,
		LL_VERSION_MINOR,
		LL_VERSION_PATCH,
		LL_VIEWER_BUILD );
	LLTextBox* channel_text = getChild<LLTextBox>("channel_text");
	channel_text->setTextArg("[CHANNEL]", channel); // though not displayed
	channel_text->setTextArg("[VERSION]", version);
	channel_text->setClickedCallback(onClickVersion);
	channel_text->setCallbackUserData(this);
	
	LLTextBox* forgot_password_text = getChild<LLTextBox>("forgot_password_text");
	forgot_password_text->setClickedCallback(onClickForgotPassword);

	LLTextBox* create_new_account_text = getChild<LLTextBox>("create_new_account_text");
	create_new_account_text->setClickedCallback(onClickNewAccount);
#endif    
	
	// get the web browser control
	LLMediaCtrl* web_browser = getChild<LLMediaCtrl>("login_html");
	web_browser->addObserver(this);

	// Need to handle login secondlife:///app/ URLs
	web_browser->setTrusted( true );

	// don't make it a tab stop until SL-27594 is fixed
	web_browser->setTabStop(FALSE);
	// web_browser->navigateToLocalPage( "loading", "loading.html" );

	// make links open in external browser
	web_browser->setOpenInExternalBrowser( true );

	// force the size to be correct (XML doesn't seem to be sufficient to do this) (with some padding so the other login screen doesn't show through)
	LLRect htmlRect = getRect();
#if USE_VIEWER_AUTH
	htmlRect.setCenterAndSize( getRect().getCenterX() - 2, getRect().getCenterY(), getRect().getWidth() + 6, getRect().getHeight());
#else
	htmlRect.setCenterAndSize( getRect().getCenterX() - 2, getRect().getCenterY() + 40, getRect().getWidth() + 6, getRect().getHeight() - 78 );
#endif
	web_browser->setRect( htmlRect );
	web_browser->reshape( htmlRect.getWidth(), htmlRect.getHeight(), TRUE );
	reshape( getRect().getWidth(), getRect().getHeight(), 1 );

	updateGridCombo();

	childSetVisible("create_new_account_text",
		!gHippoGridManager->getConnectedGrid()->getRegisterUrl().empty());
	childSetVisible("forgot_password_text",
		!gHippoGridManager->getConnectedGrid()->getPasswordUrl().empty());
		
	loadLoginPage();

#if !USE_VIEWER_AUTH
	// Initialize visibility (and don't force visibility - use prefs)
	refreshLocation( false );
#endif

}