diff options
| author | Rider Linden <rider@lindenlab.com> | 2018-07-09 13:26:48 -0700 | 
|---|---|---|
| committer | Rider Linden <rider@lindenlab.com> | 2018-07-09 13:26:48 -0700 | 
| commit | 21d165011b81909c8cab944755b53f908e51ad16 (patch) | |
| tree | 4a2dc72d9838987c120b331caa9d9a9355152a02 | |
| parent | 0bf678e23b2a29fcd2bf1488f999168b8737c010 (diff) | |
Attempting to create a settings inventory item on a non-eep region will now show a visible failure message to the user. Menu items for greating settings in inventory are disabled on non eep regions.
| -rw-r--r-- | indra/newview/llpanelmaininventory.cpp | 9 | ||||
| -rw-r--r-- | indra/newview/llpanelmaininventory.h | 1 | ||||
| -rw-r--r-- | indra/newview/llsettingsvo.cpp | 9 | ||||
| -rw-r--r-- | indra/newview/skins/default/xui/en/menu_inventory.xml | 6 | ||||
| -rw-r--r-- | indra/newview/skins/default/xui/en/menu_inventory_add.xml | 554 | ||||
| -rw-r--r-- | indra/newview/skins/default/xui/en/notifications.xml | 10 | 
6 files changed, 316 insertions, 273 deletions
diff --git a/indra/newview/llpanelmaininventory.cpp b/indra/newview/llpanelmaininventory.cpp index a9ad41e6f7..b5e24b6efb 100644 --- a/indra/newview/llpanelmaininventory.cpp +++ b/indra/newview/llpanelmaininventory.cpp @@ -58,6 +58,7 @@  #include "llsidepanelinventory.h"  #include "llfolderview.h"  #include "llradiogroup.h" +#include "llenvironment.h"  const std::string FILTERS_FILENAME("filters.xml"); @@ -128,6 +129,9 @@ LLPanelMainInventory::LLPanelMainInventory(const LLPanel::Params& p)  	mCommitCallbackRegistrar.add("Inventory.SetSortBy", boost::bind(&LLPanelMainInventory::setSortBy, this, _2));  	mCommitCallbackRegistrar.add("Inventory.Share",  boost::bind(&LLAvatarActions::shareWithAvatars, this)); +    mEnableCallbackRegistrar.add("Inventory.EnvironmentEnabled", [](LLUICtrl *, const LLSD &) { return LLPanelMainInventory::hasSettingsInventory(); }); + +  	mSavedFolderState = new LLSaveFolderState();  	mSavedFolderState->setApply(FALSE);  } @@ -1555,5 +1559,10 @@ void LLPanelMainInventory::setUploadCostIfNeeded()  	}  } +bool LLPanelMainInventory::hasSettingsInventory() +{ +    return LLEnvironment::instance().isInventoryEnabled(); +} +  // List Commands                                                              //  //////////////////////////////////////////////////////////////////////////////// diff --git a/indra/newview/llpanelmaininventory.h b/indra/newview/llpanelmaininventory.h index 732a3b04e3..a6bdee233d 100644 --- a/indra/newview/llpanelmaininventory.h +++ b/indra/newview/llpanelmaininventory.h @@ -161,6 +161,7 @@ protected:  	BOOL isActionChecked(const LLSD& userdata);  	void onCustomAction(const LLSD& command_name);  	bool handleDragAndDropToTrash(BOOL drop, EDragAndDropType cargo_type, EAcceptance* accept); +    static bool hasSettingsInventory();  	/**  	 * Set upload cost in "Upload" sub menu.  	 */ diff --git a/indra/newview/llsettingsvo.cpp b/indra/newview/llsettingsvo.cpp index 5ea29fb609..dba7e00b93 100644 --- a/indra/newview/llsettingsvo.cpp +++ b/indra/newview/llsettingsvo.cpp @@ -95,6 +95,13 @@ void LLSettingsVOBase::createInventoryItem(const LLSettingsBase::ptr_t &settings      LLTransactionID tid;      U32             nextOwnerPerm = LLPermissions::DEFAULT.getMaskNextOwner(); +    if (!LLEnvironment::instance().isInventoryEnabled()) +    { +        LL_WARNS("SETTINGS") << "Region does not support settings inventory objects." << LL_ENDL; +        LLNotificationsUtil::add("SettingsUnsuported"); +        return; +    } +      tid.generate();      LLPointer<LLInventoryCallback> cb = new LLSettingsInventoryCB([settings, callback](const LLUUID &inventoryId) { @@ -127,6 +134,7 @@ void LLSettingsVOBase::updateInventoryItem(const LLSettingsBase::ptr_t &settings      if (!LLEnvironment::instance().isInventoryEnabled())      {          LL_WARNS("SETTINGS") << "Region does not support settings inventory objects." << LL_ENDL; +        LLNotificationsUtil::add("SettingsUnsuported");          return;      } @@ -156,6 +164,7 @@ void LLSettingsVOBase::updateInventoryItem(const LLSettingsBase::ptr_t &settings      if (!LLEnvironment::instance().isInventoryEnabled())      {          LL_WARNS("SETTINGS") << "Region does not support settings inventory objects." << LL_ENDL; +        LLNotificationsUtil::add("SettingsUnsuported");          return;      } diff --git a/indra/newview/skins/default/xui/en/menu_inventory.xml b/indra/newview/skins/default/xui/en/menu_inventory.xml index 6dea791dd9..6f04785e8c 100644 --- a/indra/newview/skins/default/xui/en/menu_inventory.xml +++ b/indra/newview/skins/default/xui/en/menu_inventory.xml @@ -324,6 +324,8 @@              <menu_item_call.on_click               function="Inventory.DoCreate"               parameter="sky"/> +            <menu_item_call.on_enable +                    function="Inventory.EnvironmentEnabled" />          </menu_item_call>          <menu_item_call           label="New Water" @@ -332,6 +334,8 @@              <menu_item_call.on_click               function="Inventory.DoCreate"               parameter="water"/> +            <menu_item_call.on_enable +                    function="Inventory.EnvironmentEnabled" />          </menu_item_call>          <menu_item_call           label="New Day Cycle" @@ -340,6 +344,8 @@              <menu_item_call.on_click               function="Inventory.DoCreate"               parameter="daycycle"/> +            <menu_item_call.on_enable +                    function="Inventory.EnvironmentEnabled" />          </menu_item_call>      </menu>      <menu diff --git a/indra/newview/skins/default/xui/en/menu_inventory_add.xml b/indra/newview/skins/default/xui/en/menu_inventory_add.xml index 7c31bfe54d..0caae9f2ef 100644 --- a/indra/newview/skins/default/xui/en/menu_inventory_add.xml +++ b/indra/newview/skins/default/xui/en/menu_inventory_add.xml @@ -1,277 +1,285 @@  <?xml version="1.0" encoding="utf-8" standalone="yes" ?>  <menu - layout="topleft" - left="0" - mouse_opaque="false" - can_tear_off="false" - name="menu_inventory_add" - visible="false"> -            <menu -             create_jump_keys="true" -             label="Upload" -             layout="topleft" -             name="upload" -             tear_off="true"> -                <menu_item_call -                 label="Image (L$[COST])..." -                 layout="topleft" -                 name="Upload Image" -                 shortcut="control|U"> -                    <menu_item_call.on_click -                     function="File.UploadImage" -                     parameter="" /> -                    <menu_item_call.on_enable -                     function="File.EnableUpload" /> -                </menu_item_call> -                <menu_item_call -                 label="Sound (L$[COST])..." -                 layout="topleft" -                 name="Upload Sound"> -                    <menu_item_call.on_click -                     function="File.UploadSound" -                     parameter="" /> -                    <menu_item_call.on_enable -                     function="File.EnableUpload" /> -                </menu_item_call> -                <menu_item_call -                 label="Animation (L$[COST])..." -                 layout="topleft" -                 name="Upload Animation"> -                    <menu_item_call.on_click -                     function="File.UploadAnim" -                     parameter="" /> -                    <menu_item_call.on_enable -                     function="File.EnableUpload" /> -                </menu_item_call> -                <menu_item_call -                 label="Model..." -                 layout="topleft" -                 name="Upload Model"> -                <menu_item_call.on_click -                 function="File.UploadModel" -                 parameter="" /> -                <menu_item_call.on_enable -                 function="File.EnableUploadModel" /> -                <menu_item_call.on_visible -                function="File.VisibleUploadModel"/> -                </menu_item_call> -                <menu_item_call -                 label="Bulk (L$[COST] per file)..." -                 layout="topleft" -                 name="Bulk Upload"> -                    <menu_item_call.on_click -                     function="File.UploadBulk" -                     parameter="" /> -                </menu_item_call> -            </menu> +        layout="topleft" +        left="0" +        mouse_opaque="false" +        can_tear_off="false" +        name="menu_inventory_add" +        visible="false"> +    <menu +            create_jump_keys="true" +            label="Upload" +            layout="topleft" +            name="upload" +            tear_off="true"> +        <menu_item_call +                label="Image (L$[COST])..." +                layout="topleft" +                name="Upload Image" +                shortcut="control|U"> +            <menu_item_call.on_click +                    function="File.UploadImage" +                    parameter="" /> +            <menu_item_call.on_enable +                    function="File.EnableUpload" /> +        </menu_item_call> +        <menu_item_call +                label="Sound (L$[COST])..." +                layout="topleft" +                name="Upload Sound"> +            <menu_item_call.on_click +                    function="File.UploadSound" +                    parameter="" /> +            <menu_item_call.on_enable +                    function="File.EnableUpload" /> +        </menu_item_call> +        <menu_item_call +                label="Animation (L$[COST])..." +                layout="topleft" +                name="Upload Animation"> +            <menu_item_call.on_click +                    function="File.UploadAnim" +                    parameter="" /> +            <menu_item_call.on_enable +                    function="File.EnableUpload" /> +        </menu_item_call> +        <menu_item_call +                label="Model..." +                layout="topleft" +                name="Upload Model"> +            <menu_item_call.on_click +                    function="File.UploadModel" +                    parameter="" /> +            <menu_item_call.on_enable +                    function="File.EnableUploadModel" /> +            <menu_item_call.on_visible +                    function="File.VisibleUploadModel"/> +        </menu_item_call> +        <menu_item_call +                label="Bulk (L$[COST] per file)..." +                layout="topleft" +                name="Bulk Upload"> +            <menu_item_call.on_click +                    function="File.UploadBulk" +                    parameter="" /> +        </menu_item_call> +    </menu> -            <menu_item_call -             label="New Folder" -             layout="topleft" -             name="New Folder"> -                <menu_item_call.on_click -                 function="Inventory.DoCreate" -                 parameter="category" /> -            </menu_item_call> -            <menu_item_call -             label="New Script" -             layout="topleft" -             name="New Script"> -                <menu_item_call.on_click -                 function="Inventory.DoCreate" -                 parameter="lsl" /> -            </menu_item_call> -            <menu_item_call -             label="New Notecard" -             layout="topleft" -             name="New Note"> -                <menu_item_call.on_click -                 function="Inventory.DoCreate" -                 parameter="notecard" /> -            </menu_item_call> -            <menu_item_call -             label="New Gesture" -             layout="topleft" -             name="New Gesture"> -                <menu_item_call.on_click -                 function="Inventory.DoCreate" -                 parameter="gesture" /> -            </menu_item_call> -            <menu -             height="175" -             label="New Clothes" -             layout="topleft" -             left_delta="0" -             mouse_opaque="false" -             name="New Clothes" -             top_pad="514" -             width="125"> -                <menu_item_call -                 label="New Shirt" -                 layout="topleft" -                 name="New Shirt"> -                    <menu_item_call.on_click -                     function="Inventory.DoCreate" -                     parameter="shirt" /> -                </menu_item_call> -                <menu_item_call -                 label="New Pants" -                 layout="topleft" -                 name="New Pants"> -                    <menu_item_call.on_click -                     function="Inventory.DoCreate" -                     parameter="pants" /> -                </menu_item_call> -                <menu_item_call -                 label="New Shoes" -                 layout="topleft" -                 name="New Shoes"> -                    <menu_item_call.on_click -                     function="Inventory.DoCreate" -                     parameter="shoes" /> -                </menu_item_call> -                <menu_item_call -                 label="New Socks" -                 layout="topleft" -                 name="New Socks"> -                    <menu_item_call.on_click -                     function="Inventory.DoCreate" -                     parameter="socks" /> -                </menu_item_call> -                <menu_item_call -                 label="New Jacket" -                 layout="topleft" -                 name="New Jacket"> -                    <menu_item_call.on_click -                     function="Inventory.DoCreate" -                     parameter="jacket" /> -                </menu_item_call> -                <menu_item_call -                 label="New Skirt" -                 layout="topleft" -                 name="New Skirt"> -                    <menu_item_call.on_click -                     function="Inventory.DoCreate" -                     parameter="skirt" /> -                </menu_item_call> -                <menu_item_call -                 label="New Gloves" -                 layout="topleft" -                 name="New Gloves"> -                    <menu_item_call.on_click -                     function="Inventory.DoCreate" -                     parameter="gloves" /> -                </menu_item_call> -                <menu_item_call -                 label="New Undershirt" -                 layout="topleft" -                 name="New Undershirt"> -                    <menu_item_call.on_click -                     function="Inventory.DoCreate" -                     parameter="undershirt" /> -                </menu_item_call> -                <menu_item_call -                 label="New Underpants" -                 layout="topleft" -                 name="New Underpants"> -                    <menu_item_call.on_click -                     function="Inventory.DoCreate" -                     parameter="underpants" /> -                </menu_item_call> -                <menu_item_call -                 label="New Alpha" -                 layout="topleft" -                 name="New Alpha"> -                    <menu_item_call.on_click -                     function="Inventory.DoCreate" -                     parameter="alpha" /> -                </menu_item_call> -                <menu_item_call -                 label="New Tattoo" -                 layout="topleft" -                 name="New Tattoo"> -                    <menu_item_call.on_click -                     function="Inventory.DoCreate" -                     parameter="tattoo" /> -                </menu_item_call> -                <menu_item_call -                 label="New Physics" -                 layout="topleft" -                 name="New Physics"> -                    <menu_item_call.on_click -                     function="Inventory.DoCreate" -                     parameter="physics" /> -                </menu_item_call> -            </menu> -            <menu -             height="85" -             label="New Body Parts" -             layout="topleft" -             left_delta="0" -             mouse_opaque="false" -             name="New Body Parts" -             top_pad="514" -             width="118"> -                <menu_item_call -                 label="New Shape" -                 layout="topleft" -                 name="New Shape"> -                    <menu_item_call.on_click -                     function="Inventory.DoCreate" -                     parameter="shape" /> -                </menu_item_call> -                <menu_item_call -                 label="New Skin" -                 layout="topleft" -                 name="New Skin"> -                    <menu_item_call.on_click -                     function="Inventory.DoCreate" -                     parameter="skin" /> -                </menu_item_call> -                <menu_item_call -                 label="New Hair" -                 layout="topleft" -                 name="New Hair"> -                    <menu_item_call.on_click -                     function="Inventory.DoCreate" -                     parameter="hair" /> -                </menu_item_call> -                <menu_item_call -                 label="New Eyes" -                 layout="topleft" -                 name="New Eyes"> -                    <menu_item_call.on_click -                     function="Inventory.DoCreate" -                     parameter="eyes" /> -                </menu_item_call> -            </menu> -            <menu -             label="New Settings" -             layout="topleft" -             name="New Settings"> -                <menu_item_call -                 label="New Sky" -                 layout="topleft" -                 name="New Sky"> -                    <menu_item_call.on_click -                     function="Inventory.DoCreate" -                     parameter="sky"/> -                </menu_item_call> -                <menu_item_call -                 label="New Water" -                 layout="topleft" -                 name="New Water"> -                    <menu_item_call.on_click -                     function="Inventory.DoCreate" -                     parameter="water"/> -                </menu_item_call> -                <menu_item_call -                 label="New Day Cycle" -                 layout="topleft" -                 name="New Day Cycle"> -                    <menu_item_call.on_click -                     function="Inventory.DoCreate" -                     parameter="daycycle"/> -                </menu_item_call> -            </menu> +    <menu_item_call +            label="New Folder" +            layout="topleft" +            name="New Folder"> +        <menu_item_call.on_click +                function="Inventory.DoCreate" +                parameter="category" /> +    </menu_item_call> +    <menu_item_call +            label="New Script" +            layout="topleft" +            name="New Script"> +        <menu_item_call.on_click +                function="Inventory.DoCreate" +                parameter="lsl" /> +    </menu_item_call> +    <menu_item_call +            label="New Notecard" +            layout="topleft" +            name="New Note"> +        <menu_item_call.on_click +                function="Inventory.DoCreate" +                parameter="notecard" /> +    </menu_item_call> +    <menu_item_call +            label="New Gesture" +            layout="topleft" +            name="New Gesture"> +        <menu_item_call.on_click +                function="Inventory.DoCreate" +                parameter="gesture" /> +    </menu_item_call> +    <menu +            height="175" +            label="New Clothes" +            layout="topleft" +            left_delta="0" +            mouse_opaque="false" +            name="New Clothes" +            top_pad="514" +            width="125"> +        <menu_item_call +                label="New Shirt" +                layout="topleft" +                name="New Shirt"> +            <menu_item_call.on_click +                    function="Inventory.DoCreate" +                    parameter="shirt" /> +        </menu_item_call> +        <menu_item_call +                label="New Pants" +                layout="topleft" +                name="New Pants"> +            <menu_item_call.on_click +                    function="Inventory.DoCreate" +                    parameter="pants" /> +        </menu_item_call> +        <menu_item_call +                label="New Shoes" +                layout="topleft" +                name="New Shoes"> +            <menu_item_call.on_click +                    function="Inventory.DoCreate" +                    parameter="shoes" /> +        </menu_item_call> +        <menu_item_call +                label="New Socks" +                layout="topleft" +                name="New Socks"> +            <menu_item_call.on_click +                    function="Inventory.DoCreate" +                    parameter="socks" /> +        </menu_item_call> +        <menu_item_call +                label="New Jacket" +                layout="topleft" +                name="New Jacket"> +            <menu_item_call.on_click +                    function="Inventory.DoCreate" +                    parameter="jacket" /> +        </menu_item_call> +        <menu_item_call +                label="New Skirt" +                layout="topleft" +                name="New Skirt"> +            <menu_item_call.on_click +                    function="Inventory.DoCreate" +                    parameter="skirt" /> +        </menu_item_call> +        <menu_item_call +                label="New Gloves" +                layout="topleft" +                name="New Gloves"> +            <menu_item_call.on_click +                    function="Inventory.DoCreate" +                    parameter="gloves" /> +        </menu_item_call> +        <menu_item_call +                label="New Undershirt" +                layout="topleft" +                name="New Undershirt"> +            <menu_item_call.on_click +                    function="Inventory.DoCreate" +                    parameter="undershirt" /> +        </menu_item_call> +        <menu_item_call +                label="New Underpants" +                layout="topleft" +                name="New Underpants"> +            <menu_item_call.on_click +                    function="Inventory.DoCreate" +                    parameter="underpants" /> +        </menu_item_call> +        <menu_item_call +                label="New Alpha" +                layout="topleft" +                name="New Alpha"> +            <menu_item_call.on_click +                    function="Inventory.DoCreate" +                    parameter="alpha" /> +        </menu_item_call> +        <menu_item_call +                label="New Tattoo" +                layout="topleft" +                name="New Tattoo"> +            <menu_item_call.on_click +                    function="Inventory.DoCreate" +                    parameter="tattoo" /> +        </menu_item_call> +        <menu_item_call +                label="New Physics" +                layout="topleft" +                name="New Physics"> +            <menu_item_call.on_click +                    function="Inventory.DoCreate" +                    parameter="physics" /> +        </menu_item_call> +    </menu> +    <menu +            height="85" +            label="New Body Parts" +            layout="topleft" +            left_delta="0" +            mouse_opaque="false" +            name="New Body Parts" +            top_pad="514" +            width="118"> +        <menu_item_call +                label="New Shape" +                layout="topleft" +                name="New Shape"> +            <menu_item_call.on_click +                    function="Inventory.DoCreate" +                    parameter="shape" /> +        </menu_item_call> +        <menu_item_call +                label="New Skin" +                layout="topleft" +                name="New Skin"> +            <menu_item_call.on_click +                    function="Inventory.DoCreate" +                    parameter="skin" /> +        </menu_item_call> +        <menu_item_call +                label="New Hair" +                layout="topleft" +                name="New Hair"> +            <menu_item_call.on_click +                    function="Inventory.DoCreate" +                    parameter="hair" /> +        </menu_item_call> +        <menu_item_call +                label="New Eyes" +                layout="topleft" +                name="New Eyes"> +            <menu_item_call.on_click +                    function="Inventory.DoCreate" +                    parameter="eyes" /> +        </menu_item_call> +    </menu> +    <menu +            label="New Settings" +            layout="topleft" +            name="New Settings"> +        <menu_item_call +                label="New Sky" +                layout="topleft" +                name="New Sky"> +            <menu_item_call.on_click +                    function="Inventory.DoCreate" +                    parameter="sky"/> +            <menu_item_call.on_enable +                    function="Inventory.EnvironmentEnabled" /> + +        </menu_item_call> +        <menu_item_call +                label="New Water" +                layout="topleft" +                name="New Water"> +            <menu_item_call.on_click +                    function="Inventory.DoCreate" +                    parameter="water"/> +            <menu_item_call.on_enable +                    function="Inventory.EnvironmentEnabled" /> + +        </menu_item_call> +        <menu_item_call +                label="New Day Cycle" +                layout="topleft" +                name="New Day Cycle"> +            <menu_item_call.on_click +                    function="Inventory.DoCreate" +                    parameter="daycycle"/> +            <menu_item_call.on_enable +                    function="Inventory.EnvironmentEnabled" /> +        </menu_item_call> +    </menu>  </menu>
\ No newline at end of file diff --git a/indra/newview/skins/default/xui/en/notifications.xml b/indra/newview/skins/default/xui/en/notifications.xml index 6473ec9bc3..26e947b3ca 100644 --- a/indra/newview/skins/default/xui/en/notifications.xml +++ b/indra/newview/skins/default/xui/en/notifications.xml @@ -11150,5 +11150,15 @@ Unable to set the environment for this parcel.  Please enter or select a parcel that you have rights to modify.    <tag>fail</tag>    </notification> + +  <notification +   icon="notify.tga" +   name="SettingsUnsuported" +   persist="true" +   type="alertmodal"> +Settings are not supported on this region.  +Please move to a settings enabled region and retry your action. +  <tag>fail</tag> +  </notification>  </notifications>  | 
