aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden/indra/newview/llpanelpermissions.cpp
diff options
context:
space:
mode:
authorMcCabe Maxsted2010-08-23 11:28:14 -0700
committerMcCabe Maxsted2010-08-28 05:01:20 -0700
commit8e9305f67843672a758cbc15c9dcd2123c87613c (patch)
tree298171d42533863aa8163e1141f151a5858e3adc /linden/indra/newview/llpanelpermissions.cpp
parentreplace hardcoded SL limits by hippolimits (diff)
downloadmeta-impy-8e9305f67843672a758cbc15c9dcd2123c87613c.zip
meta-impy-8e9305f67843672a758cbc15c9dcd2123c87613c.tar.gz
meta-impy-8e9305f67843672a758cbc15c9dcd2123c87613c.tar.bz2
meta-impy-8e9305f67843672a758cbc15c9dcd2123c87613c.tar.xz
Added 'Copy Key' button to the build general tab
Diffstat (limited to 'linden/indra/newview/llpanelpermissions.cpp')
-rw-r--r--linden/indra/newview/llpanelpermissions.cpp52
1 files changed, 52 insertions, 0 deletions
diff --git a/linden/indra/newview/llpanelpermissions.cpp b/linden/indra/newview/llpanelpermissions.cpp
index d541bce..afe2de4 100644
--- a/linden/indra/newview/llpanelpermissions.cpp
+++ b/linden/indra/newview/llpanelpermissions.cpp
@@ -54,13 +54,16 @@
54#include "llstatusbar.h" // for getBalance() 54#include "llstatusbar.h" // for getBalance()
55#include "lllineeditor.h" 55#include "lllineeditor.h"
56#include "llradiogroup.h" 56#include "llradiogroup.h"
57#include "llchat.h"
57#include "llcombobox.h" 58#include "llcombobox.h"
58#include "llfloateravatarinfo.h" 59#include "llfloateravatarinfo.h"
60#include "llfloaterchat.h"
59#include "lluiconstants.h" 61#include "lluiconstants.h"
60#include "lldbstrings.h" 62#include "lldbstrings.h"
61#include "llfloatergroupinfo.h" 63#include "llfloatergroupinfo.h"
62#include "llfloatergroups.h" 64#include "llfloatergroups.h"
63#include "llnamebox.h" 65#include "llnamebox.h"
66#include "lltrans.h"
64#include "llviewercontrol.h" 67#include "llviewercontrol.h"
65#include "lluictrlfactory.h" 68#include "lluictrlfactory.h"
66#include "roles_constants.h" 69#include "roles_constants.h"
@@ -96,6 +99,8 @@ BOOL LLPanelPermissions::postBuild()
96 99
97 this->childSetAction("button deed",LLPanelPermissions::onClickDeedToGroup,this); 100 this->childSetAction("button deed",LLPanelPermissions::onClickDeedToGroup,this);
98 101
102 this->childSetAction("button copy key",LLPanelPermissions::onClickCopyObjKey,this);
103
99 this->childSetCommitCallback("checkbox allow everyone move",LLPanelPermissions::onCommitEveryoneMove,this); 104 this->childSetCommitCallback("checkbox allow everyone move",LLPanelPermissions::onCommitEveryoneMove,this);
100 105
101 this->childSetCommitCallback("checkbox allow everyone copy",LLPanelPermissions::onCommitEveryoneCopy,this); 106 this->childSetCommitCallback("checkbox allow everyone copy",LLPanelPermissions::onCommitEveryoneCopy,this);
@@ -259,6 +264,8 @@ void LLPanelPermissions::refresh()
259 childSetVisible("N:",false); 264 childSetVisible("N:",false);
260 childSetVisible("F:",false); 265 childSetVisible("F:",false);
261 266
267 childSetEnabled("button copy key",false);
268
262 return; 269 return;
263 } 270 }
264 271
@@ -844,6 +851,8 @@ void LLPanelPermissions::refresh()
844 } 851 }
845 childSetEnabled("label click action",is_perm_modify && all_volume); 852 childSetEnabled("label click action",is_perm_modify && all_volume);
846 childSetEnabled("clickaction",is_perm_modify && all_volume); 853 childSetEnabled("clickaction",is_perm_modify && all_volume);
854
855 childSetEnabled("button copy key",true);
847} 856}
848 857
849 858
@@ -977,6 +986,49 @@ void LLPanelPermissions::onClickDeedToGroup(void* data)
977 LLNotifications::instance().add( "DeedObjectToGroup", args, LLSD(), callback_deed_to_group); 986 LLNotifications::instance().add( "DeedObjectToGroup", args, LLSD(), callback_deed_to_group);
978} 987}
979 988
989void LLPanelPermissions::onClickCopyObjKey(void* data)
990{
991 std::string output;
992 std::string keys;
993 const std::string separator = ", ";
994 LLChat chat;
995 chat.mSourceType = CHAT_SOURCE_SYSTEM;
996
997 for (LLObjectSelection::root_iterator iter = LLSelectMgr::getInstance()->getSelection()->root_begin();
998 iter != LLSelectMgr::getInstance()->getSelection()->root_end(); iter++)
999 {
1000 LLSelectNode* selectNode = *iter;
1001 LLViewerObject* object = selectNode->getObject();
1002 if (object)
1003 {
1004 if (!output.empty())
1005 {
1006 output.append(separator);
1007 }
1008 output.append(selectNode->mName);
1009 output.append(": ");
1010 output.append(object->getID().asString());
1011
1012 if (!keys.empty())
1013 {
1014 keys.append(separator);
1015 }
1016 keys.append(object->getID().asString());
1017 }
1018 }
1019
1020 if (!output.empty())
1021 {
1022 chat.mText = LLTrans::getString("copy_obj_key_info") + "\n" + output;
1023 LLFloaterChat::addChat(chat);
1024 }
1025
1026 if (!keys.empty())
1027 {
1028 gViewerWindow->mWindow->copyTextToClipboard(utf8str_to_wstring(keys));
1029 }
1030}
1031
980///---------------------------------------------------------------------------- 1032///----------------------------------------------------------------------------
981/// Permissions checkboxes 1033/// Permissions checkboxes
982///---------------------------------------------------------------------------- 1034///----------------------------------------------------------------------------