diff options
author | Jacek Antonelli | 2008-09-06 18:24:57 -0500 |
---|---|---|
committer | Jacek Antonelli | 2008-09-06 18:25:07 -0500 |
commit | 798d367d54a6c6379ad355bd8345fa40e31e7fe9 (patch) | |
tree | 1921f1708cd0240648c97bc02df2c2ab5f2fc41e /linden/indra/newview/llpanelinventory.cpp | |
parent | Second Life viewer sources 1.20.15 (diff) | |
download | meta-impy-798d367d54a6c6379ad355bd8345fa40e31e7fe9.zip meta-impy-798d367d54a6c6379ad355bd8345fa40e31e7fe9.tar.gz meta-impy-798d367d54a6c6379ad355bd8345fa40e31e7fe9.tar.bz2 meta-impy-798d367d54a6c6379ad355bd8345fa40e31e7fe9.tar.xz |
Second Life viewer sources 1.21.0-RC
Diffstat (limited to '')
-rw-r--r-- | linden/indra/newview/llpanelinventory.cpp | 168 |
1 files changed, 85 insertions, 83 deletions
diff --git a/linden/indra/newview/llpanelinventory.cpp b/linden/indra/newview/llpanelinventory.cpp index 466e2b3..3c0e6d7 100644 --- a/linden/indra/newview/llpanelinventory.cpp +++ b/linden/indra/newview/llpanelinventory.cpp | |||
@@ -94,8 +94,8 @@ class LLTaskInvFVBridge : public LLFolderViewEventListener | |||
94 | { | 94 | { |
95 | protected: | 95 | protected: |
96 | LLUUID mUUID; | 96 | LLUUID mUUID; |
97 | LLString mName; | 97 | std::string mName; |
98 | mutable LLString mDisplayName; | 98 | mutable std::string mDisplayName; |
99 | LLPanelInventory* mPanel; | 99 | LLPanelInventory* mPanel; |
100 | U32 mFlags; | 100 | U32 mFlags; |
101 | 101 | ||
@@ -105,12 +105,12 @@ public: | |||
105 | LLTaskInvFVBridge( | 105 | LLTaskInvFVBridge( |
106 | LLPanelInventory* panel, | 106 | LLPanelInventory* panel, |
107 | const LLUUID& uuid, | 107 | const LLUUID& uuid, |
108 | const LLString& name, | 108 | const std::string& name, |
109 | U32 flags=0); | 109 | U32 flags=0); |
110 | virtual ~LLTaskInvFVBridge( void ) {} | 110 | virtual ~LLTaskInvFVBridge( void ) {} |
111 | 111 | ||
112 | virtual LLFontGL::StyleFlags getLabelStyle() const { return LLFontGL::NORMAL; } | 112 | virtual LLFontGL::StyleFlags getLabelStyle() const { return LLFontGL::NORMAL; } |
113 | virtual LLString getLabelSuffix() const { return LLString::null; } | 113 | virtual std::string getLabelSuffix() const { return LLStringUtil::null; } |
114 | 114 | ||
115 | static LLTaskInvFVBridge* createObjectBridge(LLPanelInventory* panel, | 115 | static LLTaskInvFVBridge* createObjectBridge(LLPanelInventory* panel, |
116 | LLInventoryObject* object); | 116 | LLInventoryObject* object); |
@@ -120,17 +120,17 @@ public: | |||
120 | static void commitBuyItem(S32 option, void* data); | 120 | static void commitBuyItem(S32 option, void* data); |
121 | 121 | ||
122 | // LLFolderViewEventListener functionality | 122 | // LLFolderViewEventListener functionality |
123 | virtual const LLString& getName() const; | 123 | virtual const std::string& getName() const; |
124 | virtual const LLString& getDisplayName() const; | 124 | virtual const std::string& getDisplayName() const; |
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 time_t getCreationDate() const; |
128 | virtual LLUIImagePtr 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() {} |
132 | virtual BOOL isItemRenameable() const; | 132 | virtual BOOL isItemRenameable() const; |
133 | virtual BOOL renameItem(const LLString& new_name); | 133 | virtual BOOL renameItem(const std::string& new_name); |
134 | virtual BOOL isItemMovable(); | 134 | virtual BOOL isItemMovable(); |
135 | virtual BOOL isItemRemovable(); | 135 | virtual BOOL isItemRemovable(); |
136 | virtual BOOL removeItem(); | 136 | virtual BOOL removeItem(); |
@@ -142,7 +142,7 @@ public: | |||
142 | virtual BOOL isClipboardPasteable() const; | 142 | virtual BOOL isClipboardPasteable() const; |
143 | virtual void pasteFromClipboard(); | 143 | virtual void pasteFromClipboard(); |
144 | virtual void buildContextMenu(LLMenuGL& menu, U32 flags); | 144 | virtual void buildContextMenu(LLMenuGL& menu, U32 flags); |
145 | virtual void performAction(LLFolderView* folder, LLInventoryModel* model, LLString action); | 145 | virtual void performAction(LLFolderView* folder, LLInventoryModel* model, std::string action); |
146 | virtual BOOL isUpToDate() const { return TRUE; } | 146 | virtual BOOL isUpToDate() const { return TRUE; } |
147 | virtual BOOL hasChildren() const { return FALSE; } | 147 | virtual BOOL hasChildren() const { return FALSE; } |
148 | virtual LLInventoryType::EType getInventoryType() const { return LLInventoryType::IT_NONE; } | 148 | virtual LLInventoryType::EType getInventoryType() const { return LLInventoryType::IT_NONE; } |
@@ -158,7 +158,7 @@ public: | |||
158 | LLTaskInvFVBridge::LLTaskInvFVBridge( | 158 | LLTaskInvFVBridge::LLTaskInvFVBridge( |
159 | LLPanelInventory* panel, | 159 | LLPanelInventory* panel, |
160 | const LLUUID& uuid, | 160 | const LLUUID& uuid, |
161 | const LLString& name, | 161 | const std::string& name, |
162 | U32 flags): | 162 | U32 flags): |
163 | mUUID(uuid), | 163 | mUUID(uuid), |
164 | mName(name), | 164 | mName(name), |
@@ -219,7 +219,7 @@ void LLTaskInvFVBridge::buyItem() | |||
219 | 219 | ||
220 | const LLSaleInfo& sale_info = item->getSaleInfo(); | 220 | const LLSaleInfo& sale_info = item->getSaleInfo(); |
221 | const LLPermissions& perm = item->getPermissions(); | 221 | const LLPermissions& perm = item->getPermissions(); |
222 | const LLString owner_name; // no owner name currently... FIXME? | 222 | const std::string owner_name; // no owner name currently... FIXME? |
223 | 223 | ||
224 | LLViewerObject* obj; | 224 | LLViewerObject* obj; |
225 | if( ( obj = gObjectList.findObject( mPanel->getTaskUUID() ) ) && obj->isAttachment() ) | 225 | if( ( obj = gObjectList.findObject( mPanel->getTaskUUID() ) ) && obj->isAttachment() ) |
@@ -230,7 +230,7 @@ void LLTaskInvFVBridge::buyItem() | |||
230 | } | 230 | } |
231 | else | 231 | else |
232 | { | 232 | { |
233 | LLString::format_map_t args; | 233 | LLStringUtil::format_map_t args; |
234 | args["[PRICE]"] = llformat("%d",sale_info.getSalePrice()); | 234 | args["[PRICE]"] = llformat("%d",sale_info.getSalePrice()); |
235 | args["[OWNER]"] = owner_name; | 235 | args["[OWNER]"] = owner_name; |
236 | if (sale_info.getSaleType() != LLSaleInfo::FS_CONTENTS) | 236 | if (sale_info.getSaleType() != LLSaleInfo::FS_CONTENTS) |
@@ -241,7 +241,7 @@ void LLTaskInvFVBridge::buyItem() | |||
241 | args["[RESELLPERM]"] = LLAlertDialog::getTemplateMessage((next_owner_mask & PERM_TRANSFER) ? "PermYes" : "PermNo"); | 241 | args["[RESELLPERM]"] = LLAlertDialog::getTemplateMessage((next_owner_mask & PERM_TRANSFER) ? "PermYes" : "PermNo"); |
242 | } | 242 | } |
243 | 243 | ||
244 | LLString alertdesc; | 244 | std::string alertdesc; |
245 | switch(sale_info.getSaleType()) | 245 | switch(sale_info.getSaleType()) |
246 | { | 246 | { |
247 | case LLSaleInfo::FS_ORIGINAL: | 247 | case LLSaleInfo::FS_ORIGINAL: |
@@ -299,12 +299,12 @@ void LLTaskInvFVBridge::commitBuyItem(S32 option, void* data) | |||
299 | delete inv; | 299 | delete inv; |
300 | } | 300 | } |
301 | 301 | ||
302 | const LLString& LLTaskInvFVBridge::getName() const | 302 | const std::string& LLTaskInvFVBridge::getName() const |
303 | { | 303 | { |
304 | return mName; | 304 | return mName; |
305 | } | 305 | } |
306 | 306 | ||
307 | const LLString& LLTaskInvFVBridge::getDisplayName() const | 307 | const std::string& LLTaskInvFVBridge::getDisplayName() const |
308 | { | 308 | { |
309 | LLInventoryItem* item = findItem(); | 309 | LLInventoryItem* item = findItem(); |
310 | if(item) | 310 | if(item) |
@@ -334,7 +334,7 @@ const LLString& LLTaskInvFVBridge::getDisplayName() const | |||
334 | } | 334 | } |
335 | 335 | ||
336 | // BUG: No creation dates for task inventory | 336 | // BUG: No creation dates for task inventory |
337 | U32 LLTaskInvFVBridge::getCreationDate() const | 337 | time_t LLTaskInvFVBridge::getCreationDate() const |
338 | { | 338 | { |
339 | return 0; | 339 | return 0; |
340 | } | 340 | } |
@@ -378,7 +378,7 @@ BOOL LLTaskInvFVBridge::isItemRenameable() const | |||
378 | return FALSE; | 378 | return FALSE; |
379 | } | 379 | } |
380 | 380 | ||
381 | BOOL LLTaskInvFVBridge::renameItem(const LLString& new_name) | 381 | BOOL LLTaskInvFVBridge::renameItem(const std::string& new_name) |
382 | { | 382 | { |
383 | LLViewerObject* object = gObjectList.findObject(mPanel->getTaskUUID()); | 383 | LLViewerObject* object = gObjectList.findObject(mPanel->getTaskUUID()); |
384 | if(object) | 384 | if(object) |
@@ -595,7 +595,7 @@ BOOL LLTaskInvFVBridge::dragOrDrop(MASK mask, BOOL drop, | |||
595 | //} | 595 | //} |
596 | 596 | ||
597 | // virtual | 597 | // virtual |
598 | void LLTaskInvFVBridge::performAction(LLFolderView* folder, LLInventoryModel* model, LLString action) | 598 | void LLTaskInvFVBridge::performAction(LLFolderView* folder, LLInventoryModel* model, std::string action) |
599 | { | 599 | { |
600 | if (action == "task_buy") | 600 | if (action == "task_buy") |
601 | { | 601 | { |
@@ -631,16 +631,17 @@ void LLTaskInvFVBridge::buildContextMenu(LLMenuGL& menu, U32 flags) | |||
631 | { | 631 | { |
632 | LLInventoryItem* item = findItem(); | 632 | LLInventoryItem* item = findItem(); |
633 | if(!item) return; | 633 | if(!item) return; |
634 | std::vector<LLString> items; | 634 | std::vector<std::string> items; |
635 | std::vector<LLString> disabled_items; | 635 | std::vector<std::string> disabled_items; |
636 | 636 | ||
637 | // *TODO: Translate | ||
637 | if(gAgent.allowOperation(PERM_OWNER, item->getPermissions(), | 638 | if(gAgent.allowOperation(PERM_OWNER, item->getPermissions(), |
638 | GP_OBJECT_MANIPULATE) | 639 | GP_OBJECT_MANIPULATE) |
639 | && item->getSaleInfo().isForSale()) | 640 | && item->getSaleInfo().isForSale()) |
640 | { | 641 | { |
641 | items.push_back("Task Buy"); | 642 | items.push_back(std::string("Task Buy")); |
642 | 643 | ||
643 | LLString label("Buy"); | 644 | std::string label("Buy"); |
644 | // Check the price of the item. | 645 | // Check the price of the item. |
645 | S32 price = getPrice(); | 646 | S32 price = getPrice(); |
646 | if (-1 == price) | 647 | if (-1 == price) |
@@ -658,7 +659,7 @@ void LLTaskInvFVBridge::buildContextMenu(LLMenuGL& menu, U32 flags) | |||
658 | LLView::child_list_t::const_iterator itor; | 659 | LLView::child_list_t::const_iterator itor; |
659 | for (itor = list->begin(); itor != list->end(); ++itor) | 660 | for (itor = list->begin(); itor != list->end(); ++itor) |
660 | { | 661 | { |
661 | LLString name = (*itor)->getName(); | 662 | std::string name = (*itor)->getName(); |
662 | LLMenuItemCallGL* menu_itemp = dynamic_cast<LLMenuItemCallGL*>(*itor); | 663 | LLMenuItemCallGL* menu_itemp = dynamic_cast<LLMenuItemCallGL*>(*itor); |
663 | if (name == "Task Buy" && menu_itemp) | 664 | if (name == "Task Buy" && menu_itemp) |
664 | { | 665 | { |
@@ -668,20 +669,20 @@ void LLTaskInvFVBridge::buildContextMenu(LLMenuGL& menu, U32 flags) | |||
668 | } | 669 | } |
669 | else | 670 | else |
670 | { | 671 | { |
671 | items.push_back("Task Open"); | 672 | items.push_back(std::string("Task Open")); |
672 | if (!isItemCopyable()) | 673 | if (!isItemCopyable()) |
673 | { | 674 | { |
674 | disabled_items.push_back("Task Open"); | 675 | disabled_items.push_back(std::string("Task Open")); |
675 | } | 676 | } |
676 | } | 677 | } |
677 | items.push_back("Task Properties"); | 678 | items.push_back(std::string("Task Properties")); |
678 | if(isItemRenameable()) | 679 | if(isItemRenameable()) |
679 | { | 680 | { |
680 | items.push_back("Task Rename"); | 681 | items.push_back(std::string("Task Rename")); |
681 | } | 682 | } |
682 | if(isItemRemovable()) | 683 | if(isItemRemovable()) |
683 | { | 684 | { |
684 | items.push_back("Task Remove"); | 685 | items.push_back(std::string("Task Remove")); |
685 | } | 686 | } |
686 | 687 | ||
687 | hideContextEntries(menu, items, disabled_items); | 688 | hideContextEntries(menu, items, disabled_items); |
@@ -698,12 +699,12 @@ public: | |||
698 | LLTaskCategoryBridge( | 699 | LLTaskCategoryBridge( |
699 | LLPanelInventory* panel, | 700 | LLPanelInventory* panel, |
700 | const LLUUID& uuid, | 701 | const LLUUID& uuid, |
701 | const LLString& name); | 702 | const std::string& name); |
702 | 703 | ||
703 | virtual LLUIImagePtr getIcon() const; | 704 | virtual LLUIImagePtr getIcon() const; |
704 | virtual const LLString& getDisplayName() const { return getName(); } | 705 | virtual const std::string& getDisplayName() const { return getName(); } |
705 | virtual BOOL isItemRenameable() const; | 706 | virtual BOOL isItemRenameable() const; |
706 | virtual BOOL renameItem(const LLString& new_name); | 707 | virtual BOOL renameItem(const std::string& new_name); |
707 | virtual BOOL isItemRemovable(); | 708 | virtual BOOL isItemRemovable(); |
708 | virtual void buildContextMenu(LLMenuGL& menu, U32 flags); | 709 | virtual void buildContextMenu(LLMenuGL& menu, U32 flags); |
709 | virtual BOOL hasChildren() const; | 710 | virtual BOOL hasChildren() const; |
@@ -716,7 +717,7 @@ public: | |||
716 | LLTaskCategoryBridge::LLTaskCategoryBridge( | 717 | LLTaskCategoryBridge::LLTaskCategoryBridge( |
717 | LLPanelInventory* panel, | 718 | LLPanelInventory* panel, |
718 | const LLUUID& uuid, | 719 | const LLUUID& uuid, |
719 | const LLString& name) : | 720 | const std::string& name) : |
720 | LLTaskInvFVBridge(panel, uuid, name) | 721 | LLTaskInvFVBridge(panel, uuid, name) |
721 | { | 722 | { |
722 | } | 723 | } |
@@ -731,7 +732,7 @@ BOOL LLTaskCategoryBridge::isItemRenameable() const | |||
731 | return FALSE; | 732 | return FALSE; |
732 | } | 733 | } |
733 | 734 | ||
734 | BOOL LLTaskCategoryBridge::renameItem(const LLString& new_name) | 735 | BOOL LLTaskCategoryBridge::renameItem(const std::string& new_name) |
735 | { | 736 | { |
736 | return FALSE; | 737 | return FALSE; |
737 | } | 738 | } |
@@ -743,9 +744,9 @@ BOOL LLTaskCategoryBridge::isItemRemovable() | |||
743 | 744 | ||
744 | void LLTaskCategoryBridge::buildContextMenu(LLMenuGL& menu, U32 flags) | 745 | void LLTaskCategoryBridge::buildContextMenu(LLMenuGL& menu, U32 flags) |
745 | { | 746 | { |
746 | std::vector<LLString> items; | 747 | std::vector<std::string> items; |
747 | std::vector<LLString> disabled_items; | 748 | std::vector<std::string> disabled_items; |
748 | items.push_back("Task Open"); | 749 | items.push_back(std::string("Task Open")); // *TODO: Translate |
749 | hideContextEntries(menu, items, disabled_items); | 750 | hideContextEntries(menu, items, disabled_items); |
750 | } | 751 | } |
751 | 752 | ||
@@ -871,7 +872,7 @@ public: | |||
871 | LLTaskTextureBridge( | 872 | LLTaskTextureBridge( |
872 | LLPanelInventory* panel, | 873 | LLPanelInventory* panel, |
873 | const LLUUID& uuid, | 874 | const LLUUID& uuid, |
874 | const LLString& name, | 875 | const std::string& name, |
875 | LLInventoryType::EType it); | 876 | LLInventoryType::EType it); |
876 | 877 | ||
877 | virtual LLUIImagePtr getIcon() const; | 878 | virtual LLUIImagePtr getIcon() const; |
@@ -883,7 +884,7 @@ protected: | |||
883 | LLTaskTextureBridge::LLTaskTextureBridge( | 884 | LLTaskTextureBridge::LLTaskTextureBridge( |
884 | LLPanelInventory* panel, | 885 | LLPanelInventory* panel, |
885 | const LLUUID& uuid, | 886 | const LLUUID& uuid, |
886 | const LLString& name, | 887 | const std::string& name, |
887 | LLInventoryType::EType it) : | 888 | LLInventoryType::EType it) : |
888 | LLTaskInvFVBridge(panel, uuid, name), | 889 | LLTaskInvFVBridge(panel, uuid, name), |
889 | mInventoryType(it) | 890 | mInventoryType(it) |
@@ -925,11 +926,11 @@ public: | |||
925 | LLTaskSoundBridge( | 926 | LLTaskSoundBridge( |
926 | LLPanelInventory* panel, | 927 | LLPanelInventory* panel, |
927 | const LLUUID& uuid, | 928 | const LLUUID& uuid, |
928 | const LLString& name); | 929 | const std::string& name); |
929 | 930 | ||
930 | virtual LLUIImagePtr getIcon() const; | 931 | virtual LLUIImagePtr getIcon() const; |
931 | virtual void openItem(); | 932 | virtual void openItem(); |
932 | virtual void performAction(LLFolderView* folder, LLInventoryModel* model, LLString action); | 933 | virtual void performAction(LLFolderView* folder, LLInventoryModel* model, std::string action); |
933 | virtual void buildContextMenu(LLMenuGL& menu, U32 flags); | 934 | virtual void buildContextMenu(LLMenuGL& menu, U32 flags); |
934 | static void openSoundPreview(void* data); | 935 | static void openSoundPreview(void* data); |
935 | }; | 936 | }; |
@@ -937,7 +938,7 @@ public: | |||
937 | LLTaskSoundBridge::LLTaskSoundBridge( | 938 | LLTaskSoundBridge::LLTaskSoundBridge( |
938 | LLPanelInventory* panel, | 939 | LLPanelInventory* panel, |
939 | const LLUUID& uuid, | 940 | const LLUUID& uuid, |
940 | const LLString& name) : | 941 | const std::string& name) : |
941 | LLTaskInvFVBridge(panel, uuid, name) | 942 | LLTaskInvFVBridge(panel, uuid, name) |
942 | { | 943 | { |
943 | } | 944 | } |
@@ -973,7 +974,7 @@ void LLTaskSoundBridge::openSoundPreview(void* data) | |||
973 | } | 974 | } |
974 | 975 | ||
975 | // virtual | 976 | // virtual |
976 | void LLTaskSoundBridge::performAction(LLFolderView* folder, LLInventoryModel* model, LLString action) | 977 | void LLTaskSoundBridge::performAction(LLFolderView* folder, LLInventoryModel* model, std::string action) |
977 | { | 978 | { |
978 | if (action == "task_play") | 979 | if (action == "task_play") |
979 | { | 980 | { |
@@ -990,15 +991,16 @@ void LLTaskSoundBridge::buildContextMenu(LLMenuGL& menu, U32 flags) | |||
990 | { | 991 | { |
991 | LLInventoryItem* item = findItem(); | 992 | LLInventoryItem* item = findItem(); |
992 | if(!item) return; | 993 | if(!item) return; |
993 | std::vector<LLString> items; | 994 | std::vector<std::string> items; |
994 | std::vector<LLString> disabled_items; | 995 | std::vector<std::string> disabled_items; |
995 | 996 | ||
997 | // *TODO: Translate | ||
996 | if(item->getPermissions().getOwner() != gAgent.getID() | 998 | if(item->getPermissions().getOwner() != gAgent.getID() |
997 | && item->getSaleInfo().isForSale()) | 999 | && item->getSaleInfo().isForSale()) |
998 | { | 1000 | { |
999 | items.push_back("Task Buy"); | 1001 | items.push_back(std::string("Task Buy")); |
1000 | 1002 | ||
1001 | LLString label("Buy"); | 1003 | std::string label("Buy"); |
1002 | // Check the price of the item. | 1004 | // Check the price of the item. |
1003 | S32 price = getPrice(); | 1005 | S32 price = getPrice(); |
1004 | if (-1 == price) | 1006 | if (-1 == price) |
@@ -1016,7 +1018,7 @@ void LLTaskSoundBridge::buildContextMenu(LLMenuGL& menu, U32 flags) | |||
1016 | LLView::child_list_t::const_iterator itor; | 1018 | LLView::child_list_t::const_iterator itor; |
1017 | for (itor = list->begin(); itor != list->end(); ++itor) | 1019 | for (itor = list->begin(); itor != list->end(); ++itor) |
1018 | { | 1020 | { |
1019 | LLString name = (*itor)->getName(); | 1021 | std::string name = (*itor)->getName(); |
1020 | LLMenuItemCallGL* menu_itemp = dynamic_cast<LLMenuItemCallGL*>(*itor); | 1022 | LLMenuItemCallGL* menu_itemp = dynamic_cast<LLMenuItemCallGL*>(*itor); |
1021 | if (name == "Task Buy" && menu_itemp) | 1023 | if (name == "Task Buy" && menu_itemp) |
1022 | { | 1024 | { |
@@ -1026,23 +1028,23 @@ void LLTaskSoundBridge::buildContextMenu(LLMenuGL& menu, U32 flags) | |||
1026 | } | 1028 | } |
1027 | else | 1029 | else |
1028 | { | 1030 | { |
1029 | items.push_back("Task Open"); | 1031 | items.push_back(std::string("Task Open")); |
1030 | if (!isItemCopyable()) | 1032 | if (!isItemCopyable()) |
1031 | { | 1033 | { |
1032 | disabled_items.push_back("Task Open"); | 1034 | disabled_items.push_back(std::string("Task Open")); |
1033 | } | 1035 | } |
1034 | } | 1036 | } |
1035 | items.push_back("Task Properties"); | 1037 | items.push_back(std::string("Task Properties")); |
1036 | if(isItemRenameable()) | 1038 | if(isItemRenameable()) |
1037 | { | 1039 | { |
1038 | items.push_back("Task Rename"); | 1040 | items.push_back(std::string("Task Rename")); |
1039 | } | 1041 | } |
1040 | if(isItemRemovable()) | 1042 | if(isItemRemovable()) |
1041 | { | 1043 | { |
1042 | items.push_back("Task Remove"); | 1044 | items.push_back(std::string("Task Remove")); |
1043 | } | 1045 | } |
1044 | 1046 | ||
1045 | items.push_back("Task Play"); | 1047 | items.push_back(std::string("Task Play")); |
1046 | /*menu.appendSeparator(); | 1048 | /*menu.appendSeparator(); |
1047 | menu.append(new LLMenuItemCallGL("Play", | 1049 | menu.append(new LLMenuItemCallGL("Play", |
1048 | &LLTaskSoundBridge::playSound, | 1050 | &LLTaskSoundBridge::playSound, |
@@ -1062,7 +1064,7 @@ public: | |||
1062 | LLTaskLandmarkBridge( | 1064 | LLTaskLandmarkBridge( |
1063 | LLPanelInventory* panel, | 1065 | LLPanelInventory* panel, |
1064 | const LLUUID& uuid, | 1066 | const LLUUID& uuid, |
1065 | const LLString& name); | 1067 | const std::string& name); |
1066 | 1068 | ||
1067 | virtual LLUIImagePtr getIcon() const; | 1069 | virtual LLUIImagePtr getIcon() const; |
1068 | }; | 1070 | }; |
@@ -1070,7 +1072,7 @@ public: | |||
1070 | LLTaskLandmarkBridge::LLTaskLandmarkBridge( | 1072 | LLTaskLandmarkBridge::LLTaskLandmarkBridge( |
1071 | LLPanelInventory* panel, | 1073 | LLPanelInventory* panel, |
1072 | const LLUUID& uuid, | 1074 | const LLUUID& uuid, |
1073 | const LLString& name) : | 1075 | const std::string& name) : |
1074 | LLTaskInvFVBridge(panel, uuid, name) | 1076 | LLTaskInvFVBridge(panel, uuid, name) |
1075 | { | 1077 | { |
1076 | } | 1078 | } |
@@ -1091,17 +1093,17 @@ public: | |||
1091 | LLTaskCallingCardBridge( | 1093 | LLTaskCallingCardBridge( |
1092 | LLPanelInventory* panel, | 1094 | LLPanelInventory* panel, |
1093 | const LLUUID& uuid, | 1095 | const LLUUID& uuid, |
1094 | const LLString& name); | 1096 | const std::string& name); |
1095 | 1097 | ||
1096 | virtual LLUIImagePtr getIcon() const; | 1098 | virtual LLUIImagePtr getIcon() const; |
1097 | virtual BOOL isItemRenameable() const; | 1099 | virtual BOOL isItemRenameable() const; |
1098 | virtual BOOL renameItem(const LLString& new_name); | 1100 | virtual BOOL renameItem(const std::string& new_name); |
1099 | }; | 1101 | }; |
1100 | 1102 | ||
1101 | LLTaskCallingCardBridge::LLTaskCallingCardBridge( | 1103 | LLTaskCallingCardBridge::LLTaskCallingCardBridge( |
1102 | LLPanelInventory* panel, | 1104 | LLPanelInventory* panel, |
1103 | const LLUUID& uuid, | 1105 | const LLUUID& uuid, |
1104 | const LLString& name) : | 1106 | const std::string& name) : |
1105 | LLTaskInvFVBridge(panel, uuid, name) | 1107 | LLTaskInvFVBridge(panel, uuid, name) |
1106 | { | 1108 | { |
1107 | } | 1109 | } |
@@ -1116,7 +1118,7 @@ BOOL LLTaskCallingCardBridge::isItemRenameable() const | |||
1116 | return FALSE; | 1118 | return FALSE; |
1117 | } | 1119 | } |
1118 | 1120 | ||
1119 | BOOL LLTaskCallingCardBridge::renameItem(const LLString& new_name) | 1121 | BOOL LLTaskCallingCardBridge::renameItem(const std::string& new_name) |
1120 | { | 1122 | { |
1121 | return FALSE; | 1123 | return FALSE; |
1122 | } | 1124 | } |
@@ -1132,7 +1134,7 @@ public: | |||
1132 | LLTaskScriptBridge( | 1134 | LLTaskScriptBridge( |
1133 | LLPanelInventory* panel, | 1135 | LLPanelInventory* panel, |
1134 | const LLUUID& uuid, | 1136 | const LLUUID& uuid, |
1135 | const LLString& name); | 1137 | const std::string& name); |
1136 | 1138 | ||
1137 | virtual LLUIImagePtr getIcon() const; | 1139 | virtual LLUIImagePtr getIcon() const; |
1138 | //static BOOL enableIfCopyable( void* userdata ); | 1140 | //static BOOL enableIfCopyable( void* userdata ); |
@@ -1141,7 +1143,7 @@ public: | |||
1141 | LLTaskScriptBridge::LLTaskScriptBridge( | 1143 | LLTaskScriptBridge::LLTaskScriptBridge( |
1142 | LLPanelInventory* panel, | 1144 | LLPanelInventory* panel, |
1143 | const LLUUID& uuid, | 1145 | const LLUUID& uuid, |
1144 | const LLString& name) : | 1146 | const std::string& name) : |
1145 | LLTaskInvFVBridge(panel, uuid, name) | 1147 | LLTaskInvFVBridge(panel, uuid, name) |
1146 | { | 1148 | { |
1147 | } | 1149 | } |
@@ -1158,7 +1160,7 @@ public: | |||
1158 | LLTaskLSLBridge( | 1160 | LLTaskLSLBridge( |
1159 | LLPanelInventory* panel, | 1161 | LLPanelInventory* panel, |
1160 | const LLUUID& uuid, | 1162 | const LLUUID& uuid, |
1161 | const LLString& name); | 1163 | const std::string& name); |
1162 | 1164 | ||
1163 | virtual void openItem(); | 1165 | virtual void openItem(); |
1164 | virtual BOOL removeItem(); | 1166 | virtual BOOL removeItem(); |
@@ -1170,7 +1172,7 @@ public: | |||
1170 | LLTaskLSLBridge::LLTaskLSLBridge( | 1172 | LLTaskLSLBridge::LLTaskLSLBridge( |
1171 | LLPanelInventory* panel, | 1173 | LLPanelInventory* panel, |
1172 | const LLUUID& uuid, | 1174 | const LLUUID& uuid, |
1173 | const LLString& name) : | 1175 | const std::string& name) : |
1174 | LLTaskScriptBridge(panel, uuid, name) | 1176 | LLTaskScriptBridge(panel, uuid, name) |
1175 | { | 1177 | { |
1176 | } | 1178 | } |
@@ -1189,7 +1191,7 @@ void LLTaskLSLBridge::openItem() | |||
1189 | } | 1191 | } |
1190 | if(object->permModify() || gAgent.isGodlike()) | 1192 | if(object->permModify() || gAgent.isGodlike()) |
1191 | { | 1193 | { |
1192 | LLString title("Script: "); | 1194 | std::string title("Script: "); |
1193 | LLInventoryItem* item = findItem(); | 1195 | LLInventoryItem* item = findItem(); |
1194 | if (item) | 1196 | if (item) |
1195 | { | 1197 | { |
@@ -1232,7 +1234,7 @@ public: | |||
1232 | LLTaskObjectBridge( | 1234 | LLTaskObjectBridge( |
1233 | LLPanelInventory* panel, | 1235 | LLPanelInventory* panel, |
1234 | const LLUUID& uuid, | 1236 | const LLUUID& uuid, |
1235 | const LLString& name); | 1237 | const std::string& name); |
1236 | 1238 | ||
1237 | virtual LLUIImagePtr getIcon() const; | 1239 | virtual LLUIImagePtr getIcon() const; |
1238 | }; | 1240 | }; |
@@ -1240,7 +1242,7 @@ public: | |||
1240 | LLTaskObjectBridge::LLTaskObjectBridge( | 1242 | LLTaskObjectBridge::LLTaskObjectBridge( |
1241 | LLPanelInventory* panel, | 1243 | LLPanelInventory* panel, |
1242 | const LLUUID& uuid, | 1244 | const LLUUID& uuid, |
1243 | const LLString& name) : | 1245 | const std::string& name) : |
1244 | LLTaskInvFVBridge(panel, uuid, name) | 1246 | LLTaskInvFVBridge(panel, uuid, name) |
1245 | { | 1247 | { |
1246 | } | 1248 | } |
@@ -1266,7 +1268,7 @@ public: | |||
1266 | LLTaskNotecardBridge( | 1268 | LLTaskNotecardBridge( |
1267 | LLPanelInventory* panel, | 1269 | LLPanelInventory* panel, |
1268 | const LLUUID& uuid, | 1270 | const LLUUID& uuid, |
1269 | const LLString& name); | 1271 | const std::string& name); |
1270 | 1272 | ||
1271 | virtual LLUIImagePtr getIcon() const; | 1273 | virtual LLUIImagePtr getIcon() const; |
1272 | virtual void openItem(); | 1274 | virtual void openItem(); |
@@ -1276,7 +1278,7 @@ public: | |||
1276 | LLTaskNotecardBridge::LLTaskNotecardBridge( | 1278 | LLTaskNotecardBridge::LLTaskNotecardBridge( |
1277 | LLPanelInventory* panel, | 1279 | LLPanelInventory* panel, |
1278 | const LLUUID& uuid, | 1280 | const LLUUID& uuid, |
1279 | const LLString& name) : | 1281 | const std::string& name) : |
1280 | LLTaskInvFVBridge(panel, uuid, name) | 1282 | LLTaskInvFVBridge(panel, uuid, name) |
1281 | { | 1283 | { |
1282 | } | 1284 | } |
@@ -1332,7 +1334,7 @@ public: | |||
1332 | LLTaskGestureBridge( | 1334 | LLTaskGestureBridge( |
1333 | LLPanelInventory* panel, | 1335 | LLPanelInventory* panel, |
1334 | const LLUUID& uuid, | 1336 | const LLUUID& uuid, |
1335 | const LLString& name); | 1337 | const std::string& name); |
1336 | 1338 | ||
1337 | virtual LLUIImagePtr getIcon() const; | 1339 | virtual LLUIImagePtr getIcon() const; |
1338 | virtual void openItem(); | 1340 | virtual void openItem(); |
@@ -1342,7 +1344,7 @@ public: | |||
1342 | LLTaskGestureBridge::LLTaskGestureBridge( | 1344 | LLTaskGestureBridge::LLTaskGestureBridge( |
1343 | LLPanelInventory* panel, | 1345 | LLPanelInventory* panel, |
1344 | const LLUUID& uuid, | 1346 | const LLUUID& uuid, |
1345 | const LLString& name) : | 1347 | const std::string& name) : |
1346 | LLTaskInvFVBridge(panel, uuid, name) | 1348 | LLTaskInvFVBridge(panel, uuid, name) |
1347 | { | 1349 | { |
1348 | } | 1350 | } |
@@ -1365,7 +1367,7 @@ void LLTaskGestureBridge::openItem() | |||
1365 | } | 1367 | } |
1366 | 1368 | ||
1367 | // TODO: save rectangle | 1369 | // TODO: save rectangle |
1368 | LLString title = getName(); | 1370 | std::string title = getName(); |
1369 | LLUUID item_id = mUUID; | 1371 | LLUUID item_id = mUUID; |
1370 | LLUUID object_id = mPanel->getTaskUUID(); | 1372 | LLUUID object_id = mPanel->getTaskUUID(); |
1371 | LLPreviewGesture* preview = LLPreviewGesture::show(title, item_id, object_id); | 1373 | LLPreviewGesture* preview = LLPreviewGesture::show(title, item_id, object_id); |
@@ -1392,7 +1394,7 @@ public: | |||
1392 | LLTaskAnimationBridge( | 1394 | LLTaskAnimationBridge( |
1393 | LLPanelInventory* panel, | 1395 | LLPanelInventory* panel, |
1394 | const LLUUID& uuid, | 1396 | const LLUUID& uuid, |
1395 | const LLString& name); | 1397 | const std::string& name); |
1396 | 1398 | ||
1397 | virtual LLUIImagePtr getIcon() const; | 1399 | virtual LLUIImagePtr getIcon() const; |
1398 | virtual void openItem(); | 1400 | virtual void openItem(); |
@@ -1402,7 +1404,7 @@ public: | |||
1402 | LLTaskAnimationBridge::LLTaskAnimationBridge( | 1404 | LLTaskAnimationBridge::LLTaskAnimationBridge( |
1403 | LLPanelInventory* panel, | 1405 | LLPanelInventory* panel, |
1404 | const LLUUID& uuid, | 1406 | const LLUUID& uuid, |
1405 | const LLString& name) : | 1407 | const std::string& name) : |
1406 | LLTaskInvFVBridge(panel, uuid, name) | 1408 | LLTaskInvFVBridge(panel, uuid, name) |
1407 | { | 1409 | { |
1408 | } | 1410 | } |
@@ -1428,7 +1430,7 @@ void LLTaskAnimationBridge::openItem() | |||
1428 | if(object->permModify() || gAgent.isGodlike()) | 1430 | if(object->permModify() || gAgent.isGodlike()) |
1429 | { | 1431 | { |
1430 | // TODO: save rectangle | 1432 | // TODO: save rectangle |
1431 | LLString title = getName(); | 1433 | std::string title = getName(); |
1432 | LLUUID item_id = mUUID; | 1434 | LLUUID item_id = mUUID; |
1433 | LLUUID object_id = mPanel->getTaskUUID(); | 1435 | LLUUID object_id = mPanel->getTaskUUID(); |
1434 | 1436 | ||
@@ -1470,7 +1472,7 @@ public: | |||
1470 | LLTaskWearableBridge( | 1472 | LLTaskWearableBridge( |
1471 | LLPanelInventory* panel, | 1473 | LLPanelInventory* panel, |
1472 | const LLUUID& uuid, | 1474 | const LLUUID& uuid, |
1473 | const LLString& name, | 1475 | const std::string& name, |
1474 | LLAssetType::EType asset_type, | 1476 | LLAssetType::EType asset_type, |
1475 | U32 flags); | 1477 | U32 flags); |
1476 | 1478 | ||
@@ -1483,7 +1485,7 @@ protected: | |||
1483 | LLTaskWearableBridge::LLTaskWearableBridge( | 1485 | LLTaskWearableBridge::LLTaskWearableBridge( |
1484 | LLPanelInventory* panel, | 1486 | LLPanelInventory* panel, |
1485 | const LLUUID& uuid, | 1487 | const LLUUID& uuid, |
1486 | const LLString& name, | 1488 | const std::string& name, |
1487 | LLAssetType::EType asset_type, | 1489 | LLAssetType::EType asset_type, |
1488 | U32 flags) : | 1490 | U32 flags) : |
1489 | LLTaskInvFVBridge(panel, uuid, name, flags), | 1491 | LLTaskInvFVBridge(panel, uuid, name, flags), |
@@ -1591,7 +1593,7 @@ LLTaskInvFVBridge* LLTaskInvFVBridge::createObjectBridge(LLPanelInventory* panel | |||
1591 | ///---------------------------------------------------------------------------- | 1593 | ///---------------------------------------------------------------------------- |
1592 | 1594 | ||
1593 | // Default constructor | 1595 | // Default constructor |
1594 | LLPanelInventory::LLPanelInventory(const LLString& name, const LLRect& rect) : | 1596 | LLPanelInventory::LLPanelInventory(const std::string& name, const LLRect& rect) : |
1595 | LLPanel(name, rect), | 1597 | LLPanel(name, rect), |
1596 | mScroller(NULL), | 1598 | mScroller(NULL), |
1597 | mFolders(NULL), | 1599 | mFolders(NULL), |
@@ -1642,13 +1644,12 @@ void LLPanelInventory::reset() | |||
1642 | setBorderVisible(FALSE); | 1644 | setBorderVisible(FALSE); |
1643 | 1645 | ||
1644 | LLRect dummy_rect(0, 1, 1, 0); | 1646 | LLRect dummy_rect(0, 1, 1, 0); |
1645 | mFolders = new LLFolderView("task inventory", NULL, dummy_rect, getTaskUUID(), this); | 1647 | mFolders = new LLFolderView(std::string("task inventory"), NULL, dummy_rect, getTaskUUID(), this); |
1646 | // this ensures that we never say "searching..." or "no items found" | 1648 | // this ensures that we never say "searching..." or "no items found" |
1647 | mFolders->getFilter()->setShowFolderState(LLInventoryFilter::SHOW_ALL_FOLDERS); | 1649 | mFolders->getFilter()->setShowFolderState(LLInventoryFilter::SHOW_ALL_FOLDERS); |
1648 | 1650 | ||
1649 | LLRect scroller_rect(0, getRect().getHeight(), getRect().getWidth(), 0); | 1651 | LLRect scroller_rect(0, getRect().getHeight(), getRect().getWidth(), 0); |
1650 | mScroller = new LLScrollableContainerView( | 1652 | mScroller = new LLScrollableContainerView(std::string("task inventory scroller"), scroller_rect, mFolders ); |
1651 | "task inventory scroller", scroller_rect, mFolders ); | ||
1652 | mScroller->setFollowsAll(); | 1653 | mScroller->setFollowsAll(); |
1653 | addChild(mScroller); | 1654 | addChild(mScroller); |
1654 | 1655 | ||
@@ -1928,9 +1929,10 @@ void LLPanelInventory::draw() | |||
1928 | 1929 | ||
1929 | if(mIsInventoryEmpty) | 1930 | if(mIsInventoryEmpty) |
1930 | { | 1931 | { |
1932 | // *TODO: Translate | ||
1931 | if((LLUUID::null != mTaskUUID) && (!mHaveInventory)) | 1933 | if((LLUUID::null != mTaskUUID) && (!mHaveInventory)) |
1932 | { | 1934 | { |
1933 | LLFontGL::sSansSerif->renderUTF8("Loading contents...", 0, | 1935 | LLFontGL::sSansSerif->renderUTF8(std::string("Loading contents..."), 0, |
1934 | (S32)(getRect().getWidth() * 0.5f), | 1936 | (S32)(getRect().getWidth() * 0.5f), |
1935 | 10, | 1937 | 10, |
1936 | LLColor4( 1, 1, 1, 1 ), | 1938 | LLColor4( 1, 1, 1, 1 ), |
@@ -1939,7 +1941,7 @@ void LLPanelInventory::draw() | |||
1939 | } | 1941 | } |
1940 | else if(mHaveInventory) | 1942 | else if(mHaveInventory) |
1941 | { | 1943 | { |
1942 | LLFontGL::sSansSerif->renderUTF8("No contents", 0, | 1944 | LLFontGL::sSansSerif->renderUTF8(std::string("No contents"), 0, |
1943 | (S32)(getRect().getWidth() * 0.5f), | 1945 | (S32)(getRect().getWidth() * 0.5f), |
1944 | 10, | 1946 | 10, |
1945 | LLColor4( 1, 1, 1, 1 ), | 1947 | LLColor4( 1, 1, 1, 1 ), |
@@ -1956,7 +1958,7 @@ void LLPanelInventory::deleteAllChildren() | |||
1956 | LLView::deleteAllChildren(); | 1958 | LLView::deleteAllChildren(); |
1957 | } | 1959 | } |
1958 | 1960 | ||
1959 | BOOL LLPanelInventory::handleDragAndDrop(S32 x, S32 y, MASK mask, BOOL drop, EDragAndDropType cargo_type, void *cargo_data, EAcceptance *accept, LLString& tooltip_msg) | 1961 | BOOL LLPanelInventory::handleDragAndDrop(S32 x, S32 y, MASK mask, BOOL drop, EDragAndDropType cargo_type, void *cargo_data, EAcceptance *accept, std::string& tooltip_msg) |
1960 | { | 1962 | { |
1961 | if (mFolders && mHaveInventory) | 1963 | if (mFolders && mHaveInventory) |
1962 | { | 1964 | { |