Add LLAvatarActions::copyUUIDs
An adaptation of a similarly named function in Alchemy Viewer Thanks Alchemy, Thalchemy.
This commit is contained in:
@@ -54,6 +54,9 @@
|
||||
#include "rlvhandler.h"
|
||||
// [/RLVa:KB]
|
||||
|
||||
#include "llviewerwindow.h"
|
||||
#include "llwindow.h"
|
||||
|
||||
extern const S32 TRANS_GIFT;
|
||||
void give_money(const LLUUID& uuid, LLViewerRegion* region, S32 amount, BOOL is_group = FALSE, S32 trx_type = TRANS_GIFT, const std::string& desc = LLStringUtil::null);
|
||||
void handle_lure(const uuid_vec_t& ids);
|
||||
@@ -803,3 +806,24 @@ bool LLAvatarActions::canBlock(const LLUUID& id)
|
||||
bool is_self = id == gAgentID;
|
||||
return !is_self && !is_linden;
|
||||
}
|
||||
|
||||
// static
|
||||
void LLAvatarActions::copyUUIDs(const uuid_vec_t& ids)
|
||||
{
|
||||
std::string ids_string;
|
||||
const std::string& separator = LLTrans::getString("words_separator");
|
||||
for (uuid_vec_t::const_iterator it = ids.begin(); it != ids.end(); ++it)
|
||||
{
|
||||
const LLUUID& id = *it;
|
||||
if (id.isNull())
|
||||
continue;
|
||||
|
||||
if (!ids_string.empty())
|
||||
ids_string.append(separator);
|
||||
|
||||
ids_string.append(id.asString());
|
||||
}
|
||||
|
||||
if (!ids_string.empty())
|
||||
gViewerWindow->mWindow->copyTextToClipboard(utf8str_to_wstring(ids_string));
|
||||
}
|
||||
|
||||
@@ -198,6 +198,11 @@ public:
|
||||
*/
|
||||
static void buildResidentsString(const uuid_vec_t& avatar_uuids, std::string& residents_string);
|
||||
|
||||
/**
|
||||
* Copy the selected avatar's UUID to clipboard
|
||||
*/
|
||||
static void copyUUIDs(const uuid_vec_t& id);
|
||||
|
||||
private:
|
||||
static bool callbackAddFriendWithMessage(const LLSD& notification, const LLSD& response);
|
||||
static bool handleRemove(const LLSD& notification, const LLSD& response);
|
||||
|
||||
Reference in New Issue
Block a user