diff options
Diffstat (limited to 'linden/indra/newview/llinventorybridge.cpp')
-rw-r--r-- | linden/indra/newview/llinventorybridge.cpp | 63 |
1 files changed, 31 insertions, 32 deletions
diff --git a/linden/indra/newview/llinventorybridge.cpp b/linden/indra/newview/llinventorybridge.cpp index be2bb9a..1d5cd88 100644 --- a/linden/indra/newview/llinventorybridge.cpp +++ b/linden/indra/newview/llinventorybridge.cpp | |||
@@ -81,7 +81,7 @@ | |||
81 | #include "llviewermessage.h" | 81 | #include "llviewermessage.h" |
82 | #include "llviewerregion.h" | 82 | #include "llviewerregion.h" |
83 | #include "lltabcontainer.h" | 83 | #include "lltabcontainer.h" |
84 | #include "llvieweruictrlfactory.h" | 84 | #include "lluictrlfactory.h" |
85 | #include "llselectmgr.h" | 85 | #include "llselectmgr.h" |
86 | #include "llfloateropenobject.h" | 86 | #include "llfloateropenobject.h" |
87 | 87 | ||
@@ -124,11 +124,11 @@ const char* ICON_NAME[ICON_NAME_COUNT] = | |||
124 | "inv_item_object.tga", | 124 | "inv_item_object.tga", |
125 | "inv_item_object_multi.tga", | 125 | "inv_item_object_multi.tga", |
126 | "inv_item_notecard.tga", | 126 | "inv_item_notecard.tga", |
127 | "inv_item_bodypart.tga", | 127 | "inv_item_skin.tga", |
128 | "inv_item_snapshot.tga", | 128 | "inv_item_snapshot.tga", |
129 | 129 | ||
130 | "inv_item_shape.tga", | 130 | "inv_item_shape.tga", |
131 | "inv_item_bodypart.tga", | 131 | "inv_item_skin.tga", |
132 | "inv_item_hair.tga", | 132 | "inv_item_hair.tga", |
133 | "inv_item_eyes.tga", | 133 | "inv_item_eyes.tga", |
134 | "inv_item_shirt.tga", | 134 | "inv_item_shirt.tga", |
@@ -388,9 +388,10 @@ void hideContextEntries(LLMenuGL& menu, | |||
388 | LLString name = (*itor)->getName(); | 388 | LLString name = (*itor)->getName(); |
389 | 389 | ||
390 | // descend into split menus: | 390 | // descend into split menus: |
391 | if ((name == "More") && (WIDGET_TYPE_MENU_ITEM_BRANCH == (*itor)->getWidgetType())) | 391 | LLMenuItemBranchGL* branchp = dynamic_cast<LLMenuItemBranchGL*>(*itor); |
392 | if ((name == "More") && branchp) | ||
392 | { | 393 | { |
393 | hideContextEntries(*((LLMenuItemBranchGL *)(*itor))->getBranch(), entries_to_show, disabled_entries); | 394 | hideContextEntries(*branchp->getBranch(), entries_to_show, disabled_entries); |
394 | } | 395 | } |
395 | 396 | ||
396 | 397 | ||
@@ -807,10 +808,9 @@ void LLItemBridge::restoreItem() | |||
807 | } | 808 | } |
808 | } | 809 | } |
809 | 810 | ||
810 | LLViewerImage* LLItemBridge::getIcon() const | 811 | LLUIImagePtr LLItemBridge::getIcon() const |
811 | { | 812 | { |
812 | LLString uuid_string = gViewerArt.getString(ICON_NAME[OBJECT_ICON_NAME]); | 813 | return LLUI::getUIImage(ICON_NAME[OBJECT_ICON_NAME]); |
813 | return gImageList.getImage(LLUUID(uuid_string), MIPMAP_FALSE, TRUE); | ||
814 | } | 814 | } |
815 | 815 | ||
816 | PermissionMask LLItemBridge::getPermissionMask() const | 816 | PermissionMask LLItemBridge::getPermissionMask() const |
@@ -1133,7 +1133,7 @@ BOOL LLFolderBridge::dragCategoryIntoFolder(LLInventoryCategory* inv_cat, | |||
1133 | } | 1133 | } |
1134 | 1134 | ||
1135 | // check to make sure source is agent inventory, and is represented there. | 1135 | // check to make sure source is agent inventory, and is represented there. |
1136 | LLToolDragAndDrop::ESource source = gToolDragAndDrop->getSource(); | 1136 | LLToolDragAndDrop::ESource source = LLToolDragAndDrop::getInstance()->getSource(); |
1137 | BOOL is_agent_inventory = (model->getCategory(inv_cat->getUUID()) != NULL) | 1137 | BOOL is_agent_inventory = (model->getCategory(inv_cat->getUUID()) != NULL) |
1138 | && (LLToolDragAndDrop::SOURCE_AGENT == source); | 1138 | && (LLToolDragAndDrop::SOURCE_AGENT == source); |
1139 | 1139 | ||
@@ -1626,7 +1626,7 @@ void LLFolderBridge::restoreItem() | |||
1626 | } | 1626 | } |
1627 | 1627 | ||
1628 | // Icons for folders are based on the preferred type | 1628 | // Icons for folders are based on the preferred type |
1629 | LLViewerImage* LLFolderBridge::getIcon() const | 1629 | LLUIImagePtr LLFolderBridge::getIcon() const |
1630 | { | 1630 | { |
1631 | const char* control = NULL; | 1631 | const char* control = NULL; |
1632 | LLAssetType::EType preferred_type = LLAssetType::AT_NONE; | 1632 | LLAssetType::EType preferred_type = LLAssetType::AT_NONE; |
@@ -1687,8 +1687,7 @@ LLViewerImage* LLFolderBridge::getIcon() const | |||
1687 | control = "inv_folder_plain_closed.tga"; | 1687 | control = "inv_folder_plain_closed.tga"; |
1688 | break; | 1688 | break; |
1689 | } | 1689 | } |
1690 | LLString uuid_string = gViewerArt.getString(control); | 1690 | return LLUI::getUIImage(control); |
1691 | return gImageList.getImage(LLUUID(uuid_string), MIPMAP_FALSE, TRUE); | ||
1692 | } | 1691 | } |
1693 | 1692 | ||
1694 | BOOL LLFolderBridge::renameItem(const LLString& new_name) | 1693 | BOOL LLFolderBridge::renameItem(const LLString& new_name) |
@@ -2195,7 +2194,7 @@ BOOL LLFolderBridge::dragItemIntoFolder(LLInventoryItem* inv_item, | |||
2195 | LLVOAvatar* avatar = gAgent.getAvatarObject(); | 2194 | LLVOAvatar* avatar = gAgent.getAvatarObject(); |
2196 | if(!avatar) return FALSE; | 2195 | if(!avatar) return FALSE; |
2197 | 2196 | ||
2198 | LLToolDragAndDrop::ESource source = gToolDragAndDrop->getSource(); | 2197 | LLToolDragAndDrop::ESource source = LLToolDragAndDrop::getInstance()->getSource(); |
2199 | BOOL accept = FALSE; | 2198 | BOOL accept = FALSE; |
2200 | LLViewerObject* object = NULL; | 2199 | LLViewerObject* object = NULL; |
2201 | if(LLToolDragAndDrop::SOURCE_AGENT == source) | 2200 | if(LLToolDragAndDrop::SOURCE_AGENT == source) |
@@ -2318,8 +2317,8 @@ BOOL LLFolderBridge::dragItemIntoFolder(LLInventoryItem* inv_item, | |||
2318 | accept = TRUE; | 2317 | accept = TRUE; |
2319 | if(drop) | 2318 | if(drop) |
2320 | { | 2319 | { |
2321 | copy_inventory_from_notecard(gToolDragAndDrop->getObjectID(), | 2320 | copy_inventory_from_notecard(LLToolDragAndDrop::getInstance()->getObjectID(), |
2322 | gToolDragAndDrop->getSourceID(), inv_item); | 2321 | LLToolDragAndDrop::getInstance()->getSourceID(), inv_item); |
2323 | } | 2322 | } |
2324 | } | 2323 | } |
2325 | else if(LLToolDragAndDrop::SOURCE_LIBRARY == source) | 2324 | else if(LLToolDragAndDrop::SOURCE_LIBRARY == source) |
@@ -2351,7 +2350,7 @@ BOOL LLFolderBridge::dragItemIntoFolder(LLInventoryItem* inv_item, | |||
2351 | // | LLScriptBridge (DEPRECTED) | | 2350 | // | LLScriptBridge (DEPRECTED) | |
2352 | // +=================================================+ | 2351 | // +=================================================+ |
2353 | 2352 | ||
2354 | LLViewerImage* LLScriptBridge::getIcon() const | 2353 | LLUIImagePtr LLScriptBridge::getIcon() const |
2355 | { | 2354 | { |
2356 | return get_item_icon(LLAssetType::AT_SCRIPT, LLInventoryType::IT_LSL, 0, FALSE); | 2355 | return get_item_icon(LLAssetType::AT_SCRIPT, LLInventoryType::IT_LSL, 0, FALSE); |
2357 | } | 2356 | } |
@@ -2363,7 +2362,7 @@ LLViewerImage* LLScriptBridge::getIcon() const | |||
2363 | LLString LLTextureBridge::sPrefix("Texture: "); | 2362 | LLString LLTextureBridge::sPrefix("Texture: "); |
2364 | 2363 | ||
2365 | 2364 | ||
2366 | LLViewerImage* LLTextureBridge::getIcon() const | 2365 | LLUIImagePtr LLTextureBridge::getIcon() const |
2367 | { | 2366 | { |
2368 | return get_item_icon(LLAssetType::AT_TEXTURE, mInvType, 0, FALSE); | 2367 | return get_item_icon(LLAssetType::AT_TEXTURE, mInvType, 0, FALSE); |
2369 | } | 2368 | } |
@@ -2413,7 +2412,7 @@ void LLTextureBridge::openItem() | |||
2413 | LLString LLSoundBridge::sPrefix("Sound: "); | 2412 | LLString LLSoundBridge::sPrefix("Sound: "); |
2414 | 2413 | ||
2415 | 2414 | ||
2416 | LLViewerImage* LLSoundBridge::getIcon() const | 2415 | LLUIImagePtr LLSoundBridge::getIcon() const |
2417 | { | 2416 | { |
2418 | return get_item_icon(LLAssetType::AT_SOUND, LLInventoryType::IT_SOUND, 0, FALSE); | 2417 | return get_item_icon(LLAssetType::AT_SOUND, LLInventoryType::IT_SOUND, 0, FALSE); |
2419 | } | 2418 | } |
@@ -2508,7 +2507,7 @@ void LLSoundBridge::buildContextMenu(LLMenuGL& menu, U32 flags) | |||
2508 | 2507 | ||
2509 | LLString LLLandmarkBridge::sPrefix("Landmark: "); | 2508 | LLString LLLandmarkBridge::sPrefix("Landmark: "); |
2510 | 2509 | ||
2511 | LLViewerImage* LLLandmarkBridge::getIcon() const | 2510 | LLUIImagePtr LLLandmarkBridge::getIcon() const |
2512 | { | 2511 | { |
2513 | return get_item_icon(LLAssetType::AT_LANDMARK, LLInventoryType::IT_LANDMARK, mVisited, FALSE); | 2512 | return get_item_icon(LLAssetType::AT_LANDMARK, LLInventoryType::IT_LANDMARK, mVisited, FALSE); |
2514 | } | 2513 | } |
@@ -2695,7 +2694,7 @@ void LLCallingCardBridge::performAction(LLFolderView* folder, LLInventoryModel* | |||
2695 | else LLItemBridge::performAction(folder, model, action); | 2694 | else LLItemBridge::performAction(folder, model, action); |
2696 | } | 2695 | } |
2697 | 2696 | ||
2698 | LLViewerImage* LLCallingCardBridge::getIcon() const | 2697 | LLUIImagePtr LLCallingCardBridge::getIcon() const |
2699 | { | 2698 | { |
2700 | BOOL online = FALSE; | 2699 | BOOL online = FALSE; |
2701 | LLViewerInventoryItem* item = getItem(); | 2700 | LLViewerInventoryItem* item = getItem(); |
@@ -2855,7 +2854,7 @@ BOOL LLCallingCardBridge::dragOrDrop(MASK mask, BOOL drop, | |||
2855 | LLString LLNotecardBridge::sPrefix("Note: "); | 2854 | LLString LLNotecardBridge::sPrefix("Note: "); |
2856 | 2855 | ||
2857 | 2856 | ||
2858 | LLViewerImage* LLNotecardBridge::getIcon() const | 2857 | LLUIImagePtr LLNotecardBridge::getIcon() const |
2859 | { | 2858 | { |
2860 | return get_item_icon(LLAssetType::AT_NOTECARD, LLInventoryType::IT_NOTECARD, 0, FALSE); | 2859 | return get_item_icon(LLAssetType::AT_NOTECARD, LLInventoryType::IT_NOTECARD, 0, FALSE); |
2861 | } | 2860 | } |
@@ -2923,7 +2922,7 @@ void LLNotecardBridge::openItem() | |||
2923 | 2922 | ||
2924 | LLString LLGestureBridge::sPrefix("Gesture: "); | 2923 | LLString LLGestureBridge::sPrefix("Gesture: "); |
2925 | 2924 | ||
2926 | LLViewerImage* LLGestureBridge::getIcon() const | 2925 | LLUIImagePtr LLGestureBridge::getIcon() const |
2927 | { | 2926 | { |
2928 | return get_item_icon(LLAssetType::AT_GESTURE, LLInventoryType::IT_GESTURE, 0, FALSE); | 2927 | return get_item_icon(LLAssetType::AT_GESTURE, LLInventoryType::IT_GESTURE, 0, FALSE); |
2929 | } | 2928 | } |
@@ -3055,7 +3054,7 @@ void LLGestureBridge::buildContextMenu(LLMenuGL& menu, U32 flags) | |||
3055 | LLString LLAnimationBridge::sPrefix("Animation: "); | 3054 | LLString LLAnimationBridge::sPrefix("Animation: "); |
3056 | 3055 | ||
3057 | 3056 | ||
3058 | LLViewerImage* LLAnimationBridge::getIcon() const | 3057 | LLUIImagePtr LLAnimationBridge::getIcon() const |
3059 | { | 3058 | { |
3060 | return get_item_icon(LLAssetType::AT_ANIMATION, LLInventoryType::IT_ANIMATION, 0, FALSE); | 3059 | return get_item_icon(LLAssetType::AT_ANIMATION, LLInventoryType::IT_ANIMATION, 0, FALSE); |
3061 | } | 3060 | } |
@@ -3173,7 +3172,7 @@ BOOL LLObjectBridge::isItemRemovable() | |||
3173 | return LLInvFVBridge::isItemRemovable(); | 3172 | return LLInvFVBridge::isItemRemovable(); |
3174 | } | 3173 | } |
3175 | 3174 | ||
3176 | LLViewerImage* LLObjectBridge::getIcon() const | 3175 | LLUIImagePtr LLObjectBridge::getIcon() const |
3177 | { | 3176 | { |
3178 | return get_item_icon(LLAssetType::AT_OBJECT, mInvType, mAttachPt, mIsMultiObject ); | 3177 | return get_item_icon(LLAssetType::AT_OBJECT, mInvType, mAttachPt, mIsMultiObject ); |
3179 | } | 3178 | } |
@@ -3223,7 +3222,7 @@ void LLObjectBridge::performAction(LLFolderView* folder, LLInventoryModel* model | |||
3223 | gObjectList.findObject(item->getUUID()); | 3222 | gObjectList.findObject(item->getUUID()); |
3224 | if (found_obj) | 3223 | if (found_obj) |
3225 | { | 3224 | { |
3226 | gSelectMgr->remove(found_obj); | 3225 | LLSelectMgr::getInstance()->remove(found_obj); |
3227 | } | 3226 | } |
3228 | else | 3227 | else |
3229 | { | 3228 | { |
@@ -3432,10 +3431,10 @@ BOOL LLObjectBridge::renameItem(const LLString& new_name) | |||
3432 | LLViewerObject* obj = avatar->getWornAttachment( item->getUUID() ); | 3431 | LLViewerObject* obj = avatar->getWornAttachment( item->getUUID() ); |
3433 | if( obj ) | 3432 | if( obj ) |
3434 | { | 3433 | { |
3435 | gSelectMgr->deselectAll(); | 3434 | LLSelectMgr::getInstance()->deselectAll(); |
3436 | gSelectMgr->addAsIndividual( obj, SELECT_ALL_TES, FALSE ); | 3435 | LLSelectMgr::getInstance()->addAsIndividual( obj, SELECT_ALL_TES, FALSE ); |
3437 | gSelectMgr->selectionSetObjectName( new_name ); | 3436 | LLSelectMgr::getInstance()->selectionSetObjectName( new_name ); |
3438 | gSelectMgr->deselectAll(); | 3437 | LLSelectMgr::getInstance()->deselectAll(); |
3439 | } | 3438 | } |
3440 | } | 3439 | } |
3441 | } | 3440 | } |
@@ -3450,7 +3449,7 @@ BOOL LLObjectBridge::renameItem(const LLString& new_name) | |||
3450 | 3449 | ||
3451 | LLString LLLSLTextBridge::sPrefix("Script: "); | 3450 | LLString LLLSLTextBridge::sPrefix("Script: "); |
3452 | 3451 | ||
3453 | LLViewerImage* LLLSLTextBridge::getIcon() const | 3452 | LLUIImagePtr LLLSLTextBridge::getIcon() const |
3454 | { | 3453 | { |
3455 | return get_item_icon(LLAssetType::AT_SCRIPT, LLInventoryType::IT_LSL, 0, FALSE); | 3454 | return get_item_icon(LLAssetType::AT_SCRIPT, LLInventoryType::IT_LSL, 0, FALSE); |
3456 | } | 3455 | } |
@@ -4176,7 +4175,7 @@ void remove_inventory_category_from_avatar_step2( BOOL proceed, void* userdata) | |||
4176 | LLViewerObject *found_obj = gObjectList.findObject( obj_item_array.get(i)->getUUID()); | 4175 | LLViewerObject *found_obj = gObjectList.findObject( obj_item_array.get(i)->getUUID()); |
4177 | if (found_obj) | 4176 | if (found_obj) |
4178 | { | 4177 | { |
4179 | gSelectMgr->remove(found_obj); | 4178 | LLSelectMgr::getInstance()->remove(found_obj); |
4180 | } | 4179 | } |
4181 | else | 4180 | else |
4182 | { | 4181 | { |
@@ -4243,7 +4242,7 @@ LLString LLWearableBridge::getLabelSuffix() const | |||
4243 | } | 4242 | } |
4244 | } | 4243 | } |
4245 | 4244 | ||
4246 | LLViewerImage* LLWearableBridge::getIcon() const | 4245 | LLUIImagePtr LLWearableBridge::getIcon() const |
4247 | { | 4246 | { |
4248 | return get_item_icon(mAssetType, mInvType, mWearableType, FALSE); | 4247 | return get_item_icon(mAssetType, mInvType, mWearableType, FALSE); |
4249 | } | 4248 | } |