diff options
| author | Rider Linden <rider@lindenlab.com> | 2019-01-04 17:10:28 -0800 | 
|---|---|---|
| committer | Rider Linden <rider@lindenlab.com> | 2019-01-04 17:10:28 -0800 | 
| commit | 64e45b5b6ef8ded7bbea1b376e5bf2cbb0d6f5a4 (patch) | |
| tree | 1d2334529f952a303188856794feb765749290b6 | |
| parent | e9a2e8f88c67685ea6b894e8a4ae289067d0bfb7 (diff) | |
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.
| -rw-r--r-- | indra/llui/llmenugl.cpp | 22 | ||||
| -rw-r--r-- | indra/llui/llmenugl.h | 3 | ||||
| -rw-r--r-- | indra/newview/llfloatereditextdaycycle.cpp | 14 | ||||
| -rw-r--r-- | indra/newview/llflyoutcombobtn.cpp | 6 | ||||
| -rw-r--r-- | indra/newview/llflyoutcombobtn.h | 1 | ||||
| -rw-r--r-- | indra/newview/llpanelenvironment.cpp | 4 | ||||
| -rw-r--r-- | indra/newview/llviewerregion.h | 6 | ||||
| -rw-r--r-- | indra/newview/skins/default/xui/en/floater_edit_ext_day_cycle.xml | 3 | 
8 files changed, 58 insertions, 1 deletions
diff --git a/indra/llui/llmenugl.cpp b/indra/llui/llmenugl.cpp index 0d42f726fa..ddcce61123 100644 --- a/indra/llui/llmenugl.cpp +++ b/indra/llui/llmenugl.cpp @@ -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; diff --git a/indra/llui/llmenugl.h b/indra/llui/llmenugl.h index 69f7d21513..6ca581fa86 100644 --- a/indra/llui/llmenugl.h +++ b/indra/llui/llmenugl.h @@ -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); diff --git a/indra/newview/llfloatereditextdaycycle.cpp b/indra/newview/llfloatereditextdaycycle.cpp index 41582ffcc3..cb6fd611ec 100644 --- a/indra/newview/llfloatereditextdaycycle.cpp +++ b/indra/newview/llfloatereditextdaycycle.cpp @@ -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); diff --git a/indra/newview/llflyoutcombobtn.cpp b/indra/newview/llflyoutcombobtn.cpp index b008ee13be..48bfb85072 100644 --- a/indra/newview/llflyoutcombobtn.cpp +++ b/indra/newview/llflyoutcombobtn.cpp @@ -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; diff --git a/indra/newview/llflyoutcombobtn.h b/indra/newview/llflyoutcombobtn.h index b0dd4abadf..e41cd0cecb 100644 --- a/indra/newview/llflyoutcombobtn.h +++ b/indra/newview/llflyoutcombobtn.h @@ -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); diff --git a/indra/newview/llpanelenvironment.cpp b/indra/newview/llpanelenvironment.cpp index 3e0bb43d71..a150e66085 100644 --- a/indra/newview/llpanelenvironment.cpp +++ b/indra/newview/llpanelenvironment.cpp @@ -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();  } diff --git a/indra/newview/llviewerregion.h b/indra/newview/llviewerregion.h index d5266ec873..0e39e9b284 100644 --- a/indra/newview/llviewerregion.h +++ b/indra/newview/llviewerregion.h @@ -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; diff --git a/indra/newview/skins/default/xui/en/floater_edit_ext_day_cycle.xml b/indra/newview/skins/default/xui/en/floater_edit_ext_day_cycle.xml index a3dbab2509..a6868d7f90 100644 --- a/indra/newview/skins/default/xui/en/floater_edit_ext_day_cycle.xml +++ b/indra/newview/skins/default/xui/en/floater_edit_ext_day_cycle.xml @@ -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"  | 
