diff options
Diffstat (limited to 'indra')
-rw-r--r-- | indra/llui/llurlentry.cpp | 58 | ||||
-rw-r--r-- | indra/llui/llurlentry.h | 1 | ||||
-rw-r--r-- | indra/newview/skins/default/xui/en/strings.xml | 14 |
3 files changed, 72 insertions, 1 deletions
diff --git a/indra/llui/llurlentry.cpp b/indra/llui/llurlentry.cpp index 35428e4227..e8e3459673 100644 --- a/indra/llui/llurlentry.cpp +++ b/indra/llui/llurlentry.cpp @@ -310,7 +310,6 @@ LLUrlEntryAgent::LLUrlEntryAgent() boost::regex::perl|boost::regex::icase); mMenuName = "menu_url_agent.xml"; mIcon = "Generic_Person"; - mTooltip = LLTrans::getString("TooltipAgentUrl"); mColor = LLUIColorTable::instance().getColor("AgentLinkColor"); } @@ -323,6 +322,38 @@ void LLUrlEntryAgent::onAgentNameReceived(const LLUUID& id, callObservers(id.asString(), first + " " + last); } +std::string LLUrlEntryAgent::getTooltip(const std::string &string) const +{ + // return a tooltip corresponding to the URL type instead of the generic one + std::string url = getUrl(string); + + if (LLStringUtil::endsWith(url, "/mute")) + { + return LLTrans::getString("TooltipAgentMute"); + } + if (LLStringUtil::endsWith(url, "/unmute")) + { + return LLTrans::getString("TooltipAgentUnmute"); + } + if (LLStringUtil::endsWith(url, "/im")) + { + return LLTrans::getString("TooltipAgentIM"); + } + if (LLStringUtil::endsWith(url, "/pay")) + { + return LLTrans::getString("TooltipAgentPay"); + } + if (LLStringUtil::endsWith(url, "/offerteleport")) + { + return LLTrans::getString("TooltipAgentOfferTeleport"); + } + if (LLStringUtil::endsWith(url, "/requestfriend")) + { + return LLTrans::getString("TooltipAgentRequestFriend"); + } + return LLTrans::getString("TooltipAgentUrl"); +} + std::string LLUrlEntryAgent::getLabel(const std::string &url, const LLUrlLabelCallback &cb) { if (!gCacheName) @@ -346,6 +377,31 @@ std::string LLUrlEntryAgent::getLabel(const std::string &url, const LLUrlLabelCa } else if (gCacheName->getFullName(agent_id, full_name)) { + // customize label string based on agent SLapp suffix + if (LLStringUtil::endsWith(url, "/mute")) + { + return LLTrans::getString("SLappAgentMute") + " " + full_name; + } + if (LLStringUtil::endsWith(url, "/unmute")) + { + return LLTrans::getString("SLappAgentUnmute") + " " + full_name; + } + if (LLStringUtil::endsWith(url, "/im")) + { + return LLTrans::getString("SLappAgentIM") + " " + full_name; + } + if (LLStringUtil::endsWith(url, "/pay")) + { + return LLTrans::getString("SLappAgentPay") + " " + full_name; + } + if (LLStringUtil::endsWith(url, "/offerteleport")) + { + return LLTrans::getString("SLappAgentOfferTeleport") + " " + full_name; + } + if (LLStringUtil::endsWith(url, "/requestfriend")) + { + return LLTrans::getString("SLappAgentRequestFriend") + " " + full_name; + } return full_name; } else diff --git a/indra/llui/llurlentry.h b/indra/llui/llurlentry.h index c947ef7259..84d0968779 100644 --- a/indra/llui/llurlentry.h +++ b/indra/llui/llurlentry.h @@ -169,6 +169,7 @@ class LLUrlEntryAgent : public LLUrlEntryBase public: LLUrlEntryAgent(); /*virtual*/ std::string getLabel(const std::string &url, const LLUrlLabelCallback &cb); + /*virtual*/ std::string getTooltip(const std::string &string) const; private: void onAgentNameReceived(const LLUUID& id, const std::string& first, const std::string& last, BOOL is_group); diff --git a/indra/newview/skins/default/xui/en/strings.xml b/indra/newview/skins/default/xui/en/strings.xml index 111daec242..2a46311fce 100644 --- a/indra/newview/skins/default/xui/en/strings.xml +++ b/indra/newview/skins/default/xui/en/strings.xml @@ -79,6 +79,12 @@ <string name="TooltipHttpUrl">Click to view this web page</string> <string name="TooltipSLURL">Click to view this location's information</string> <string name="TooltipAgentUrl">Click to view this Resident's profile</string> + <string name="TooltipAgentMute">Click to mute this Resident</string> + <string name="TooltipAgentUnmute">Click to unmute this Resident</string> + <string name="TooltipAgentIM">Click to IM this Resident</string> + <string name="TooltipAgentPay">Click to Pay this Resident</string> + <string name="TooltipAgentOfferTeleport">Click to offer a teleport request to this Resident</string> + <string name="TooltipAgentRequestFriend">Click to send a friend request to this Resident</string> <string name="TooltipGroupUrl">Click to view this group's description</string> <string name="TooltipEventUrl">Click to view this event's description</string> <string name="TooltipClassifiedUrl">Click to view this classified</string> @@ -95,6 +101,14 @@ <string name="SLurlLabelTeleport">Teleport to</string> <string name="SLurlLabelShowOnMap">Show Map for</string> + <!-- label strings for secondlife:///app/agent SLapps --> + <string name="SLappAgentMute">Mute</string> + <string name="SLappAgentUnmute">Unmute</string> + <string name="SLappAgentIM">IM</string> + <string name="SLappAgentPay">Pay</string> + <string name="SLappAgentOfferTeleport">Offer Teleport to </string> + <string name="SLappAgentRequestFriend">Friend Request </string> + <!-- ButtonToolTips, llfloater.cpp --> <string name="BUTTON_CLOSE_DARWIN">Close (⌘W)</string> <string name="BUTTON_CLOSE_WIN">Close (Ctrl+W)</string> |