コード例 #1
0
void LLFloaterChat::draw()
{
	// enable say and shout only when text available
		
	childSetValue("toggle_active_speakers_btn", childIsVisible("active_speakers_panel"));

	LLChatBar* chat_barp = getChild<LLChatBar>("chat_panel", TRUE);
	if (chat_barp)
	{
		chat_barp->refresh();
	}

	mPanel->refreshSpeakers();
	LLFloater::draw();
}
コード例 #2
0
// protected
void LLPanelDirBrowser::updateResultCount()
{
	LLScrollListCtrl* list = findChild<LLScrollListCtrl>("results");
	if (!list) return;

	S32 result_count = list->getItemCount();
	std::string result_text;

	if (!mHaveSearchResults) result_count = 0;

	if (childIsVisible("Next >")) 
	{
		// Item count be off by a few if bogus items sent from database
		// Just use the number of results per page. JC
		result_text = llformat(">%d found", mResultsPerPage);
	}
	else 
	{
		result_text = llformat("%d found", result_count);
	}
	
	childSetValue("result_text", result_text);
	
	if (result_count == 0)
	{
		// add none found response
		if (list->getItemCount() == 0)
		{
			list->setCommentText(LLTrans::getString("NoneFound"));
			list->operateOnAll(LLCtrlListInterface::OP_DESELECT);
		}
	}
	else
	{
		list->setEnabled(true);
	}
}
コード例 #3
0
ファイル: lloverlaybar.cpp プロジェクト: xinyaojiejie/Dale
// Per-frame updates of visibility
void LLOverlayBar::refresh()
{
	BOOL im_received = gIMView->getIMReceived();
	childSetVisible("IM Received", im_received);
	childSetEnabled("IM Received", im_received);

	BOOL busy = gAgent.getBusy();
	childSetVisible("Set Not Busy", busy);
	childSetEnabled("Set Not Busy", busy);

	BOOL controls_grabbed = gAgent.anyControlGrabbed();
	
	childSetVisible("Release Keys", controls_grabbed);
	childSetEnabled("Release Keys", controls_grabbed);


	BOOL mouselook_grabbed;
	mouselook_grabbed = gAgent.isControlGrabbed(CONTROL_ML_LBUTTON_DOWN_INDEX)
						|| gAgent.isControlGrabbed(CONTROL_ML_LBUTTON_UP_INDEX);

	
	childSetVisible("Mouselook", mouselook_grabbed);
	childSetEnabled("Mouselook", mouselook_grabbed);

	BOOL sitting = FALSE;
	if (gAgent.getAvatarObject())
	{
		sitting = gAgent.getAvatarObject()->mIsSitting;
		childSetVisible("Stand Up", sitting);
		childSetEnabled("Stand Up", sitting);
		
	}

	if ( gAudiop )
	{
		LLParcel* parcel = gParcelMgr->getAgentParcel();
		if (!parcel
			|| !parcel->getMusicURL()
			|| !parcel->getMusicURL()[0]
			|| !gSavedSettings.getBOOL("AudioStreamingMusic"))
		{
			mMusicRemote->setVisible(FALSE);
			mMusicRemote->setEnabled(FALSE);
		}
		else
		{
			mMusicRemote->setVisible(TRUE);
			mMusicRemote->setEnabled(TRUE);
		}
	}

	// if there is a url and a texture and media is enabled and available and media streaming is on... (phew!)
	if ( LLMediaEngine::getInstance () &&
		 LLMediaEngine::getInstance ()->getUrl ().length () && 
		 LLMediaEngine::getInstance ()->getImageUUID ().notNull () &&
		 LLMediaEngine::getInstance ()->isEnabled () &&
		 LLMediaEngine::getInstance ()->isAvailable () &&
		 gSavedSettings.getBOOL ( "AudioStreamingVideo" ) )
	{
		// display remote control 
		mMediaRemote->setVisible ( TRUE );
		mMediaRemote->setEnabled ( TRUE );

		if ( LLMediaEngine::getInstance ()->getMediaRenderer () )
		{
			if ( LLMediaEngine::getInstance ()->getMediaRenderer ()->isPlaying () ||
				LLMediaEngine::getInstance ()->getMediaRenderer ()->isLooping () )
			{
				mMediaRemote->setTransportState ( LLMediaRemoteCtrl::Pause, TRUE );
			}
			else
			if ( LLMediaEngine::getInstance ()->getMediaRenderer ()->isPaused () )
			{
				mMediaRemote->setTransportState ( LLMediaRemoteCtrl::Play, TRUE );
			}
			else
			{
				mMediaRemote->setTransportState ( LLMediaRemoteCtrl::Stop, TRUE );
			};
		};
	}
	else
	{
		mMediaRemote->setVisible ( FALSE );
		mMediaRemote->setEnabled ( FALSE );
		mMediaRemote->setTransportState ( LLMediaRemoteCtrl::Stop, TRUE );
	};

	BOOL any_button = (childIsVisible("IM Received")
					   || childIsVisible("Set Not Busy")
					   || childIsVisible("Release Keys")
					   || childIsVisible("Mouselook")
					   || childIsVisible("Stand Up")
					   || mMusicRemote->getVisible()
					   || mMediaRemote->getVisible() );		   
					   
	
	// turn off the whole bar in mouselook
	if (gAgent.cameraMouselook())
	{
		setVisible(FALSE);
	}
	else
	{
		setVisible(any_button);
	};
}
コード例 #4
0
void LLFloaterBuyCurrencyUI::updateUI()
{
	bool hasError = mManager.hasError();
	mManager.updateUI(!hasError && !mManager.buying());

	// section zero: title area
	{
		childSetVisible("info_buying", false);
		childSetVisible("info_cannot_buy", false);
		childSetVisible("info_need_more", false);
		if (hasError)
		{
			childSetVisible("info_cannot_buy", true);
		}
		else if (mHasTarget)
		{
			childSetVisible("info_need_more", true);
		}
		else
		{
			childSetVisible("info_buying", true);
		}
	}
	
	// error section
	if (hasError)
	{
		mChildren.setBadge(std::string("step_error"), LLViewChildren::BADGE_ERROR);
		
		LLTextBox* message = getChild<LLTextBox>("error_message");
		if (message)
		{
			message->setVisible(true);
			message->setWrappedText(mManager.errorMessage());
		}

		childSetVisible("error_web", !mManager.errorURI().empty());
		if (!mManager.errorURI().empty())
		{
			childHide("getting_data");
		}
	}
	else
	{
		childHide("step_error");
		childHide("error_message");
		childHide("error_web");
	}
	
	
	//  currency
	childSetVisible("contacting", false);
	childSetVisible("buy_action", false);
	childSetVisible("buy_action_unknown", false);
	
	if (!hasError)
	{
		mChildren.setBadge(std::string("step_1"), LLViewChildren::BADGE_NOTE);

		if (mManager.buying())
		{
			childSetVisible("contacting", true);
		}
		else
		{
			if (mHasTarget)
			{
				childSetVisible("buy_action", true);
				childSetTextArg("buy_action", "[NAME]", mTargetName);
				childSetTextArg("buy_action", "[PRICE]", llformat("%d",mTargetPrice));
			}
			else
			{
				childSetVisible("buy_action_unknown", true);
			}
		}
		
		S32 balance = gStatusBar->getBalance();
		childShow("balance_label");
		childShow("balance_amount");
		childSetTextArg("balance_amount", "[AMT]", llformat("%d", balance));
		
		S32 buying = mManager.getAmount();
		childShow("buying_label");
		childShow("buying_amount");
		childSetTextArg("buying_amount", "[AMT]", llformat("%d", buying));
		
		S32 total = balance + buying;
		childShow("total_label");
		childShow("total_amount");
		childSetTextArg("total_amount", "[AMT]", llformat("%d", total));

		childSetVisible("purchase_warning_repurchase", false);
		childSetVisible("purchase_warning_notenough", false);
		if (mHasTarget)
		{
			if (total >= mTargetPrice)
			{
				childSetVisible("purchase_warning_repurchase", true);
			}
			else
			{
				childSetVisible("purchase_warning_notenough", true);
			}
		}
	}
	else
	{
		childHide("step_1");
		childHide("balance_label");
		childHide("balance_amount");
		childHide("buying_label");
		childHide("buying_amount");
		childHide("total_label");
		childHide("total_amount");
		childHide("purchase_warning_repurchase");
		childHide("purchase_warning_notenough");
	}
	
	childSetEnabled("buy_btn", mManager.canBuy());

	if (!mManager.canBuy() && !childIsVisible("error_web"))
	{
		childShow("getting_data");
	}
}
コード例 #5
0
ファイル: llimpanel.cpp プロジェクト: HyangZhao/NaCl-main
// virtual
void LLFloaterIMPanel::draw()
{	
	LLViewerRegion* region = gAgent.getRegion();
	
	BOOL enable_connect = (region && region->getCapability("ChatSessionRequest") != "")
					  && mSessionInitialized
					  && LLVoiceClient::getInstance()->voiceEnabled()
					  && mCallBackEnabled;

	// hide/show start call and end call buttons
	LLVoiceChannel* voice_channel = LLIMModel::getInstance()->getVoiceChannel(mSessionUUID);
	if (!voice_channel)
		return;

	childSetVisible("end_call_btn", LLVoiceClient::getInstance()->voiceEnabled() && voice_channel->getState() >= LLVoiceChannel::STATE_CALL_STARTED);
	childSetVisible("start_call_btn", LLVoiceClient::getInstance()->voiceEnabled() && voice_channel->getState() < LLVoiceChannel::STATE_CALL_STARTED);
	childSetEnabled("start_call_btn", enable_connect);
	childSetEnabled("send_btn", !childGetValue("chat_editor").asString().empty());
	
	LLPointer<LLSpeaker> self_speaker;
	LLIMSpeakerMgr* speaker_mgr = LLIMModel::getInstance()->getSpeakerManager(mSessionUUID);
	if (speaker_mgr)
	{
		self_speaker = speaker_mgr->findSpeaker(gAgent.getID());
	}
	if(!mTextIMPossible)
	{
		mInputEditor->setEnabled(FALSE);
		mInputEditor->setLabel(getString("unavailable_text_label"));
	}
	else if (self_speaker.notNull() && self_speaker->mModeratorMutedText)
	{
		mInputEditor->setEnabled(FALSE);
		mInputEditor->setLabel(getString("muted_text_label"));
	}
	else
	{
		mInputEditor->setEnabled(TRUE);
		mInputEditor->setLabel(getString("default_text_label"));
	}

	// show speakers window when voice first connects
	if (mShowSpeakersOnConnect && voice_channel->isActive())
	{
		childSetVisible("active_speakers_panel", TRUE);
		mShowSpeakersOnConnect = FALSE;
	}
	childSetValue("toggle_active_speakers_btn", childIsVisible("active_speakers_panel"));

	if (mTyping)
	{
		// Time out if user hasn't typed for a while.
		if (mLastKeystrokeTimer.getElapsedTimeF32() > LLAgent::TYPING_TIMEOUT_SECS)
		{
			setTyping(FALSE);
		}

		// If we are typing, and it's been a little while, send the
		// typing indicator
		if (!mSentTypingState
			&& mFirstKeystrokeTimer.getElapsedTimeF32() > 1.f)
		{
			sendTypingState(TRUE);
			mSentTypingState = TRUE;
		}
	}

	// use embedded panel if available
	if (mSpeakerPanel)
	{
		if (mSpeakerPanel->getVisible())
		{
			mSpeakerPanel->refreshSpeakers();
		}
	}
	else
	{
		// refresh volume and mute checkbox
		childSetVisible("speaker_volume", LLVoiceClient::getInstance()->voiceEnabled() && voice_channel->isActive());
		childSetValue("speaker_volume", LLVoiceClient::getInstance()->getUserVolume(mOtherParticipantUUID));

		childSetValue("mute_btn", LLMuteList::getInstance()->isMuted(mOtherParticipantUUID, LLMute::flagVoiceChat));
		childSetVisible("mute_btn", LLVoiceClient::getInstance()->voiceEnabled() && voice_channel->isActive());
	}
	LLFloater::draw();
}