Export perm added to UI!

Code added, Along with all the potential PERM_EXPORT bits...
Actual PERM_EXPORT bit still needs to be added.
SimulatorFeature comes next.
This commit is contained in:
Lirusaito
2013-02-14 22:14:42 -05:00
committed by Melanie
parent 3005b9dd2c
commit 15fea2ef54
5 changed files with 55 additions and 6 deletions

View File

@@ -197,6 +197,7 @@ LLFloaterProperties::LLFloaterProperties(const std::string& name, const LLRect&
// everyone permissions
childSetCommitCallback("CheckEveryoneCopy",&onCommitPermissions, this);
childSetCommitCallback("CheckEveryoneMove",&onCommitPermissions, this);
childSetCommitCallback("CheckExport", &onCommitPermissions, this);
// next owner permissions
childSetCommitCallback("CheckNextOwnerModify",&onCommitPermissions, this);
childSetCommitCallback("CheckNextOwnerCopy",&onCommitPermissions, this);
@@ -251,11 +252,13 @@ void LLFloaterProperties::refresh()
"CheckOwnerModify",
"CheckOwnerCopy",
"CheckOwnerTransfer",
"CheckOwnerExport",
"CheckGroupCopy",
"CheckGroupMod",
"CheckGroupMove",
"CheckEveryoneCopy",
"CheckEveryoneMove",
"CheckExport",
"CheckNextOwnerModify",
"CheckNextOwnerCopy",
"CheckNextOwnerTransfer",
@@ -436,6 +439,8 @@ void LLFloaterProperties::refreshFromItem(LLInventoryItem* item)
childSetValue("CheckOwnerCopy",LLSD((BOOL)(owner_mask & PERM_COPY)));
childSetEnabled("CheckOwnerTransfer",FALSE);
childSetValue("CheckOwnerTransfer",LLSD((BOOL)(owner_mask & PERM_TRANSFER)));
childSetEnabled("CheckOwnerExport",false);
// childSetValue("CheckOwnerExport", (bool)(owner_mask & PERM_EXPORT));
///////////////////////
// DEBUG PERMISSIONS //
@@ -519,6 +524,7 @@ void LLFloaterProperties::refreshFromItem(LLInventoryItem* item)
childSetEnabled("CheckEveryoneCopy",false);
childSetEnabled("CheckEveryoneMove",false);
}
childSetEnabled("CheckExport", gAgent.getID() == item->getCreatorUUID());
// Set values.
BOOL is_group_copy = (group_mask & PERM_COPY) ? TRUE : FALSE;
@@ -531,6 +537,7 @@ void LLFloaterProperties::refreshFromItem(LLInventoryItem* item)
childSetValue("CheckEveryoneCopy",LLSD((BOOL)(everyone_mask & PERM_COPY)));
childSetValue("CheckEveryoneMove",LLSD((BOOL)(everyone_mask & PERM_MOVE)));
//childSetValue("CheckExport", everyone_mask & PERM_EXPORT);
///////////////
// SALE INFO //
@@ -750,6 +757,11 @@ void LLFloaterProperties::onCommitPermissions(LLUICtrl* ctrl, void* data)
perm.setEveryoneBits(gAgent.getID(), gAgent.getGroupID(),
CheckEveryoneCopy->get(), PERM_COPY);
}
LLCheckBoxCtrl* CheckExport = self->getChild<LLCheckBoxCtrl>("CheckExport");
if(CheckExport)
{
// perm.setEveryoneBits(gAgent.getID(), gAgent.getGroupID(), CheckExport->get(), PERM_EXPORT);
}
LLCheckBoxCtrl* CheckNextOwnerModify = self->getChild<LLCheckBoxCtrl>("CheckNextOwnerModify");
if(CheckNextOwnerModify)

View File

@@ -112,6 +112,8 @@ BOOL LLPanelPermissions::postBuild()
childSetCommitCallback("checkbox allow everyone copy",LLPanelPermissions::onCommitEveryoneCopy,this);
getChild<LLUICtrl>("checkbox allow export")->setCommitCallback(boost::bind(&LLPanelPermissions::onCommitExport, this));
childSetCommitCallback("checkbox for sale",LLPanelPermissions::onCommitSaleInfo,this);
childSetCommitCallback("Edit Cost",LLPanelPermissions::onCommitSaleInfo,this);
@@ -223,10 +225,13 @@ void LLPanelPermissions::refresh()
childSetEnabled("checkbox share with group",false);
childSetEnabled("button deed",false);
childSetEnabled("text anyone can", false);
childSetValue("checkbox allow everyone move",FALSE);
childSetEnabled("checkbox allow everyone move",false);
childSetValue("checkbox allow everyone copy",FALSE);
childSetEnabled("checkbox allow everyone copy",false);
childSetValue("checkbox allow export", false);
childSetEnabled("checkbox allow export", false);
//Next owner can:
childSetEnabled("Next owner can:",false);
@@ -620,6 +625,8 @@ void LLPanelPermissions::refresh()
LLStringUtil::replaceChar(perm_string, 'C', 'c');
if (diff_mask & PERM_TRANSFER)
LLStringUtil::replaceChar(perm_string, 'T', 't');
/* if (diff_mask & PERM_EXPORT)
LLStringUtil::replaceChar(perm_string, 'E', 'e');*/
}
childSetText("B:",perm_string);
childSetVisible("B:",true);
@@ -688,15 +695,18 @@ void LLPanelPermissions::refresh()
if (has_change_perm_ability)
{
childSetEnabled("checkbox share with group",true);
childSetEnabled("text anyone can", true);
childSetEnabled("checkbox allow everyone move",owner_mask_on & PERM_MOVE);
childSetEnabled("checkbox allow everyone copy",owner_mask_on & PERM_COPY && owner_mask_on & PERM_TRANSFER);
}
else
{
childSetEnabled("checkbox share with group", FALSE);
childSetEnabled("text anyone can", false);
childSetEnabled("checkbox allow everyone move", FALSE);
childSetEnabled("checkbox allow everyone copy", FALSE);
}
childSetEnabled("checkbox allow export", mCreatorID == gAgent.getID());
if (has_change_sale_ability && (owner_mask_on & PERM_TRANSFER))
{
@@ -779,6 +789,23 @@ void LLPanelPermissions::refresh()
childSetValue("checkbox allow everyone copy",TRUE);
childSetTentative("checkbox allow everyone copy",true);
}
// Export
/* if(everyone_mask_on & PERM_EXPORT)
{
childSetValue("checkbox allow export", true);
childSetTentative("checkbox allow export", false);
}
else if(everyone_mask_on & PERM_EXPORT)
{
childSetValue("checkbox allow export", false);
childSetTentative("checkbox allow export", false);
}
else*/
{
childSetValue("checkbox allow export", true);
childSetTentative("checkbox allow export", true);
}
}
if(valid_next_perms)
@@ -1064,6 +1091,11 @@ void LLPanelPermissions::onCommitEveryoneCopy(LLUICtrl *ctrl, void *data)
onCommitPerm(ctrl, data, PERM_EVERYONE, PERM_COPY);
}
void LLPanelPermissions::onCommitExport()
{
// perm.setEveryoneBits(gAgent.getID(), gAgent.getGroupID(), childGetValue("checkbox allow export"), PERM_EXPORT);
}
// static
void LLPanelPermissions::onCommitNextOwnerModify(LLUICtrl* ctrl, void* data)
{

View File

@@ -86,6 +86,7 @@ protected:
static void onCommitEveryoneMove(LLUICtrl *ctrl, void *data);
static void onCommitEveryoneCopy(LLUICtrl *ctrl, void *data);
//static void onCommitEveryoneModify(LLUICtrl *ctrl, void *data);
void onCommitExport();
static void onCommitNextOwnerModify(LLUICtrl* ctrl, void* data);
static void onCommitNextOwnerCopy(LLUICtrl* ctrl, void* data);

View File

@@ -80,9 +80,10 @@
initial_value="false" label="Copy" left_delta="78" mouse_opaque="true"
name="CheckOwnerCopy" radio_style="false" width="88" />
<check_box bottom="-155" follows="left|top" font="SansSerifSmall" height="16"
initial_value="false" label="Resell/Give away" left_delta="88"
initial_value="false" label="Transfer" left_delta="88"
mouse_opaque="true" name="CheckOwnerTransfer" radio_style="false"
width="106" />
<check_box name="CheckOwnerExport" label="Export" bottom_delta="0" follows="left|top" left_delta="88" enabled="false"/>
<text bg_visible="false" border_drop_shadow_visible="false" border_visible="false"
bottom="-165" drop_shadow_visible="true" follows="left|top"
font="SansSerifSmall" h_pad="0" halign="left" height="10" left="10"
@@ -140,6 +141,7 @@
<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" />
<check_box name="CheckExport" label="Export" bottom_delta="0" follows="left|top" left_delta="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"
@@ -153,7 +155,7 @@
initial_value="false" label="Copy" left_delta="78" mouse_opaque="true"
name="CheckNextOwnerCopy" radio_style="false" width="88" />
<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="Transfer" left_delta="88"
mouse_opaque="true" name="CheckNextOwnerTransfer" radio_style="false"
width="106" />
<text bg_visible="false" border_drop_shadow_visible="false" border_visible="false"

View File

@@ -429,12 +429,14 @@
mouse_opaque="true" name="button deed" scale_image="TRUE"
tool_tip="Group shared objects can be deeded by a group officer."
width="78" />
<check_box bottom_delta="-18" follows="left|top" font="SansSerifSmall" height="16"
initial_value="false" label="Allow anyone to move" left="10"
<text name="text anyone can" bottom_delta="-12" left="10" follows="left|top">Anyone can:</text>
<check_box bottom_delta="-24" follows="left|top" font="SansSerifSmall" height="16"
initial_value="false" label="Move"
mouse_opaque="true" name="checkbox allow everyone move" width="142" />
<check_box bottom_delta="-18" follows="left|top" font="SansSerifSmall" height="16"
initial_value="false" label="Allow anyone to copy" left="10"
<check_box bottom_delta="0" follows="left|top" font="SansSerifSmall" height="16"
initial_value="false" label="Copy" left_delta="60"
mouse_opaque="true" name="checkbox allow everyone copy" width="141" />
<check_box name="checkbox export" label="Export" bottom_delta="0" left_delta="60" follows="left|top"/>
<check_box bottom_delta="-18" follows="left|top" font="SansSerifSmall" height="16"
initial_value="false" label="Show in search" left="10" name="search_check"
tool_tip="Let people see this object in search results" width="78" />