summaryrefslogtreecommitdiff
path: root/indra/newview
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview')
-rw-r--r--indra/newview/llinventoryfilter.cpp45
-rw-r--r--indra/newview/llinventoryfilter.h18
-rw-r--r--indra/newview/llinventorypanel.cpp4
-rw-r--r--indra/newview/llinventorypanel.h2
-rw-r--r--indra/newview/llpanelmaininventory.cpp7
-rw-r--r--indra/newview/llsidepaneliteminfo.cpp19
-rw-r--r--indra/newview/llwearableitemslist.cpp22
-rw-r--r--indra/newview/skins/default/xui/en/menu_wearable_list_item.xml9
-rw-r--r--indra/newview/skins/default/xui/en/sidepanel_item_info.xml10
-rw-r--r--indra/newview/skins/default/xui/en/sidepanel_task_info.xml2
10 files changed, 106 insertions, 32 deletions
diff --git a/indra/newview/llinventoryfilter.cpp b/indra/newview/llinventoryfilter.cpp
index 6e829f2dc2..f8241320cf 100644
--- a/indra/newview/llinventoryfilter.cpp
+++ b/indra/newview/llinventoryfilter.cpp
@@ -57,7 +57,7 @@ LLInventoryFilter::FilterOps::FilterOps() :
mPermissions(PERM_NONE),
mFilterTypes(FILTERTYPE_OBJECT),
mFilterUUID(LLUUID::null),
- mIncludeLinks(TRUE)
+ mFilterLinks(FILTERLINK_INCLUDE_LINKS)
{
}
@@ -104,8 +104,10 @@ BOOL LLInventoryFilter::check(const LLFolderViewItem* item)
const BOOL passed_filtertype = checkAgainstFilterType(item);
const BOOL passed_permissions = checkAgainstPermissions(item);
+ const BOOL passed_filterlink = checkAgainstFilterLinks(item);
const BOOL passed = (passed_filtertype &&
- passed_permissions &&
+ passed_permissions &&
+ passed_filterlink &&
(mFilterSubString.size() == 0 || mSubStringMatchOffset != std::string::npos));
return passed;
@@ -229,6 +231,21 @@ BOOL LLInventoryFilter::checkAgainstPermissions(const LLFolderViewItem* item) co
return (perm & mFilterOps.mPermissions) == mFilterOps.mPermissions;
}
+BOOL LLInventoryFilter::checkAgainstFilterLinks(const LLFolderViewItem* item) const
+{
+ const LLFolderViewEventListener* listener = item->getListener();
+ if (!listener) return FALSE;
+
+ const LLUUID object_id = listener->getUUID();
+ const LLInventoryObject *object = gInventory.getObject(object_id);
+ const BOOL is_link = object->getIsLinkType();
+ if (is_link && (mFilterOps.mFilterLinks == FILTERLINK_EXCLUDE_LINKS))
+ return FALSE;
+ if (!is_link && (mFilterOps.mFilterLinks == FILTERLINK_ONLY_LINKS))
+ return FALSE;
+ return TRUE;
+}
+
const std::string& LLInventoryFilter::getFilterSubString(BOOL trim) const
{
return mFilterSubString;
@@ -246,6 +263,7 @@ BOOL LLInventoryFilter::isNotDefault() const
|| mFilterOps.mFilterCategoryTypes != mDefaultFilterOps.mFilterCategoryTypes
|| mFilterOps.mFilterWearableTypes != mDefaultFilterOps.mFilterWearableTypes
|| mFilterOps.mFilterTypes != FILTERTYPE_OBJECT
+ || mFilterOps.mFilterLinks != FILTERLINK_INCLUDE_LINKS
|| mFilterSubString.size()
|| mFilterOps.mPermissions != mDefaultFilterOps.mPermissions
|| mFilterOps.mMinDate != mDefaultFilterOps.mMinDate
@@ -259,6 +277,7 @@ BOOL LLInventoryFilter::isActive() const
|| mFilterOps.mFilterCategoryTypes != 0xffffffffffffffffULL
|| mFilterOps.mFilterWearableTypes != 0xffffffffffffffffULL
|| mFilterOps.mFilterTypes != FILTERTYPE_OBJECT
+ || mFilterOps.mFilterLinks != FILTERLINK_INCLUDE_LINKS
|| mFilterSubString.size()
|| mFilterOps.mPermissions != PERM_NONE
|| mFilterOps.mMinDate != time_min()
@@ -410,6 +429,11 @@ void LLInventoryFilter::setFilterSubString(const std::string& string)
mFilterOps.mFilterUUID == LLUUID::null;
setModified(FILTER_RESTART);
}
+
+ // Cancel out filter links once the search string is modified
+ {
+ mFilterOps.mFilterLinks = FILTERLINK_INCLUDE_LINKS;
+ }
}
}
@@ -508,16 +532,17 @@ void LLInventoryFilter::setHoursAgo(U32 hours)
mFilterOps.mFilterTypes |= FILTERTYPE_DATE;
}
-void LLInventoryFilter::setIncludeLinks(BOOL include_links)
+void LLInventoryFilter::setFilterLinks(U64 filter_links)
{
- if (mFilterOps.mIncludeLinks != include_links)
+ if (mFilterOps.mFilterLinks != filter_links)
{
- if (!mFilterOps.mIncludeLinks)
- setModified(FILTER_LESS_RESTRICTIVE);
- else
+ if (mFilterOps.mFilterLinks == FILTERLINK_EXCLUDE_LINKS ||
+ mFilterOps.mFilterLinks == FILTERLINK_ONLY_LINKS)
setModified(FILTER_MORE_RESTRICTIVE);
+ else
+ setModified(FILTER_LESS_RESTRICTIVE);
}
- mFilterOps.mIncludeLinks = include_links;
+ mFilterOps.mFilterLinks = filter_links;
}
void LLInventoryFilter::setShowFolderState(EFolderShow state)
@@ -895,9 +920,9 @@ U32 LLInventoryFilter::getHoursAgo() const
{
return mFilterOps.mHoursAgo;
}
-BOOL LLInventoryFilter::getIncludeLinks() const
+U64 LLInventoryFilter::getFilterLinks() const
{
- return mFilterOps.mIncludeLinks;
+ return mFilterOps.mFilterLinks;
}
LLInventoryFilter::EFolderShow LLInventoryFilter::getShowFolderState() const
{
diff --git a/indra/newview/llinventoryfilter.h b/indra/newview/llinventoryfilter.h
index f740a6b333..3d476e4795 100644
--- a/indra/newview/llinventoryfilter.h
+++ b/indra/newview/llinventoryfilter.h
@@ -56,8 +56,7 @@ public:
FILTER_MORE_RESTRICTIVE // if you didn't pass the previous filter, you definitely won't pass this one
};
- enum EFilterType
- {
+ enum EFilterType {
FILTERTYPE_NONE = 0,
FILTERTYPE_OBJECT = 0x1 << 0, // normal default search-by-object-type
FILTERTYPE_CATEGORY = 0x1 << 1, // search by folder type
@@ -66,6 +65,13 @@ public:
FILTERTYPE_WEARABLE = 0x1 << 4 // search by wearable type
};
+ enum EFilterLink
+ {
+ FILTERLINK_INCLUDE_LINKS, // show links too
+ FILTERLINK_EXCLUDE_LINKS, // don't show links
+ FILTERLINK_ONLY_LINKS // only show links
+ };
+
// REFACTOR: Change this to an enum.
static const U32 SO_DATE = 1;
static const U32 SO_FOLDERS_BY_NAME = 2;
@@ -100,8 +106,8 @@ public:
void setHoursAgo(U32 hours);
U32 getHoursAgo() const;
- void setIncludeLinks(BOOL include_links);
- BOOL getIncludeLinks() const;
+ void setFilterLinks(U64 filter_link);
+ U64 getFilterLinks() const;
// +-------------------------------------------------------------------+
// + Execution And Results
@@ -109,6 +115,8 @@ public:
BOOL check(const LLFolderViewItem* item);
BOOL checkAgainstFilterType(const LLFolderViewItem* item) const;
BOOL checkAgainstPermissions(const LLFolderViewItem* item) const;
+ BOOL checkAgainstFilterLinks(const LLFolderViewItem* item) const;
+
std::string::size_type getStringMatchOffset() const;
// +-------------------------------------------------------------------+
@@ -179,7 +187,7 @@ private:
U32 mHoursAgo;
EFolderShow mShowFolderState;
PermissionMask mPermissions;
- BOOL mIncludeLinks;
+ U64 mFilterLinks;
};
U32 mOrder;
diff --git a/indra/newview/llinventorypanel.cpp b/indra/newview/llinventorypanel.cpp
index 72d35af3b7..5af99f3c8f 100644
--- a/indra/newview/llinventorypanel.cpp
+++ b/indra/newview/llinventorypanel.cpp
@@ -256,9 +256,9 @@ void LLInventoryPanel::setHoursAgo(U32 hours)
getFilter()->setHoursAgo(hours);
}
-void LLInventoryPanel::setIncludeLinks(BOOL include_links)
+void LLInventoryPanel::setFilterLinks(U64 filter_links)
{
- getFilter()->setIncludeLinks(include_links);
+ getFilter()->setFilterLinks(filter_links);
}
void LLInventoryPanel::setShowFolderState(LLInventoryFilter::EFolderShow show)
diff --git a/indra/newview/llinventorypanel.h b/indra/newview/llinventorypanel.h
index 84603e8b4f..c9e317f816 100644
--- a/indra/newview/llinventorypanel.h
+++ b/indra/newview/llinventorypanel.h
@@ -145,7 +145,7 @@ public:
void setSinceLogoff(BOOL sl);
void setHoursAgo(U32 hours);
BOOL getSinceLogoff();
- void setIncludeLinks(BOOL include_links);
+ void setFilterLinks(U64 filter_links);
void setShowFolderState(LLInventoryFilter::EFolderShow show);
LLInventoryFilter::EFolderShow getShowFolderState();
diff --git a/indra/newview/llpanelmaininventory.cpp b/indra/newview/llpanelmaininventory.cpp
index 9eece81861..fa7e06d323 100644
--- a/indra/newview/llpanelmaininventory.cpp
+++ b/indra/newview/llpanelmaininventory.cpp
@@ -392,6 +392,7 @@ void LLPanelMainInventory::onClearSearch()
{
mActivePanel->setFilterSubString(LLStringUtil::null);
mActivePanel->setFilterTypes(0xffffffff);
+ mActivePanel->setFilterLinks(LLInventoryFilter::FILTERLINK_INCLUDE_LINKS);
}
if (finder)
@@ -1068,6 +1069,7 @@ void LLPanelMainInventory::onCustomAction(const LLSD& userdata)
mFilterEditor->setFocus(TRUE);
filter->setFilterUUID(item_id);
filter->setShowFolderState(LLInventoryFilter::SHOW_NON_EMPTY_FOLDERS);
+ filter->setFilterLinks(LLInventoryFilter::FILTERLINK_ONLY_LINKS);
}
}
@@ -1134,7 +1136,10 @@ BOOL LLPanelMainInventory::isActionEnabled(const LLSD& userdata)
if (command_name == "find_links")
{
- LLFolderViewItem* current_item = getActivePanel()->getRootFolder()->getCurSelectedItem();
+ LLFolderView* root = getActivePanel()->getRootFolder();
+ std::set<LLUUID> selection_set = root->getSelectionList();
+ if (selection_set.size() != 1) return FALSE;
+ LLFolderViewItem* current_item = root->getCurSelectedItem();
if (!current_item) return FALSE;
const LLUUID& item_id = current_item->getListener()->getUUID();
const LLInventoryObject *obj = gInventory.getObject(item_id);
diff --git a/indra/newview/llsidepaneliteminfo.cpp b/indra/newview/llsidepaneliteminfo.cpp
index 6ccd89dddb..d9870e81c5 100644
--- a/indra/newview/llsidepaneliteminfo.cpp
+++ b/indra/newview/llsidepaneliteminfo.cpp
@@ -323,6 +323,19 @@ void LLSidepanelItemInfo::refreshFromItem(LLViewerInventoryItem* item)
childSetText("LabelOwnerName",getString("public"));
}
+ ////////////
+ // ORIGIN //
+ ////////////
+
+ if (object)
+ {
+ childSetText("origin",getString("origin_inworld"));
+ }
+ else
+ {
+ childSetText("origin",getString("origin_inventory"));
+ }
+
//////////////////
// ACQUIRE DATE //
//////////////////
@@ -341,9 +354,9 @@ void LLSidepanelItemInfo::refreshFromItem(LLViewerInventoryItem* item)
childSetText ("LabelAcquiredDate", timeStr);
}
- /////////////////////////////////////
- // PERMISSIONS AND SALE ITEM HIDING
- /////////////////////////////////////
+ //////////////////////////////////////
+ // PERMISSIONS AND SALE ITEM HIDING //
+ //////////////////////////////////////
const std::string perm_and_sale_items[]={
"perms_inv",
diff --git a/indra/newview/llwearableitemslist.cpp b/indra/newview/llwearableitemslist.cpp
index cf165f8f66..868322699e 100644
--- a/indra/newview/llwearableitemslist.cpp
+++ b/indra/newview/llwearableitemslist.cpp
@@ -621,6 +621,7 @@ void LLWearableItemsList::ContextMenu::updateItemsVisibility(LLContextMenu* menu
U32 mask = 0; // mask of selected items' types
U32 n_items = ids.size(); // number of selected items
U32 n_worn = 0; // number of worn items among the selected ones
+ U32 n_already_worn = 0; // number of items worn of same type as selected items
U32 n_links = 0; // number of links among the selected items
U32 n_editable = 0; // number of editable items among the selected ones
@@ -638,10 +639,11 @@ void LLWearableItemsList::ContextMenu::updateItemsVisibility(LLContextMenu* menu
updateMask(mask, item->getType());
- bool is_link = item->getIsLinkType();
- bool is_worn = get_is_item_worn(id);
- bool is_editable = gAgentWearables.isWearableModifiable(id);
-
+ const LLWearableType::EType wearable_type = item->getWearableType();
+ const bool is_link = item->getIsLinkType();
+ const bool is_worn = get_is_item_worn(id);
+ const bool is_editable = gAgentWearables.isWearableModifiable(id);
+ const bool is_already_worn = gAgentWearables.selfHasWearable(wearable_type);
if (is_worn)
{
++n_worn;
@@ -654,14 +656,20 @@ void LLWearableItemsList::ContextMenu::updateItemsVisibility(LLContextMenu* menu
{
++n_links;
}
+ if (is_already_worn)
+ {
+ ++n_already_worn;
+ }
} // for
bool standalone = mParent ? mParent->isStandalone() : false;
// *TODO: eliminate multiple traversals over the menu items
- setMenuItemVisible(menu, "wear_add", mask == MASK_CLOTHING && n_worn == 0);
- setMenuItemEnabled(menu, "wear_add", n_items == 1 && canAddWearable(ids.front()));
- setMenuItemVisible(menu, "wear", n_worn == 0);
+ setMenuItemVisible(menu, "wear_wear", n_already_worn == 0);
+ setMenuItemEnabled(menu, "wear_wear", n_already_worn == 0);
+ setMenuItemVisible(menu, "wear_add", mask == MASK_CLOTHING && n_worn == 0 && n_already_worn != 0);
+ setMenuItemEnabled(menu, "wear_add", n_items == 1 && canAddWearable(ids.front()) && n_already_worn != 0);
+ setMenuItemVisible(menu, "wear_replace", n_worn == 0 && n_already_worn != 0);
//visible only when one item selected and this item is worn
setMenuItemVisible(menu, "edit", !standalone && mask & (MASK_CLOTHING|MASK_BODYPART) && n_worn == n_items && n_worn == 1);
setMenuItemEnabled(menu, "edit", n_editable == 1 && n_worn == 1 && n_items == 1);
diff --git a/indra/newview/skins/default/xui/en/menu_wearable_list_item.xml b/indra/newview/skins/default/xui/en/menu_wearable_list_item.xml
index 23eb89e448..c3adbb7904 100644
--- a/indra/newview/skins/default/xui/en/menu_wearable_list_item.xml
+++ b/indra/newview/skins/default/xui/en/menu_wearable_list_item.xml
@@ -4,11 +4,18 @@
<menu_item_call
label="Replace"
layout="topleft"
- name="wear">
+ name="wear_replace">
<on_click
function="Wearable.Wear" />
</menu_item_call>
<menu_item_call
+ label="Wear"
+ layout="topleft"
+ name="wear_wear">
+ <on_click
+ function="Wearable.Add" />
+ </menu_item_call>
+ <menu_item_call
label="Add"
layout="topleft"
name="wear_add">
diff --git a/indra/newview/skins/default/xui/en/sidepanel_item_info.xml b/indra/newview/skins/default/xui/en/sidepanel_item_info.xml
index f3912b5133..50df227fbf 100644
--- a/indra/newview/skins/default/xui/en/sidepanel_item_info.xml
+++ b/indra/newview/skins/default/xui/en/sidepanel_item_info.xml
@@ -26,6 +26,14 @@
name="acquiredDate">
[wkday,datetime,local] [mth,datetime,local] [day,datetime,local] [hour,datetime,local]:[min,datetime,local]:[second,datetime,local] [year,datetime,local]
</panel.string>
+ <panel.string
+ name="origin_inventory">
+ (Inventory)
+ </panel.string>
+ <panel.string
+ name="origin_inworld">
+ (Inworld)
+ </panel.string>
<icon
follows="top|right"
height="18"
@@ -65,7 +73,7 @@
height="13"
layout="topleft"
left="45"
- name="where"
+ name="origin"
text_color="LtGray_50"
value="(Inventory)"
width="150" />
diff --git a/indra/newview/skins/default/xui/en/sidepanel_task_info.xml b/indra/newview/skins/default/xui/en/sidepanel_task_info.xml
index ef7ec74b5a..843015cb8b 100644
--- a/indra/newview/skins/default/xui/en/sidepanel_task_info.xml
+++ b/indra/newview/skins/default/xui/en/sidepanel_task_info.xml
@@ -85,7 +85,7 @@
left="45"
name="where"
text_color="LtGray_50"
- value="(inworld)"
+ value="(Inworld)"
width="150" />
<panel
follows="all"