diff options
author | Jacek Antonelli | 2008-08-15 23:44:58 -0500 |
---|---|---|
committer | Jacek Antonelli | 2008-08-15 23:44:58 -0500 |
commit | 089fc07d207c71ce1401e72f09c31ad8c45872e2 (patch) | |
tree | 0028955add042c6f45b47a7b774adeeac9c592cb /linden/indra/newview/llinventorybridge.cpp | |
parent | Second Life viewer sources 1.16.0.5 (diff) | |
download | meta-impy-089fc07d207c71ce1401e72f09c31ad8c45872e2.zip meta-impy-089fc07d207c71ce1401e72f09c31ad8c45872e2.tar.gz meta-impy-089fc07d207c71ce1401e72f09c31ad8c45872e2.tar.bz2 meta-impy-089fc07d207c71ce1401e72f09c31ad8c45872e2.tar.xz |
Second Life viewer sources 1.17.0.12
Diffstat (limited to 'linden/indra/newview/llinventorybridge.cpp')
-rw-r--r-- | linden/indra/newview/llinventorybridge.cpp | 68 |
1 files changed, 43 insertions, 25 deletions
diff --git a/linden/indra/newview/llinventorybridge.cpp b/linden/indra/newview/llinventorybridge.cpp index a7b80ae..0d5c30e 100644 --- a/linden/indra/newview/llinventorybridge.cpp +++ b/linden/indra/newview/llinventorybridge.cpp | |||
@@ -822,7 +822,7 @@ LLString LLItemBridge::getLabelSuffix() const | |||
822 | if(item) | 822 | if(item) |
823 | { | 823 | { |
824 | // it's a bit confusing to put nocopy/nomod/etc on calling cards. | 824 | // it's a bit confusing to put nocopy/nomod/etc on calling cards. |
825 | if(LLAssetType::AT_CALLINGCARD != item->getType() | 825 | if( LLAssetType::AT_CALLINGCARD != item->getType() |
826 | && item->getPermissions().getOwner() == gAgent.getID()) | 826 | && item->getPermissions().getOwner() == gAgent.getID()) |
827 | { | 827 | { |
828 | BOOL copy = item->getPermissions().allowCopyBy(gAgent.getID()); | 828 | BOOL copy = item->getPermissions().allowCopyBy(gAgent.getID()); |
@@ -834,14 +834,32 @@ LLString LLItemBridge::getLabelSuffix() const | |||
834 | const char* NO_MOD = " (no modify)"; | 834 | const char* NO_MOD = " (no modify)"; |
835 | const char* NO_XFER = " (no transfer)"; | 835 | const char* NO_XFER = " (no transfer)"; |
836 | const char* scopy; | 836 | const char* scopy; |
837 | if(copy) scopy = EMPTY; | 837 | if(copy) |
838 | else scopy = NO_COPY; | 838 | { |
839 | scopy = EMPTY; | ||
840 | } | ||
841 | else | ||
842 | { | ||
843 | scopy = NO_COPY; | ||
844 | }; | ||
839 | const char* smod; | 845 | const char* smod; |
840 | if(mod) smod = EMPTY; | 846 | if(mod) |
841 | else smod = NO_MOD; | 847 | { |
848 | smod = EMPTY; | ||
849 | } | ||
850 | else | ||
851 | { | ||
852 | smod = NO_MOD; | ||
853 | }; | ||
842 | const char* sxfer; | 854 | const char* sxfer; |
843 | if(xfer) sxfer = EMPTY; | 855 | if(xfer) |
844 | else sxfer = NO_XFER; | 856 | { |
857 | sxfer = EMPTY; | ||
858 | } | ||
859 | else | ||
860 | { | ||
861 | sxfer = NO_XFER; | ||
862 | }; | ||
845 | char buffer[MAX_STRING]; /*Flawfinder: ignore*/ | 863 | char buffer[MAX_STRING]; /*Flawfinder: ignore*/ |
846 | snprintf( /* Flawfinder: ignore */ | 864 | snprintf( /* Flawfinder: ignore */ |
847 | buffer, | 865 | buffer, |
@@ -2510,14 +2528,14 @@ void LLLandmarkBridge::performAction(LLFolderView* folder, LLInventoryModel* mod | |||
2510 | else LLItemBridge::performAction(folder, model, action); | 2528 | else LLItemBridge::performAction(folder, model, action); |
2511 | } | 2529 | } |
2512 | 2530 | ||
2513 | void open_landmark(const LLUUID& item_id, | 2531 | void open_landmark(LLViewerInventoryItem* inv_item, |
2514 | const LLString& title, | 2532 | const LLString& title, |
2515 | BOOL show_keep_discard, | 2533 | BOOL show_keep_discard, |
2516 | const LLUUID& source_id, | 2534 | const LLUUID& source_id, |
2517 | BOOL take_focus) | 2535 | BOOL take_focus) |
2518 | { | 2536 | { |
2519 | // See if we can bring an exiting preview to the front | 2537 | // See if we can bring an exiting preview to the front |
2520 | if( !LLPreview::show( item_id, take_focus ) ) | 2538 | if( !LLPreview::show( inv_item->getUUID(), take_focus ) ) |
2521 | { | 2539 | { |
2522 | // There isn't one, so make a new preview | 2540 | // There isn't one, so make a new preview |
2523 | S32 left, top; | 2541 | S32 left, top; |
@@ -2525,11 +2543,12 @@ void open_landmark(const LLUUID& item_id, | |||
2525 | LLRect rect = gSavedSettings.getRect("PreviewLandmarkRect"); | 2543 | LLRect rect = gSavedSettings.getRect("PreviewLandmarkRect"); |
2526 | rect.translate( left - rect.mLeft, top - rect.mTop ); | 2544 | rect.translate( left - rect.mLeft, top - rect.mTop ); |
2527 | 2545 | ||
2528 | LLPreviewLandmark* preview = new LLPreviewLandmark("preview landmark", | 2546 | LLPreviewLandmark* preview = new LLPreviewLandmark(title, |
2529 | rect, | 2547 | rect, |
2530 | title, | 2548 | title, |
2531 | item_id, | 2549 | inv_item->getUUID(), |
2532 | show_keep_discard); | 2550 | show_keep_discard, |
2551 | inv_item); | ||
2533 | preview->setSourceID(source_id); | 2552 | preview->setSourceID(source_id); |
2534 | if(take_focus) preview->setFocus(TRUE); | 2553 | if(take_focus) preview->setFocus(TRUE); |
2535 | // keep onscreen | 2554 | // keep onscreen |
@@ -2542,7 +2561,7 @@ void LLLandmarkBridge::openItem() | |||
2542 | LLViewerInventoryItem* item = getItem(); | 2561 | LLViewerInventoryItem* item = getItem(); |
2543 | if( item ) | 2562 | if( item ) |
2544 | { | 2563 | { |
2545 | open_landmark(mUUID, LLString(" ") + getPrefix() + item->getName(), FALSE); | 2564 | open_landmark(item, LLString(" ") + getPrefix() + item->getName(), FALSE); |
2546 | } | 2565 | } |
2547 | } | 2566 | } |
2548 | 2567 | ||
@@ -2769,14 +2788,15 @@ LLViewerImage* LLNotecardBridge::getIcon() const | |||
2769 | return get_item_icon(LLAssetType::AT_NOTECARD, LLInventoryType::IT_NOTECARD, 0, FALSE); | 2788 | return get_item_icon(LLAssetType::AT_NOTECARD, LLInventoryType::IT_NOTECARD, 0, FALSE); |
2770 | } | 2789 | } |
2771 | 2790 | ||
2772 | void open_notecard(const LLUUID& item_id, | 2791 | void open_notecard(LLViewerInventoryItem* inv_item, |
2773 | const LLString& title, | 2792 | const LLString& title, |
2793 | const LLUUID& object_id, | ||
2774 | BOOL show_keep_discard, | 2794 | BOOL show_keep_discard, |
2775 | const LLUUID& source_id, | 2795 | const LLUUID& source_id, |
2776 | BOOL take_focus) | 2796 | BOOL take_focus) |
2777 | { | 2797 | { |
2778 | // See if we can bring an existing preview to the front | 2798 | // See if we can bring an existing preview to the front |
2779 | if(!LLPreview::show(item_id, take_focus)) | 2799 | if(!LLPreview::show(inv_item->getUUID(), take_focus)) |
2780 | { | 2800 | { |
2781 | // There isn't one, so make a new preview | 2801 | // There isn't one, so make a new preview |
2782 | S32 left, top; | 2802 | S32 left, top; |
@@ -2784,13 +2804,9 @@ void open_notecard(const LLUUID& item_id, | |||
2784 | LLRect rect = gSavedSettings.getRect("NotecardEditorRect"); | 2804 | LLRect rect = gSavedSettings.getRect("NotecardEditorRect"); |
2785 | rect.translate(left - rect.mLeft, top - rect.mTop); | 2805 | rect.translate(left - rect.mLeft, top - rect.mTop); |
2786 | LLPreviewNotecard* preview; | 2806 | LLPreviewNotecard* preview; |
2787 | preview = new LLPreviewNotecard("preview notecard", | 2807 | preview = new LLPreviewNotecard("preview notecard", rect, title, |
2788 | rect, | 2808 | inv_item->getUUID(), object_id, inv_item->getAssetUUID(), |
2789 | title, | 2809 | show_keep_discard, inv_item); |
2790 | item_id, | ||
2791 | LLUUID::null, | ||
2792 | LLUUID::null, | ||
2793 | show_keep_discard); | ||
2794 | preview->setSourceID(source_id); | 2810 | preview->setSourceID(source_id); |
2795 | if(take_focus) preview->setFocus(TRUE); | 2811 | if(take_focus) preview->setFocus(TRUE); |
2796 | // Force to be entirely onscreen. | 2812 | // Force to be entirely onscreen. |
@@ -2809,23 +2825,22 @@ void open_notecard(const LLUUID& item_id, | |||
2809 | // { | 2825 | // { |
2810 | // // create new multipreview if it doesn't exist | 2826 | // // create new multipreview if it doesn't exist |
2811 | // LLMultiPreview* preview_hostp = new LLMultiPreview(existing_preview->getRect()); | 2827 | // LLMultiPreview* preview_hostp = new LLMultiPreview(existing_preview->getRect()); |
2812 | |||
2813 | // preview_hostp->addFloater(existing_preview); | 2828 | // preview_hostp->addFloater(existing_preview); |
2814 | // } | 2829 | // } |
2815 | // // add this preview to existing host | 2830 | // // add this preview to existing host |
2816 | // preview_hostp->addFloater(preview); | 2831 | // preview_hostp->addFloater(preview); |
2817 | // } | 2832 | // } |
2818 | //} | 2833 | //} |
2819 | |||
2820 | } | 2834 | } |
2821 | } | 2835 | } |
2822 | 2836 | ||
2837 | |||
2823 | void LLNotecardBridge::openItem() | 2838 | void LLNotecardBridge::openItem() |
2824 | { | 2839 | { |
2825 | LLViewerInventoryItem* item = getItem(); | 2840 | LLViewerInventoryItem* item = getItem(); |
2826 | if (item) | 2841 | if (item) |
2827 | { | 2842 | { |
2828 | open_notecard(mUUID, getPrefix() + item->getName(), FALSE); | 2843 | open_notecard(item, getPrefix() + item->getName(), LLUUID::null, FALSE); |
2829 | } | 2844 | } |
2830 | } | 2845 | } |
2831 | 2846 | ||
@@ -3460,10 +3475,13 @@ public: | |||
3460 | * Do nothing. We only care about the destructor | 3475 | * Do nothing. We only care about the destructor |
3461 | */ | 3476 | */ |
3462 | } | 3477 | } |
3478 | |||
3479 | protected: | ||
3463 | ~LLWearInventoryCategoryCallback() | 3480 | ~LLWearInventoryCategoryCallback() |
3464 | { | 3481 | { |
3465 | wear_inventory_category_on_avatar(gInventory.getCategory(mCatID), mAppend); | 3482 | wear_inventory_category_on_avatar(gInventory.getCategory(mCatID), mAppend); |
3466 | } | 3483 | } |
3484 | |||
3467 | private: | 3485 | private: |
3468 | LLUUID mCatID; | 3486 | LLUUID mCatID; |
3469 | bool mAppend; | 3487 | bool mAppend; |