SL-10041, SL-9758: Environment tab is disabled(shows can't do this) when EM does not allow parcel override. "Commit" button now reads "Apply to Parcel" or "Apply to Region" as needed.

master
Rider Linden 2019-01-04 17:10:28 -08:00
parent e9a2e8f88c
commit 64e45b5b6e
8 changed files with 58 additions and 1 deletions

View File

@ -2713,6 +2713,15 @@ void LLMenuGL::setItemVisible( const std::string& name, BOOL visible )
}
}
void LLMenuGL::setItemLabel(const std::string &name, const std::string &label)
{
LLMenuItemGL *item = getItem(name);
if (item)
item->setLabel(label);
}
void LLMenuGL::setItemLastSelected(LLMenuItemGL* item)
{
if (getVisible())
@ -2757,6 +2766,19 @@ LLMenuItemGL* LLMenuGL::getItem(S32 number)
return NULL;
}
LLMenuItemGL* LLMenuGL::getItem(std::string name)
{
item_list_t::iterator item_iter;
for (item_iter = mItems.begin(); item_iter != mItems.end(); ++item_iter)
{
if ((*item_iter)->getName() == name)
{
return (*item_iter);
}
}
return NULL;
}
LLMenuItemGL* LLMenuGL::getHighlightedItem()
{
item_list_t::iterator item_iter;

View File

@ -463,6 +463,8 @@ public:
void setEnabledSubMenus(BOOL enable);
void setItemVisible( const std::string& name, BOOL visible);
void setItemLabel(const std::string &name, const std::string &label);
// sets the left,bottom corner of menu, useful for popups
void setLeftAndBottom(S32 left, S32 bottom);
@ -493,6 +495,7 @@ public:
void setItemLastSelected(LLMenuItemGL* item); // must be in menu
U32 getItemCount(); // number of menu items
LLMenuItemGL* getItem(S32 number); // 0 = first item
LLMenuItemGL* getItem(std::string name);
LLMenuItemGL* getHighlightedItem();
LLMenuItemGL* highlightNextItem(LLMenuItemGL* cur_item, BOOL skip_disabled = TRUE);

View File

@ -113,6 +113,9 @@ namespace {
const std::string ACTION_APPLY_REGION("apply_region");
const F32 DAY_CYCLE_PLAY_TIME_SECONDS = 60;
const std::string STR_COMMIT_PARCEL("commit_parcel");
const std::string STR_COMMIT_REGION("commit_region");
}
//=========================================================================
@ -440,6 +443,17 @@ void LLFloaterEditExtDayCycle::refresh()
bool show_commit = ((mEditContext == CONTEXT_PARCEL) || (mEditContext == CONTEXT_REGION));
bool show_apply = (mEditContext == CONTEXT_INVENTORY);
if (show_commit)
{
std::string commit_text;
if (mEditContext == CONTEXT_PARCEL)
commit_text = getString(STR_COMMIT_PARCEL);
else
commit_text = getString(STR_COMMIT_REGION);
mFlyoutControl->setMenuItemLabel(ACTION_COMMIT, commit_text);
}
mFlyoutControl->setMenuItemVisible(ACTION_COMMIT, show_commit);
mFlyoutControl->setMenuItemVisible(ACTION_SAVE, is_inventory_avail);
mFlyoutControl->setMenuItemVisible(ACTION_SAVEAS, is_inventory_avail);

View File

@ -112,6 +112,12 @@ void LLFlyoutComboBtnCtrl::setMenuItemVisible(const std::string &item, bool visi
mFlyoutMenu->setItemVisible(item, visible);
}
void LLFlyoutComboBtnCtrl::setMenuItemLabel(const std::string &item, const std::string &label)
{
mFlyoutMenu->setItemLabel(item, label);
}
void LLFlyoutComboBtnCtrl::onFlyoutButton(LLUICtrl *ctrl, const LLSD &data)
{
S32 x, y;

View File

@ -46,6 +46,7 @@ public:
void setMenuItemEnabled(const std::string &item, bool enabled);
void setShownBtnEnabled(bool enabled);
void setMenuItemVisible(const std::string &item, bool visible);
void setMenuItemLabel(const std::string &item, const std::string &label);
U32 getItemCount();
void setSelectedItem(S32 itemno);

View File

@ -299,9 +299,11 @@ void LLPanelEnvironmentInfo::refreshFromEstate()
{
/*TODO: Unfortunately only estate manager may get information from the LLEstateInfoModel.
* The proletariat is not allowed to know what options are set for an estate. We should fix this.*/
LLViewerRegion *pRegion = gAgent.getRegion();
bool oldAO = mAllowOverride;
mAllowOverride = (!isRegion()) || LLEstateInfoModel::instance().getAllowEnvironmentOverride();
//mAllowOverride = (!isRegion()) || LLEstateInfoModel::instance().getAllowEnvironmentOverride();
mAllowOverride = (isRegion() && LLEstateInfoModel::instance().getAllowEnvironmentOverride()) || pRegion->getAllowEnvironmentOverride();
if (oldAO != mAllowOverride)
refresh();
}

View File

@ -131,6 +131,7 @@ public:
inline BOOL isPrelude() const;
inline BOOL getAllowTerraform() const;
inline BOOL getRestrictPushObject() const;
inline BOOL getAllowEnvironmentOverride() const;
inline BOOL getReleaseNotesRequested() const;
bool isAlive(); // can become false if circuit disconnects
@ -635,6 +636,11 @@ inline BOOL LLViewerRegion::getRestrictPushObject() const
return ((mRegionFlags & REGION_FLAGS_RESTRICT_PUSHOBJECT) != 0);
}
inline BOOL LLViewerRegion::getAllowEnvironmentOverride() const
{
return ((mRegionFlags & REGION_FLAGS_ALLOW_ENVIRONMENT_OVERRIDE) != 0);
}
inline BOOL LLViewerRegion::getReleaseNotesRequested() const
{
return mReleaseNotesRequested;

View File

@ -24,6 +24,9 @@
<string name="sky_label">Sky</string>
<string name="water_label">Water</string>
<string name="commit_parcel">Apply To Parcel</string>
<string name="commit_region">Apply To Region</string>
<!-- Layout -->
<layout_stack name="outer_stack"
width="705"