diff options
author | McCabe Maxsted | 2010-08-23 11:28:14 -0700 |
---|---|---|
committer | McCabe Maxsted | 2010-08-28 05:01:20 -0700 |
commit | 8e9305f67843672a758cbc15c9dcd2123c87613c (patch) | |
tree | 298171d42533863aa8163e1141f151a5858e3adc | |
parent | replace hardcoded SL limits by hippolimits (diff) | |
download | meta-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
4 files changed, 60 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 | ||
989 | void 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 | ///---------------------------------------------------------------------------- |
diff --git a/linden/indra/newview/llpanelpermissions.h b/linden/indra/newview/llpanelpermissions.h index 9fa4cce..d8451e4 100644 --- a/linden/indra/newview/llpanelpermissions.h +++ b/linden/indra/newview/llpanelpermissions.h | |||
@@ -74,6 +74,7 @@ protected: | |||
74 | static void onClickGroup(void*); | 74 | static void onClickGroup(void*); |
75 | static void cbGroupID(LLUUID group_id, void* userdata); | 75 | static void cbGroupID(LLUUID group_id, void* userdata); |
76 | static void onClickDeedToGroup(void*); | 76 | static void onClickDeedToGroup(void*); |
77 | static void onClickCopyObjKey(void*); | ||
77 | 78 | ||
78 | static void onCommitPerm(LLUICtrl *ctrl, void *data, U8 field, U32 perm); | 79 | static void onCommitPerm(LLUICtrl *ctrl, void *data, U8 field, U32 perm); |
79 | 80 | ||
diff --git a/linden/indra/newview/skins/default/xui/en-us/floater_tools.xml b/linden/indra/newview/skins/default/xui/en-us/floater_tools.xml index 58c6443..6210cdd 100644 --- a/linden/indra/newview/skins/default/xui/en-us/floater_tools.xml +++ b/linden/indra/newview/skins/default/xui/en-us/floater_tools.xml | |||
@@ -466,6 +466,10 @@ | |||
466 | Contents | 466 | Contents |
467 | </radio_item> | 467 | </radio_item> |
468 | </radio_group> | 468 | </radio_group> |
469 | <button bottom="-358" follows="top|right" font="SansSerifSmall" halign="center" | ||
470 | height="20" label="Copy Key" label_selected="Copy Key" right="-10" | ||
471 | mouse_opaque="true" name="button copy key" width="78" | ||
472 | tool_tip="Copies an object's key(s) to the clipboard" /> | ||
469 | <text bg_visible="false" border_drop_shadow_visible="false" border_visible="false" | 473 | <text bg_visible="false" border_drop_shadow_visible="false" border_visible="false" |
470 | bottom="-262" drop_shadow_visible="true" follows="left|top|right" | 474 | bottom="-262" drop_shadow_visible="true" follows="left|top|right" |
471 | font="SansSerifSmall" h_pad="0" halign="left" height="10" left="10" | 475 | font="SansSerifSmall" h_pad="0" halign="left" height="10" left="10" |
diff --git a/linden/indra/newview/skins/default/xui/en-us/strings.xml b/linden/indra/newview/skins/default/xui/en-us/strings.xml index a17d0de..e349a34 100644 --- a/linden/indra/newview/skins/default/xui/en-us/strings.xml +++ b/linden/indra/newview/skins/default/xui/en-us/strings.xml | |||
@@ -20,6 +20,9 @@ | |||
20 | <string name="TitleBarMultiple"> | 20 | <string name="TitleBarMultiple"> |
21 | [FIRST_NAME] [LAST_NAME] on [GRID_NAME] | 21 | [FIRST_NAME] [LAST_NAME] on [GRID_NAME] |
22 | </string> | 22 | </string> |
23 | <string name="copy_obj_key_info"> | ||
24 | Copied key(s) for: | ||
25 | </string> | ||
23 | 26 | ||
24 | <!-- Login --> | 27 | <!-- Login --> |
25 | <string name="LoginInProgress">Logging in. [APP_NAME] may appear frozen. Please wait.</string> | 28 | <string name="LoginInProgress">Logging in. [APP_NAME] may appear frozen. Please wait.</string> |