aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden/indra/newview/llpanelinventory.cpp
diff options
context:
space:
mode:
authorJacek Antonelli2008-08-15 23:45:42 -0500
committerJacek Antonelli2008-08-15 23:45:42 -0500
commitce28e056c20bf2723f565bbf464b87781ec248a2 (patch)
treeef7b0501c4de4b631a916305cbc2a5fdc125e52d /linden/indra/newview/llpanelinventory.cpp
parentSecond Life viewer sources 1.19.1.4b (diff)
downloadmeta-impy-ce28e056c20bf2723f565bbf464b87781ec248a2.zip
meta-impy-ce28e056c20bf2723f565bbf464b87781ec248a2.tar.gz
meta-impy-ce28e056c20bf2723f565bbf464b87781ec248a2.tar.bz2
meta-impy-ce28e056c20bf2723f565bbf464b87781ec248a2.tar.xz
Second Life viewer sources 1.20.2
Diffstat (limited to 'linden/indra/newview/llpanelinventory.cpp')
-rw-r--r--linden/indra/newview/llpanelinventory.cpp120
1 files changed, 58 insertions, 62 deletions
diff --git a/linden/indra/newview/llpanelinventory.cpp b/linden/indra/newview/llpanelinventory.cpp
index 3e92760..466e2b3 100644
--- a/linden/indra/newview/llpanelinventory.cpp
+++ b/linden/indra/newview/llpanelinventory.cpp
@@ -125,7 +125,7 @@ public:
125 virtual PermissionMask getPermissionMask() const { return PERM_NONE; } 125 virtual PermissionMask getPermissionMask() const { return PERM_NONE; }
126 virtual const LLUUID& getUUID() const { return mUUID; } 126 virtual const LLUUID& getUUID() const { return mUUID; }
127 virtual U32 getCreationDate() const; 127 virtual U32 getCreationDate() const;
128 virtual LLViewerImage* getIcon() const; 128 virtual LLUIImagePtr getIcon() const;
129 virtual void openItem(); 129 virtual void openItem();
130 virtual void previewItem(); 130 virtual void previewItem();
131 virtual void selectItem() {} 131 virtual void selectItem() {}
@@ -339,7 +339,7 @@ U32 LLTaskInvFVBridge::getCreationDate() const
339 return 0; 339 return 0;
340} 340}
341 341
342LLViewerImage* LLTaskInvFVBridge::getIcon() const 342LLUIImagePtr LLTaskInvFVBridge::getIcon() const
343{ 343{
344 BOOL item_is_multi = FALSE; 344 BOOL item_is_multi = FALSE;
345 if ( mFlags & LLInventoryItem::II_FLAGS_OBJECT_HAS_MULTIPLE_ITEMS ) 345 if ( mFlags & LLInventoryItem::II_FLAGS_OBJECT_HAS_MULTIPLE_ITEMS )
@@ -700,7 +700,7 @@ public:
700 const LLUUID& uuid, 700 const LLUUID& uuid,
701 const LLString& name); 701 const LLString& name);
702 702
703 virtual LLViewerImage* getIcon() const; 703 virtual LLUIImagePtr getIcon() const;
704 virtual const LLString& getDisplayName() const { return getName(); } 704 virtual const LLString& getDisplayName() const { return getName(); }
705 virtual BOOL isItemRenameable() const; 705 virtual BOOL isItemRenameable() const;
706 virtual BOOL renameItem(const LLString& new_name); 706 virtual BOOL renameItem(const LLString& new_name);
@@ -721,10 +721,9 @@ LLTaskCategoryBridge::LLTaskCategoryBridge(
721{ 721{
722} 722}
723 723
724LLViewerImage* LLTaskCategoryBridge::getIcon() const 724LLUIImagePtr LLTaskCategoryBridge::getIcon() const
725{ 725{
726 LLString uuid_string = gViewerArt.getString("inv_folder_plain_closed.tga"); 726 return LLUI::getUIImage("inv_folder_plain_closed.tga");
727 return gImageList.getImage(LLUUID(uuid_string), MIPMAP_FALSE, TRUE);
728} 727}
729 728
730BOOL LLTaskCategoryBridge::isItemRenameable() const 729BOOL LLTaskCategoryBridge::isItemRenameable() const
@@ -799,7 +798,7 @@ BOOL LLTaskCategoryBridge::dragOrDrop(MASK mask, BOOL drop,
799 switch(cargo_type) 798 switch(cargo_type)
800 { 799 {
801 case DAD_CATEGORY: 800 case DAD_CATEGORY:
802 accept = gToolDragAndDrop->dadUpdateInventoryCategory(object,drop); 801 accept = LLToolDragAndDrop::getInstance()->dadUpdateInventoryCategory(object,drop);
803 break; 802 break;
804 case DAD_TEXTURE: 803 case DAD_TEXTURE:
805 case DAD_SOUND: 804 case DAD_SOUND:
@@ -817,8 +816,8 @@ BOOL LLTaskCategoryBridge::dragOrDrop(MASK mask, BOOL drop,
817 //accept = LLToolDragAndDrop::isInventoryDropAcceptable(object, (LLViewerInventoryItem*)cargo_data); 816 //accept = LLToolDragAndDrop::isInventoryDropAcceptable(object, (LLViewerInventoryItem*)cargo_data);
818 if(LLToolDragAndDrop::isInventoryDropAcceptable( 817 if(LLToolDragAndDrop::isInventoryDropAcceptable(
819 object, (LLViewerInventoryItem*)cargo_data) 818 object, (LLViewerInventoryItem*)cargo_data)
820 && (LLToolDragAndDrop::SOURCE_WORLD != gToolDragAndDrop->getSource()) 819 && (LLToolDragAndDrop::SOURCE_WORLD != LLToolDragAndDrop::getInstance()->getSource())
821 && (LLToolDragAndDrop::SOURCE_NOTECARD != gToolDragAndDrop->getSource())) 820 && (LLToolDragAndDrop::SOURCE_NOTECARD != LLToolDragAndDrop::getInstance()->getSource()))
822 { 821 {
823 accept = TRUE; 822 accept = TRUE;
824 } 823 }
@@ -826,8 +825,8 @@ BOOL LLTaskCategoryBridge::dragOrDrop(MASK mask, BOOL drop,
826 { 825 {
827 LLToolDragAndDrop::dropInventory(object, 826 LLToolDragAndDrop::dropInventory(object,
828 (LLViewerInventoryItem*)cargo_data, 827 (LLViewerInventoryItem*)cargo_data,
829 gToolDragAndDrop->getSource(), 828 LLToolDragAndDrop::getInstance()->getSource(),
830 gToolDragAndDrop->getSourceID()); 829 LLToolDragAndDrop::getInstance()->getSourceID());
831 } 830 }
832 break; 831 break;
833 case DAD_SCRIPT: 832 case DAD_SCRIPT:
@@ -838,8 +837,8 @@ BOOL LLTaskCategoryBridge::dragOrDrop(MASK mask, BOOL drop,
838 //accept = LLToolDragAndDrop::isInventoryDropAcceptable(object, (LLViewerInventoryItem*)cargo_data); 837 //accept = LLToolDragAndDrop::isInventoryDropAcceptable(object, (LLViewerInventoryItem*)cargo_data);
839 if(LLToolDragAndDrop::isInventoryDropAcceptable( 838 if(LLToolDragAndDrop::isInventoryDropAcceptable(
840 object, (LLViewerInventoryItem*)cargo_data) 839 object, (LLViewerInventoryItem*)cargo_data)
841 && (LLToolDragAndDrop::SOURCE_WORLD != gToolDragAndDrop->getSource()) 840 && (LLToolDragAndDrop::SOURCE_WORLD != LLToolDragAndDrop::getInstance()->getSource())
842 && (LLToolDragAndDrop::SOURCE_NOTECARD != gToolDragAndDrop->getSource())) 841 && (LLToolDragAndDrop::SOURCE_NOTECARD != LLToolDragAndDrop::getInstance()->getSource()))
843 { 842 {
844 accept = TRUE; 843 accept = TRUE;
845 } 844 }
@@ -850,8 +849,8 @@ BOOL LLTaskCategoryBridge::dragOrDrop(MASK mask, BOOL drop,
850 // inactive if the control key is being held down. 849 // inactive if the control key is being held down.
851 BOOL active = ((mask & MASK_CONTROL) == 0); 850 BOOL active = ((mask & MASK_CONTROL) == 0);
852 LLToolDragAndDrop::dropScript(object, item, active, 851 LLToolDragAndDrop::dropScript(object, item, active,
853 gToolDragAndDrop->getSource(), 852 LLToolDragAndDrop::getInstance()->getSource(),
854 gToolDragAndDrop->getSourceID()); 853 LLToolDragAndDrop::getInstance()->getSourceID());
855 } 854 }
856 break; 855 break;
857 case DAD_CALLINGCARD: 856 case DAD_CALLINGCARD:
@@ -875,7 +874,7 @@ public:
875 const LLString& name, 874 const LLString& name,
876 LLInventoryType::EType it); 875 LLInventoryType::EType it);
877 876
878 virtual LLViewerImage* getIcon() const; 877 virtual LLUIImagePtr getIcon() const;
879 virtual void openItem(); 878 virtual void openItem();
880protected: 879protected:
881 LLInventoryType::EType mInventoryType; 880 LLInventoryType::EType mInventoryType;
@@ -891,7 +890,7 @@ LLTaskTextureBridge::LLTaskTextureBridge(
891{ 890{
892} 891}
893 892
894LLViewerImage* LLTaskTextureBridge::getIcon() const 893LLUIImagePtr LLTaskTextureBridge::getIcon() const
895{ 894{
896 return get_item_icon(LLAssetType::AT_TEXTURE, mInventoryType, 0, FALSE); 895 return get_item_icon(LLAssetType::AT_TEXTURE, mInventoryType, 0, FALSE);
897} 896}
@@ -928,7 +927,7 @@ public:
928 const LLUUID& uuid, 927 const LLUUID& uuid,
929 const LLString& name); 928 const LLString& name);
930 929
931 virtual LLViewerImage* getIcon() const; 930 virtual LLUIImagePtr getIcon() const;
932 virtual void openItem(); 931 virtual void openItem();
933 virtual void performAction(LLFolderView* folder, LLInventoryModel* model, LLString action); 932 virtual void performAction(LLFolderView* folder, LLInventoryModel* model, LLString action);
934 virtual void buildContextMenu(LLMenuGL& menu, U32 flags); 933 virtual void buildContextMenu(LLMenuGL& menu, U32 flags);
@@ -943,7 +942,7 @@ LLTaskSoundBridge::LLTaskSoundBridge(
943{ 942{
944} 943}
945 944
946LLViewerImage* LLTaskSoundBridge::getIcon() const 945LLUIImagePtr LLTaskSoundBridge::getIcon() const
947{ 946{
948 return get_item_icon(LLAssetType::AT_SOUND, LLInventoryType::IT_SOUND, 0, FALSE); 947 return get_item_icon(LLAssetType::AT_SOUND, LLInventoryType::IT_SOUND, 0, FALSE);
949} 948}
@@ -1065,7 +1064,7 @@ public:
1065 const LLUUID& uuid, 1064 const LLUUID& uuid,
1066 const LLString& name); 1065 const LLString& name);
1067 1066
1068 virtual LLViewerImage* getIcon() const; 1067 virtual LLUIImagePtr getIcon() const;
1069}; 1068};
1070 1069
1071LLTaskLandmarkBridge::LLTaskLandmarkBridge( 1070LLTaskLandmarkBridge::LLTaskLandmarkBridge(
@@ -1076,7 +1075,7 @@ LLTaskLandmarkBridge::LLTaskLandmarkBridge(
1076{ 1075{
1077} 1076}
1078 1077
1079LLViewerImage* LLTaskLandmarkBridge::getIcon() const 1078LLUIImagePtr LLTaskLandmarkBridge::getIcon() const
1080{ 1079{
1081 return get_item_icon(LLAssetType::AT_LANDMARK, LLInventoryType::IT_LANDMARK, 0, FALSE); 1080 return get_item_icon(LLAssetType::AT_LANDMARK, LLInventoryType::IT_LANDMARK, 0, FALSE);
1082} 1081}
@@ -1094,7 +1093,7 @@ public:
1094 const LLUUID& uuid, 1093 const LLUUID& uuid,
1095 const LLString& name); 1094 const LLString& name);
1096 1095
1097 virtual LLViewerImage* getIcon() const; 1096 virtual LLUIImagePtr getIcon() const;
1098 virtual BOOL isItemRenameable() const; 1097 virtual BOOL isItemRenameable() const;
1099 virtual BOOL renameItem(const LLString& new_name); 1098 virtual BOOL renameItem(const LLString& new_name);
1100}; 1099};
@@ -1107,7 +1106,7 @@ LLTaskCallingCardBridge::LLTaskCallingCardBridge(
1107{ 1106{
1108} 1107}
1109 1108
1110LLViewerImage* LLTaskCallingCardBridge::getIcon() const 1109LLUIImagePtr LLTaskCallingCardBridge::getIcon() const
1111{ 1110{
1112 return get_item_icon(LLAssetType::AT_CALLINGCARD, LLInventoryType::IT_CALLINGCARD, 0, FALSE); 1111 return get_item_icon(LLAssetType::AT_CALLINGCARD, LLInventoryType::IT_CALLINGCARD, 0, FALSE);
1113} 1112}
@@ -1135,7 +1134,7 @@ public:
1135 const LLUUID& uuid, 1134 const LLUUID& uuid,
1136 const LLString& name); 1135 const LLString& name);
1137 1136
1138 virtual LLViewerImage* getIcon() const; 1137 virtual LLUIImagePtr getIcon() const;
1139 //static BOOL enableIfCopyable( void* userdata ); 1138 //static BOOL enableIfCopyable( void* userdata );
1140}; 1139};
1141 1140
@@ -1147,7 +1146,7 @@ LLTaskScriptBridge::LLTaskScriptBridge(
1147{ 1146{
1148} 1147}
1149 1148
1150LLViewerImage* LLTaskScriptBridge::getIcon() const 1149LLUIImagePtr LLTaskScriptBridge::getIcon() const
1151{ 1150{
1152 return get_item_icon(LLAssetType::AT_SCRIPT, LLInventoryType::IT_LSL, 0, FALSE); 1151 return get_item_icon(LLAssetType::AT_SCRIPT, LLInventoryType::IT_LSL, 0, FALSE);
1153} 1152}
@@ -1235,7 +1234,7 @@ public:
1235 const LLUUID& uuid, 1234 const LLUUID& uuid,
1236 const LLString& name); 1235 const LLString& name);
1237 1236
1238 virtual LLViewerImage* getIcon() const; 1237 virtual LLUIImagePtr getIcon() const;
1239}; 1238};
1240 1239
1241LLTaskObjectBridge::LLTaskObjectBridge( 1240LLTaskObjectBridge::LLTaskObjectBridge(
@@ -1246,7 +1245,7 @@ LLTaskObjectBridge::LLTaskObjectBridge(
1246{ 1245{
1247} 1246}
1248 1247
1249LLViewerImage* LLTaskObjectBridge::getIcon() const 1248LLUIImagePtr LLTaskObjectBridge::getIcon() const
1250{ 1249{
1251 BOOL item_is_multi = FALSE; 1250 BOOL item_is_multi = FALSE;
1252 if ( mFlags & LLInventoryItem::II_FLAGS_OBJECT_HAS_MULTIPLE_ITEMS ) 1251 if ( mFlags & LLInventoryItem::II_FLAGS_OBJECT_HAS_MULTIPLE_ITEMS )
@@ -1269,7 +1268,7 @@ public:
1269 const LLUUID& uuid, 1268 const LLUUID& uuid,
1270 const LLString& name); 1269 const LLString& name);
1271 1270
1272 virtual LLViewerImage* getIcon() const; 1271 virtual LLUIImagePtr getIcon() const;
1273 virtual void openItem(); 1272 virtual void openItem();
1274 virtual BOOL removeItem(); 1273 virtual BOOL removeItem();
1275}; 1274};
@@ -1282,7 +1281,7 @@ LLTaskNotecardBridge::LLTaskNotecardBridge(
1282{ 1281{
1283} 1282}
1284 1283
1285LLViewerImage* LLTaskNotecardBridge::getIcon() const 1284LLUIImagePtr LLTaskNotecardBridge::getIcon() const
1286{ 1285{
1287 return get_item_icon(LLAssetType::AT_NOTECARD, LLInventoryType::IT_NOTECARD, 0, FALSE); 1286 return get_item_icon(LLAssetType::AT_NOTECARD, LLInventoryType::IT_NOTECARD, 0, FALSE);
1288} 1287}
@@ -1335,7 +1334,7 @@ public:
1335 const LLUUID& uuid, 1334 const LLUUID& uuid,
1336 const LLString& name); 1335 const LLString& name);
1337 1336
1338 virtual LLViewerImage* getIcon() const; 1337 virtual LLUIImagePtr getIcon() const;
1339 virtual void openItem(); 1338 virtual void openItem();
1340 virtual BOOL removeItem(); 1339 virtual BOOL removeItem();
1341}; 1340};
@@ -1348,7 +1347,7 @@ LLTaskGestureBridge::LLTaskGestureBridge(
1348{ 1347{
1349} 1348}
1350 1349
1351LLViewerImage* LLTaskGestureBridge::getIcon() const 1350LLUIImagePtr LLTaskGestureBridge::getIcon() const
1352{ 1351{
1353 return get_item_icon(LLAssetType::AT_GESTURE, LLInventoryType::IT_GESTURE, 0, FALSE); 1352 return get_item_icon(LLAssetType::AT_GESTURE, LLInventoryType::IT_GESTURE, 0, FALSE);
1354} 1353}
@@ -1395,7 +1394,7 @@ public:
1395 const LLUUID& uuid, 1394 const LLUUID& uuid,
1396 const LLString& name); 1395 const LLString& name);
1397 1396
1398 virtual LLViewerImage* getIcon() const; 1397 virtual LLUIImagePtr getIcon() const;
1399 virtual void openItem(); 1398 virtual void openItem();
1400 virtual BOOL removeItem(); 1399 virtual BOOL removeItem();
1401}; 1400};
@@ -1408,7 +1407,7 @@ LLTaskAnimationBridge::LLTaskAnimationBridge(
1408{ 1407{
1409} 1408}
1410 1409
1411LLViewerImage* LLTaskAnimationBridge::getIcon() const 1410LLUIImagePtr LLTaskAnimationBridge::getIcon() const
1412{ 1411{
1413 return get_item_icon(LLAssetType::AT_ANIMATION, LLInventoryType::IT_ANIMATION, 0, FALSE); 1412 return get_item_icon(LLAssetType::AT_ANIMATION, LLInventoryType::IT_ANIMATION, 0, FALSE);
1414} 1413}
@@ -1475,7 +1474,7 @@ public:
1475 LLAssetType::EType asset_type, 1474 LLAssetType::EType asset_type,
1476 U32 flags); 1475 U32 flags);
1477 1476
1478 virtual LLViewerImage* getIcon() const; 1477 virtual LLUIImagePtr getIcon() const;
1479 1478
1480protected: 1479protected:
1481 LLAssetType::EType mAssetType; 1480 LLAssetType::EType mAssetType;
@@ -1492,7 +1491,7 @@ LLTaskWearableBridge::LLTaskWearableBridge(
1492{ 1491{
1493} 1492}
1494 1493
1495LLViewerImage* LLTaskWearableBridge::getIcon() const 1494LLUIImagePtr LLTaskWearableBridge::getIcon() const
1496{ 1495{
1497 return get_item_icon(mAssetType, LLInventoryType::IT_WEARABLE, mFlags, FALSE ); 1496 return get_item_icon(mAssetType, LLInventoryType::IT_WEARABLE, mFlags, FALSE );
1498} 1497}
@@ -1620,9 +1619,9 @@ void LLPanelInventory::clearContents()
1620{ 1619{
1621 mHaveInventory = FALSE; 1620 mHaveInventory = FALSE;
1622 mIsInventoryEmpty = TRUE; 1621 mIsInventoryEmpty = TRUE;
1623 if (gToolDragAndDrop && gToolDragAndDrop->getSource() == LLToolDragAndDrop::SOURCE_WORLD) 1622 if (LLToolDragAndDrop::getInstance() && LLToolDragAndDrop::getInstance()->getSource() == LLToolDragAndDrop::SOURCE_WORLD)
1624 { 1623 {
1625 gToolDragAndDrop->endDrag(); 1624 LLToolDragAndDrop::getInstance()->endDrag();
1626 } 1625 }
1627 1626
1628 if( mScroller ) 1627 if( mScroller )
@@ -1854,12 +1853,12 @@ void LLPanelInventory::refresh()
1854 //llinfos << "LLPanelInventory::refresh()" << llendl; 1853 //llinfos << "LLPanelInventory::refresh()" << llendl;
1855 BOOL has_inventory = FALSE; 1854 BOOL has_inventory = FALSE;
1856 const BOOL non_root_ok = TRUE; 1855 const BOOL non_root_ok = TRUE;
1857 LLSelectNode* node = gSelectMgr->getSelection()->getFirstRootNode(NULL, non_root_ok); 1856 LLSelectNode* node = LLSelectMgr::getInstance()->getSelection()->getFirstRootNode(NULL, non_root_ok);
1858 if(node) 1857 if(node)
1859 { 1858 {
1860 LLViewerObject* object = node->getObject(); 1859 LLViewerObject* object = node->getObject();
1861 if(object && ((gSelectMgr->getSelection()->getRootObjectCount() == 1) 1860 if(object && ((LLSelectMgr::getInstance()->getSelection()->getRootObjectCount() == 1)
1862 || (gSelectMgr->getSelection()->getObjectCount() == 1))) 1861 || (LLSelectMgr::getInstance()->getSelection()->getObjectCount() == 1)))
1863 { 1862 {
1864 // determine if we need to make a request. Start with a 1863 // determine if we need to make a request. Start with a
1865 // default based on if we have inventory at all. 1864 // default based on if we have inventory at all.
@@ -1925,30 +1924,27 @@ void LLPanelInventory::startRenamingSelectedItem()
1925 1924
1926void LLPanelInventory::draw() 1925void LLPanelInventory::draw()
1927{ 1926{
1928 if( getVisible() ) 1927 LLPanel::draw();
1929 {
1930 LLPanel::draw();
1931 1928
1932 if(mIsInventoryEmpty) 1929 if(mIsInventoryEmpty)
1930 {
1931 if((LLUUID::null != mTaskUUID) && (!mHaveInventory))
1933 { 1932 {
1934 if((LLUUID::null != mTaskUUID) && (!mHaveInventory)) 1933 LLFontGL::sSansSerif->renderUTF8("Loading contents...", 0,
1935 { 1934 (S32)(getRect().getWidth() * 0.5f),
1936 LLFontGL::sSansSerif->renderUTF8("Loading contents...", 0, 1935 10,
1937 (S32)(getRect().getWidth() * 0.5f), 1936 LLColor4( 1, 1, 1, 1 ),
1938 10, 1937 LLFontGL::HCENTER,
1939 LLColor4( 1, 1, 1, 1 ), 1938 LLFontGL::BOTTOM);
1940 LLFontGL::HCENTER, 1939 }
1941 LLFontGL::BOTTOM); 1940 else if(mHaveInventory)
1942 } 1941 {
1943 else if(mHaveInventory) 1942 LLFontGL::sSansSerif->renderUTF8("No contents", 0,
1944 { 1943 (S32)(getRect().getWidth() * 0.5f),
1945 LLFontGL::sSansSerif->renderUTF8("No contents", 0, 1944 10,
1946 (S32)(getRect().getWidth() * 0.5f), 1945 LLColor4( 1, 1, 1, 1 ),
1947 10, 1946 LLFontGL::HCENTER,
1948 LLColor4( 1, 1, 1, 1 ), 1947 LLFontGL::BOTTOM);
1949 LLFontGL::HCENTER,
1950 LLFontGL::BOTTOM);
1951 }
1952 } 1948 }
1953 } 1949 }
1954} 1950}