Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
Alchemy Viewer
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Silent mode is enabled
All outbound communications are blocked.
Learn more
.
Show more breadcrumbs
Alchemy Archive
Alchemy Viewer
Commits
faad5eff
Commit
faad5eff
authored
15 years ago
by
Eric M. Tulla (BigPapi)
Browse files
Options
Downloads
Plain Diff
Automated merge with
ssh://hg.lindenlab.com/viewer/viewer-2-0/
parents
b139ebcc
65bbff63
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
indra/newview/llsidepaneliteminfo.cpp
+80
-22
80 additions, 22 deletions
indra/newview/llsidepaneliteminfo.cpp
indra/newview/llsidepaneliteminfo.h
+3
-3
3 additions, 3 deletions
indra/newview/llsidepaneliteminfo.h
with
83 additions
and
25 deletions
indra/newview/llsidepaneliteminfo.cpp
+
80
−
22
View file @
faad5eff
...
@@ -157,11 +157,12 @@ void LLSidepanelItemInfo::reset()
...
@@ -157,11 +157,12 @@ void LLSidepanelItemInfo::reset()
void
LLSidepanelItemInfo
::
refresh
()
void
LLSidepanelItemInfo
::
refresh
()
{
{
LLInventoryItem
*
item
=
findItem
();
LL
Viewer
InventoryItem
*
item
=
findItem
();
if
(
item
)
if
(
item
)
{
{
refreshFromItem
(
item
);
refreshFromItem
(
item
);
updateVerbs
();
updateVerbs
();
return
;
}
}
else
else
{
{
...
@@ -171,10 +172,7 @@ void LLSidepanelItemInfo::refresh()
...
@@ -171,10 +172,7 @@ void LLSidepanelItemInfo::refresh()
}
}
}
}
const
LLUUID
trash_id
=
gInventory
.
findCategoryUUIDForType
(
LLFolderType
::
FT_TRASH
);
if
(
!
getIsEditing
())
bool
is_editable
=
item
&&
(
item
->
getUUID
()
!=
trash_id
)
&&
!
gInventory
.
isObjectDescendentOf
(
item
->
getUUID
(),
trash_id
);
if
(
!
getIsEditing
()
||
!
is_editable
)
{
{
const
std
::
string
no_item_names
[]
=
{
const
std
::
string
no_item_names
[]
=
{
"LabelItemName"
,
"LabelItemName"
,
...
@@ -212,7 +210,7 @@ void LLSidepanelItemInfo::refresh()
...
@@ -212,7 +210,7 @@ void LLSidepanelItemInfo::refresh()
}
}
}
}
if
(
!
i
s_editable
)
if
(
!
i
tem
)
{
{
const
std
::
string
no_edit_mode_names
[]
=
{
const
std
::
string
no_edit_mode_names
[]
=
{
"BtnCreator"
,
"BtnCreator"
,
...
@@ -227,24 +225,26 @@ void LLSidepanelItemInfo::refresh()
...
@@ -227,24 +225,26 @@ void LLSidepanelItemInfo::refresh()
updateVerbs
();
updateVerbs
();
}
}
void
LLSidepanelItemInfo
::
refreshFromItem
(
LLInventoryItem
*
item
)
void
LLSidepanelItemInfo
::
refreshFromItem
(
LL
Viewer
InventoryItem
*
item
)
{
{
////////////////////////
////////////////////////
// PERMISSIONS LOOKUP //
// PERMISSIONS LOOKUP //
////////////////////////
////////////////////////
// do not enable the UI for incomplete items.
// do not enable the UI for incomplete items.
LLViewerInventoryItem
*
i
=
(
LLViewerInventoryItem
*
)
item
;
BOOL
is_complete
=
item
->
isComplete
();
BOOL
is_complete
=
i
->
isComplete
();
const
BOOL
cannot_restrict_permissions
=
LLInventoryType
::
cannotRestrictPermissions
(
item
->
getInventoryType
());
const
BOOL
cannot_restrict_permissions
=
LLInventoryType
::
cannotRestrictPermissions
(
i
->
getInventoryType
());
const
BOOL
is_calling_card
=
(
item
->
getInventoryType
()
==
LLInventoryType
::
IT_CALLINGCARD
);
const
BOOL
is_calling_card
=
(
i
->
getInventoryType
()
==
LLInventoryType
::
IT_CALLINGCARD
);
const
LLPermissions
&
perm
=
item
->
getPermissions
();
const
LLPermissions
&
perm
=
item
->
getPermissions
();
const
BOOL
can_agent_manipulate
=
gAgent
.
allowOperation
(
PERM_OWNER
,
perm
,
const
BOOL
can_agent_manipulate
=
gAgent
.
allowOperation
(
PERM_OWNER
,
perm
,
GP_OBJECT_MANIPULATE
);
GP_OBJECT_MANIPULATE
);
const
BOOL
can_agent_sell
=
gAgent
.
allowOperation
(
PERM_OWNER
,
perm
,
const
BOOL
can_agent_sell
=
gAgent
.
allowOperation
(
PERM_OWNER
,
perm
,
GP_OBJECT_SET_SALE
)
&&
GP_OBJECT_SET_SALE
)
&&
!
cannot_restrict_permissions
;
!
cannot_restrict_permissions
;
const
BOOL
is_link
=
i
->
getIsLinkType
();
const
BOOL
is_link
=
item
->
getIsLinkType
();
const
LLUUID
trash_id
=
gInventory
.
findCategoryUUIDForType
(
LLFolderType
::
FT_TRASH
);
bool
not_in_trash
=
item
&&
(
item
->
getUUID
()
!=
trash_id
)
&&
!
gInventory
.
isObjectDescendentOf
(
item
->
getUUID
(),
trash_id
);
// You need permission to modify the object to modify an inventory
// You need permission to modify the object to modify an inventory
// item in it.
// item in it.
...
@@ -261,7 +261,7 @@ void LLSidepanelItemInfo::refreshFromItem(LLInventoryItem* item)
...
@@ -261,7 +261,7 @@ void LLSidepanelItemInfo::refreshFromItem(LLInventoryItem* item)
//////////////////////
//////////////////////
BOOL
is_modifiable
=
gAgent
.
allowOperation
(
PERM_MODIFY
,
perm
,
BOOL
is_modifiable
=
gAgent
.
allowOperation
(
PERM_MODIFY
,
perm
,
GP_OBJECT_MANIPULATE
)
GP_OBJECT_MANIPULATE
)
&&
is_obj_modify
&&
is_complete
;
&&
is_obj_modify
&&
is_complete
&&
not_in_trash
;
childSetEnabled
(
"LabelItemNameTitle"
,
TRUE
);
childSetEnabled
(
"LabelItemNameTitle"
,
TRUE
);
childSetEnabled
(
"LabelItemName"
,
is_modifiable
&&
!
is_calling_card
);
// for now, don't allow rename of calling cards
childSetEnabled
(
"LabelItemName"
,
is_modifiable
&&
!
is_calling_card
);
// for now, don't allow rename of calling cards
...
@@ -339,6 +339,64 @@ void LLSidepanelItemInfo::refreshFromItem(LLInventoryItem* item)
...
@@ -339,6 +339,64 @@ void LLSidepanelItemInfo::refreshFromItem(LLInventoryItem* item)
childSetText
(
"LabelAcquiredDate"
,
timeStr
);
childSetText
(
"LabelAcquiredDate"
,
timeStr
);
}
}
/////////////////////////////////////
// PERMISSIONS AND SALE ITEM HIDING
/////////////////////////////////////
const
std
::
string
perm_and_sale_items
[]
=
{
"perms_inv"
,
"OwnerLabel"
,
"perm_modify"
,
"CheckOwnerModify"
,
"CheckOwnerCopy"
,
"CheckOwnerTransfer"
,
"GroupLabel"
,
"CheckShareWithGroup"
,
"AnyoneLabel"
,
"CheckEveryoneCopy"
,
"NextOwnerLabel"
,
"CheckNextOwnerModify"
,
"CheckNextOwnerCopy"
,
"CheckNextOwnerTransfer"
,
"CheckPurchase"
,
"SaleLabel"
,
"RadioSaleType"
,
"combobox sale copy"
,
"Edit Cost"
,
"TextPrice"
};
const
std
::
string
debug_items
[]
=
{
"BaseMaskDebug"
,
"OwnerMaskDebug"
,
"GroupMaskDebug"
,
"EveryoneMaskDebug"
,
"NextMaskDebug"
};
// Hide permissions checkboxes and labels and for sale info if in the trash
// or ui elements don't apply to these objects and return from function
if
(
!
not_in_trash
||
cannot_restrict_permissions
)
{
for
(
size_t
t
=
0
;
t
<
LL_ARRAY_SIZE
(
perm_and_sale_items
);
++
t
)
{
childSetVisible
(
perm_and_sale_items
[
t
],
false
);
}
for
(
size_t
t
=
0
;
t
<
LL_ARRAY_SIZE
(
debug_items
);
++
t
)
{
childSetVisible
(
debug_items
[
t
],
false
);
}
return
;
}
else
// Make sure perms and sale ui elements are visible
{
for
(
size_t
t
=
0
;
t
<
LL_ARRAY_SIZE
(
perm_and_sale_items
);
++
t
)
{
childSetVisible
(
perm_and_sale_items
[
t
],
true
);
}
}
///////////////////////
///////////////////////
// OWNER PERMISSIONS //
// OWNER PERMISSIONS //
///////////////////////
///////////////////////
...
@@ -541,7 +599,7 @@ void LLSidepanelItemInfo::refreshFromItem(LLInventoryItem* item)
...
@@ -541,7 +599,7 @@ void LLSidepanelItemInfo::refreshFromItem(LLInventoryItem* item)
void
LLSidepanelItemInfo
::
onClickCreator
()
void
LLSidepanelItemInfo
::
onClickCreator
()
{
{
LLInventoryItem
*
item
=
findItem
();
LL
Viewer
InventoryItem
*
item
=
findItem
();
if
(
!
item
)
return
;
if
(
!
item
)
return
;
if
(
!
item
->
getCreatorUUID
().
isNull
())
if
(
!
item
->
getCreatorUUID
().
isNull
())
{
{
...
@@ -552,7 +610,7 @@ void LLSidepanelItemInfo::onClickCreator()
...
@@ -552,7 +610,7 @@ void LLSidepanelItemInfo::onClickCreator()
// static
// static
void
LLSidepanelItemInfo
::
onClickOwner
()
void
LLSidepanelItemInfo
::
onClickOwner
()
{
{
LLInventoryItem
*
item
=
findItem
();
LL
Viewer
InventoryItem
*
item
=
findItem
();
if
(
!
item
)
return
;
if
(
!
item
)
return
;
if
(
item
->
getPermissions
().
isGroupOwned
())
if
(
item
->
getPermissions
().
isGroupOwned
())
{
{
...
@@ -568,7 +626,7 @@ void LLSidepanelItemInfo::onClickOwner()
...
@@ -568,7 +626,7 @@ void LLSidepanelItemInfo::onClickOwner()
void
LLSidepanelItemInfo
::
onCommitName
()
void
LLSidepanelItemInfo
::
onCommitName
()
{
{
//llinfos << "LLSidepanelItemInfo::onCommitName()" << llendl;
//llinfos << "LLSidepanelItemInfo::onCommitName()" << llendl;
LLViewerInventoryItem
*
item
=
(
LLViewerInventoryItem
*
)
findItem
();
LLViewerInventoryItem
*
item
=
findItem
();
if
(
!
item
)
if
(
!
item
)
{
{
return
;
return
;
...
@@ -604,7 +662,7 @@ void LLSidepanelItemInfo::onCommitName()
...
@@ -604,7 +662,7 @@ void LLSidepanelItemInfo::onCommitName()
void
LLSidepanelItemInfo
::
onCommitDescription
()
void
LLSidepanelItemInfo
::
onCommitDescription
()
{
{
//llinfos << "LLSidepanelItemInfo::onCommitDescription()" << llendl;
//llinfos << "LLSidepanelItemInfo::onCommitDescription()" << llendl;
LLViewerInventoryItem
*
item
=
(
LLViewerInventoryItem
*
)
findItem
();
LLViewerInventoryItem
*
item
=
findItem
();
if
(
!
item
)
return
;
if
(
!
item
)
return
;
LLLineEditor
*
labelItemDesc
=
getChild
<
LLLineEditor
>
(
"LabelItemDesc"
);
LLLineEditor
*
labelItemDesc
=
getChild
<
LLLineEditor
>
(
"LabelItemDesc"
);
...
@@ -642,7 +700,7 @@ void LLSidepanelItemInfo::onCommitDescription()
...
@@ -642,7 +700,7 @@ void LLSidepanelItemInfo::onCommitDescription()
void
LLSidepanelItemInfo
::
onCommitPermissions
()
void
LLSidepanelItemInfo
::
onCommitPermissions
()
{
{
//llinfos << "LLSidepanelItemInfo::onCommitPermissions()" << llendl;
//llinfos << "LLSidepanelItemInfo::onCommitPermissions()" << llendl;
LLViewerInventoryItem
*
item
=
(
LLViewerInventoryItem
*
)
findItem
();
LLViewerInventoryItem
*
item
=
findItem
();
if
(
!
item
)
return
;
if
(
!
item
)
return
;
LLPermissions
perm
(
item
->
getPermissions
());
LLPermissions
perm
(
item
->
getPermissions
());
...
@@ -751,7 +809,7 @@ void LLSidepanelItemInfo::onCommitSaleType()
...
@@ -751,7 +809,7 @@ void LLSidepanelItemInfo::onCommitSaleType()
void
LLSidepanelItemInfo
::
updateSaleInfo
()
void
LLSidepanelItemInfo
::
updateSaleInfo
()
{
{
LLViewerInventoryItem
*
item
=
(
LLViewerInventoryItem
*
)
findItem
();
LLViewerInventoryItem
*
item
=
findItem
();
if
(
!
item
)
return
;
if
(
!
item
)
return
;
LLSaleInfo
sale_info
(
item
->
getSaleInfo
());
LLSaleInfo
sale_info
(
item
->
getSaleInfo
());
if
(
!
gAgent
.
allowOperation
(
PERM_TRANSFER
,
item
->
getPermissions
(),
GP_OBJECT_SET_SALE
))
if
(
!
gAgent
.
allowOperation
(
PERM_TRANSFER
,
item
->
getPermissions
(),
GP_OBJECT_SET_SALE
))
...
@@ -851,9 +909,9 @@ void LLSidepanelItemInfo::updateSaleInfo()
...
@@ -851,9 +909,9 @@ void LLSidepanelItemInfo::updateSaleInfo()
}
}
}
}
LLInventoryItem
*
LLSidepanelItemInfo
::
findItem
()
const
LL
Viewer
InventoryItem
*
LLSidepanelItemInfo
::
findItem
()
const
{
{
LLInventoryItem
*
item
=
NULL
;
LL
Viewer
InventoryItem
*
item
=
NULL
;
if
(
mObjectID
.
isNull
())
if
(
mObjectID
.
isNull
())
{
{
// it is in agent inventory
// it is in agent inventory
...
@@ -864,7 +922,7 @@ LLInventoryItem* LLSidepanelItemInfo::findItem() const
...
@@ -864,7 +922,7 @@ LLInventoryItem* LLSidepanelItemInfo::findItem() const
LLViewerObject
*
object
=
gObjectList
.
findObject
(
mObjectID
);
LLViewerObject
*
object
=
gObjectList
.
findObject
(
mObjectID
);
if
(
object
)
if
(
object
)
{
{
item
=
(
LL
InventoryItem
*
)
object
->
getInventoryObject
(
mItemID
);
item
=
static_cast
<
LLViewer
InventoryItem
*
>
(
object
->
getInventoryObject
(
mItemID
)
)
;
}
}
}
}
return
item
;
return
item
;
...
...
This diff is collapsed.
Click to expand it.
indra/newview/llsidepaneliteminfo.h
+
3
−
3
View file @
faad5eff
...
@@ -41,7 +41,7 @@
...
@@ -41,7 +41,7 @@
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
class
LLButton
;
class
LLButton
;
class
LLInventoryItem
;
class
LL
Viewer
InventoryItem
;
class
LLItemPropertiesObserver
;
class
LLItemPropertiesObserver
;
class
LLViewerObject
;
class
LLViewerObject
;
class
LLPermissions
;
class
LLPermissions
;
...
@@ -63,10 +63,10 @@ protected:
...
@@ -63,10 +63,10 @@ protected:
/*virtual*/
void
refresh
();
/*virtual*/
void
refresh
();
/*virtual*/
void
save
();
/*virtual*/
void
save
();
LLInventoryItem
*
findItem
()
const
;
LL
Viewer
InventoryItem
*
findItem
()
const
;
LLViewerObject
*
findObject
()
const
;
LLViewerObject
*
findObject
()
const
;
void
refreshFromItem
(
LLInventoryItem
*
item
);
void
refreshFromItem
(
LL
Viewer
InventoryItem
*
item
);
private:
private:
LLUUID
mItemID
;
// inventory UUID for the inventory item.
LLUUID
mItemID
;
// inventory UUID for the inventory item.
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment