diff options
Diffstat (limited to 'indra/newview/llpanelprofile.cpp')
-rw-r--r-- | indra/newview/llpanelprofile.cpp | 47 |
1 files changed, 28 insertions, 19 deletions
diff --git a/indra/newview/llpanelprofile.cpp b/indra/newview/llpanelprofile.cpp index 7a28dd11f8..38308f2498 100644 --- a/indra/newview/llpanelprofile.cpp +++ b/indra/newview/llpanelprofile.cpp @@ -828,9 +828,12 @@ BOOL LLPanelProfileSecondLife::postBuild() mAgentActionMenuButton = getChild<LLMenuButton>("agent_actions_menu"); mSaveDescriptionChanges = getChild<LLButton>("save_description_changes"); mDiscardDescriptionChanges = getChild<LLButton>("discard_description_changes"); - mSeeOnlineToggle = getChild<LLButton>("allow_to_see_online"); - mSeeOnMapToggle = getChild<LLButton>("allow_to_see_on_map"); - mEditObjectsToggle = getChild<LLButton>("allow_edit_my_objects"); + mCanSeeOnlineIcon = getChild<LLIconCtrl>("can_see_online"); + mCantSeeOnlineIcon = getChild<LLIconCtrl>("cant_see_online"); + mCanSeeOnMapIcon = getChild<LLIconCtrl>("can_see_on_map"); + mCantSeeOnMapIcon = getChild<LLIconCtrl>("cant_see_on_map"); + mCanEditObjectsIcon = getChild<LLIconCtrl>("can_edit_objects"); + mCantEditObjectsIcon = getChild<LLIconCtrl>("cant_edit_objects"); mShowInSearchCombo->setCommitCallback([this](LLUICtrl*, void*) { onShowInSearchCallback(); }, nullptr); mGroupList->setDoubleClickCallback([this](LLUICtrl*, S32 x, S32 y, MASK mask) { LLPanelProfileSecondLife::openGroupProfile(); }); @@ -838,9 +841,6 @@ BOOL LLPanelProfileSecondLife::postBuild() mSaveDescriptionChanges->setCommitCallback([this](LLUICtrl*, void*) { onSaveDescriptionChanges(); }, nullptr); mDiscardDescriptionChanges->setCommitCallback([this](LLUICtrl*, void*) { onDiscardDescriptionChanges(); }, nullptr); mDescriptionEdit->setKeystrokeCallback([this](LLTextEditor* caller) { onSetDescriptionDirty(); }); - mSeeOnlineToggle->setMouseUpCallback([this](LLUICtrl*, const LLSD&) { onShowAgentPermissionsDialog(); }); - mSeeOnMapToggle->setMouseUpCallback([this](LLUICtrl*, const LLSD&) { onShowAgentPermissionsDialog(); }); - mEditObjectsToggle->setMouseUpCallback([this](LLUICtrl*, const LLSD&) { onShowAgentPermissionsDialog(); }); getChild<LLButton>("open_notes")->setCommitCallback([this](LLUICtrl*, void*) { onOpenNotes(); }, nullptr); @@ -933,9 +933,13 @@ void LLPanelProfileSecondLife::resetData() mGroups.clear(); mGroupList->setGroups(mGroups); - mSeeOnlineToggle->setToggleState(false); - mSeeOnMapToggle->setToggleState(false); - mEditObjectsToggle->setToggleState(false); + mCanSeeOnlineIcon->setVisible(false); + mCantSeeOnlineIcon->setVisible(true); + mCanSeeOnMapIcon->setVisible(false); + mCantSeeOnMapIcon->setVisible(true); + mCanEditObjectsIcon->setVisible(false); + mCantEditObjectsIcon->setVisible(true); + childSetVisible("permissions_panel", false); } @@ -1115,16 +1119,25 @@ void LLPanelProfileSecondLife::fillRightsData() if (relation) { S32 rights = relation->getRightsGrantedTo(); + bool can_see_online = LLRelationship::GRANT_ONLINE_STATUS & rights; + bool can_see_on_map = LLRelationship::GRANT_MAP_LOCATION & rights; + bool can_edit_objects = LLRelationship::GRANT_MODIFY_OBJECTS & rights; - mSeeOnlineToggle->setToggleState(LLRelationship::GRANT_ONLINE_STATUS & rights ? TRUE : FALSE); - mSeeOnMapToggle->setToggleState(LLRelationship::GRANT_MAP_LOCATION & rights ? TRUE : FALSE); - mEditObjectsToggle->setToggleState(LLRelationship::GRANT_MODIFY_OBJECTS & rights ? TRUE : FALSE); + mCanSeeOnlineIcon->setVisible(can_see_online); + mCantSeeOnlineIcon->setVisible(!can_see_online); + mCanSeeOnMapIcon->setVisible(can_see_on_map); + mCantSeeOnMapIcon->setVisible(!can_see_on_map); + mCanEditObjectsIcon->setVisible(can_edit_objects); + mCantEditObjectsIcon->setVisible(!can_edit_objects); } else { - mSeeOnlineToggle->setToggleState(false); - mSeeOnMapToggle->setToggleState(false); - mEditObjectsToggle->setToggleState(false); + mCanSeeOnlineIcon->setVisible(false); + mCantSeeOnlineIcon->setVisible(true); + mCanSeeOnMapIcon->setVisible(false); + mCantSeeOnMapIcon->setVisible(true); + mCanEditObjectsIcon->setVisible(false); + mCantEditObjectsIcon->setVisible(true); } childSetVisible("permissions_panel", NULL != relation); @@ -1614,10 +1627,6 @@ void LLPanelProfileSecondLife::onShowAgentPermissionsDialog() { floater->closeFloater(); } - - mSeeOnlineToggle->setFocus(false); - mSeeOnMapToggle->setFocus(false); - mEditObjectsToggle->setFocus(false); } void LLPanelProfileSecondLife::onOpenNotes() |