diff options
Diffstat (limited to 'indra')
| -rw-r--r-- | indra/newview/llfloaterenvironmentadjust.cpp | 19 | ||||
| -rw-r--r-- | indra/newview/llfloaterenvironmentadjust.h | 2 | ||||
| -rw-r--r-- | indra/newview/llfloatermyenvironment.cpp | 121 | ||||
| -rw-r--r-- | indra/newview/llfloatermyenvironment.h | 66 | ||||
| -rw-r--r-- | indra/newview/skins/default/xui/en/floater_adjust_environment.xml | 14 | ||||
| -rw-r--r-- | indra/newview/skins/default/xui/en/floater_my_environments.xml | 13 | ||||
| -rw-r--r-- | indra/newview/skins/default/xui/en/notifications.xml | 15 | 
7 files changed, 101 insertions, 149 deletions
| diff --git a/indra/newview/llfloaterenvironmentadjust.cpp b/indra/newview/llfloaterenvironmentadjust.cpp index 6773e2dcaf..2c646799ff 100644 --- a/indra/newview/llfloaterenvironmentadjust.cpp +++ b/indra/newview/llfloaterenvironmentadjust.cpp @@ -28,6 +28,7 @@  #include "llfloaterenvironmentadjust.h" +#include "llnotificationsutil.h"  #include "llslider.h"  #include "llsliderctrl.h"  #include "llcolorswatch.h" @@ -53,6 +54,7 @@ namespace      const std::string FIELD_SKY_GLOW_SIZE("glow_size");      const std::string FIELD_SKY_STAR_BRIGHTNESS("star_brightness");      const std::string FIELD_SKY_MOON_ROTATION("moon_rotation"); +    const std::string BTN_RESET("btn_reset");      const F32 SLIDER_SCALE_SUN_AMBIENT(3.0f);      const F32 SLIDER_SCALE_BLUE_HORIZON_DENSITY(2.0f); @@ -93,6 +95,7 @@ BOOL LLFloaterEnvironmentAdjust::postBuild()      getChild<LLUICtrl>(FIELD_SKY_SUN_SCALE)->setCommitCallback([this](LLUICtrl *, const LLSD &) { onSunScaleChanged(); });      getChild<LLUICtrl>(FIELD_SKY_MOON_ROTATION)->setCommitCallback([this](LLUICtrl *, const LLSD &) { onMoonRotationChanged(); }); +    getChild<LLUICtrl>(BTN_RESET)->setCommitCallback([this](LLUICtrl *, const LLSD &) { onButtonReset(); });      refresh();      return TRUE; @@ -184,6 +187,22 @@ void LLFloaterEnvironmentAdjust::captureCurrentEnvironment()  } +void LLFloaterEnvironmentAdjust::onButtonReset() +{ +    LLNotificationsUtil::add("PersonalSettingsConfirmReset", LLSD(), LLSD(), +        [this](const LLSD¬if, const LLSD&resp) +    { +        S32 opt = LLNotificationsUtil::getSelectedOption(notif, resp); +        if (opt == 0) +        { +            this->closeFloater(); +            LLEnvironment::instance().clearEnvironment(LLEnvironment::ENV_LOCAL); +            LLEnvironment::instance().setSelectedEnvironment(LLEnvironment::ENV_LOCAL); +            LLEnvironment::instance().updateEnvironment(); +        } +    });  + +}  //-------------------------------------------------------------------------  void LLFloaterEnvironmentAdjust::onAmbientLightChanged()  { diff --git a/indra/newview/llfloaterenvironmentadjust.h b/indra/newview/llfloaterenvironmentadjust.h index 5bd91b0c43..4876c45065 100644 --- a/indra/newview/llfloaterenvironmentadjust.h +++ b/indra/newview/llfloaterenvironmentadjust.h @@ -77,6 +77,8 @@ private:      void                        onMoonRotationChanged(); +    void                        onButtonReset(); +      void                        onEnvironmentUpdated(LLEnvironment::EnvSelection_t env, S32 version);      LLSettingsSky::ptr_t        mLiveSky; diff --git a/indra/newview/llfloatermyenvironment.cpp b/indra/newview/llfloatermyenvironment.cpp index 3a83042d4f..8c2772a87d 100644 --- a/indra/newview/llfloatermyenvironment.cpp +++ b/indra/newview/llfloatermyenvironment.cpp @@ -1,10 +1,10 @@  /**    * @file llfloatergesture.cpp - * @brief Read-only list of gestures from your inventory. + * @brief LLFloaterMyEnvironment class implementation   *   * $LicenseInfo:firstyear=2002&license=viewerlgpl$   * Second Life Viewer Source Code - * Copyright (C) 2010, Linden Research, Inc. + * Copyright (C) 2019, Linden Research, Inc.   *    * This library is free software; you can redistribute it and/or   * modify it under the terms of the GNU Lesser General Public @@ -32,21 +32,11 @@  #include "llinventorybridge.h"  #include "llinventoryfunctions.h"  #include "llinventorymodel.h" -#include "llclipboard.h"  #include "llagent.h"  #include "llclipboard.h" -#include "llkeyboard.h" -#include "llmenugl.h" -#include "llmultigesture.h" -#include "llscrolllistctrl.h"  #include "llcheckboxctrl.h" -#include "lltrans.h" -#include "llviewergesture.h" -#include "llviewermenu.h"   #include "llviewerinventory.h" -#include "llviewercontrol.h" -#include "llfloaterperms.h"  #include "llenvironment.h"  #include "llparcel.h"  #include "llviewerparcelmgr.h" @@ -57,6 +47,7 @@ namespace      const std::string CHECK_DAYS("chk_days");      const std::string CHECK_SKIES("chk_skies");      const std::string CHECK_WATER("chk_water"); +    const std::string FLT_SEARCH("flt_search");      const std::string PANEL_SETTINGS("pnl_settings");      const std::string BUTTON_NEWSETTINGS("btn_gear");      const std::string BUTTON_GEAR("btn_newsettings"); @@ -82,72 +73,6 @@ namespace  }  //========================================================================= -#if 0 -BOOL item_name_precedes( LLInventoryItem* a, LLInventoryItem* b ) -{ -	return LLStringUtil::precedesDict( a->getName(), b->getName() ); -} - -class LLFloaterGestureObserver : public LLGestureManagerObserver -{ -public: -	LLFloaterGestureObserver(LLFloaterGesture* floater) : mFloater(floater) {} -	virtual ~LLFloaterGestureObserver() {} -	virtual void changed() { mFloater->refreshAll(); } - -private: -	LLFloaterGesture* mFloater; -}; -//----------------------------- -// GestureCallback -//----------------------------- - -class GestureShowCallback : public LLInventoryCallback -{ -public: -	void fire(const LLUUID &inv_item) -	{ -		LLPreviewGesture::show(inv_item, LLUUID::null); -		 -		LLInventoryItem* item = gInventory.getItem(inv_item); -		if (item) -		{ -			LLPermissions perm = item->getPermissions(); -			perm.setMaskNext(LLFloaterPerms::getNextOwnerPerms("Gestures")); -			perm.setMaskEveryone(LLFloaterPerms::getEveryonePerms("Gestures")); -			perm.setMaskGroup(LLFloaterPerms::getGroupPerms("Gestures")); -			item->setPermissions(perm); -			item->updateServer(FALSE); -		} -	} -}; - -class GestureCopiedCallback : public LLInventoryCallback -{ -private: -	LLFloaterGesture* mFloater; -	 -public: -	GestureCopiedCallback(LLFloaterGesture* floater): mFloater(floater) -	{} -	void fire(const LLUUID &inv_item) -	{ -		if(mFloater) -		{ -			mFloater->addGesture(inv_item,NULL,mFloater->getChild<LLScrollListCtrl>("gesture_list")); - -			// EXP-1909 (Pasted gesture displayed twice) -			// The problem is that addGesture is called here for the second time for the same item (which is copied) -			// First time addGesture is called from LLFloaterGestureObserver::changed(), which is a callback for inventory -			// change. So we need to refresh the gesture list to avoid duplicates. -			mFloater->refreshAll(); -		} -	} -}; - -#endif - -//=========================================================================  LLFloaterMyEnvironment::LLFloaterMyEnvironment(const LLSD& key) :      LLFloater(key),      mInventoryList(nullptr), @@ -167,10 +92,6 @@ LLFloaterMyEnvironment::LLFloaterMyEnvironment(const LLSD& key) :  LLFloaterMyEnvironment::~LLFloaterMyEnvironment()  { -    // 	LLGestureMgr::instance().removeObserver(mObserver); -    // 	delete mObserver; -    // 	mObserver = NULL; -    // 	gInventory.removeObserver(this);  } @@ -193,8 +114,11 @@ BOOL LLFloaterMyEnvironment::postBuild()      childSetCommitCallback(CHECK_SKIES, [this](LLUICtrl*, void*) { onFilterCheckChange(); }, nullptr);      childSetCommitCallback(CHECK_WATER, [this](LLUICtrl*, void*) { onFilterCheckChange(); }, nullptr); -    childSetCommitCallback(BUTTON_DELETE, [this](LLUICtrl *, void*) { onDeleteSelected(); }, nullptr); +    mFilterEdit = getChild<LLFilterEditor>(FLT_SEARCH); +    mFilterEdit->setCommitCallback([this](LLUICtrl*, const LLSD& param){ onFilterEdit(param.asString()); }); +    childSetCommitCallback(BUTTON_DELETE, [this](LLUICtrl *, void*) { onDeleteSelected(); }, nullptr); +    mSavedFolderState.setApply(FALSE);      return TRUE;  } @@ -252,6 +176,37 @@ void LLFloaterMyEnvironment::onSelectionChange()      refreshButtonStates();  } +void LLFloaterMyEnvironment::onFilterEdit(const std::string& search_string) +{ +    std::string upper_case_search_string = search_string; +    LLStringUtil::toUpper(upper_case_search_string); + +    if (upper_case_search_string.empty()) +    { +        if (mInventoryList->getFilterSubString().empty()) +        { +            // current filter and new filter empty, do nothing +            return; +        } + +        mSavedFolderState.setApply(TRUE); +        mInventoryList->getRootFolder()->applyFunctorRecursively(mSavedFolderState); +        // add folder with current item to list of previously opened folders +        LLOpenFoldersWithSelection opener; +        mInventoryList->getRootFolder()->applyFunctorRecursively(opener); +        mInventoryList->getRootFolder()->scrollToShowSelection(); + +    } +    else if (mInventoryList->getFilterSubString().empty()) +    { +        // first letter in search term, save existing folder open state +        mSavedFolderState.setApply(FALSE); +        mInventoryList->getRootFolder()->applyFunctorRecursively(mSavedFolderState); +    } + +    mInventoryList->setFilterSubString(search_string); +} +  void LLFloaterMyEnvironment::onDeleteSelected()  {      uuid_vec_t selected; diff --git a/indra/newview/llfloatermyenvironment.h b/indra/newview/llfloatermyenvironment.h index 9472fb63e2..67e35343da 100644 --- a/indra/newview/llfloatermyenvironment.h +++ b/indra/newview/llfloatermyenvironment.h @@ -1,10 +1,10 @@  /**    * @file llfloatermyenvironment.h - * @brief Read-only list of gestures from your inventory. + * @brief LLFloaterMyEnvironment class header file   *   * $LicenseInfo:firstyear=2002&license=viewerlgpl$   * Second Life Viewer Source Code - * Copyright (C) 2010, Linden Research, Inc. + * Copyright (C) 2019, Linden Research, Inc.   *    * This library is free software; you can redistribute it and/or   * modify it under the terms of the GNU Lesser General Public @@ -24,10 +24,6 @@   * $/LicenseInfo$   */ -/** - * (Also has legacy gesture editor for testing.) - */ -  #ifndef LL_LLFLOATERMYENVIRONMENT_H  #define LL_LLFLOATERMYENVIRONMENT_H  #include <vector>  @@ -35,14 +31,8 @@  #include "llfloater.h"  #include "llinventoryobserver.h"  #include "llinventoryfilter.h" +#include "llfiltereditor.h" -class LLView; -class LLButton; -class LLLineEditor; -class LLComboBox; -class LLViewerGesture; -class LLGestureOptions; -class LLMenuGL;  class LLInventoryPanel;  class LLFloaterMyEnvironment @@ -60,10 +50,13 @@ public:  private:      LLInventoryPanel *              mInventoryList; +    LLFilterEditor *                mFilterEdit;      U64                             mTypeFilter;      LLUUID                          mSelectedAsset; +    LLSaveFolderState               mSavedFolderState;      void                            onFilterCheckChange(); +    void                            onFilterEdit(const std::string& search_string);      void                            onSelectionChange();      void                            onDeleteSelected();      void                            onDoCreate(const LLSD &data); @@ -77,53 +70,6 @@ private:      bool                            isSettingSelected(LLUUID item_id);      static LLUUID                   findItemByAssetId(LLUUID asset_id, bool copyable_only, bool ignore_library); - -#if 0 -	virtual void done (); -	void        refreshAll(); -	/** -	 * @brief Add new scrolllistitem into gesture_list. -	 * @param  item_id inventory id of gesture -	 * @param  gesture can be NULL , if item was not loaded yet -	 */ -	void addGesture(const LLUUID& item_id, LLMultiGesture* gesture, LLCtrlListInterface * list); - -protected: -	// Reads from the gesture manager's list of active gestures -	// and puts them in this list. -	void buildGestureList(); -	void playGesture(LLUUID item_id); -private: -	void addToCurrentOutFit(); -	/** -	 * @brief  This method is using to collect selected items.  -	 * In some places gesture_list can be rebuilt by gestureObservers during  iterating data from LLScrollListCtrl::getAllSelected(). -	 * Therefore we have to copy these items to avoid viewer crash. -	 * @see LLFloaterGesture::onActivateBtnClick -	 */ -	void getSelectedIds(uuid_vec_t& ids); -	bool isActionEnabled(const LLSD& command); -	/** -	 * @brief Activation rules: -	 *  According to Gesture Spec: -	 *  1. If all selected gestures are active: set to inactive -	 *  2. If all selected gestures are inactive: set to active -	 *  3. If selected gestures are in a mixed state: set all to active -	 */ -	void onActivateBtnClick(); -	void onClickEdit(); -	void onClickPlay(); -	void onClickNew(); -	void onCommitList(); -	void onCopyPasteAction(const LLSD& command); -	void onDeleteSelected(); - -	LLUUID mSelectedID; -	LLUUID mGestureFolderID; -	LLScrollListCtrl* mGestureList; - -	LLFloaterGestureObserver* mObserver; -#endif  }; diff --git a/indra/newview/skins/default/xui/en/floater_adjust_environment.xml b/indra/newview/skins/default/xui/en/floater_adjust_environment.xml index e2cf809c9c..fc356c10c7 100644 --- a/indra/newview/skins/default/xui/en/floater_adjust_environment.xml +++ b/indra/newview/skins/default/xui/en/floater_adjust_environment.xml @@ -5,14 +5,14 @@           save_rect="false"           title="Personal Lighting"           width="845" -         height="225" +         height="230"           min_width="500"           min_height="225"           single_instance="true"           can_resize="false">      <layout_stack name="outer_stack"                    width="845" -                  height="212" +                  height="220"                    follows="all"                    animate="false"                    top="0" @@ -84,6 +84,16 @@                                    name="blue_density"                                    top_pad="5"                                    width="60"/> +                    <button +                      follows="left|top" +                      height="23" +                      label="Reset" +                      tool_tip="Close and reset to Shared Environment" +                      layout="topleft" +                      name="btn_reset" +                      left_delta="-2" +                      top_pad="10" +                      width="100"/>                      <text follows="right|top"                            height="10"                            layout="topleft" diff --git a/indra/newview/skins/default/xui/en/floater_my_environments.xml b/indra/newview/skins/default/xui/en/floater_my_environments.xml index 854ac8b758..7e65e5d69c 100644 --- a/indra/newview/skins/default/xui/en/floater_my_environments.xml +++ b/indra/newview/skins/default/xui/en/floater_my_environments.xml @@ -28,9 +28,8 @@                  border="true"                  bevel_style="in"                  auto_resize="false" -                user_resize="true"                  tab_group="1" -                height="24" +                height="54"                  name="filter_panel"                  label="Filters"                  font="SansSerifBold"> @@ -82,6 +81,15 @@                      name="chk_water"                      top_delta="0"                      width="60" /> +          <filter_editor +                  follows="left|top|right" +                  height="23" +                  label="Filter Environments" +                  layout="topleft" +                  left="4" +                  name="flt_search" +                  top_pad="6" +                  right="-4" />          </layout_panel>          <layout_panel                  auto_resize="true" @@ -116,7 +124,6 @@          </layout_panel>          <layout_panel                  auto_resize="false" -                user_resize="true"                  tab_group="1"                  height="31"                  name="pnl_control" diff --git a/indra/newview/skins/default/xui/en/notifications.xml b/indra/newview/skins/default/xui/en/notifications.xml index 931e44b319..fc3556ddc0 100644 --- a/indra/newview/skins/default/xui/en/notifications.xml +++ b/indra/newview/skins/default/xui/en/notifications.xml @@ -11405,7 +11405,20 @@ Are you sure you want to continue?       notext="No"       yestext="Yes"/>    </notification> -   + +  <notification + icon="alertmodal.tga" + name="PersonalSettingsConfirmReset" + type="alertmodal"> +You are about to remove all applied Personal lighting settings. +Are you sure you want to continue? +    <tag>confirm</tag> +    <usetemplate +     name="okcancelbuttons" +     notext="No" +     yestext="Yes"/> +  </notification> +    <notification     icon="alertmodal.tga"     name="SettingsMakeNoTrans" | 
