summaryrefslogtreecommitdiff
path: root/indra/newview
diff options
context:
space:
mode:
authorMaxim Nikolenko <maximnproductengine@lindenlab.com>2023-04-17 13:22:27 +0300
committerMaxim Nikolenko <maximnproductengine@lindenlab.com>2023-04-17 13:22:27 +0300
commit5554686b9117901cddb3d36f237622442c1d7a8d (patch)
treed10ef52054d798e9f228acde7990d5b4298f994a /indra/newview
parent94dd7b2c0c020bad25dab9472d612f673f136422 (diff)
SL-19544 WIP show item permissions after item name
Diffstat (limited to 'indra/newview')
-rw-r--r--indra/newview/llinventorybridge.cpp2
-rw-r--r--indra/newview/llinventorygallery.cpp50
-rw-r--r--indra/newview/llinventorygallery.h8
-rw-r--r--indra/newview/llpanelmaininventory.cpp4
-rw-r--r--indra/newview/skins/default/xui/en/panel_inventory_gallery_item.xml18
-rw-r--r--indra/newview/skins/default/xui/en/strings.xml1
6 files changed, 53 insertions, 30 deletions
diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp
index dadc7bc057..1c8342cdda 100644
--- a/indra/newview/llinventorybridge.cpp
+++ b/indra/newview/llinventorybridge.cpp
@@ -918,7 +918,7 @@ void LLInvFVBridge::getClipboardEntries(bool show_asset_id,
addDeleteContextMenuOptions(items, disabled_items);
- if (!isPanelActive("All Items") && !isPanelActive("single_folder_inv"))
+ if (!isPanelActive("All Items") && !isPanelActive("single_folder_inv") && !isPanelActive("comb_single_folder_inv"))
{
items.push_back(std::string("Show in Main Panel"));
}
diff --git a/indra/newview/llinventorygallery.cpp b/indra/newview/llinventorygallery.cpp
index 94996cb941..f6a1f49306 100644
--- a/indra/newview/llinventorygallery.cpp
+++ b/indra/newview/llinventorygallery.cpp
@@ -1202,7 +1202,8 @@ LLInventoryGalleryItem::LLInventoryGalleryItem(const Params& p)
mSelected(false),
mDefaultImage(true),
mName(""),
- mSuffix(""),
+ mWornSuffix(""),
+ mPermSuffix(""),
mUUID(LLUUID()),
mIsFolder(true),
mIsLink(false),
@@ -1221,7 +1222,6 @@ LLInventoryGalleryItem::~LLInventoryGalleryItem()
BOOL LLInventoryGalleryItem::postBuild()
{
mNameText = getChild<LLTextBox>("item_name");
- mSuffixText = getChild<LLTextBox>("suffix_text");
mTextBgPanel = getChild<LLPanel>("text_bg_panel");
return TRUE;
@@ -1262,6 +1262,32 @@ void LLInventoryGalleryItem::setType(LLAssetType::EType type, LLInventoryType::E
}
}
}
+ else
+ {
+ const LLInventoryItem *item = gInventory.getItem(mUUID);
+ if(item && (LLAssetType::AT_CALLINGCARD != item->getType()) && !mIsLink)
+ {
+ std::string delim(" --");
+ bool copy = item->getPermissions().allowCopyBy(gAgent.getID());
+ if (!copy)
+ {
+ mPermSuffix += delim;
+ mPermSuffix += LLTrans::getString("no_copy_lbl");
+ }
+ bool mod = item->getPermissions().allowModifyBy(gAgent.getID());
+ if (!mod)
+ {
+ mPermSuffix += mPermSuffix.empty() ? delim : ",";
+ mPermSuffix += LLTrans::getString("no_modify_lbl");
+ }
+ bool xfer = item->getPermissions().allowOperationBy(PERM_TRANSFER, gAgent.getID());
+ if (!xfer)
+ {
+ mPermSuffix += mPermSuffix.empty() ? delim : ",";
+ mPermSuffix += LLTrans::getString("no_transfer_lbl");
+ }
+ }
+ }
getChild<LLIconCtrl>("item_type")->setValue(icon_name);
getChild<LLIconCtrl>("link_overlay")->setVisible(is_link);
@@ -1294,9 +1320,7 @@ void LLInventoryGalleryItem::draw()
void LLInventoryGalleryItem::setName(std::string name)
{
mName = name;
- mNameText->setFont(getTextFont());
- mNameText->setText(name);
- mNameText->setToolTip(name);
+ updateNameText();
}
void LLInventoryGalleryItem::setSelected(bool value)
@@ -1401,16 +1425,14 @@ void LLInventoryGalleryItem::setWorn(bool value)
if(mWorn)
{
- mSuffix = (mType == LLAssetType::AT_GESTURE) ? getString("active_string") : getString("worn_string");
+ mWornSuffix = (mType == LLAssetType::AT_GESTURE) ? LLTrans::getString("active") : LLTrans::getString("worn");
}
else
{
- mSuffix = "";
+ mWornSuffix = "";
}
- mSuffixText->setValue(mSuffix);
- mNameText->setFont(getTextFont());
- mNameText->setText(mName); // refresh to pick up font changes
+ updateNameText();
}
LLFontGL* LLInventoryGalleryItem::getTextFont()
@@ -1422,6 +1444,14 @@ LLFontGL* LLInventoryGalleryItem::getTextFont()
return mIsLink ? LLFontGL::getFontSansSerifSmallItalic() : LLFontGL::getFontSansSerifSmall();
}
+void LLInventoryGalleryItem::updateNameText()
+{
+ mNameText->setFont(getTextFont());
+ mNameText->setText(mName + mPermSuffix + mWornSuffix);
+ mNameText->setToolTip(mName + mPermSuffix + mWornSuffix);
+ getChild<LLThumbnailCtrl>("preview_thumbnail")->setToolTip(mName + mPermSuffix + mWornSuffix);
+}
+
//-----------------------------
// LLThumbnailsObserver
//-----------------------------
diff --git a/indra/newview/llinventorygallery.h b/indra/newview/llinventorygallery.h
index fd6bd0d502..fdab616720 100644
--- a/indra/newview/llinventorygallery.h
+++ b/indra/newview/llinventorygallery.h
@@ -256,7 +256,7 @@ public:
std::string getCreatorName() { return mCreatorName;}
std::string getItemName() {return mName;}
- std::string getItemNameSuffix() {return mSuffix;}
+ std::string getItemNameSuffix() {return mPermSuffix + mWornSuffix;}
bool isDefaultImage() {return mDefaultImage;}
bool isHidden() {return mHidden;}
@@ -269,11 +269,12 @@ public:
bool isFolder() { return mIsFolder; }
bool isLink() { return mIsLink; }
EInventorySortGroup getSortGroup() { return mSortGroup; }
+
+ void updateNameText();
private:
LLUUID mUUID;
LLTextBox* mNameText;
- LLTextBox* mSuffixText;
LLPanel* mTextBgPanel;
bool mSelected;
bool mWorn;
@@ -289,7 +290,8 @@ private:
EInventorySortGroup mSortGroup;
LLAssetType::EType mType;
std::string mName;
- std::string mSuffix;
+ std::string mWornSuffix;
+ std::string mPermSuffix;
LLInventoryGallery* mGallery;
};
diff --git a/indra/newview/llpanelmaininventory.cpp b/indra/newview/llpanelmaininventory.cpp
index 62b7a38857..f67b09d121 100644
--- a/indra/newview/llpanelmaininventory.cpp
+++ b/indra/newview/llpanelmaininventory.cpp
@@ -1640,6 +1640,10 @@ void LLPanelMainInventory::setSingleFolderViewRoot(const LLUUID& folder_id, bool
mInventoryGalleryPanel->clearNavigationHistory();
}
}
+ else if(isCombinationViewMode())
+ {
+ mCombinationInventoryPanel->changeFolderRoot(folder_id);
+ }
updateNavButtons();
}
diff --git a/indra/newview/skins/default/xui/en/panel_inventory_gallery_item.xml b/indra/newview/skins/default/xui/en/panel_inventory_gallery_item.xml
index e7589f889f..574872a870 100644
--- a/indra/newview/skins/default/xui/en/panel_inventory_gallery_item.xml
+++ b/indra/newview/skins/default/xui/en/panel_inventory_gallery_item.xml
@@ -13,8 +13,6 @@
layout="topleft"
left="0"
top="0">
- <string name="worn_string">(worn)</string>
- <string name="active_string">(active)</string>
<thumbnail
name="preview_thumbnail"
fallback_image="Thumbnail_Fallback"
@@ -62,28 +60,16 @@
length="1"
follows="left|top"
left="1"
- height="10"
+ height="23"
layout="topleft"
name="item_name"
parse_urls="false"
text_readonly_color="White"
+ word_wrap="true"
top="2"
width="127"
use_ellipses="true">
Item name, folder name.
</text>
- <text
- read_only="true"
- length="1"
- follows="left|top"
- left="1"
- height="10"
- layout="topleft"
- name="suffix_text"
- text_readonly_color="InventoryItemLinkColor"
- top="13"
- width="127">
- (worn)
- </text>
</panel>
</panel>
diff --git a/indra/newview/skins/default/xui/en/strings.xml b/indra/newview/skins/default/xui/en/strings.xml
index 48715d5b32..2fbdaf7bd0 100644
--- a/indra/newview/skins/default/xui/en/strings.xml
+++ b/indra/newview/skins/default/xui/en/strings.xml
@@ -2393,6 +2393,7 @@ If you continue to receive this message, please contact Second Life support for
<string name="Unconstrained">Unconstrained</string>
<!-- use value="" because they have preceding spaces -->
+ <string name="active" value=" (active)"/>
<string name="no_transfer" value=" (no transfer)" />
<string name="no_modify" value=" (no modify)" />
<string name="no_copy" value=" (no copy)" />