Anonymous avatar Anonymous committed 269fafd Merge

Merge with head

Comments (0)

Files changed (3)

indra/newview/llinspectavatar.cpp

 #include "llvoiceclient.h"
 #include "llviewerobjectlist.h"
 #include "lltransientfloatermgr.h"
+#include "llnotificationsutil.h"
 
 // Linden libraries
 #include "llfloater.h"
 	void onClickReport();
 	void onClickFreeze();
 	void onClickEject();
+	void onClickKick();
+	void onClickCSR();
 	void onClickZoomIn();  
 	void onClickFindOnMap();
 	bool onVisibleFindOnMap();
-	bool onVisibleFreezeEject();
+	bool onVisibleEject();
+	bool onVisibleFreeze();
 	bool onVisibleZoomIn();
 	void onClickMuteVolume();
 	void onVolumeChange(const LLSD& data);
 	bool enableMute();
 	bool enableUnmute();
 	bool enableTeleportOffer();
+	bool godModeEnabled();
 
 	// Is used to determine if "Add friend" option should be enabled in gear menu
 	bool isNotFriend();
 	mCommitCallbackRegistrar.add("InspectAvatar.Pay",	boost::bind(&LLInspectAvatar::onClickPay, this));	
 	mCommitCallbackRegistrar.add("InspectAvatar.Share",	boost::bind(&LLInspectAvatar::onClickShare, this));
 	mCommitCallbackRegistrar.add("InspectAvatar.ToggleMute",	boost::bind(&LLInspectAvatar::onToggleMute, this));	
-	mCommitCallbackRegistrar.add("InspectAvatar.Freeze",
-		boost::bind(&LLInspectAvatar::onClickFreeze, this));	
-	mCommitCallbackRegistrar.add("InspectAvatar.Eject",
-		boost::bind(&LLInspectAvatar::onClickEject, this));	
+	mCommitCallbackRegistrar.add("InspectAvatar.Freeze", boost::bind(&LLInspectAvatar::onClickFreeze, this));	
+	mCommitCallbackRegistrar.add("InspectAvatar.Eject", boost::bind(&LLInspectAvatar::onClickEject, this));	
+	mCommitCallbackRegistrar.add("InspectAvatar.Kick", boost::bind(&LLInspectAvatar::onClickKick, this));	
+	mCommitCallbackRegistrar.add("InspectAvatar.CSR", boost::bind(&LLInspectAvatar::onClickCSR, this));	
 	mCommitCallbackRegistrar.add("InspectAvatar.Report",	boost::bind(&LLInspectAvatar::onClickReport, this));	
 	mCommitCallbackRegistrar.add("InspectAvatar.FindOnMap",	boost::bind(&LLInspectAvatar::onClickFindOnMap, this));	
 	mCommitCallbackRegistrar.add("InspectAvatar.ZoomIn", boost::bind(&LLInspectAvatar::onClickZoomIn, this));
 	mCommitCallbackRegistrar.add("InspectAvatar.DisableVoice", boost::bind(&LLInspectAvatar::toggleSelectedVoice, this, false));
 	mCommitCallbackRegistrar.add("InspectAvatar.EnableVoice", boost::bind(&LLInspectAvatar::toggleSelectedVoice, this, true));
+
+	mEnableCallbackRegistrar.add("InspectAvatar.EnableGod",	boost::bind(&LLInspectAvatar::godModeEnabled, this));	
 	mEnableCallbackRegistrar.add("InspectAvatar.VisibleFindOnMap",	boost::bind(&LLInspectAvatar::onVisibleFindOnMap, this));	
-	mEnableCallbackRegistrar.add("InspectAvatar.VisibleFreezeEject",	
-		boost::bind(&LLInspectAvatar::onVisibleFreezeEject, this));	
-	mEnableCallbackRegistrar.add("InspectAvatar.VisibleZoomIn", 
-		boost::bind(&LLInspectAvatar::onVisibleZoomIn, this));
+	mEnableCallbackRegistrar.add("InspectAvatar.VisibleEject",	boost::bind(&LLInspectAvatar::onVisibleEject, this));	
+	mEnableCallbackRegistrar.add("InspectAvatar.VisibleFreeze",	boost::bind(&LLInspectAvatar::onVisibleFreeze, this));	
+	mEnableCallbackRegistrar.add("InspectAvatar.VisibleZoomIn", boost::bind(&LLInspectAvatar::onVisibleZoomIn, this));
 	mEnableCallbackRegistrar.add("InspectAvatar.Gear.Enable", boost::bind(&LLInspectAvatar::isNotFriend, this));
 	mEnableCallbackRegistrar.add("InspectAvatar.Gear.EnableCall", boost::bind(&LLAvatarActions::canCall));
 	mEnableCallbackRegistrar.add("InspectAvatar.Gear.EnableTeleportOffer", boost::bind(&LLInspectAvatar::enableTeleportOffer, this));
 	return gAgent.isGodlike() || is_agent_mappable(mAvatarID);
 }
 
-bool LLInspectAvatar::onVisibleFreezeEject()
+bool LLInspectAvatar::onVisibleEject()
 {
 	return enable_freeze_eject( LLSD(mAvatarID) );
 }
 
+bool LLInspectAvatar::onVisibleFreeze()
+{
+	// either user is a god and can do long distance freeze
+	// or check for target proximity and permissions
+	return gAgent.isGodlike() || enable_freeze_eject(LLSD(mAvatarID));
+}
+
 bool LLInspectAvatar::onVisibleZoomIn()
 {
 	return gObjectList.findObject(mAvatarID);
 	closeFloater();
 }
 
+bool godlike_freeze(const LLSD& notification, const LLSD& response)
+{
+	LLUUID avatar_id = notification["payload"]["avatar_id"].asUUID();
+	S32 option = LLNotificationsUtil::getSelectedOption(notification, response);
+
+	switch (option)
+	{
+	case 0:
+		LLAvatarActions::freeze(avatar_id);
+		break;
+	case 1:
+		LLAvatarActions::unfreeze(avatar_id);
+		break;
+	default:
+		break;
+	}
+
+	return false;
+}
+
 void LLInspectAvatar::onClickFreeze()
 {
-	handle_avatar_freeze( LLSD(mAvatarID) );
+	if (gAgent.isGodlike())
+	{
+		// use godlike freeze-at-a-distance, with confirmation
+		LLNotificationsUtil::add("FreezeAvatar",
+			LLSD(),
+			LLSD().with("avatar_id", mAvatarID),
+			godlike_freeze);
+	}
+	else
+	{
+		// use default "local" version of freezing that requires avatar to be in range
+		handle_avatar_freeze( LLSD(mAvatarID) );
+	}
 	closeFloater();
 }
 
 	closeFloater();
 }
 
+void LLInspectAvatar::onClickKick()
+{
+	LLAvatarActions::kick(mAvatarID);
+	closeFloater();
+}
+
+void LLInspectAvatar::onClickCSR()
+{
+	std::string name;
+	gCacheName->getFullName(mAvatarID, name);
+	LLAvatarActions::csr(mAvatarID, name);
+	closeFloater();
+}
+
 void LLInspectAvatar::onClickZoomIn() 
 {
 	handle_zoom_to_object(mAvatarID);
 	return LLAvatarActions::canOfferTeleport(mAvatarID);
 }
 
+bool LLInspectAvatar::godModeEnabled()
+{
+	return gAgent.isGodlike();
+}
+
 //////////////////////////////////////////////////////////////////////////////
 // LLInspectAvatarUtil
 //////////////////////////////////////////////////////////////////////////////

indra/newview/skins/default/xui/da/panel_people.xml

 <?xml version="1.0" encoding="utf-8" standalone="yes"?>
 <!-- Side tray panel -->
 <panel label="Personer" name="people_panel">
-	<string name="no_recent_people" value="Ingen tidligere personer. Leder du efter nogen at være sammen med? Prøv [secondlife:///app/search/people Search] eller [secondlife:///app/worldmap World Map]."/>
-	<string name="no_filtered_recent_people" value="Fandt du ikke det du søgte? Prøv [secondlife:///app/search/people/[SEARCH_TERM] Search]."/>
-	<string name="no_one_near" value="Ingen i nærheden. Leder du efter nogen at være sammen med? Prøv [secondlife:///app/search/people Search] eller [secondlife:///app/worldmap World Map]."/>
-	<string name="no_one_filtered_near" value="Fandt du ikke det du søgte? Prøv [secondlife:///app/search/people/[SEARCH_TERM] Search]."/>
+	<string name="no_recent_people" value="Ingen tidligere personer. Leder du efter nogen at være sammen med? Prøv [secondlife:///app/search/people Søg] eller [secondlife:///app/worldmap Verdenskort]."/>
+	<string name="no_filtered_recent_people" value="Fandt du ikke det du søgte? Prøv [secondlife:///app/search/people/[SEARCH_TERM] Søg]."/>
+	<string name="no_one_near" value="Ingen i nærheden. Leder du efter nogen at være sammen med? Prøv [secondlife:///app/search/people Søg] eller [secondlife:///app/worldmap Verdenskort]."/>
+	<string name="no_one_filtered_near" value="Fandt du ikke det du søgte? Prøv [secondlife:///app/search/people/[SEARCH_TERM] Søg]."/>
 	<string name="no_friends_online" value="Ingen venner online"/>
 	<string name="no_friends" value="Ingen venner"/>
 	<string name="no_friends_msg">
-		Find venner via [secondlife:///app/search/people Search] eller højre-klik på en beboer og tilføj dem som venner.
-Leder du efter nogen at være sammen med? Prøv [secondlife:///app/worldmap World Map].
+		Find venner via [secondlife:///app/search/people Søg] eller højre-klik på en beboer og tilføj dem som venner.
+Leder du efter nogen at være sammen med? Prøv [secondlife:///app/worldmap Verdenskort].
 	</string>
 	<string name="no_filtered_friends_msg">
-		Fandt du ikke det du søgte? Prøv [secondlife:///app/search/people/[SEARCH_TERM] Search].
+		Fandt du ikke det du søgte? Prøv [secondlife:///app/search/people/[SEARCH_TERM] Søg].
 	</string>
 	<string name="people_filter_label" value="Filtrér personer"/>
 	<string name="groups_filter_label" value="Filtrér grupper"/>
-	<string name="no_filtered_groups_msg" value="Fandt du ikke det du søgte? Prøv [secondlife:///app/search/groups/[SEARCH_TERM] Search]."/>
-	<string name="no_groups_msg" value="Leder du efter grupper at være med i? Prøv [secondlife:///app/search/groups Search]."/>
+	<string name="no_filtered_groups_msg" value="Fandt du ikke det du søgte? Prøv [secondlife:///app/search/groups/[SEARCH_TERM] Søg]."/>
+	<string name="no_groups_msg" value="Leder du efter grupper at være med i? Prøv [secondlife:///app/search/groups Søg]."/>
 	<filter_editor label="Filtrér" name="filter_input"/>
 	<tab_container name="tabs">
 		<panel label="TÆT PÅ" name="nearby_panel">

indra/newview/skins/default/xui/en/menu_inspect_avatar_gear.xml

     <menu_item_call.on_click
      function="InspectAvatar.Freeze"/>
     <menu_item_call.on_visible
-     function="InspectAvatar.VisibleFreezeEject"/>
+     function="InspectAvatar.VisibleFreeze"/>
   </menu_item_call>
   <menu_item_call
    label="Eject"
     <menu_item_call.on_click
      function="InspectAvatar.Eject"/>
     <menu_item_call.on_visible
-     function="InspectAvatar.VisibleFreezeEject"/>
+     function="InspectAvatar.VisibleEject"/>
+  </menu_item_call>
+  <menu_item_call
+   label="Kick"
+   name="kick">
+    <menu_item_call.on_click
+     function="InspectAvatar.Kick"/>
+    <menu_item_call.on_visible
+     function="InspectAvatar.EnableGod"/>
+  </menu_item_call>
+  <menu_item_call
+  label="CSR"
+  name="csr">
+    <menu_item_call.on_click
+     function="InspectAvatar.CSR" />
+    <menu_item_call.on_visible
+     function="InspectAvatar.EnableGod" />
   </menu_item_call>
   <menu_item_call
    label="Debug Textures"
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.