Allow more flexible perm controls, from item properties floater.
TODO: Bring these permission flexibilities into build floater's general tab.
This commit is contained in:
@@ -197,9 +197,12 @@ LLFloaterProperties::LLFloaterProperties(const std::string& name, const LLRect&
|
|||||||
// owner permissions
|
// owner permissions
|
||||||
// Permissions debug text
|
// Permissions debug text
|
||||||
// group permissions
|
// group permissions
|
||||||
childSetCommitCallback("CheckShareWithGroup",&onCommitPermissions, this);
|
childSetCommitCallback("CheckGroupCopy",&onCommitPermissions, this);
|
||||||
|
childSetCommitCallback("CheckGroupMod",&onCommitPermissions, this);
|
||||||
|
childSetCommitCallback("CheckGroupMove",&onCommitPermissions, this);
|
||||||
// everyone permissions
|
// everyone permissions
|
||||||
childSetCommitCallback("CheckEveryoneCopy",&onCommitPermissions, this);
|
childSetCommitCallback("CheckEveryoneCopy",&onCommitPermissions, this);
|
||||||
|
childSetCommitCallback("CheckEveryoneMove",&onCommitPermissions, this);
|
||||||
// next owner permissions
|
// next owner permissions
|
||||||
childSetCommitCallback("CheckNextOwnerModify",&onCommitPermissions, this);
|
childSetCommitCallback("CheckNextOwnerModify",&onCommitPermissions, this);
|
||||||
childSetCommitCallback("CheckNextOwnerCopy",&onCommitPermissions, this);
|
childSetCommitCallback("CheckNextOwnerCopy",&onCommitPermissions, this);
|
||||||
@@ -261,8 +264,11 @@ void LLFloaterProperties::refresh()
|
|||||||
"CheckOwnerModify",
|
"CheckOwnerModify",
|
||||||
"CheckOwnerCopy",
|
"CheckOwnerCopy",
|
||||||
"CheckOwnerTransfer",
|
"CheckOwnerTransfer",
|
||||||
"CheckShareWithGroup",
|
"CheckGroupCopy",
|
||||||
|
"CheckGroupMod",
|
||||||
|
"CheckGroupMove",
|
||||||
"CheckEveryoneCopy",
|
"CheckEveryoneCopy",
|
||||||
|
"CheckEveryoneMove",
|
||||||
"CheckNextOwnerModify",
|
"CheckNextOwnerModify",
|
||||||
"CheckNextOwnerCopy",
|
"CheckNextOwnerCopy",
|
||||||
"CheckNextOwnerTransfer",
|
"CheckNextOwnerTransfer",
|
||||||
@@ -530,13 +536,23 @@ void LLFloaterProperties::refreshFromItem(LLInventoryItem* item)
|
|||||||
// Check for ability to change values.
|
// Check for ability to change values.
|
||||||
if (!is_link && is_obj_modify && can_agent_manipulate)
|
if (!is_link && is_obj_modify && can_agent_manipulate)
|
||||||
{
|
{
|
||||||
childSetEnabled("CheckShareWithGroup",TRUE);
|
childSetEnabled("GroupLabel", true);
|
||||||
|
childSetEnabled("CheckGroupCopy",owner_mask & PERM_TRANSFER);
|
||||||
|
childSetEnabled("CheckGroupMod", owner_mask & PERM_MODIFY);
|
||||||
|
childSetEnabled("CheckGroupMove", true);
|
||||||
|
childSetEnabled("EveryoneLabel", true);
|
||||||
childSetEnabled("CheckEveryoneCopy",(owner_mask & PERM_COPY) && (owner_mask & PERM_TRANSFER));
|
childSetEnabled("CheckEveryoneCopy",(owner_mask & PERM_COPY) && (owner_mask & PERM_TRANSFER));
|
||||||
|
childSetEnabled("CheckEveryoneMove",true);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
childSetEnabled("CheckShareWithGroup",FALSE);
|
childSetEnabled("GroupLabel", false);
|
||||||
|
childSetEnabled("CheckGroupCopy", false);
|
||||||
|
childSetEnabled("CheckGroupMod", false);
|
||||||
|
childSetEnabled("CheckGroupMove", false);
|
||||||
|
childSetEnabled("EveryoneLabel", false);
|
||||||
childSetEnabled("CheckEveryoneCopy",FALSE);
|
childSetEnabled("CheckEveryoneCopy",FALSE);
|
||||||
|
childSetEnabled("CheckEveryoneMove",false);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Set values.
|
// Set values.
|
||||||
@@ -544,36 +560,12 @@ void LLFloaterProperties::refreshFromItem(LLInventoryItem* item)
|
|||||||
BOOL is_group_modify = (group_mask & PERM_MODIFY) ? TRUE : FALSE;
|
BOOL is_group_modify = (group_mask & PERM_MODIFY) ? TRUE : FALSE;
|
||||||
BOOL is_group_move = (group_mask & PERM_MOVE) ? TRUE : FALSE;
|
BOOL is_group_move = (group_mask & PERM_MOVE) ? TRUE : FALSE;
|
||||||
|
|
||||||
if (is_group_copy && is_group_modify && is_group_move)
|
childSetValue("CheckGroupCopy", is_group_copy);
|
||||||
{
|
childSetValue("CheckGroupMod", is_group_modify);
|
||||||
childSetValue("CheckShareWithGroup",LLSD((BOOL)TRUE));
|
childSetValue("CheckGroupMove", is_group_move);
|
||||||
|
|
||||||
LLCheckBoxCtrl* ctl = getChild<LLCheckBoxCtrl>("CheckShareWithGroup");
|
|
||||||
if(ctl)
|
|
||||||
{
|
|
||||||
ctl->setTentative(FALSE);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else if (!is_group_copy && !is_group_modify && !is_group_move)
|
|
||||||
{
|
|
||||||
childSetValue("CheckShareWithGroup",LLSD((BOOL)FALSE));
|
|
||||||
LLCheckBoxCtrl* ctl = getChild<LLCheckBoxCtrl>("CheckShareWithGroup");
|
|
||||||
if(ctl)
|
|
||||||
{
|
|
||||||
ctl->setTentative(FALSE);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
LLCheckBoxCtrl* ctl = getChild<LLCheckBoxCtrl>("CheckShareWithGroup");
|
|
||||||
if(ctl)
|
|
||||||
{
|
|
||||||
ctl->setTentative(TRUE);
|
|
||||||
ctl->set(TRUE);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
childSetValue("CheckEveryoneCopy",LLSD((BOOL)(everyone_mask & PERM_COPY)));
|
childSetValue("CheckEveryoneCopy",LLSD((BOOL)(everyone_mask & PERM_COPY)));
|
||||||
|
childSetValue("CheckEveryoneMove",LLSD((BOOL)(everyone_mask & PERM_MOVE)));
|
||||||
|
|
||||||
///////////////
|
///////////////
|
||||||
// SALE INFO //
|
// SALE INFO //
|
||||||
@@ -762,13 +754,30 @@ void LLFloaterProperties::onCommitPermissions(LLUICtrl* ctrl, void* data)
|
|||||||
LLPermissions perm(item->getPermissions());
|
LLPermissions perm(item->getPermissions());
|
||||||
|
|
||||||
|
|
||||||
LLCheckBoxCtrl* CheckShareWithGroup = self->getChild<LLCheckBoxCtrl>("CheckShareWithGroup");
|
LLCheckBoxCtrl* CheckGroupCopy = self->getChild<LLCheckBoxCtrl>("CheckGroupCopy");
|
||||||
|
if(CheckGroupCopy)
|
||||||
if(CheckShareWithGroup)
|
|
||||||
{
|
{
|
||||||
perm.setGroupBits(gAgent.getID(), gAgent.getGroupID(),
|
perm.setGroupBits(gAgent.getID(), gAgent.getGroupID(),
|
||||||
CheckShareWithGroup->get(),
|
CheckGroupCopy->get(), PERM_COPY);
|
||||||
PERM_MODIFY | PERM_MOVE | PERM_COPY);
|
}
|
||||||
|
LLCheckBoxCtrl* CheckGroupMod = self->getChild<LLCheckBoxCtrl>("CheckGroupMod");
|
||||||
|
if(CheckGroupMod)
|
||||||
|
{
|
||||||
|
perm.setGroupBits(gAgent.getID(), gAgent.getGroupID(),
|
||||||
|
CheckGroupMod->get(), PERM_MODIFY);
|
||||||
|
}
|
||||||
|
LLCheckBoxCtrl* CheckGroupMove = self->getChild<LLCheckBoxCtrl>("CheckGroupMove");
|
||||||
|
if(CheckGroupMove)
|
||||||
|
{
|
||||||
|
perm.setGroupBits(gAgent.getID(), gAgent.getGroupID(),
|
||||||
|
CheckGroupMove->get(), PERM_MOVE);
|
||||||
|
}
|
||||||
|
|
||||||
|
LLCheckBoxCtrl* CheckEveryoneMove = self->getChild<LLCheckBoxCtrl>("CheckEveryoneMove");
|
||||||
|
if(CheckEveryoneMove)
|
||||||
|
{
|
||||||
|
perm.setEveryoneBits(gAgent.getID(), gAgent.getGroupID(),
|
||||||
|
CheckEveryoneMove->get(), PERM_MOVE);
|
||||||
}
|
}
|
||||||
LLCheckBoxCtrl* CheckEveryoneCopy = self->getChild<LLCheckBoxCtrl>("CheckEveryoneCopy");
|
LLCheckBoxCtrl* CheckEveryoneCopy = self->getChild<LLCheckBoxCtrl>("CheckEveryoneCopy");
|
||||||
if(CheckEveryoneCopy)
|
if(CheckEveryoneCopy)
|
||||||
|
|||||||
@@ -113,16 +113,35 @@
|
|||||||
mouse_opaque="true" name="NextMaskDebug" v_pad="0" width="90">
|
mouse_opaque="true" name="NextMaskDebug" v_pad="0" width="90">
|
||||||
N:
|
N:
|
||||||
</text>
|
</text>
|
||||||
<check_box bottom="-187" follows="left|top" font="SansSerifSmall" height="16"
|
|
||||||
initial_value="false" label="Share with group" left="10"
|
|
||||||
mouse_opaque="true" name="CheckShareWithGroup" radio_style="false"
|
|
||||||
width="106" />
|
|
||||||
<check_box bottom_delta="-32" follows="left|top" font="SansSerifSmall" height="16"
|
|
||||||
initial_value="false" label="Allow anyone to copy" left="10"
|
|
||||||
mouse_opaque="true" name="CheckEveryoneCopy" radio_style="false"
|
|
||||||
width="130" />
|
|
||||||
<text bg_visible="false" border_drop_shadow_visible="false" border_visible="false"
|
<text bg_visible="false" border_drop_shadow_visible="false" border_visible="false"
|
||||||
bottom_delta="-26" drop_shadow_visible="true" follows="left|top"
|
bottom_delta="-20" drop_shadow_visible="true" follows="left|top"
|
||||||
|
font="SansSerifSmall" h_pad="0" halign="left" height="10" left="10"
|
||||||
|
mouse_opaque="true" name="GroupLabel" v_pad="0" width="198">
|
||||||
|
Group members can:
|
||||||
|
</text>
|
||||||
|
<check_box bottom_delta="-20" follows="left|top" font="SansSerifSmall" height="16"
|
||||||
|
initial_value="false" label="Modify" left="10" mouse_opaque="true"
|
||||||
|
name="CheckGroupMod" radio_style="false" width="78" />
|
||||||
|
<check_box bottom_delta="0" follows="left|top" font="SansSerifSmall" height="16"
|
||||||
|
initial_value="false" label="Copy" left_delta="78" mouse_opaque="true"
|
||||||
|
name="CheckGroupCopy" radio_style="false" width="88" />
|
||||||
|
<check_box bottom_delta="0" follows="left|top" font="SansSerifSmall" height="16"
|
||||||
|
initial_value="false" label="Move" left_delta="88" mouse_opaque="true"
|
||||||
|
name="CheckGroupMove" radio_style="false" width="106" />
|
||||||
|
<text bg_visible="false" border_drop_shadow_visible="false" border_visible="false"
|
||||||
|
bottom_delta="-17" drop_shadow_visible="true" follows="left|top"
|
||||||
|
font="SansSerifSmall" h_pad="0" halign="left" height="10" left="10"
|
||||||
|
mouse_opaque="true" name="EveryoneLabel" v_pad="0" width="88">
|
||||||
|
Anyone can:
|
||||||
|
</text>
|
||||||
|
<check_box bottom_delta="-8" follows="left|top" font="SansSerifSmall" height="16"
|
||||||
|
initial_value="false" label="Copy" left="88" mouse_opaque="true"
|
||||||
|
name="CheckEveryoneCopy" radio_style="false" width="88" />
|
||||||
|
<check_box bottom_delta="0" follows="left|top" font="SansSerifSmall" height="16"
|
||||||
|
initial_value="false" label="Move" left_delta="88" mouse_opaque="true"
|
||||||
|
name="CheckEveryoneMove" radio_style="false" width="88" />
|
||||||
|
<text bg_visible="false" border_drop_shadow_visible="false" border_visible="false"
|
||||||
|
bottom_delta="-13" drop_shadow_visible="true" follows="left|top"
|
||||||
font="SansSerifSmall" h_pad="0" halign="left" height="10" left="10"
|
font="SansSerifSmall" h_pad="0" halign="left" height="10" left="10"
|
||||||
mouse_opaque="true" name="NextOwnerLabel" v_pad="0" width="88">
|
mouse_opaque="true" name="NextOwnerLabel" v_pad="0" width="88">
|
||||||
Next owner can:
|
Next owner can:
|
||||||
@@ -130,10 +149,10 @@
|
|||||||
<check_box bottom_delta="-20" follows="left|top" font="SansSerifSmall" height="16"
|
<check_box bottom_delta="-20" follows="left|top" font="SansSerifSmall" height="16"
|
||||||
initial_value="false" label="Modify" left="10" mouse_opaque="true"
|
initial_value="false" label="Modify" left="10" mouse_opaque="true"
|
||||||
name="CheckNextOwnerModify" radio_style="false" width="78" />
|
name="CheckNextOwnerModify" radio_style="false" width="78" />
|
||||||
<check_box bottom="-265" follows="left|top" font="SansSerifSmall" height="16"
|
<check_box bottom_delta="0" follows="left|top" font="SansSerifSmall" height="16"
|
||||||
initial_value="false" label="Copy" left_delta="78" mouse_opaque="true"
|
initial_value="false" label="Copy" left_delta="78" mouse_opaque="true"
|
||||||
name="CheckNextOwnerCopy" radio_style="false" width="88" />
|
name="CheckNextOwnerCopy" radio_style="false" width="88" />
|
||||||
<check_box bottom="-265" follows="left|top" font="SansSerifSmall" height="16"
|
<check_box bottom_delta="0" follows="left|top" font="SansSerifSmall" height="16"
|
||||||
initial_value="false" label="Resell/Give away" left_delta="88"
|
initial_value="false" label="Resell/Give away" left_delta="88"
|
||||||
mouse_opaque="true" name="CheckNextOwnerTransfer" radio_style="false"
|
mouse_opaque="true" name="CheckNextOwnerTransfer" radio_style="false"
|
||||||
width="106" />
|
width="106" />
|
||||||
|
|||||||
Reference in New Issue
Block a user