void wlfPanel_AdvSettings::build()
{
	deleteAllChildren();
	if (!gSavedSettings.getBOOL("wlfAdvSettingsPopup"))
	{
		LLUICtrlFactory::getInstance()->buildPanel(this, "wlfPanel_AdvSettings_expanded.xml", &getFactoryMap());
	}
	else
	{
		LLUICtrlFactory::getInstance()->buildPanel(this, "wlfPanel_AdvSettings.xml", &getFactoryMap());
	}
}
void LLMediaRemoteCtrl::build()
{
	//HACK: only works because we don't have any implicit children (i.e. titlebars, close button, etc)
	deleteAllChildren();
	if (gSavedSettings.getBOOL("ShowVolumeSettingsPopup"))
	{
		LLUICtrlFactory::getInstance()->buildPanel(this, "panel_media_remote_expanded.xml", &getFactoryMap());
	}
	else
	{
		LLUICtrlFactory::getInstance()->buildPanel(this, "panel_media_remote.xml", &getFactoryMap());
	}
}
LLPanelGroupInvite::LLPanelGroupInvite(const std::string& name,
									   const LLUUID& group_id)
	: LLPanel(name)
{
	mImplementation = new impl(group_id);
	mPendingUpdate = FALSE;
	mStoreSelected = LLUUID::null;

	std::string panel_def_file;

	// Pass on construction of this panel to the control factory.
	LLUICtrlFactory::getInstance()->buildPanel(this, "panel_group_invite.xml", &getFactoryMap());
}
//
// Member Functions
//
LLFloaterChat::LLFloaterChat(const LLSD& seed)
:	LLFloater(std::string("chat floater"), std::string("FloaterChatRect"), LLStringUtil::null, 
			  RESIZE_YES, 440, 100, DRAG_ON_TOP, MINIMIZE_NO, CLOSE_YES),
	mPanel(NULL)
{
	mFactoryMap["chat_panel"] = LLCallbackMap(createChatPanel, NULL);
	mFactoryMap["active_speakers_panel"] = LLCallbackMap(createSpeakersPanel, NULL);
	// do not automatically open singleton floaters (as result of getInstance())
	LLUICtrlFactory::getInstance()->buildFloater(this, "floater_chat_history.xml", &getFactoryMap(), /*no_open =*/false);

	LLTextEditor* history_editor_with_mute = getChild<LLTextEditor>("Chat History Editor with mute");
	getChild<LLUICtrl>("show mutes")->setCommitCallback(boost::bind(&LLFloaterChat::onClickToggleShowMute, this, _2, getChild<LLTextEditor>("Chat History Editor"), history_editor_with_mute));
	getChild<LLUICtrl>("chat_history_open")->setCommitCallback(boost::bind(show_log_browser, "chat", "chat"));
}
void LLPanelGroup::setGroupID(const LLUUID& group_id)
{
	LLGroupMgr::getInstance()->removeObserver(this);
	mID = group_id;
	LLGroupMgr::getInstance()->addObserver(this);
	//TODO:  this is really bad, we should add a method
	// where the panels can just update themselves
	// on a group id change.  Similar to update() but with a group
	// id change.

	// For now, rebuild panel
	//delete children and rebuild panel
	deleteAllChildren();
	LLUICtrlFactory::getInstance()->buildPanel(this, "panel_group.xml", &getFactoryMap());
}
//
// Member Functions
//
LLFloaterChat::LLFloaterChat(const LLSD& seed)
:	LLFloater(std::string("chat floater"), std::string("FloaterChatRect"), LLStringUtil::null, 
			  RESIZE_YES, 440, 100, DRAG_ON_TOP, MINIMIZE_NO, CLOSE_YES),
	mPanel(NULL)
{
	mFactoryMap["chat_panel"] = LLCallbackMap(createChatPanel, NULL);
	mFactoryMap["active_speakers_panel"] = LLCallbackMap(createSpeakersPanel, NULL);
	// do not automatically open singleton floaters (as result of getInstance())
	BOOL no_open = FALSE;
	LLUICtrlFactory::getInstance()->buildFloater(this,"floater_chat_history.xml",&getFactoryMap(),no_open);

	childSetCommitCallback("show mutes",onClickToggleShowMute,this); //show mutes
	childSetVisible("Chat History Editor with mute",FALSE);
	childSetAction("toggle_active_speakers_btn", onClickToggleActiveSpeakers, this);
	setDefaultBtn("Chat");
}
LLFloaterMarketplaceListings::LLFloaterMarketplaceListings(const LLSD& key)
: LLFloater(key)
, mCategoriesObserver(NULL)
, mCategoryAddedObserver(NULL)
, mRootFolderId(LLUUID::null)
, mInventoryStatus(NULL)
, mInventoryInitializationInProgress(NULL)
, mInventoryPlaceholder(NULL)
, mInventoryText(NULL)
, mInventoryTitle(NULL)
, mPanelListings(NULL)
, mPanelListingsSet(false)
{
	//buildFromFile("floater_marketplace_listings.xml");
	mFactoryMap["panel_marketplace_listing"] = LLCallbackMap([&](void*) { return mPanelListings = new LLPanelMarketplaceListings; });
	LLUICtrlFactory::instance().buildFloater(this, "floater_marketplace_listings.xml", &getFactoryMap());
}
Beispiel #8
0
LLFloaterAudioVolume::LLFloaterAudioVolume(const LLSD& seed)
{
	mFactoryMap["Volume Panel"]	= LLCallbackMap(createVolumePanel, NULL);
	gUICtrlFactory->buildFloater(this, "floater_audio_volume.xml", &getFactoryMap());

	S32 pos_x = mRect.mLeft;
	S32 pos_y = mRect.mBottom;
	LLView* volume_panel_view = gOverlayBar->getChildByName("master_volume");
	if (volume_panel_view)
	{
		pos_x = volume_panel_view->getRect().mLeft;
		pos_y = volume_panel_view->getRect().mTop;
	}

	setOrigin(pos_x, pos_y);
	gFloaterView->adjustToFitScreen(this, FALSE);
	gSavedSettings.setBOOL("ShowAudioVolume", TRUE);
}
LLFloaterURLDisplay::LLFloaterURLDisplay(const LLSD& sd)
{	
	mFactoryMap["place_details_panel"] = LLCallbackMap(LLFloaterURLDisplay::createPlaceDetail, this);
	LLUICtrlFactory::getInstance()->buildFloater(this, "floater_preview_url.xml", &getFactoryMap());
	this->setVisible(false);

	// If positioned at 0,0 the teleport button is behind the toolbar.
	LLRect r = getRect();
	if (r.mBottom == 0 && r.mLeft == 0)
	{
		// first use, center it
		center();
	}
	else
	{
		gFloaterView->adjustToFitScreen(this, FALSE);
	}
}
Beispiel #10
0
LLPanelGroup::LLPanelGroup(const std::string& filename,
						   const std::string& name,
						   const LLUUID& group_id,
						   const std::string& initial_tab_selected)
:	LLPanel(name, LLRect(), FALSE),
	LLGroupMgrObserver( group_id ),
	mCurrentTab( NULL ),
	mRequestedTab( NULL ),
	mTabContainer( NULL ),
	mIgnoreTransition( FALSE ),
	mForceClose( FALSE ),
	mInitialTab(initial_tab_selected),
	mAllowEdit( TRUE ),
	mShowingNotifyDialog( FALSE )
{
	// Set up the factory callbacks.
	mFactoryMap["general_tab"]	= LLCallbackMap(LLPanelGroupGeneral::createTab,
												&mID);
	mFactoryMap["roles_tab"]	= LLCallbackMap(LLPanelGroupRoles::createTab,
												&mID);
	mFactoryMap["notices_tab"]	= LLCallbackMap(LLPanelGroupNotices::createTab,
												&mID);
	mFactoryMap["voting_tab"]	= LLCallbackMap(LLPanelGroupVoting::createTab,
												&mID);
	mFactoryMap["land_money_tab"]= LLCallbackMap(LLPanelGroupLandMoney::createTab,
												 &mID);
	// Roles sub tabs
	mFactoryMap["members_sub_tab"] = LLCallbackMap(LLPanelGroupMembersSubTab::createTab, &mID);
	mFactoryMap["roles_sub_tab"] = LLCallbackMap(LLPanelGroupRolesSubTab::createTab, &mID);
	mFactoryMap["actions_sub_tab"] = LLCallbackMap(LLPanelGroupActionsSubTab::createTab, &mID);

	LLGroupMgr::getInstance()->addObserver(this);

	// Pass on construction of this panel to the control factory.
	LLUICtrlFactory::getInstance()->buildPanel(this, filename, &getFactoryMap());
	mFilename = filename;
}
void wlfPanel_AdvSettings::build()
{
	mConnections.clear();
	deleteAllChildren();
	mExpanded = gSavedSettings.getBOOL("wlfAdvSettingsPopup");
	if (mRegionChangedSlot.connected()) mRegionChangedSlot.disconnect();
	LLUICtrlFactory::instance().buildPanel(this, mExpanded ? "wlfPanel_AdvSettings_expanded.xml" : "wlfPanel_AdvSettings.xml", &getFactoryMap());
}
LLFloaterMyFriends::LLFloaterMyFriends(const LLSD& seed)
{
	mFactoryMap["friends_panel"] = LLCallbackMap(LLFloaterMyFriends::createFriendsPanel, NULL);
	mFactoryMap["groups_panel"] = LLCallbackMap(LLFloaterMyFriends::createGroupsPanel, NULL);
	// do not automatically open singleton floaters (as result of getInstance())
	BOOL no_open = FALSE;
	static LLCachedControl<bool> horiz("ContactsUseHorizontalButtons");
	LLUICtrlFactory::getInstance()->buildFloater(this, (horiz ? "floater_my_friends_horiz.xml" : "floater_my_friends.xml"), &getFactoryMap(), no_open);
}
LLPanelAudioPrefs::LLPanelAudioPrefs()
{
	mFactoryMap["Volume Panel"]	= LLCallbackMap(createVolumePanel, NULL);
	
	LLUICtrlFactory::getInstance()->buildPanel(this, "panel_preferences_audio.xml", &getFactoryMap());
}
LLPreviewLandmark::LLPreviewLandmark(const std::string& name,
									 const LLRect& rect,
									 const std::string& title,
									 const LLUUID& item_uuid,
									 BOOL show_keep_discard,
									 LLViewerInventoryItem* inv_item)
:	LLPreview(name,
			  LLRect(rect.mLeft, 
					rect.mTop, 
					(show_keep_discard ? rect.mRight+70 : rect.mRight), 
					rect.mBottom), 
			  title, 
			  item_uuid, 
			  LLUUID::null, // object id
			  FALSE,  // allow resize
			  0, 0, // min dimensions
			  inv_item),
	mLandmark( NULL )
{
	
	mFactoryMap["place_details_panel"] = LLCallbackMap(LLPreviewLandmark::createPlaceDetail, this);
	if (show_keep_discard)
	{
		LLUICtrlFactory::getInstance()->buildFloater(this, "floater_preview_new_landmark.xml", &getFactoryMap());
		childSetAction("Discard btn",onDiscardBtn,this);
	}
	else
	{
		LLUICtrlFactory::getInstance()->buildFloater(this, "floater_preview_existing_landmark.xml", &getFactoryMap());
	}

	/*
	childSetCommitCallback("desc_editor", LLPreview::onText, this);
	childSetText("desc_editor", item->getDescription());
	childSetText("name_editor", item->getName());
	childSetPrevalidate("desc_editor", &LLLineEditor::prevalidatePrintableNotPipe);

	setTitle(title);
	
	if (!getHost())
	{
		LLRect curRect = getRect();
		translate(rect.mLeft - curRect.mLeft, rect.mTop - curRect.mTop);
	}
	*/
	LLPreviewLandmark::sOrderedInstances.push_back( this );
}
Beispiel #15
0
void catchAndThrow() {

    JNIEnv* env = attach();

    if ( ! env->ExceptionCheck() ) {
        return;
    }

    jthrowable jexception = env->ExceptionOccurred();
    env->ExceptionClear();

    /* Find the fully qualified name for the exception type, so
     * we can find a matching C++ proxy exception.
     *
     * In java, this looks like:
     *   String typeName = exception.getClass().getName();
     */
    jclass throwableClass = env->FindClass( "java/lang/Throwable" );

    if ( ! throwableClass ) {
        string msg = "Assert failed: Unable to find the class, java.lang.Throwable.";
        throw JNIException( msg );
    }

    jclass classClass = env->FindClass( "java/lang/Class" );
    if ( ! classClass ) {
        string msg = "Assert failed: Unable to find the class, java.lang.Class.";
        throw JNIException( msg );
    }

    jmethodID throwableGetClass = env->GetMethodID( throwableClass, "getClass", "()Ljava/lang/Class;" );
    if ( ! throwableGetClass ) {
        string msg = "Assert failed: Unable to find the method, Throwable.getClass().";
        throw JNIException( msg );
    }
    deleteLocalRef( env, throwableClass );

    jmethodID classGetName = env->GetMethodID( classClass, "getName", "()Ljava/lang/String;" );
    if ( ! classGetName ) {
        string msg = "Assert failed: Unable to find the method, Class.getName().";
        throw JNIException( msg );
    }

    jmethodID classGetSuperclass = env->GetMethodID( classClass, "getSuperclass", "()Ljava/lang/Class;" );
    if ( ! classGetSuperclass ) {
        string msg = "Assert failed: Unable to find the method, Class.getSuperclass().";
        throw JNIException( msg );
    }
    deleteLocalRef( env, classClass );

    jobject exceptionClass = env->CallObjectMethod( jexception, throwableGetClass );
    if ( env->ExceptionOccurred() ) {
        env->ExceptionDescribe();
        string msg = "helper::catchAndThrow()\n" \
                "An error occurred while trying to call getClass() on the thrown exception.";
        throw JNIException( msg );
    }

    jstring exceptionType = static_cast<jstring>( env->CallObjectMethod( exceptionClass, classGetName ) );
    if ( env->ExceptionOccurred() ) {
        env->ExceptionDescribe();
        string msg = "helper::catchAndThrow()\n" \
                "An error occurred while trying to call getName() on the class of the thrown exception.";
        throw JNIException( msg );
    }

    string exceptionTypeString = asString( env, exceptionType );

    /* Now, find the matching factory for this exception type.
     */
    while ( true ) {

        FactoryMap::iterator it = getFactoryMap()->find( exceptionTypeString );

        /* If we couldn't find a match, try to find the parent exception type.
         */
        if ( it == getFactoryMap()->end() ) {

            jobject superClass = env->CallObjectMethod( exceptionClass, classGetSuperclass );

            if ( env->ExceptionOccurred() ) {
                env->ExceptionDescribe();
                string msg = "helper::catchAndThrow()\n" \
                        "An error occurred while trying to call getSuperclass() on the thrown exception.";
                throw JNIException( msg );
            }

            /* We get NULL if we've already reached java.lang.Object, in which case,
             * we couldn't find any match at all.
             */
            if ( ! superClass ) {
                break;
            }

            deleteLocalRef( env, exceptionClass );
            deleteLocalRef( env, exceptionType );
            exceptionClass = superClass;

            exceptionType = static_cast<jstring>( env->CallObjectMethod( exceptionClass, classGetName ) );

            if ( env->ExceptionOccurred() ) {
                env->ExceptionDescribe();
                string msg = "helper::catchAndThrow()\n" \
                        "An error occurred while trying to call getName() on the superclass " \
                        "of the thrown exception.";
                throw JNIException( msg );
            }

            exceptionTypeString = asString( env, exceptionType );
            if ( exceptionTypeString == "java.lang.Object" ) {
                /*
                 * Couldn't find a matching exception. Abort!
                 */
                break;
            }
            continue;
        }

        /* Ask the factory to throw the exception.
         */
        jvalue value;
        value.l = jexception;
        it->second->throwInstance( value );
    }

    exceptionClass = env->CallObjectMethod( jexception, throwableGetClass );

    if ( env->ExceptionOccurred() ) {
        env->ExceptionDescribe();
        string msg = "helper::catchAndThrow()\n" \
                "An error occurred while trying to call getClass() on the thrown exception.";
        throw JNIException( msg );
    }

    exceptionType = static_cast<jstring>( env->CallObjectMethod( exceptionClass, classGetName ) );

    if ( env->ExceptionOccurred() ) {
        env->ExceptionDescribe();
        string msg = "helper::catchAndThrow()\n" \
                "An error occurred while trying to call getName() on the class of the thrown exception.";
        throw JNIException( msg );
    }

    // Fallback: throw a JNIException with the type name and message of the Throwable.

    exceptionTypeString = asString( env, exceptionType );
    jmethodID getMessage = env->GetMethodID(static_cast<jclass>(exceptionClass), "getMessage", "()Ljava/lang/String;");
    if ( !getMessage) {
        throw JNIException("Could not find Throwable.getMessage() method");
    }

    jstring jmessage = static_cast<jstring>( env->CallObjectMethod(jexception, getMessage));
    if ( !jmessage) {
        // No message specified (or some error in the JVM), so just print the Exception type.
        throw JNIException(string("Exception occurred in JVM: ") + exceptionTypeString);
    }
    const char *msg = env->GetStringUTFChars(jmessage, NULL);
    throw JNIException( exceptionTypeString + ": " + msg );
}
Beispiel #16
0
void enlist( JFactory* factory ) {
    string name = factory->getClass()->getName();
    replace( name.begin(), name.end(), '/', '.' );
    getFactoryMap()->insert( FactoryMap::value_type( name, factory ) );
}
LLFloaterClassifiedInfo::LLFloaterClassifiedInfo(const std::string& name, const LLUUID &id)
:	LLFloater(name),
mClassifiedID( id )
{
	mFactoryMap["classified_details_panel"] = LLCallbackMap(LLFloaterClassifiedInfo::createClassifiedDetail, this);
	LLUICtrlFactory::getInstance()->buildFloater(this, "floater_preview_classified.xml", &getFactoryMap());
	gClassifiedInfoInstances.addData(id, this);
}
LLFloaterActiveSpeakers::LLFloaterActiveSpeakers(const LLSD& seed) : mPanel(NULL)
{
    mFactoryMap["active_speakers_panel"] = LLCallbackMap(createSpeakersPanel, NULL);
    // do not automatically open singleton floaters (as result of getInstance())
    BOOL no_open = FALSE;
    LLUICtrlFactory::getInstance()->buildFloater(this, "floater_active_speakers.xml", &getFactoryMap(), no_open);
    //RN: for now, we poll voice client every frame to get voice amplitude feedback
    //gVoiceClient->addObserver(this);
    mPanel->refreshSpeakers();
}
Beispiel #19
0
//
// LLFloaterIMPanel
//
LLFloaterIMPanel::LLFloaterIMPanel(
	const std::string& log_label,
	const LLUUID& session_id,
	const LLUUID& other_participant_id,
	const EInstantMessage& dialog,
	const LLDynamicArray<LLUUID>& ids) :
	LLFloater(log_label, LLRect(), log_label),
	mStartCallOnInitialize(false),
	mInputEditor(NULL),
	mHistoryEditor(NULL),
	mSessionInitialized(false),
	mSessionStartMsgPos(0),
	mSessionType(P2P_SESSION),
	mSessionUUID(session_id),
	mLogLabel(log_label),
	mQueuedMsgsForInit(),
	mOtherParticipantUUID(other_participant_id),
	mDialog(dialog),
	mTyping(false),
	mTypingLineStartIndex(0),
	mOtherTyping(false),
	mOtherTypingName(),
	mNumUnreadMessages(0),
	mSentTypingState(true),
	mShowSpeakersOnConnect(true),
	mDing(false),
	mRPMode(false),
	mTextIMPossible(true),
	mCallBackEnabled(true),
	mSpeakers(NULL),
	mSpeakerPanel(NULL),
	mVoiceChannel(NULL),
	mFirstKeystrokeTimer(),
	mLastKeystrokeTimer()
{
	if (mOtherParticipantUUID.isNull())
	{
		llwarns << "Other participant is NULL" << llendl;
	}

	// set P2P type by default
	static LLCachedControl<bool> concise_im("UseConciseIMButtons");
	std::string xml_filename = concise_im ? "floater_instant_message_concisebuttons.xml" : "floater_instant_message.xml";


	switch(mDialog)
	{
	case IM_SESSION_GROUP_START:
	case IM_SESSION_INVITE:
	case IM_SESSION_CONFERENCE_START:
		mCommitCallbackRegistrar.add("FlipDing", boost::bind<void>(boost::lambda::_1 = !boost::lambda::_1, boost::ref(mDing)));
		// determine whether it is group or conference session
		if (gAgent.isInGroup(mSessionUUID))
		{
			static LLCachedControl<bool> concise("UseConciseGroupChatButtons");
			xml_filename = concise ? "floater_instant_message_group_concisebuttons.xml" : "floater_instant_message_group.xml";
			mSessionType = GROUP_SESSION;
		}
		else
		{
			static LLCachedControl<bool> concise("UseConciseConferenceButtons");
			xml_filename = concise ? "floater_instant_message_ad_hoc_concisebuttons.xml" : "floater_instant_message_ad_hoc.xml";
			mSessionType = ADHOC_SESSION;
		}
		mFactoryMap["active_speakers_panel"] = LLCallbackMap(createSpeakersPanel, this);
		mVoiceChannel = new LLVoiceChannelGroup(mSessionUUID, mLogLabel);
		break;
	// just received text from another user
	case IM_NOTHING_SPECIAL:
		mTextIMPossible = LLVoiceClient::getInstance()->isSessionTextIMPossible(mSessionUUID);
		mCallBackEnabled = LLVoiceClient::getInstance()->isSessionCallBackPossible(mSessionUUID);
		// fallthrough
	case IM_SESSION_P2P_INVITE:
		mVoiceChannel = new LLVoiceChannelP2P(mSessionUUID, mLogLabel, mOtherParticipantUUID);
		LLAvatarTracker::instance().addParticularFriendObserver(mOtherParticipantUUID, this);
		break;
	default:
		llwarns << "Unknown session type" << llendl;
		break;
	}

	mSpeakers = new LLIMSpeakerMgr(mVoiceChannel);

	LLUICtrlFactory::getInstance()->buildFloater(this,
								xml_filename,
								&getFactoryMap(),
								FALSE);

	// enable line history support for instant message bar
	mInputEditor->setEnableLineHistory(TRUE);

	if ( gSavedPerAccountSettings.getBOOL("LogShowHistory") )
	{
		LLLogChat::loadHistory(mLogLabel,
				       &chatFromLogFile,
				       (void *)this);
	}

	if ( !mSessionInitialized )
	{
		if ( !send_start_session_messages(
				 mSessionUUID,
				 mOtherParticipantUUID,
				 ids,
				 mDialog) )
		{
			//we don't need to need to wait for any responses
			//so we're already initialized
			mSessionInitialized = true;
		}
		else
		{
			//locally echo a little "starting session" message
			LLUIString session_start = sSessionStartString;

			session_start.setArg("[NAME]", getTitle());
			mSessionStartMsgPos = mHistoryEditor->getWText().length();

			addHistoryLine(
				session_start,
				gSavedSettings.getColor4("SystemChatColor"),
				false);
		}
	}
}