aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
-rw-r--r--ChangeLog.txt17
-rw-r--r--linden/indra/newview/llfloatertools.cpp97
-rw-r--r--linden/indra/newview/llfloatertools.h7
-rw-r--r--linden/indra/newview/llviewermenu.cpp12
-rw-r--r--linden/indra/newview/skins/default/xui/en-us/floater_tools.xml58
-rw-r--r--linden/indra/newview/skins/default/xui/en-us/menu_pie_object.xml10
6 files changed, 171 insertions, 30 deletions
diff --git a/ChangeLog.txt b/ChangeLog.txt
index bae9cf1..3994bb6 100644
--- a/ChangeLog.txt
+++ b/ChangeLog.txt
@@ -19,6 +19,23 @@
19 modified: .gitignore 19 modified: .gitignore
20 20
21 21
22 * Added Link/Unlink buttons to the Tools floater.
23
24 modified: linden/indra/newview/llfloatertools.cpp
25 modified: linden/indra/newview/llfloatertools.h
26 modified: linden/indra/newview/skins/default/xui/en-us/floater_tools.xml
27
28
29 * Fixed 'Unlink' not toggling in Tools menu.
30
31 modified: linden/indra/newview/llviewermenu.cpp
32
33
34 * Added Link/Unlink options to the object pie menu.
35
36 modified: linden/indra/newview/skins/default/xui/en-us/menu_pie_object.xml
37
38
222009-06-10 McCabe Maxsted <hakushakukun@gmail.com> 392009-06-10 McCabe Maxsted <hakushakukun@gmail.com>
23 40
24 * Fixed Communicate window not toggling from menu. 41 * Fixed Communicate window not toggling from menu.
diff --git a/linden/indra/newview/llfloatertools.cpp b/linden/indra/newview/llfloatertools.cpp
index 73b6061..84a1edc 100644
--- a/linden/indra/newview/llfloatertools.cpp
+++ b/linden/indra/newview/llfloatertools.cpp
@@ -46,6 +46,7 @@
46#include "llfloateropenobject.h" 46#include "llfloateropenobject.h"
47#include "llfocusmgr.h" 47#include "llfocusmgr.h"
48#include "llmenugl.h" 48#include "llmenugl.h"
49#include "llnotify.h"
49#include "llpanelcontents.h" 50#include "llpanelcontents.h"
50#include "llpanelface.h" 51#include "llpanelface.h"
51#include "llpanelland.h" 52#include "llpanelland.h"
@@ -235,6 +236,11 @@ BOOL LLFloaterTools::postBuild()
235 mTextGridMode = getChild<LLTextBox>("text ruler mode"); 236 mTextGridMode = getChild<LLTextBox>("text ruler mode");
236 mComboGridMode = getChild<LLComboBox>("combobox grid mode"); 237 mComboGridMode = getChild<LLComboBox>("combobox grid mode");
237 childSetCommitCallback("combobox grid mode",commit_grid_mode, this); 238 childSetCommitCallback("combobox grid mode",commit_grid_mode, this);
239 mBtnLink = getChild<LLButton>("link_btn");
240 childSetAction("link_btn",onClickLink, this);
241 mBtnUnlink = getChild<LLButton>("unlink_btn");
242 childSetAction("unlink_btn",onClickUnlink, this);
243
238 // 244 //
239 // Create Buttons 245 // Create Buttons
240 // 246 //
@@ -387,6 +393,9 @@ LLFloaterTools::LLFloaterTools()
387 mBtnDuplicate(NULL), 393 mBtnDuplicate(NULL),
388 mBtnDuplicateInPlace(NULL), 394 mBtnDuplicateInPlace(NULL),
389 395
396 mBtnLink(NULL),
397 mBtnUnlink(NULL),
398
390 mComboTreesGrass(NULL), 399 mComboTreesGrass(NULL),
391 mCheckSticky(NULL), 400 mCheckSticky(NULL),
392 mCheckCopySelection(NULL), 401 mCheckCopySelection(NULL),
@@ -661,6 +670,44 @@ void LLFloaterTools::updatePopup(LLCoordGL center, MASK mask)
661 if (mCheckStretchUniform) mCheckStretchUniform->setVisible( edit_visible ); 670 if (mCheckStretchUniform) mCheckStretchUniform->setVisible( edit_visible );
662 if (mCheckStretchTexture) mCheckStretchTexture->setVisible( edit_visible ); 671 if (mCheckStretchTexture) mCheckStretchTexture->setVisible( edit_visible );
663 672
673 if (mBtnLink) mBtnLink->setVisible( edit_visible );
674 if (mBtnUnlink) mBtnUnlink->setVisible( edit_visible );
675
676 // Check to see if we can link things
677 bool can_link = false;
678 if (!gSavedSettings.getBOOL("EditLinkedParts"))
679 {
680 if(LLSelectMgr::getInstance()->selectGetAllRootsValid() && LLSelectMgr::getInstance()->getSelection()->getRootObjectCount() >= 2)
681 {
682 struct f : public LLSelectedObjectFunctor
683 {
684 virtual bool apply(LLViewerObject* object)
685 {
686 return object->permModify();
687 }
688 }
689 func;
690 const bool firstonly = true;
691 can_link = LLSelectMgr::getInstance()->getSelection()->applyToRootObjects(&func, firstonly);
692 }
693 }
694 mBtnLink->setEnabled(can_link);
695
696 // Check to see if we can unlink things
697 bool can_unlink = false;
698 if (LLSelectMgr::getInstance()->selectGetAllRootsValid() &&
699 LLSelectMgr::getInstance()->getSelection()->getFirstEditableObject() &&
700 !LLSelectMgr::getInstance()->getSelection()->getFirstEditableObject()->isAttachment())
701 {
702 if (LLSelectMgr::getInstance()->getSelection()->getRootObjectCount() !=
703 LLSelectMgr::getInstance()->getSelection()->getObjectCount())
704 {
705 can_unlink = true;
706 }
707 }
708 mBtnUnlink->setEnabled(can_unlink);
709
710
664 // Create buttons 711 // Create buttons
665 BOOL create_visible = (tool == LLToolCompCreate::getInstance()); 712 BOOL create_visible = (tool == LLToolCompCreate::getInstance());
666 713
@@ -1109,3 +1156,53 @@ void LLFloaterTools::onSelectTreesGrass(LLUICtrl*, void*)
1109 gSavedSettings.setString("LastGrass", selected); 1156 gSavedSettings.setString("LastGrass", selected);
1110 } 1157 }
1111} 1158}
1159
1160// static
1161void LLFloaterTools::onClickLink(void* data)
1162{
1163 if(!LLSelectMgr::getInstance()->selectGetAllRootsValid())
1164 {
1165 LLNotifyBox::showXml("UnableToLinkWhileDownloading");
1166 return;
1167 }
1168
1169 S32 object_count = LLSelectMgr::getInstance()->getSelection()->getObjectCount();
1170 if (object_count > MAX_CHILDREN_PER_TASK + 1)
1171 {
1172 LLStringUtil::format_map_t args;
1173 args["[COUNT]"] = llformat("%d", object_count);
1174 int max = MAX_CHILDREN_PER_TASK+1;
1175 args["[MAX]"] = llformat("%d", max);
1176 gViewerWindow->alertXml("UnableToLinkObjects", args);
1177 return;
1178 }
1179
1180 if(LLSelectMgr::getInstance()->getSelection()->getRootObjectCount() < 2)
1181 {
1182 gViewerWindow->alertXml("CannotLinkIncompleteSet");
1183 return;
1184 }
1185 if(!LLSelectMgr::getInstance()->selectGetRootsModify())
1186 {
1187 gViewerWindow->alertXml("CannotLinkModify");
1188 return;
1189 }
1190 LLUUID owner_id;
1191 std::string owner_name;
1192 if(!LLSelectMgr::getInstance()->selectGetOwner(owner_id, owner_name))
1193 {
1194 // we don't actually care if you're the owner, but novices are
1195 // the most likely to be stumped by this one, so offer the
1196 // easiest and most likely solution.
1197 gViewerWindow->alertXml("CannotLinkDifferentOwners");
1198 return;
1199 }
1200 LLSelectMgr::getInstance()->sendLink();
1201 return;
1202}
1203
1204// static
1205void LLFloaterTools::onClickUnlink(void* data)
1206{
1207 LLSelectMgr::getInstance()->sendDelink();
1208}
diff --git a/linden/indra/newview/llfloatertools.h b/linden/indra/newview/llfloatertools.h
index 360b1df..8f88977 100644
--- a/linden/indra/newview/llfloatertools.h
+++ b/linden/indra/newview/llfloatertools.h
@@ -102,6 +102,7 @@ public:
102 virtual void onFocusReceived(); 102 virtual void onFocusReceived();
103 static void setEditTool(void* data); 103 static void setEditTool(void* data);
104 void saveLastTool(); 104 void saveLastTool();
105
105private: 106private:
106 static void setObjectType( void* data ); 107 static void setObjectType( void* data );
107 108
@@ -109,6 +110,9 @@ private:
109 110
110 static void onClickGridOptions(void* data); 111 static void onClickGridOptions(void* data);
111 112
113 static void onClickLink(void* data);
114 static void onClickUnlink(void* data);
115
112public: 116public:
113 117
114 LLButton *mBtnFocus; 118 LLButton *mBtnFocus;
@@ -152,6 +156,9 @@ public:
152 LLButton *mBtnDuplicate; 156 LLButton *mBtnDuplicate;
153 LLButton *mBtnDuplicateInPlace; 157 LLButton *mBtnDuplicateInPlace;
154 158
159 LLButton *mBtnLink;
160 LLButton *mBtnUnlink;
161
155 // Create buttons 162 // Create buttons
156 LLComboBox *mComboTreesGrass; 163 LLComboBox *mComboTreesGrass;
157 LLCheckBoxCtrl *mCheckSticky; 164 LLCheckBoxCtrl *mCheckSticky;
diff --git a/linden/indra/newview/llviewermenu.cpp b/linden/indra/newview/llviewermenu.cpp
index 4dedf49..838f230 100644
--- a/linden/indra/newview/llviewermenu.cpp
+++ b/linden/indra/newview/llviewermenu.cpp
@@ -4188,9 +4188,17 @@ class LLToolsEnableUnlink : public view_listener_t
4188{ 4188{
4189 bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) 4189 bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata)
4190 { 4190 {
4191 bool new_value = LLSelectMgr::getInstance()->selectGetAllRootsValid() && 4191 bool new_value = false;
4192 if (LLSelectMgr::getInstance()->selectGetAllRootsValid() &&
4192 LLSelectMgr::getInstance()->getSelection()->getFirstEditableObject() && 4193 LLSelectMgr::getInstance()->getSelection()->getFirstEditableObject() &&
4193 !LLSelectMgr::getInstance()->getSelection()->getFirstEditableObject()->isAttachment(); 4194 !LLSelectMgr::getInstance()->getSelection()->getFirstEditableObject()->isAttachment())
4195 {
4196 if (LLSelectMgr::getInstance()->getSelection()->getRootObjectCount() !=
4197 LLSelectMgr::getInstance()->getSelection()->getObjectCount())
4198 {
4199 new_value = true;
4200 }
4201 }
4194 gMenuHolder->findControl(userdata["control"].asString())->setValue(new_value); 4202 gMenuHolder->findControl(userdata["control"].asString())->setValue(new_value);
4195 return true; 4203 return true;
4196 } 4204 }
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 b649614..18d56b4 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
@@ -79,43 +79,49 @@
79 <check_box bottom_delta="-15" follows="left|top" font="SansSerifSmall" height="16" 79 <check_box bottom_delta="-15" follows="left|top" font="SansSerifSmall" height="16"
80 initial_value="false" label="Select Faces to Texture" left="4" mouse_opaque="true" 80 initial_value="false" label="Select Faces to Texture" left="4" mouse_opaque="true"
81 name="radio select face" radio_style="true" width="114" /> 81 name="radio select face" radio_style="true" width="114" />
82 <check_box bottom_delta="-19" control_name="EditLinkedParts" follows="left|top" 82 <check_box bottom_delta="-22" control_name="SnapEnabled" follows="left|top"
83 font="SansSerifSmall" height="16" initial_value="false" 83 font="SansSerifSmall" height="16" initial_value="true" label="Use Grid"
84 label="Edit linked parts" left="4" mouse_opaque="true" 84 left_delta="0" mouse_opaque="true" name="checkbox snap to grid" width="134" />
85 name="checkbox edit linked parts" width="114" /> 85 <button bottom_delta="0" follows="left|top" font="SansSerifSmall" halign="center"
86 <text bg_visible="false" border_drop_shadow_visible="false" border_visible="false" 86 height="16" label="Options..." label_selected="Options..." left_delta="75"
87 mouse_opaque="true" name="Options..." scale_image="TRUE" width="80" />
88 <text bg_visible="false" border_drop_shadow_visible="false" border_visible="false"
87 bottom_delta="-20" drop_shadow_visible="true" follows="left|top" 89 bottom_delta="-20" drop_shadow_visible="true" follows="left|top"
88 font="SansSerifSmall" h_pad="0" halign="left" height="14" left="6" 90 font="SansSerifSmall" h_pad="0" halign="left" height="14" left="6"
89 mouse_opaque="true" name="text ruler mode" v_pad="0" width="68"> 91 mouse_opaque="true" name="text ruler mode" v_pad="0" width="68">
90 Ruler mode: 92 Ruler mode:
91 </text> 93 </text>
92 <combo_box allow_text_entry="false" bottom_delta="-4" follows="left|top" height="20" 94 <combo_box allow_text_entry="false" bottom_delta="-4" follows="left|top" height="20"
93 left_delta="74" max_chars="20" mouse_opaque="true" 95 left_delta="74" max_chars="20" mouse_opaque="true"
94 name="combobox grid mode" width="86"> 96 name="combobox grid mode" width="86">
95 <combo_item name="World" value="World"> 97 <combo_item name="World" value="World">
96 World 98 World
97 </combo_item> 99 </combo_item>
98 <combo_item name="Local" value="Local"> 100 <combo_item name="Local" value="Local">
99 Local 101 Local
100 </combo_item> 102 </combo_item>
101 <combo_item name="Reference" value="Reference"> 103 <combo_item name="Reference" value="Reference">
102 Reference 104 Reference
103 </combo_item> 105 </combo_item>
104 </combo_box> 106 </combo_box>
105 <check_box bottom="-70" control_name="ScaleUniform" follows="left|top" 107 <check_box bottom="-70" control_name="ScaleUniform" follows="left|top"
106 font="SansSerifSmall" height="16" initial_value="false" 108 font="SansSerifSmall" height="16" initial_value="false"
107 label="Stretch Both Sides" left="143" mouse_opaque="true" 109 label="Stretch Both Sides" left="143" mouse_opaque="true"
108 name="checkbox uniform" width="134" /> 110 name="checkbox uniform" width="134" />
109 <check_box bottom_delta="-15" control_name="ScaleStretchTextures" follows="left|top" 111 <check_box bottom_delta="-15" control_name="ScaleStretchTextures" follows="left|top"
110 font="SansSerifSmall" height="16" initial_value="true" 112 font="SansSerifSmall" height="16" initial_value="true"
111 label="Stretch Textures" left_delta="0" mouse_opaque="true" 113 label="Stretch Textures" left_delta="0" mouse_opaque="true"
112 name="checkbox stretch textures" width="134" /> 114 name="checkbox stretch textures" width="134" />
113 <check_box bottom_delta="-19" control_name="SnapEnabled" follows="left|top" 115 <check_box bottom_delta="-15" control_name="EditLinkedParts" follows="left|top"
114 font="SansSerifSmall" height="16" initial_value="true" label="Use Grid" 116 font="SansSerifSmall" height="16" initial_value="false"
115 left_delta="0" mouse_opaque="true" name="checkbox snap to grid" width="134" /> 117 label="Edit linked parts" left="143" mouse_opaque="true"
116 <button bottom_delta="-14" follows="left|top" font="SansSerifSmall" halign="center" 118 name="checkbox edit linked parts" width="114" />
117 height="16" label="Options..." label_selected="Options..." left_delta="20" 119 <button bottom_delta="-18" follows="left|top" font="SansSerifSmall"
118 mouse_opaque="true" name="Options..." scale_image="TRUE" width="80" /> 120 halign="center" height="18" label="Link" label_selected="Link"
121 right="-5" mouse_opaque="true" name="link_btn" width="78" />
122 <button bottom_delta="-20" follows="left|top" font="SansSerifSmall"
123 halign="center" height="18" label="Unlink" label_selected="Unlink"
124 right="-5" mouse_opaque="true" name="unlink_btn" width="78" />
119 125
120<!-- Help text --> 126<!-- Help text -->
121 127
diff --git a/linden/indra/newview/skins/default/xui/en-us/menu_pie_object.xml b/linden/indra/newview/skins/default/xui/en-us/menu_pie_object.xml
index 7ef84c4..8d059c1 100644
--- a/linden/indra/newview/skins/default/xui/en-us/menu_pie_object.xml
+++ b/linden/indra/newview/skins/default/xui/en-us/menu_pie_object.xml
@@ -59,9 +59,15 @@
59 <on_click function="Object.Inspect" /> 59 <on_click function="Object.Inspect" />
60 <on_enable function="Object.EnableInspect" /> 60 <on_enable function="Object.EnableInspect" />
61 </menu_item_call> 61 </menu_item_call>
62 <menu_item_call name="Link" enabled="false" label="Link">
63 <on_click function="Tools.Link" userdata="" />
64 <on_enable function="Tools.EnableLink" />
65 </menu_item_call>
62 <menu_item_separator /> 66 <menu_item_separator />
63 <menu_item_separator /> 67 <menu_item_call name="Unlink" enabled="false" label="Unlink">
64 <menu_item_separator /> 68 <on_click function="Tools.Unlink" userdata="" />
69 <on_enable function="Tools.EnableUnlink" />
70 </menu_item_call>
65 </pie_menu> 71 </pie_menu>
66 <menu_item_call enabled="false" label="Buy..." mouse_opaque="true" name="Buy..."> 72 <menu_item_call enabled="false" label="Buy..." mouse_opaque="true" name="Buy...">
67 <on_click function="Object.Buy" /> 73 <on_click function="Object.Buy" />