diff options
Diffstat (limited to 'linden/indra/newview/llviewermenu.cpp')
-rw-r--r-- | linden/indra/newview/llviewermenu.cpp | 145 |
1 files changed, 145 insertions, 0 deletions
diff --git a/linden/indra/newview/llviewermenu.cpp b/linden/indra/newview/llviewermenu.cpp index 2940bdd..ba1ef9a 100644 --- a/linden/indra/newview/llviewermenu.cpp +++ b/linden/indra/newview/llviewermenu.cpp | |||
@@ -209,6 +209,7 @@ | |||
209 | #include "llwaterparammanager.h" | 209 | #include "llwaterparammanager.h" |
210 | 210 | ||
211 | #include "lltexlayer.h" | 211 | #include "lltexlayer.h" |
212 | #include "primbackup.h" | ||
212 | 213 | ||
213 | void init_client_menu(LLMenuGL* menu); | 214 | void init_client_menu(LLMenuGL* menu); |
214 | void init_server_menu(LLMenuGL* menu); | 215 | void init_server_menu(LLMenuGL* menu); |
@@ -2104,6 +2105,143 @@ class LLObjectMute : public view_listener_t | |||
2104 | } | 2105 | } |
2105 | }; | 2106 | }; |
2106 | 2107 | ||
2108 | class LLObjectEnableCopyUUID : public view_listener_t | ||
2109 | { | ||
2110 | bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) | ||
2111 | { | ||
2112 | LLViewerObject* object = LLSelectMgr::getInstance()->getSelection()->getFirstObject(); | ||
2113 | bool new_value = (object != NULL); | ||
2114 | |||
2115 | gMenuHolder->findControl(userdata["control"].asString())->setValue(new_value); | ||
2116 | return true; | ||
2117 | } | ||
2118 | }; | ||
2119 | |||
2120 | class LLObjectCopyUUID : public view_listener_t | ||
2121 | { | ||
2122 | bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) | ||
2123 | { | ||
2124 | LLViewerObject* object = LLSelectMgr::getInstance()->getSelection()->getFirstObject(); | ||
2125 | if (!object) return true; | ||
2126 | |||
2127 | LLUUID id = object->getID(); | ||
2128 | |||
2129 | char buffer[UUID_STR_LENGTH]; | ||
2130 | id.toString(buffer); | ||
2131 | |||
2132 | |||
2133 | gViewerWindow->mWindow->copyTextToClipboard(utf8str_to_wstring(buffer)); | ||
2134 | |||
2135 | LLSelectMgr::getInstance()->deselectAll(); | ||
2136 | return true; | ||
2137 | } | ||
2138 | }; | ||
2139 | |||
2140 | |||
2141 | class LLObjectEnableExport : public view_listener_t | ||
2142 | { | ||
2143 | bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) | ||
2144 | { | ||
2145 | LLViewerObject* object = LLSelectMgr::getInstance()->getSelection()->getPrimaryObject(); | ||
2146 | bool new_value = (object != NULL); | ||
2147 | if (new_value) | ||
2148 | { | ||
2149 | LLVOAvatar* avatar = find_avatar_from_object(object); | ||
2150 | new_value = (avatar == NULL); | ||
2151 | } | ||
2152 | if(new_value) | ||
2153 | { | ||
2154 | |||
2155 | struct ff : public LLSelectedNodeFunctor | ||
2156 | { | ||
2157 | ff(const LLSD& data) : LLSelectedNodeFunctor() | ||
2158 | ,userdata(data) | ||
2159 | { | ||
2160 | |||
2161 | } | ||
2162 | const LLSD& userdata; | ||
2163 | virtual bool apply(LLSelectNode* node) | ||
2164 | { | ||
2165 | if(gAgent.getID()!=node->mPermissions->getCreator()) | ||
2166 | { | ||
2167 | llwarns<<"Incorrect permission to export"<<llendl; | ||
2168 | return false; | ||
2169 | } | ||
2170 | return true; | ||
2171 | } | ||
2172 | }; | ||
2173 | |||
2174 | #ifdef LL_GRID_PERMISSIONS | ||
2175 | |||
2176 | ff * the_ff=new ff(userdata); | ||
2177 | if(LLSelectMgr::getInstance()->getSelection()->applyToNodes(the_ff,false)) | ||
2178 | { | ||
2179 | gMenuHolder->findControl(userdata["control"].asString())->setValue(true); | ||
2180 | } | ||
2181 | else | ||
2182 | { | ||
2183 | gMenuHolder->findControl(userdata["control"].asString())->setValue(false); | ||
2184 | } | ||
2185 | return true; | ||
2186 | } | ||
2187 | |||
2188 | gMenuHolder->findControl(userdata["control"].asString())->setValue(new_value); | ||
2189 | return true; | ||
2190 | #else | ||
2191 | } | ||
2192 | gMenuHolder->findControl(userdata["control"].asString())->setValue(true); | ||
2193 | return true; | ||
2194 | #endif | ||
2195 | |||
2196 | } | ||
2197 | }; | ||
2198 | |||
2199 | class LLObjectExport : public view_listener_t | ||
2200 | { | ||
2201 | bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) | ||
2202 | { | ||
2203 | LLViewerObject* object = LLSelectMgr::getInstance()->getSelection()->getPrimaryObject(); | ||
2204 | if (!object) return true; | ||
2205 | |||
2206 | LLVOAvatar* avatar = find_avatar_from_object(object); | ||
2207 | |||
2208 | if (!avatar) | ||
2209 | { | ||
2210 | primbackup::getInstance()->pre_export_object(); | ||
2211 | } | ||
2212 | |||
2213 | return true; | ||
2214 | } | ||
2215 | }; | ||
2216 | |||
2217 | |||
2218 | class LLObjectEnableImport : public view_listener_t | ||
2219 | { | ||
2220 | bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) | ||
2221 | { | ||
2222 | gMenuHolder->findControl(userdata["control"].asString())->setValue(TRUE); | ||
2223 | return true; | ||
2224 | } | ||
2225 | }; | ||
2226 | |||
2227 | class LLObjectImport : public view_listener_t | ||
2228 | { | ||
2229 | bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) | ||
2230 | { | ||
2231 | primbackup::getInstance()->import_object(FALSE); | ||
2232 | return true; | ||
2233 | } | ||
2234 | }; | ||
2235 | |||
2236 | class LLObjectImportUpload : public view_listener_t | ||
2237 | { | ||
2238 | bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) | ||
2239 | { | ||
2240 | primbackup::getInstance()->import_object(TRUE); | ||
2241 | return true; | ||
2242 | } | ||
2243 | }; | ||
2244 | |||
2107 | bool handle_go_to() | 2245 | bool handle_go_to() |
2108 | { | 2246 | { |
2109 | // JAMESDEBUG try simulator autopilot | 2247 | // JAMESDEBUG try simulator autopilot |
@@ -9652,6 +9790,10 @@ void initialize_menus() | |||
9652 | addMenu(new LLObjectBuy(), "Object.Buy"); | 9790 | addMenu(new LLObjectBuy(), "Object.Buy"); |
9653 | addMenu(new LLObjectEdit(), "Object.Edit"); | 9791 | addMenu(new LLObjectEdit(), "Object.Edit"); |
9654 | addMenu(new LLObjectInspect(), "Object.Inspect"); | 9792 | addMenu(new LLObjectInspect(), "Object.Inspect"); |
9793 | addMenu(new LLObjectCopyUUID(), "Object.CopyUUID"); | ||
9794 | addMenu(new LLObjectExport(), "Object.Export"); | ||
9795 | addMenu(new LLObjectImport(), "Object.Import"); | ||
9796 | addMenu(new LLObjectImportUpload(), "Object.ImportUpload"); | ||
9655 | 9797 | ||
9656 | addMenu(new LLObjectEnableOpen(), "Object.EnableOpen"); | 9798 | addMenu(new LLObjectEnableOpen(), "Object.EnableOpen"); |
9657 | addMenu(new LLObjectEnableTouch(), "Object.EnableTouch"); | 9799 | addMenu(new LLObjectEnableTouch(), "Object.EnableTouch"); |
@@ -9662,6 +9804,9 @@ void initialize_menus() | |||
9662 | addMenu(new LLObjectEnableReportAbuse(), "Object.EnableReportAbuse"); | 9804 | addMenu(new LLObjectEnableReportAbuse(), "Object.EnableReportAbuse"); |
9663 | addMenu(new LLObjectEnableMute(), "Object.EnableMute"); | 9805 | addMenu(new LLObjectEnableMute(), "Object.EnableMute"); |
9664 | addMenu(new LLObjectEnableBuy(), "Object.EnableBuy"); | 9806 | addMenu(new LLObjectEnableBuy(), "Object.EnableBuy"); |
9807 | addMenu(new LLObjectEnableCopyUUID(), "Object.EnableCopyUUID"); | ||
9808 | addMenu(new LLObjectEnableExport(), "Object.EnableExport"); | ||
9809 | addMenu(new LLObjectEnableImport(), "Object.EnableImport"); | ||
9665 | 9810 | ||
9666 | /*addMenu(new LLObjectVisibleTouch(), "Object.VisibleTouch"); | 9811 | /*addMenu(new LLObjectVisibleTouch(), "Object.VisibleTouch"); |
9667 | addMenu(new LLObjectVisibleCustomTouch(), "Object.VisibleCustomTouch"); | 9812 | addMenu(new LLObjectVisibleCustomTouch(), "Object.VisibleCustomTouch"); |