summaryrefslogtreecommitdiff
path: root/indra/newview
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview')
-rw-r--r--indra/newview/llpanelprofile.cpp145
-rw-r--r--indra/newview/llpanelprofile.h5
-rw-r--r--indra/newview/skins/default/xui/en/menu_name_field.xml22
-rw-r--r--indra/newview/skins/default/xui/en/menu_profile_other.xml129
-rw-r--r--indra/newview/skins/default/xui/en/panel_profile_secondlife.xml57
5 files changed, 274 insertions, 84 deletions
diff --git a/indra/newview/llpanelprofile.cpp b/indra/newview/llpanelprofile.cpp
index 5453c87013..adf5036498 100644
--- a/indra/newview/llpanelprofile.cpp
+++ b/indra/newview/llpanelprofile.cpp
@@ -61,6 +61,7 @@
#include "llfilepicker.h"
#include "llfirstuse.h"
#include "llgroupactions.h"
+#include "lllogchat.h"
#include "llmutelist.h"
#include "llnotificationsutil.h"
#include "llpanelblockedlist.h"
@@ -148,7 +149,6 @@ void request_avatar_properties_coro(std::string cap_url, LLUUID agent_id)
avatar_data->image_id = result["sl_image_id"].asUUID();
avatar_data->fl_image_id = result["fl_image_id"].asUUID();
avatar_data->partner_id = result["partner_id"].asUUID();
- // Todo: new descriptio size is 65536, check if it actually fits or has scroll
avatar_data->about_text = result["sl_about_text"].asString();
// Todo: new descriptio size is 65536, check if it actually fits or has scroll
avatar_data->fl_about_text = result["fl_about_text"].asString();
@@ -250,6 +250,7 @@ void request_avatar_properties_coro(std::string cap_url, LLUUID agent_id)
avatar_notes.agent_id = agent_id;
avatar_notes.target_id = agent_id;
+ // Todo: new notes size is 65536, check that field has a scroll
avatar_notes.notes = result["notes"].asString();
panel = floater_profile->findChild<LLPanel>(PANEL_NOTES, TRUE);
@@ -594,16 +595,11 @@ BOOL LLPanelProfileSecondLife::postBuild()
mSecondLifePicLayout = getChild<LLPanel>("image_stack");
mDescriptionEdit = getChild<LLTextBase>("sl_description_edit");
mGiveInvPanel = getChild<LLPanel>("give_stack");
-
- LLUICtrl::EnableCallbackRegistry::ScopedRegistrar enable;
- enable.add("Profile.EnableCall", [this](LLUICtrl*, const LLSD&) { return mVoiceStatus; });
- enable.add("Profile.EnableGod", [](LLUICtrl*, const LLSD&) { return gAgent.isGodlike(); });
+ mAgentActionMenuButton = getChild<LLMenuButton>("agent_actions_menu");
mGroupList->setDoubleClickCallback(boost::bind(&LLPanelProfileSecondLife::openGroupProfile, this));
mGroupList->setReturnCallback(boost::bind(&LLPanelProfileSecondLife::openGroupProfile, this));
- //mAgentActionMenuButton->setMenu("menu_name_field.xml", LLMenuButton::MP_BOTTOM_RIGHT);
-
return TRUE;
}
@@ -623,6 +619,7 @@ void LLPanelProfileSecondLife::onOpen(const LLSD& key)
childSetVisible("notes_panel", !own_profile);
childSetVisible("settings_panel", own_profile);
+ childSetVisible("permissions_panel", !own_profile);
if (own_profile && !getEmbedded())
{
@@ -631,8 +628,23 @@ void LLPanelProfileSecondLife::onOpen(const LLSD& key)
mGroupList->enableForAgent(false);
}
+ // Init menu, menu needs to be created in scope of a registar to work correctly.
+ LLUICtrl::CommitCallbackRegistry::ScopedRegistrar commit;
+ commit.add("Profile.Commit", [this](LLUICtrl*, const LLSD& userdata) { onCommitMenu(userdata); });
+
+ LLUICtrl::EnableCallbackRegistry::ScopedRegistrar enable;
+ enable.add("Profile.EnableItem", [this](LLUICtrl*, const LLSD& userdata) { return onEnableMenu(userdata); });
+ enable.add("Profile.CheckItem", [this](LLUICtrl*, const LLSD& userdata) { return onCheckMenu(userdata); });
+
if (own_profile)
{
+ //mAgentActionMenuButton->setMenu("menu_profile_self.xml", LLMenuButton::MP_BOTTOM_RIGHT);
+ }
+ else
+ {
+ // Todo: use PeopleContextMenu instead?
+ // Todo: add options to copy name, display name, id, may be slurl
+ mAgentActionMenuButton->setMenu("menu_profile_other.xml", LLMenuButton::MP_BOTTOM_RIGHT);
}
mDescriptionEdit->setParseHTML(!own_profile && !getEmbedded());
@@ -817,8 +829,9 @@ void LLPanelProfileSecondLife::openGroupProfile()
void LLPanelProfileSecondLife::onAvatarNameCache(const LLUUID& agent_id, const LLAvatarName& av_name)
{
mAvatarNameCacheConnection.disconnect();
-
- //getChild<LLUICtrl>("complete_name")->setValue( av_name.getCompleteName() );
+ // Should be possible to get this from AgentProfile capability
+ getChild<LLUICtrl>("display_name")->setValue( av_name.getDisplayName() );
+ getChild<LLUICtrl>("user_name")->setValue(av_name.getUserName() );
}
void LLPanelProfileSecondLife::setUploadProfileImagePath(const std::string &path, const std::string &orig_path)
@@ -861,7 +874,7 @@ void LLPanelProfileSecondLife::fillCommonData(const LLAvatarData* avatar_data)
LLStringUtil::format_map_t args;
args["[AGE]"] = LLDateUtil::ageFromDate( avatar_data->born_on, LLDate::now());
std::string register_date = getString("AgeFormat", args);
- getChild<LLUICtrl>("register_date")->setValue(register_date );
+ getChild<LLUICtrl>("user_age")->setValue(register_date );
mDescriptionEdit->setValue(avatar_data->about_text);
mImageAssetId = avatar_data->image_id;
mSecondLifePic->setValue(mImageAssetId);
@@ -891,14 +904,17 @@ void LLPanelProfileSecondLife::fillCommonData(const LLAvatarData* avatar_data)
void LLPanelProfileSecondLife::fillPartnerData(const LLAvatarData* avatar_data)
{
- LLTextEditor* partner_text = getChild<LLTextEditor>("partner_text");
+ LLTextBox* partner_text_ctrl = getChild<LLTextBox>("partner_link");
if (avatar_data->partner_id.notNull())
{
- partner_text->setText(LLSLURL("agent", avatar_data->partner_id, "inspect").getSLURLString());
+ LLStringUtil::format_map_t args;
+ args["[LINK]"] = LLSLURL("agent", avatar_data->partner_id, "inspect").getSLURLString();
+ std::string partner_text = getString("partner_text", args);
+ partner_text_ctrl->setText(partner_text);
}
else
{
- partner_text->setText(getString("no_partner_text"));
+ partner_text_ctrl->setText(getString("no_partner_text"));
}
}
@@ -1101,29 +1117,106 @@ void LLPanelProfileSecondLife::onPickTexture()
void LLPanelProfileSecondLife::onCommitMenu(const LLSD& userdata)
{
- LLAvatarName av_name;
- if (!LLAvatarNameCache::get(getAvatarId(), &av_name))
+ const std::string item_name = userdata.asString();
+ const LLUUID agent_id = getAvatarId();
+ // todo: consider moving this into LLAvatarActions::onCommit(name, id)
+ // and making all other flaoters, like people menu do the same
+ if (item_name == "im")
{
- // shouldn't happen, button(menu) is supposed to be invisible while name is fetching
- LL_WARNS() << "Failed to get agent data" << LL_ENDL;
- return;
+ LLAvatarActions::startIM(agent_id);
+ }
+ else if (item_name == "offer_teleport")
+ {
+ LLAvatarActions::offerTeleport(agent_id);
+ }
+ else if (item_name == "request_teleport")
+ {
+ LLAvatarActions::teleportRequest(agent_id);
+ }
+ else if (item_name == "voice_call")
+ {
+ LLAvatarActions::startCall(agent_id);
+ }
+ else if (item_name == "callog")
+ {
+ LLAvatarActions::viewChatHistory(agent_id);
+ }
+ else if (item_name == "add_friend")
+ {
+ LLAvatarActions::requestFriendshipDialog(agent_id);
+ }
+ else if (item_name == "remove_friend")
+ {
+ LLAvatarActions::removeFriendDialog(agent_id);
+ }
+ else if (item_name == "invite_to_group")
+ {
+ LLAvatarActions::inviteToGroup(agent_id);
+ }
+ else if (item_name == "can_show_on_map")
+ {
+ LLAvatarActions::showOnMap(agent_id);
+ }
+ else if (item_name == "share")
+ {
+ LLAvatarActions::share(agent_id);
+ }
+ else if (item_name == "pay")
+ {
+ LLAvatarActions::pay(agent_id);
}
+ else if (item_name == "toggle_block_agent")
+ {
+ LLAvatarActions::toggleBlock(agent_id);
+ }
+}
+bool LLPanelProfileSecondLife::onEnableMenu(const LLSD& userdata)
+{
const std::string item_name = userdata.asString();
- LLWString wstr;
- if (item_name == "display")
+ const LLUUID agent_id = getAvatarId();
+ if (item_name == "offer_teleport" || item_name == "request_teleport")
+ {
+ return LLAvatarActions::canOfferTeleport(agent_id);
+ }
+ else if (item_name == "voice_call")
{
- wstr = utf8str_to_wstring(av_name.getDisplayName(true));
+ return LLAvatarActions::canCall();
}
- else if (item_name == "name")
+ else if (item_name == "callog")
{
- wstr = utf8str_to_wstring(av_name.getAccountName());
+ return LLLogChat::isTranscriptExist(agent_id);
}
- else if (item_name == "id")
+ else if (item_name == "add_friend")
+ {
+ return !LLAvatarActions::isFriend(agent_id);
+ }
+ else if (item_name == "remove_friend")
+ {
+ return LLAvatarActions::isFriend(agent_id);
+ }
+ else if (item_name == "can_show_on_map")
+ {
+ return (LLAvatarTracker::instance().isBuddyOnline(agent_id) && is_agent_mappable(agent_id))
+ || gAgent.isGodlike();
+ }
+ else if (item_name == "toggle_block_agent")
+ {
+ return LLAvatarActions::canBlock(agent_id);
+ }
+
+ return false;
+}
+
+bool LLPanelProfileSecondLife::onCheckMenu(const LLSD& userdata)
+{
+ const std::string item_name = userdata.asString();
+ const LLUUID agent_id = getAvatarId();
+ if (item_name == "toggle_block_agent")
{
- wstr = utf8str_to_wstring(getAvatarId().asString());
+ return LLAvatarActions::isBlocked(agent_id);
}
- LLClipboard::instance().copyToClipboard(wstr, 0, wstr.size());
+ return false;
}
void LLPanelProfileSecondLife::onAvatarNameCacheSetName(const LLUUID& agent_id, const LLAvatarName& av_name)
diff --git a/indra/newview/llpanelprofile.h b/indra/newview/llpanelprofile.h
index c73973b812..f695167a89 100644
--- a/indra/newview/llpanelprofile.h
+++ b/indra/newview/llpanelprofile.h
@@ -164,7 +164,9 @@ private:
/*virtual*/ void updateButtons();
void onClickSetName();
void onPickTexture();
- void onCommitMenu(const LLSD& userdata);
+ void onCommitMenu(const LLSD& userdata);
+ bool onEnableMenu(const LLSD& userdata);
+ bool onCheckMenu(const LLSD& userdata);
void onAvatarNameCacheSetName(const LLUUID& id, const LLAvatarName& av_name);
private:
@@ -178,6 +180,7 @@ private:
LLPanel* mSecondLifePicLayout;
LLTextBase* mDescriptionEdit;
LLPanel* mGiveInvPanel;
+ LLMenuButton* mAgentActionMenuButton;
bool mVoiceStatus;
std::string mImageFile;
diff --git a/indra/newview/skins/default/xui/en/menu_name_field.xml b/indra/newview/skins/default/xui/en/menu_name_field.xml
deleted file mode 100644
index 3c5e5dd353..0000000000
--- a/indra/newview/skins/default/xui/en/menu_name_field.xml
+++ /dev/null
@@ -1,22 +0,0 @@
-<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
-<toggleable_menu
- name="CopyMenu">
- <menu_item_call
- label="Copy Display Name"
- layout="topleft"
- name="copy_display">
- <on_click function="Profile.CopyName" parameter="display"/>
- </menu_item_call>
- <menu_item_call
- label="Copy Agent Name"
- layout="topleft"
- name="copy_name">
- <on_click function="Profile.CopyName" parameter="name"/>
- </menu_item_call>
- <menu_item_call
- label="Copy Agent Id"
- layout="topleft"
- name="copy_id">
- <on_click function="Profile.CopyName" parameter="id"/>
- </menu_item_call>
-</toggleable_menu>
diff --git a/indra/newview/skins/default/xui/en/menu_profile_other.xml b/indra/newview/skins/default/xui/en/menu_profile_other.xml
new file mode 100644
index 0000000000..5fc625b8e5
--- /dev/null
+++ b/indra/newview/skins/default/xui/en/menu_profile_other.xml
@@ -0,0 +1,129 @@
+<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
+<toggleable_menu
+ layout="topleft"
+ name="Avatar Profile Menu">
+ <menu_item_call
+ label="IM"
+ layout="topleft"
+ name="im">
+ <menu_item_call.on_click
+ function="Profile.Commit"
+ parameter="im"/>
+ </menu_item_call>
+ <menu_item_call
+ label="Offer Teleport"
+ name="offer_teleport">
+ <menu_item_call.on_click
+ function="Profile.Commit"
+ parameter="offer_teleport"/>
+ <menu_item_call.on_enable
+ function="Profile.EnableItem"
+ parameter="offer_teleport"/>
+ </menu_item_call>
+ <menu_item_call
+ label="Request Teleport"
+ name="request_teleport">
+ <menu_item_call.on_click
+ function="Profile.Commit"
+ parameter="request_teleport"/>
+ <menu_item_call.on_enable
+ function="Profile.EnableItem"
+ parameter="request_teleport"/>
+ </menu_item_call>
+ <menu_item_call
+ label="Voice call"
+ layout="topleft"
+ name="voice_call">
+ <menu_item_call.on_click
+ function="Profile.Commit"
+ parameter="voice_call"/>
+ <menu_item_call.on_enable
+ function="Profile.EnableItem"
+ parameter="voice_call"/>
+ </menu_item_call>
+ <menu_item_separator />
+ <menu_item_call
+ label="View chat history..."
+ layout="topleft"
+ name="chat_history">
+ <menu_item_call.on_click
+ function="Profile.Commit"
+ parameter="chat_history"/>
+ <menu_item_call.on_enable
+ function="Profile.EnableItem"
+ parameter="chat_history"/>
+ </menu_item_call>
+ <menu_item_separator name="separator_chat_history"/>
+ <menu_item_call
+ label="Add Friend"
+ layout="topleft"
+ name="add_friend">
+ <menu_item_call.on_click
+ function="Profile.Commit"
+ parameter="add_friend"/>
+ <menu_item_call.on_visible
+ function="Profile.EnableItem"
+ parameter="add_friend"/>
+ </menu_item_call>
+ <menu_item_call
+ label="Remove Friend"
+ layout="topleft"
+ name="remove_friend">
+ <menu_item_call.on_click
+ function="Profile.Commit"
+ parameter="remove_friend"/>
+ <menu_item_call.on_enable
+ function="Profile.EnableItem"
+ parameter="remove_friend"/>
+ </menu_item_call>
+ <menu_item_call
+ label="Invite to group..."
+ layout="topleft"
+ name="invite_to_group">
+ <menu_item_call.on_click
+ function="Profile.Commit"
+ parameter="invite_to_group"/>
+ </menu_item_call>
+ <menu_item_separator name="separator_invite_to_group"/>
+ <menu_item_call
+ label="Map"
+ layout="topleft"
+ name="map">
+ <menu_item_call.on_click
+ function="Profile.Commit"
+ parameter="can_show_on_map"/>
+ <menu_item_call.on_enable
+ function="Profile.EnableItem"
+ parameter="can_show_on_map"/>
+ </menu_item_call>
+ <menu_item_call
+ label="Share"
+ layout="topleft"
+ name="share">
+ <menu_item_call.on_click
+ function="Profile.Commit"
+ parameter="share"/>
+ </menu_item_call>
+ <menu_item_call
+ label="Pay"
+ layout="topleft"
+ name="pay">
+ <menu_item_call.on_click
+ function="Profile.Commit"
+ parameter="pay"/>
+ </menu_item_call>
+ <menu_item_check
+ label="Block/Unblock"
+ layout="topleft"
+ name="block_unblock">
+ <menu_item_check.on_click
+ function="Profile.Commit"
+ parameter="toggle_block_agent"/>
+ <menu_item_check.on_check
+ function="Profile.CheckItem"
+ parameter="toggle_block_agent"/>
+ <menu_item_check.on_enable
+ function="Profile.EnableItem"
+ parameter="toggle_block_agent"/>
+ </menu_item_check>
+</toggleable_menu>
diff --git a/indra/newview/skins/default/xui/en/panel_profile_secondlife.xml b/indra/newview/skins/default/xui/en/panel_profile_secondlife.xml
index fe1244aaf3..4b40db9b5d 100644
--- a/indra/newview/skins/default/xui/en/panel_profile_secondlife.xml
+++ b/indra/newview/skins/default/xui/en/panel_profile_secondlife.xml
@@ -14,7 +14,10 @@
value="[AGE]" />
<string
name="no_partner_text"
- value="None" />
+ value="Partner: None" />
+ <string
+ name="partner_text"
+ value="Partner: [LINK]" />
<string
name="CaptionTextAcctInfo">
Account: [ACCTTYPE]
@@ -78,6 +81,7 @@ Account: [ACCTTYPE]
<text
name="display_name"
value="(loading...)"
+ font="SansSerifBigLarge"
top="0"
left="2"
right="-1"
@@ -88,40 +92,43 @@ Account: [ACCTTYPE]
<text
name="user_name"
value="(loading...)"
- top_pad="3"
+ top_pad="0"
left="2"
right="-1"
- height="20"
+ height="16"
follows="left|top|right"
layout="topleft"/>
<text
name="user_age"
value="(loading...)"
- top_pad="3"
+ top_pad="0"
left="2"
right="-1"
- height="20"
+ height="16"
follows="left|top|right"
layout="topleft"/>
<text
+ type="string"
name="partner_link"
value="Partner: (loading...)"
- top_pad="3"
+ top_pad="0"
left="2"
right="-1"
- height="20"
+ height="16"
follows="left|top|right"
- layout="topleft"/>
+ layout="topleft"
+ translate="false"
+ use_ellipses="true" />
<text
name="account_info"
value="Account: (loading...)"
- top_pad="3"
+ top_pad="0"
left="2"
right="-1"
- height="20"
+ height="16"
follows="left|top|right"
layout="topleft"/>
@@ -139,7 +146,7 @@ Account: [ACCTTYPE]
image_pressed="DropDown_Press"
image_pressed_selected="DropDown_Press"
image_disabled="DropDown_Disabled"
- name="agent_actions" />
+ name="agent_actions_menu" />
</layout_panel>
<layout_panel
@@ -149,6 +156,7 @@ Account: [ACCTTYPE]
width="26"
auto_resize="false"
user_resize="false">
+ <!--Todo: progress indicator-->
<!--Probably should be borderless buttons-->
<icon
name="allow_to_see_online"
@@ -272,7 +280,7 @@ Account: [ACCTTYPE]
user_resize="false">
<text
name="group_label"
- value="(loading...) is a member of:"
+ value="Group membership"
top="1"
left="1"
right="-1"
@@ -300,8 +308,7 @@ Account: [ACCTTYPE]
width="200"
auto_resize="true"
user_resize="false">
- <!-- notes are only for other agents -->
-
+ <!-- notes are only for other agents -->
<text
name="notes_label"
value="My private notes:"
@@ -328,27 +335,7 @@ Account: [ACCTTYPE]
h_pad="2"
max_length="65000"
parse_urls="true"
- word_wrap="true"/>
- <button
- name="save_notes_changes"
- label="Save"
- bottom="-1"
- right="-105"
- height="20"
- width="80"
- follows="bottom|right"
- layout="topleft"
- label_selected="Find on Map"/>
- <button
- name="discard_notes_changes"
- label="Discard"
- bottom="-1"
- right="-1"
- height="20"
- width="100"
- follows="bottom|right"
- layout="topleft"
- label_selected="Find on Map"/>
+ word_wrap="true"/>
</layout_panel>
<layout_panel