Feature Request (from IRC): Allow less restrictive access to group profiles from search

mAllowEdit has really signified whether or not llpanelgroup was in its own standalone floater
This change removes the restrictions the lindens chose to put on group search, allowing the user as much control as possible over a group from outside a dedicated floater

Notices and Land & Money get their information from messages passed through viewermessage, addressed to the right instance by id, as such they must be unique to the standalone floater
Cancel button in group search will only enable when changes have been made and will refresh the group, clearing changes.
The OK button is not visible in group search as it serves the same purpose as the Apply button here.
This commit is contained in:
Lirusaito
2013-06-14 23:08:56 -04:00
parent cf675c3748
commit 8ce71811c5
6 changed files with 24 additions and 26 deletions

View File

@@ -390,7 +390,7 @@ void* LLFloaterDirectory::createGroupDetail(void* userdata)
{
LLFloaterDirectory *self = (LLFloaterDirectory*)userdata;
self->mPanelGroupp = new LLPanelGroup(gAgent.getGroupID());
self->mPanelGroupp->setAllowEdit(FALSE || gAgent.isGodlike()); // Gods can always edit panels
self->mPanelGroupp->setAllowEdit(false); // Singu Note: This setting actually just tells the panel whether or not it is in search
self->mPanelGroupp->setVisible(FALSE);
return self->mPanelGroupp;
}

View File

@@ -246,14 +246,13 @@ BOOL LLPanelGroup::postBuild()
if (button)
{
button->setClickedCallback(boost::bind(&LLPanelGroup::onBtnCancel,this));
button->setVisible(mAllowEdit);
button->setEnabled(mAllowEdit); // Cancel should always be enabled for standalone group floater, this is expected behavior and may be used for simply closing
}
button = getChild<LLButton>("btn_apply");
if (button)
{
button->setClickedCallback(boost::bind(&LLPanelGroup::onBtnApply,this));
button->setVisible(mAllowEdit);
button->setEnabled(FALSE);
mApplyBtn = button;
@@ -263,7 +262,6 @@ BOOL LLPanelGroup::postBuild()
if (button)
{
button->setClickedCallback(boost::bind(&LLPanelGroup::onBtnRefresh,this));
button->setVisible(mAllowEdit);
}
return TRUE;
@@ -286,11 +284,15 @@ void LLPanelGroup::tabChanged()
{
//some tab information has changed,....enable/disable the apply button
//based on if they need an apply
std::string str;
const bool need = mCurrentTab->needsApply(str);
if ( mApplyBtn )
{
std::string mesg;
mApplyBtn->setEnabled(mCurrentTab->needsApply(mesg));
mApplyBtn->setEnabled(need);
}
if (mAllowEdit) return; // Cancel should always be enabled for standalone group floater, this is expected behavior and may be used for simply closing
if (LLUICtrl* ctrl = getChild<LLUICtrl>("btn_cancel"))
ctrl->setEnabled(need);
}
void LLPanelGroup::handleClickTab()
@@ -477,7 +479,10 @@ void LLPanelGroup::onBtnOK(void* user_data)
void LLPanelGroup::onBtnCancel(void* user_data)
{
LLPanelGroup* self = static_cast<LLPanelGroup*>(user_data);
self->close();
if (self->mAllowEdit) // We're in a standalone floater
self->close();
else // We're in search, we can't close out, just refreshData to kill changes
self->refreshData();
}
// static

View File

@@ -298,8 +298,7 @@ void LLPanelGroupGeneral::onCommitEnrollment()
}
// Make sure the agent can change enrollment info.
if (!gAgent.hasPowerInGroup(mGroupID,GP_MEMBER_OPTIONS)
|| !mAllowEdit)
if (!gAgent.hasPowerInGroup(mGroupID,GP_MEMBER_OPTIONS))
{
return;
}
@@ -317,7 +316,7 @@ void LLPanelGroupGeneral::onCommitEnrollment()
void LLPanelGroupGeneral::onCommitTitle()
{
if (mGroupID.isNull() || !mAllowEdit) return;
if (mGroupID.isNull()) return;
LLGroupMgr::getInstance()->sendGroupTitleUpdate(mGroupID,mComboActiveTitle->getCurrentID());
update(GC_TITLES);
mComboActiveTitle->resetDirty();
@@ -564,7 +563,6 @@ void LLPanelGroupGeneral::update(LLGroupChange gc)
if (mComboActiveTitle)
{
mComboActiveTitle->setVisible(is_member);
mComboActiveTitle->setEnabled(mAllowEdit);
if ( mActiveTitleLabel) mActiveTitleLabel->setVisible(is_member);
@@ -624,7 +622,7 @@ void LLPanelGroupGeneral::update(LLGroupChange gc)
if (mCtrlShowInGroupList)
{
mCtrlShowInGroupList->set(gdatap->mShowInList);
mCtrlShowInGroupList->setEnabled(mAllowEdit && can_change_ident);
mCtrlShowInGroupList->setEnabled(can_change_ident);
mCtrlShowInGroupList->resetDirty();
}
@@ -638,20 +636,20 @@ void LLPanelGroupGeneral::update(LLGroupChange gc)
{
mComboMature->setCurrentByIndex(NON_MATURE_CONTENT);
}
mComboMature->setEnabled(mAllowEdit && can_change_ident);
mComboMature->setEnabled(can_change_ident);
mComboMature->setVisible( !gAgent.isTeen() );
mComboMature->resetDirty();
}
if (mCtrlOpenEnrollment)
{
mCtrlOpenEnrollment->set(gdatap->mOpenEnrollment);
mCtrlOpenEnrollment->setEnabled(mAllowEdit && can_change_member_opts);
mCtrlOpenEnrollment->setEnabled(can_change_member_opts);
mCtrlOpenEnrollment->resetDirty();
}
if (mCtrlEnrollmentFee)
{
mCtrlEnrollmentFee->set(gdatap->mMembershipFee > 0);
mCtrlEnrollmentFee->setEnabled(mAllowEdit && can_change_member_opts);
mCtrlEnrollmentFee->setEnabled(can_change_member_opts);
mCtrlEnrollmentFee->resetDirty();
}
@@ -659,9 +657,7 @@ void LLPanelGroupGeneral::update(LLGroupChange gc)
{
S32 fee = gdatap->mMembershipFee;
mSpinEnrollmentFee->set((F32)fee);
mSpinEnrollmentFee->setEnabled( mAllowEdit &&
(fee > 0) &&
can_change_member_opts);
mSpinEnrollmentFee->setEnabled(fee && can_change_member_opts);
mSpinEnrollmentFee->resetDirty();
}
if ( mBtnJoinGroup )
@@ -693,7 +689,6 @@ void LLPanelGroupGeneral::update(LLGroupChange gc)
mCtrlReceiveNotices->setVisible(is_member);
if (is_member)
{
mCtrlReceiveNotices->setEnabled(mAllowEdit);
if(!mCtrlReceiveNotices->isDirty()) //If the user hasn't edited this then refresh it. Value may have changed in groups panel, etc.
{
mCtrlReceiveNotices->set(agent_gdatap.mAcceptNotices);
@@ -707,7 +702,6 @@ void LLPanelGroupGeneral::update(LLGroupChange gc)
mCtrlListGroup->setVisible(is_member);
if (is_member)
{
mCtrlListGroup->setEnabled(mAllowEdit);
if(!mCtrlListGroup->isDirty()) //If the user hasn't edited this then refresh it. Value may have changed in groups panel, etc.
{
mCtrlListGroup->set(agent_gdatap.mListInProfile);
@@ -721,7 +715,6 @@ void LLPanelGroupGeneral::update(LLGroupChange gc)
mCtrlReceiveChat->setVisible(is_member);
if (is_member)
{
mCtrlReceiveChat->setEnabled(mAllowEdit);
if(!mCtrlReceiveChat->isDirty()) //If the user hasn't edited this then refresh it. Value may have changed in groups panel, etc.
{
mCtrlReceiveChat->set(!gIMMgr->getIgnoreGroup(mGroupID));
@@ -730,8 +723,8 @@ void LLPanelGroupGeneral::update(LLGroupChange gc)
}
}
if (mInsignia) mInsignia->setEnabled(mAllowEdit && can_change_ident);
if (mEditCharter) mEditCharter->setEnabled(mAllowEdit && can_change_ident);
if (mInsignia) mInsignia->setEnabled(can_change_ident);
if (mEditCharter) mEditCharter->setEnabled(can_change_ident);
if (mGroupName) mGroupName->setText(gdatap->mName);
if (mGroupNameEditor) mGroupNameEditor->setVisible(FALSE);

View File

@@ -198,7 +198,7 @@ BOOL LLPanelGroupRoles::isVisibleByAgent(LLAgent* agentp)
GP_MEMBER_EJECT |
GP_MEMBER_OPTIONS );
*/
return mAllowEdit && agentp->isInGroup(mGroupID);
return agentp->isInGroup(mGroupID);
}

View File

@@ -1491,7 +1491,7 @@ LLPanelGroupVoting::~LLPanelGroupVoting()
BOOL LLPanelGroupVoting::isVisibleByAgent(LLAgent* agentp)
{
//if they are in the group, the panel is viewable
return mAllowEdit && agentp->isInGroup(mGroupID);
return agentp->isInGroup(mGroupID);
}
BOOL LLPanelGroupVoting::postBuild()

View File

@@ -703,7 +703,7 @@ To buy direct, visit the land and click on the place name in the title bar.
width="430" />
<panel bottom="-560" follows="right|top" height="470" left="340"
name="event_details_panel" width="440" />
<panel bottom="-580" follows="right|top" height="515" left="350"
<panel bottom="-570" follows="right|top" height="515" left="350"
name="group_details_panel_holder" width="430">
<panel bottom="0" follows="right|top" height="470" left="0" name="group_details_panel"
width="430" />