diff options
Diffstat (limited to 'indra/newview')
30 files changed, 653 insertions, 267 deletions
| diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml index f71662a7c8..7156af57ec 100644 --- a/indra/newview/app_settings/settings.xml +++ b/indra/newview/app_settings/settings.xml @@ -8140,17 +8140,6 @@        <key>Value</key>        <integer>0</integer>      </map>     -    <key>ShowCameraButton</key>                 -    <map> -      <key>Comment</key> -      <string>Show/Hide Camera button in the bottom tray</string> -      <key>Persist</key> -      <integer>1</integer> -      <key>Type</key> -      <string>Boolean</string> -      <key>Value</key> -      <integer>1</integer>    -    </map>  	<key>ShowScriptErrors</key>      <map>        <key>Comment</key> @@ -8173,39 +8162,6 @@        <key>Value</key>        <integer>0</integer>      </map> -    <key>ShowSnapshotButton</key>                 -    <map> -      <key>Comment</key> -      <string>Show/Hide Snapshot button button in the bottom tray</string> -      <key>Persist</key> -      <integer>1</integer> -      <key>Type</key> -      <string>Boolean</string> -      <key>Value</key> -      <integer>1</integer>    -    </map> -    <key>ShowMoveButton</key>                 -    <map> -      <key>Comment</key> -      <string>Show/Hide Move button in the bottom tray</string> -      <key>Persist</key> -      <integer>1</integer> -      <key>Type</key> -      <string>Boolean</string> -      <key>Value</key> -      <integer>1</integer>    -    </map>     -    <key>ShowGestureButton</key>                 -    <map> -      <key>Comment</key> -      <string>Show/Hide Gesture button in the bottom tray</string> -      <key>Persist</key> -      <integer>1</integer> -      <key>Type</key> -      <string>Boolean</string> -      <key>Value</key> -      <integer>1</integer>    -    </map>      <key>ShowObjectRenderingCost</key>                      <map>        <key>Comment</key> @@ -8726,6 +8682,17 @@        <key>Value</key>        <integer>0</integer>      </map> +    <key>SidebarWithButtonsVisibility</key> +    <map> +      <key>Comment</key> +      <string>Sets visibility of sidebar with its tabs' buttons</string> +      <key>Persist</key> +      <integer>1</integer> +      <key>Type</key> +      <string>Boolean</string> +      <key>Value</key> +      <integer>1</integer> +    </map>      <key>SkinCurrent</key>      <map>        <key>Comment</key> diff --git a/indra/newview/llbottomtray.cpp b/indra/newview/llbottomtray.cpp index 7f528c88b2..0595bedd31 100644 --- a/indra/newview/llbottomtray.cpp +++ b/indra/newview/llbottomtray.cpp @@ -61,7 +61,7 @@ namespace  	const std::string& PANEL_CAMERA_NAME	= "cam_panel";  	const std::string& PANEL_GESTURE_NAME	= "gesture_panel"; -	S32 get_panel_min_width(LLLayoutStack* stack, LLPanel* panel) +	S32 get_panel_min_width(LLLayoutStack* stack, LLView* panel)  	{  		S32 minimal_width = 0;  		llassert(stack); @@ -183,6 +183,13 @@ LLBottomTray::~LLBottomTray()  	{  		LLIMMgr::getInstance()->removeSessionObserver(this);  	} + +	if (mNearbyChatBar) +	{ +		// store custom width of chatbar panel. +		S32 custom_width = mNearbyChatBar->getRect().getWidth(); +		gSavedSettings.setS32("ChatBarCustomWidth", custom_width); +	}  }  // *TODO Vadim: why void* ? @@ -361,6 +368,20 @@ S32 LLBottomTray::notifyParent(const LLSD& info)  		showWellButton("im_well" == chiclet_name ? RS_IM_WELL : RS_NOTIFICATION_WELL, should_be_visible);  		return 1;  	} + +	if (info.has("action") && info["action"] == "resize") +	{ +		const std::string& name = info["view_name"]; + +		// expected only resize of nearby chatbar +		if (mNearbyChatBar->getName() != name) return LLPanel::notifyParent(info); + +		const S32 new_width = info["new_width"]; + +		processChatbarCustomization(new_width); + +		return 2; +	}  	return LLPanel::notifyParent(info);  } @@ -648,6 +669,24 @@ void LLBottomTray::reshape(S32 width, S32 height, BOOL called_from_parent)  	if (mNearbyChatBar)			log(mNearbyChatBar, "after");  	if (mChicletPanel)			log(mChicletPanel, "after"); + + +	// Restore width of the chatbar on first reshape. +	// we can not to do this from postBuild because reshape is called from parent view on startup +	// creation after it and reset width according to resize logic. +	static bool needs_restore_custom_state = true; +	if (mNearbyChatBar && needs_restore_custom_state) +	{ +		// restore custom width of chatbar panel. +		S32 new_width = gSavedSettings.getS32("ChatBarCustomWidth"); +		if (new_width > 0) +		{ +			processChatbarCustomization(new_width); +			mNearbyChatBar->reshape(new_width, mNearbyChatBar->getRect().getHeight()); +		} +		needs_restore_custom_state = false; +	} +  }  S32 LLBottomTray::processWidthDecreased(S32 delta_width) @@ -1130,6 +1169,7 @@ void LLBottomTray::initResizeStateContainers()  	mStateProcessedObjectMap.insert(std::make_pair(RS_BUTTON_MOVEMENT, mMovementPanel));  	mStateProcessedObjectMap.insert(std::make_pair(RS_BUTTON_CAMERA, mCamPanel));  	mStateProcessedObjectMap.insert(std::make_pair(RS_BUTTON_SNAPSHOT, mSnapshotPanel)); +	mStateProcessedObjectMap.insert(std::make_pair(RS_BUTTON_SIDEBAR, getChild<LLPanel>("sidebar_btn_panel")));  	mStateProcessedObjectMap.insert(std::make_pair(RS_BUTTON_BUILD, getChild<LLPanel>("build_btn_panel")));  	mStateProcessedObjectMap.insert(std::make_pair(RS_BUTTON_SEARCH, getChild<LLPanel>("search_btn_panel")));  	mStateProcessedObjectMap.insert(std::make_pair(RS_BUTTON_WORLD_MAP, getChild<LLPanel>("world_map_btn_panel"))); @@ -1140,6 +1180,7 @@ void LLBottomTray::initResizeStateContainers()  	mButtonsProcessOrder.push_back(RS_BUTTON_MOVEMENT);  	mButtonsProcessOrder.push_back(RS_BUTTON_CAMERA);  	mButtonsProcessOrder.push_back(RS_BUTTON_SNAPSHOT); +	mButtonsProcessOrder.push_back(RS_BUTTON_SIDEBAR);  	mButtonsProcessOrder.push_back(RS_BUTTON_BUILD);  	mButtonsProcessOrder.push_back(RS_BUTTON_SEARCH);  	mButtonsProcessOrder.push_back(RS_BUTTON_WORLD_MAP); @@ -1155,6 +1196,7 @@ void LLBottomTray::initResizeStateContainers()  	{  		const EResizeState button_type = *it;  		// is there an appropriate object? +		llassert(mStateProcessedObjectMap.count(button_type) > 0);  		if (0 == mStateProcessedObjectMap.count(button_type)) continue;  		// set default width for it. @@ -1166,24 +1208,40 @@ void LLBottomTray::initResizeStateContainers()  } +// this method must be called before restoring of the chat entry field on startup +// because it resets chatbar's width according to resize logic.  void LLBottomTray::initButtonsVisibility()  { -	// *TODO: move control settings of other buttons here -	setTrayButtonVisibleIfPossible(RS_BUTTON_BUILD, gSavedSettings.getBOOL("ShowBuildButton")); -	setTrayButtonVisibleIfPossible(RS_BUTTON_SEARCH, gSavedSettings.getBOOL("ShowSearchButton")); -	setTrayButtonVisibleIfPossible(RS_BUTTON_WORLD_MAP, gSavedSettings.getBOOL("ShowWorldMapButton")); -	setTrayButtonVisibleIfPossible(RS_BUTTON_MINI_MAP, gSavedSettings.getBOOL("ShowMiniMapButton")); +	setVisibleAndFitWidths(RS_BUTTON_GESTURES, gSavedSettings.getBOOL("ShowGestureButton")); +	setVisibleAndFitWidths(RS_BUTTON_MOVEMENT, gSavedSettings.getBOOL("ShowMoveButton")); +	setVisibleAndFitWidths(RS_BUTTON_CAMERA, gSavedSettings.getBOOL("ShowCameraButton")); +	setVisibleAndFitWidths(RS_BUTTON_SNAPSHOT, gSavedSettings.getBOOL("ShowSnapshotButton")); +	setVisibleAndFitWidths(RS_BUTTON_SIDEBAR, gSavedSettings.getBOOL("ShowSidebarButton")); +	setVisibleAndFitWidths(RS_BUTTON_BUILD, gSavedSettings.getBOOL("ShowBuildButton")); +	setVisibleAndFitWidths(RS_BUTTON_SEARCH, gSavedSettings.getBOOL("ShowSearchButton")); +	setVisibleAndFitWidths(RS_BUTTON_WORLD_MAP, gSavedSettings.getBOOL("ShowWorldMapButton")); +	setVisibleAndFitWidths(RS_BUTTON_MINI_MAP, gSavedSettings.getBOOL("ShowMiniMapButton"));  }  void LLBottomTray::setButtonsControlsAndListeners()  { -	// *TODO: move control settings of other buttons here +	gSavedSettings.declareBOOL("ShowGestureButton", TRUE, "Shows/Hides Gesture button in the bottom tray. (Declared in code)"); +	gSavedSettings.declareBOOL("ShowMoveButton", TRUE, "Shows/Hides Move button in the bottom tray. (Declared in code)"); +	gSavedSettings.declareBOOL("ShowSnapshotButton", TRUE, "Shows/Hides Snapshot button button in the bottom tray. (Declared in code)"); +	gSavedSettings.declareBOOL("ShowCameraButton", TRUE, "Show/Hide View button in the bottom tray. (Declared in code)"); +	gSavedSettings.declareBOOL("ShowSidebarButton", TRUE, "Shows/hides Sidebar button in the bottom tray. (Declared in code)");  	gSavedSettings.declareBOOL("ShowBuildButton", TRUE, "Shows/Hides Build button in the bottom tray. (Declared in code)");  	gSavedSettings.declareBOOL("ShowSearchButton", TRUE, "Shows/Hides Search button in the bottom tray. (Declared in code)");  	gSavedSettings.declareBOOL("ShowWorldMapButton", TRUE, "Shows/Hides Map button in the bottom tray. (Declared in code)");  	gSavedSettings.declareBOOL("ShowMiniMapButton", TRUE, "Shows/Hides Mini-Map button in the bottom tray. (Declared in code)"); +	gSavedSettings.declareS32("ChatBarCustomWidth", 0, "Stores customized width of chat bar. (Declared in code)"); +	gSavedSettings.getControl("ShowGestureButton")->getSignal()->connect(boost::bind(&LLBottomTray::toggleShowButton, RS_BUTTON_GESTURES, _2)); +	gSavedSettings.getControl("ShowMoveButton")->getSignal()->connect(boost::bind(&LLBottomTray::toggleShowButton, RS_BUTTON_MOVEMENT, _2)); +	gSavedSettings.getControl("ShowCameraButton")->getSignal()->connect(boost::bind(&LLBottomTray::toggleShowButton, RS_BUTTON_CAMERA, _2)); +	gSavedSettings.getControl("ShowSnapshotButton")->getSignal()->connect(boost::bind(&LLBottomTray::toggleShowButton, RS_BUTTON_SNAPSHOT, _2)); +	gSavedSettings.getControl("ShowSidebarButton")->getSignal()->connect(boost::bind(&LLBottomTray::toggleShowButton, RS_BUTTON_SIDEBAR, _2));  	gSavedSettings.getControl("ShowBuildButton")->getSignal()->connect(boost::bind(&LLBottomTray::toggleShowButton, RS_BUTTON_BUILD, _2));  	gSavedSettings.getControl("ShowSearchButton")->getSignal()->connect(boost::bind(&LLBottomTray::toggleShowButton, RS_BUTTON_SEARCH, _2));  	gSavedSettings.getControl("ShowWorldMapButton")->getSignal()->connect(boost::bind(&LLBottomTray::toggleShowButton, RS_BUTTON_WORLD_MAP, _2)); @@ -1262,17 +1320,18 @@ bool LLBottomTray::setVisibleAndFitWidths(EResizeState object_type, bool visible  			const S32 chatbar_shrunk_width =  				mNearbyChatBar->getRect().getWidth() - get_panel_min_width(mToolbarStack, mNearbyChatBar); -			const S32 sum_of_min_widths = -				get_panel_min_width(mToolbarStack, mStateProcessedObjectMap[RS_BUTTON_CAMERA])   + -				get_panel_min_width(mToolbarStack, mStateProcessedObjectMap[RS_BUTTON_MOVEMENT]) + -				get_panel_min_width(mToolbarStack, mStateProcessedObjectMap[RS_BUTTON_GESTURES]) + -				get_panel_min_width(mToolbarStack, mSpeakPanel); +			S32 sum_of_min_widths = get_panel_min_width(mToolbarStack, mSpeakPanel); +			S32 sum_of_curr_widths = get_curr_width(mSpeakPanel); + +			resize_state_vec_t::const_iterator it = mButtonsProcessOrder.begin(); +			const resize_state_vec_t::const_iterator it_end = mButtonsProcessOrder.end(); -			const S32 sum_of_curr_widths = -				get_curr_width(mStateProcessedObjectMap[RS_BUTTON_CAMERA])   + -				get_curr_width(mStateProcessedObjectMap[RS_BUTTON_MOVEMENT]) + -				get_curr_width(mStateProcessedObjectMap[RS_BUTTON_GESTURES]) + -				get_curr_width(mSpeakPanel); +			for (; it != it_end; ++it) +			{ +				LLPanel * cur_panel = mStateProcessedObjectMap[*it]; +				sum_of_min_widths += get_panel_min_width(mToolbarStack, cur_panel); +				sum_of_curr_widths += get_curr_width(cur_panel); +			}  			const S32 possible_shrunk_width =  				chatbar_shrunk_width + (sum_of_curr_widths - sum_of_min_widths); @@ -1352,4 +1411,34 @@ void LLBottomTray::showWellButton(EResizeState object_type, bool visible)  	}  } +void LLBottomTray::processChatbarCustomization(S32 new_width) +{ +	if (NULL == mNearbyChatBar) return; + +	const S32 delta_width = mNearbyChatBar->getRect().getWidth() - new_width; + +	if (delta_width == 0) return; + +	LLView * chiclet_layout_panel = mChicletPanel->getParent(); +	const S32 chiclet_min_width = get_panel_min_width(mToolbarStack, chiclet_layout_panel); +	const S32 chiclet_panel_width = chiclet_layout_panel->getRect().getWidth(); +	const S32 available_chiclet_shrink_width = chiclet_panel_width - chiclet_min_width; +	llassert(available_chiclet_shrink_width >= 0); + +	if (delta_width > 0) // panel gets narrowly +	{ +		S32 total_possible_width = delta_width + available_chiclet_shrink_width; +		processShowButtons(total_possible_width); +		processExtendButtons(total_possible_width); +	} +	// here (delta_width < 0) // panel gets wider +	else //if (-delta_width > available_chiclet_shrink_width) +	{ +		S32 required_width = delta_width + available_chiclet_shrink_width; +		S32 buttons_freed_width = 0; +		processShrinkButtons(required_width, buttons_freed_width); +		processHideButtons(required_width, buttons_freed_width); +	} +} +  //EOF diff --git a/indra/newview/llbottomtray.h b/indra/newview/llbottomtray.h index 5588aefb42..889dc42097 100644 --- a/indra/newview/llbottomtray.h +++ b/indra/newview/llbottomtray.h @@ -124,6 +124,7 @@ private:  		, RS_BUTTON_SEARCH		= 0x0400  		, RS_BUTTON_WORLD_MAP	= 0x0800  		, RS_BUTTON_MINI_MAP	= 0x1000 +		, RS_BUTTON_SIDEBAR		= 0x2000  		/*  		Once new button that can be hidden on resize is added don't forget to update related places: @@ -138,6 +139,7 @@ private:  		 */  		, RS_BUTTONS_CAN_BE_HIDDEN = RS_BUTTON_SNAPSHOT | RS_BUTTON_CAMERA | RS_BUTTON_MOVEMENT | RS_BUTTON_GESTURES  									| RS_BUTTON_BUILD | RS_BUTTON_SEARCH | RS_BUTTON_WORLD_MAP | RS_BUTTON_MINI_MAP +									| RS_BUTTON_SIDEBAR  	}EResizeState;  	/** @@ -341,6 +343,17 @@ private:  	 */  	void showWellButton(EResizeState object_type, bool visible); +	/** +	 * Handles a customization of chatbar width. +	 * +	 * When chatbar gets wider layout stack will reduce chiclet panel (it is auto-resizable) +	 *	But once chiclet panel reaches its minimal width Stack will force to reduce buttons width. +	 *	including Speak button. The similar behavior is when chatbar gets narrowly. +	 * This methods force resize behavior to resize buttons properly in these cases. +	 */ +	void processChatbarCustomization(S32 new_width); + +  	MASK mResizeState;  	typedef std::map<EResizeState, LLPanel*> state_object_map_t; diff --git a/indra/newview/llcofwearables.cpp b/indra/newview/llcofwearables.cpp index 8d4430a9ea..7c4ceb3458 100644 --- a/indra/newview/llcofwearables.cpp +++ b/indra/newview/llcofwearables.cpp @@ -49,18 +49,6 @@ const LLSD REARRANGE = LLSD().with("rearrange", LLSD());  static const LLWearableItemNameComparator WEARABLE_NAME_COMPARATOR; -bool LLWearableItemNameComparator::doCompare(const LLPanelWearableListItem* wearable_item1, const LLPanelWearableListItem* wearable_item2) const -{ -	std::string name1 = wearable_item1->getItemName(); -	std::string name2 = wearable_item2->getItemName(); - -	LLStringUtil::toUpper(name1); -	LLStringUtil::toUpper(name2); - -	return name1 < name2; -} - -  LLCOFWearables::LLCOFWearables() : LLPanel(),  	mAttachments(NULL),  	mClothing(NULL), diff --git a/indra/newview/llcofwearables.h b/indra/newview/llcofwearables.h index 612bb103d2..583ee96247 100644 --- a/indra/newview/llcofwearables.h +++ b/indra/newview/llcofwearables.h @@ -33,59 +33,16 @@  #ifndef LL_LLCOFWEARABLES_H  #define LL_LLCOFWEARABLES_H +// llui +#include "llflatlistview.h"  #include "llpanel.h" -#include "llinventorymodel.h" -#include "llappearancemgr.h" -#include "llwearableitemslist.h" - -class LLFlatListView; - - -/** Abstract comparator of wearable list items */ -class LLWearableListItemComparator : public LLFlatListView::ItemComparator -{ -	LOG_CLASS(LLWearableListItemComparator); - -public: -	LLWearableListItemComparator() {}; -	virtual ~LLWearableListItemComparator() {}; - -	virtual bool compare(const LLPanel* item1, const LLPanel* item2) const -	{ -		const LLPanelWearableListItem* wearable_item1 = dynamic_cast<const LLPanelWearableListItem*>(item1); -		const LLPanelWearableListItem* wearable_item2 = dynamic_cast<const LLPanelWearableListItem*>(item2); - -		if (!wearable_item1 || !wearable_item2) -		{ -			llwarning("item1 and item2 cannot be null", 0); -			return true; -		} - -		return doCompare(wearable_item1, wearable_item2); -	} -protected: - -	/**  -	 * Returns true if wearable_item1 < wearable_item2, false otherwise  -	 * Implement this method in your particular comparator. -	 */ -	virtual bool doCompare(const LLPanelWearableListItem* wearable_item1, const LLPanelWearableListItem* wearable_item2) const = 0; -}; - - -class LLWearableItemNameComparator : public LLWearableListItemComparator -{ -	LOG_CLASS(LLWearableItemNameComparator); - -public: -	LLWearableItemNameComparator() {}; -	virtual ~LLWearableItemNameComparator() {}; - -protected: -	virtual bool doCompare(const LLPanelWearableListItem* wearable_item1, const LLPanelWearableListItem* wearable_item2) const; -}; +#include "llappearancemgr.h" +#include "llinventorymodel.h" +class LLPanelClothingListItem; +class LLPanelBodyPartsListItem; +class LLPanelDeletableWearableListItem;  /**   * Adaptor between LLAccordionCtrlTab and LLFlatListView to facilitate communication between them  diff --git a/indra/newview/llface.cpp b/indra/newview/llface.cpp index a1336815f7..e0e5b32299 100644 --- a/indra/newview/llface.cpp +++ b/indra/newview/llface.cpp @@ -1376,9 +1376,18 @@ F32 LLFace::getTextureVirtualSize()  		texel_area = 1.f;  	} -	//apply texel area to face area to get accurate ratio -	//face_area /= llclamp(texel_area, 1.f/64.f, 16.f); -	F32 face_area = mPixelArea / llclamp(texel_area, 0.015625f, 128.f); +	F32 face_area; +	if (mVObjp->isSculpted() && texel_area > 1.f) +	{ +		//sculpts can break assumptions about texel area +		face_area = mPixelArea; +	} +	else +	{ +		//apply texel area to face area to get accurate ratio +		//face_area /= llclamp(texel_area, 1.f/64.f, 16.f); +		face_area =  mPixelArea / llclamp(texel_area, 0.015625f, 128.f); +	}  	if(face_area > LLViewerTexture::sMaxSmallImageSize)  	{ diff --git a/indra/newview/llfloaterland.cpp b/indra/newview/llfloaterland.cpp index 256796aa80..abdb55ec17 100644 --- a/indra/newview/llfloaterland.cpp +++ b/indra/newview/llfloaterland.cpp @@ -646,9 +646,12 @@ void LLPanelLandGeneral::refresh()  			}  			// Display claim date -			// *TODO:Localize (Time format may need Translating)  			time_t claim_date = parcel->getClaimDate(); -			mTextClaimDate->setText(formatted_time(claim_date)); +			std::string claim_date_str = getString("time_stamp_template"); +			LLSD substitution; +			substitution["datetime"] = (S32) claim_date; +			LLStringUtil::format (claim_date_str, substitution); +			mTextClaimDate->setText(claim_date_str);  			mTextClaimDate->setEnabled(is_leased);  			BOOL enable_auction = (gAgent.getGodLevel() >= GOD_LIAISON) diff --git a/indra/newview/llinventoryitemslist.h b/indra/newview/llinventoryitemslist.h index a3863b511c..807952948b 100644 --- a/indra/newview/llinventoryitemslist.h +++ b/indra/newview/llinventoryitemslist.h @@ -124,6 +124,15 @@ public:  	/** Get the name of a corresponding inventory item */  	const std::string& getItemName() const { return mItem->getName(); } +	/** Get the asset type of a corresponding inventory item */ +	LLAssetType::EType getType() const { return mItem->getType(); } + +	/** Get the wearable type of a corresponding inventory item */ +	LLWearableType::EType getWearableType() const { return mItem->getWearableType(); } + +	/** Get the description of a corresponding inventory item */ +	const std::string& getDescription() const { return mItem->getDescription(); } +  	virtual ~LLPanelInventoryListItemBase(){}  protected: diff --git a/indra/newview/llnearbychatbar.cpp b/indra/newview/llnearbychatbar.cpp index bd504906d5..b00fcb2608 100644 --- a/indra/newview/llnearbychatbar.cpp +++ b/indra/newview/llnearbychatbar.cpp @@ -69,6 +69,25 @@ static LLChatTypeTrigger sChatTypeTriggers[] = {  	{ "/shout"	, CHAT_TYPE_SHOUT}  }; +//ext-7367 +//Problem: gesture list control (actually LLScrollListCtrl) didn't actually process mouse wheel message.  +// introduce new gesture list subclass to "eat" mouse wheel messages (and probably some other messages) +class LLGestureScrollListCtrl: public LLScrollListCtrl +{ +protected: +	friend class LLUICtrlFactory; +	LLGestureScrollListCtrl(const LLScrollListCtrl::Params& params) +		:LLScrollListCtrl(params) +	{ +	} +public: +	BOOL handleScrollWheel(S32 x, S32 y, S32 clicks) +	{ +		LLScrollListCtrl::handleScrollWheel( x, y, clicks ); +		return TRUE; +	} +}; +  LLGestureComboList::Params::Params()  :	combo_button("combo_button"),  	combo_list("combo_list") @@ -90,13 +109,14 @@ LLGestureComboList::LLGestureComboList(const LLGestureComboList::Params& p)  	addChild(mButton); -	LLScrollListCtrl::Params params = p.combo_list; +	LLGestureScrollListCtrl::Params params(p.combo_list); +	  	params.name("GestureComboList");  	params.commit_callback.function(boost::bind(&LLGestureComboList::onItemSelected, this, _2));  	params.visible(false);  	params.commit_on_keyboard_movement(false); -	mList = LLUICtrlFactory::create<LLScrollListCtrl>(params); +	mList = LLUICtrlFactory::create<LLGestureScrollListCtrl>(params);  	addChild(mList);  	//****************************Gesture Part********************************/ diff --git a/indra/newview/llpaneloutfitedit.cpp b/indra/newview/llpaneloutfitedit.cpp index 44832ac496..4178fd9c90 100644 --- a/indra/newview/llpaneloutfitedit.cpp +++ b/indra/newview/llpaneloutfitedit.cpp @@ -210,7 +210,8 @@ LLPanelOutfitEdit::LLPanelOutfitEdit()  	mCOFWearables(NULL),  	mInventoryItemsPanel(NULL),  	mCOFObserver(NULL), -	mCOFDragAndDropObserver(NULL) +	mCOFDragAndDropObserver(NULL), +	mInitialized(false)  {  	mSavedFolderState = new LLSaveFolderState();  	mSavedFolderState->setApply(FALSE); @@ -307,6 +308,16 @@ BOOL LLPanelOutfitEdit::postBuild()  	return TRUE;  } +// virtual +void LLPanelOutfitEdit::onOpen(const LLSD& key) +{ +	if (!mInitialized) +	{ +		displayCurrentOutfit(); +		mInitialized = true; +	} +} +  void LLPanelOutfitEdit::moveWearable(bool closer_to_body)  {  	LLUUID item_id = mCOFWearables->getSelectedUUID(); @@ -446,13 +457,25 @@ void LLPanelOutfitEdit::onSearchEdit(const std::string& string)  void LLPanelOutfitEdit::onAddToOutfitClicked(void)  { -	LLFolderViewItem* curr_item = mInventoryItemsPanel->getRootFolder()->getCurSelectedItem(); -	if (!curr_item) return; +	LLUUID selected_id; +	if (mInventoryItemsPanel->getVisible()) +	{ +		LLFolderViewItem* curr_item = mInventoryItemsPanel->getRootFolder()->getCurSelectedItem(); +		if (!curr_item) return; + +		LLFolderViewEventListener* listenerp  = curr_item->getListener(); +		if (!listenerp) return; + +		selected_id = listenerp->getUUID(); +	} +	else if (mWearableItemsPanel->getVisible()) +	{ +		selected_id = mWearableItemsList->getSelectedUUID(); +	} -	LLFolderViewEventListener* listenerp  = curr_item->getListener(); -	if (!listenerp) return; +	if (selected_id.isNull()) return; -	LLAppearanceMgr::getInstance()->wearItemOnAvatar(listenerp->getUUID()); +	LLAppearanceMgr::getInstance()->wearItemOnAvatar(selected_id);  } diff --git a/indra/newview/llpaneloutfitedit.h b/indra/newview/llpaneloutfitedit.h index 953a70785c..a08dc653ef 100644 --- a/indra/newview/llpaneloutfitedit.h +++ b/indra/newview/llpaneloutfitedit.h @@ -61,6 +61,7 @@ class LLFilteredWearableListManager;  class LLPanelOutfitEdit : public LLPanel  { +	LOG_CLASS(LLPanelOutfitEdit);  public:  	// NOTE: initialize mLookItemTypes at the index of any new enum you add in the LLPanelOutfitEdit() constructor @@ -83,6 +84,7 @@ public:  	/*virtual*/ ~LLPanelOutfitEdit();  	/*virtual*/ BOOL postBuild(); +	/*virtual*/ void onOpen(const LLSD& key);  	void moveWearable(bool closer_to_body); @@ -146,6 +148,7 @@ private:  	std::vector<LLLookItemType> mLookItemTypes;  	LLCOFWearables*		mCOFWearables; +	bool				mInitialized;  };  #endif // LL_LLPANELOUTFITEDIT_H diff --git a/indra/newview/llpaneloutfitsinventory.cpp b/indra/newview/llpaneloutfitsinventory.cpp index ea75c16c56..0760c57f8e 100644 --- a/indra/newview/llpaneloutfitsinventory.cpp +++ b/indra/newview/llpaneloutfitsinventory.cpp @@ -73,7 +73,8 @@ static LLRegisterPanelClassWrapper<LLPanelOutfitsInventory> t_inventory("panel_o  LLPanelOutfitsInventory::LLPanelOutfitsInventory() :  	mMyOutfitsPanel(NULL),  	mCurrentOutfitPanel(NULL), -	mParent(NULL) +	mParent(NULL), +	mInitialized(false)  {  	mSavedFolderState = new LLSaveFolderState();  	mSavedFolderState->setApply(FALSE); @@ -106,6 +107,18 @@ BOOL LLPanelOutfitsInventory::postBuild()  // virtual  void LLPanelOutfitsInventory::onOpen(const LLSD& key)  { +	if (!mInitialized) +	{ +		LLSidepanelAppearance* panel_appearance = getAppearanceSP(); +		if (panel_appearance) +		{ +			// *TODO: move these methods to LLPanelOutfitsInventory? +			panel_appearance->fetchInventory(); +			panel_appearance->refreshCurrentOutfitName(); +		} +		mInitialized = true; +	} +  	// Make sure we know which tab is selected, update the filter,  	// and update verbs.  	onTabChange(); @@ -249,8 +262,7 @@ bool LLPanelOutfitsInventory::onSaveCommit(const LLSD& notification, const LLSD&  		{  			LLUUID outfit_folder = LLAppearanceMgr::getInstance()->makeNewOutfitLinks(outfit_name); -			LLSidepanelAppearance* panel_appearance = -				dynamic_cast<LLSidepanelAppearance *>(LLSideTray::getInstance()->getPanel("sidepanel_appearance")); +			LLSidepanelAppearance* panel_appearance = getAppearanceSP();  			if (panel_appearance)  			{  				panel_appearance->showOutfitsInventoryPanel(); @@ -661,3 +673,11 @@ void LLPanelOutfitsInventory::onWearablesLoaded()  {  	setWearablesLoading(false);  } + +LLSidepanelAppearance* LLPanelOutfitsInventory::getAppearanceSP() +{ +	static LLSidepanelAppearance* panel_appearance = +		dynamic_cast<LLSidepanelAppearance*> +		(LLSideTray::getInstance()->getPanel("sidepanel_appearance")); +	return panel_appearance; +} diff --git a/indra/newview/llpaneloutfitsinventory.h b/indra/newview/llpaneloutfitsinventory.h index 6b4d1dbd84..a0fe91cd80 100644 --- a/indra/newview/llpaneloutfitsinventory.h +++ b/indra/newview/llpaneloutfitsinventory.h @@ -49,6 +49,7 @@ class LLTabContainer;  class LLPanelOutfitsInventory : public LLPanel  { +	LOG_CLASS(LLPanelOutfitsInventory);  public:  	LLPanelOutfitsInventory();  	virtual ~LLPanelOutfitsInventory(); @@ -72,6 +73,7 @@ public:  	void setParent(LLSidepanelAppearance *parent);  	LLFolderView* getRootFolder(); +	LLSidepanelAppearance* getAppearanceSP();  	static LLPanelOutfitsInventory* findInstance(); @@ -132,6 +134,8 @@ private:  	// List Commands                                                              //  	////////////////////////////////////////////////////////////////////////////////  	/// + +	bool mInitialized;  };  #endif //LL_LLPANELOUTFITSINVENTORY_H diff --git a/indra/newview/llsidepanelappearance.cpp b/indra/newview/llsidepanelappearance.cpp index 658a7b52e3..3f05e05fd4 100644 --- a/indra/newview/llsidepanelappearance.cpp +++ b/indra/newview/llsidepanelappearance.cpp @@ -97,7 +97,8 @@ LLSidepanelAppearance::LLSidepanelAppearance() :  	mFilterSubString(LLStringUtil::null),  	mFilterEditor(NULL),  	mOutfitEdit(NULL), -	mCurrOutfitPanel(NULL) +	mCurrOutfitPanel(NULL), +	mOpened(false)  {  } @@ -116,7 +117,7 @@ BOOL LLSidepanelAppearance::postBuild()  	mEditAppearanceBtn = getChild<LLButton>("editappearance_btn");  	mEditAppearanceBtn->setClickedCallback(boost::bind(&LLSidepanelAppearance::onEditAppearanceButtonClicked, this)); -	childSetAction("edit_outfit_btn", boost::bind(&LLSidepanelAppearance::onEditOutfitButtonClicked, this)); +	childSetAction("edit_outfit_btn", boost::bind(&LLSidepanelAppearance::showOutfitEditPanel, this));  	mNewOutfitBtn = getChild<LLButton>("newlook_btn");  	mNewOutfitBtn->setClickedCallback(boost::bind(&LLSidepanelAppearance::onNewOutfitButtonClicked, this)); @@ -148,7 +149,7 @@ BOOL LLSidepanelAppearance::postBuild()  		LLButton* edit_wearable_back_btn = mEditWearable->getChild<LLButton>("back_btn");  		if (edit_wearable_back_btn)  		{ -			edit_wearable_back_btn->setClickedCallback(boost::bind(&LLSidepanelAppearance::onEditWearBackClicked, this)); +			edit_wearable_back_btn->setClickedCallback(boost::bind(&LLSidepanelAppearance::showOutfitEditPanel, this));  		}  	} @@ -167,27 +168,36 @@ BOOL LLSidepanelAppearance::postBuild()  // virtual  void LLSidepanelAppearance::onOpen(const LLSD& key)  { -	fetchInventory(); -	refreshCurrentOutfitName(); - -	if (mPanelOutfitsInventory) -	{ -		mPanelOutfitsInventory->onOpen(key); -	} -  	if (!key.has("type")) -		return; - -	// Switch to the requested panel. -	std::string type = key["type"].asString(); -	if (type == "my_outfits")  	{ -		showOutfitsInventoryPanel(); +		// No specific panel requested. +		// If we're opened for the first time then show My Outfits. +		// Else do nothing. +		if (!mOpened) +		{ +			showOutfitsInventoryPanel(); +		}  	} -	else if (type == "edit_outfit") +	else  	{ -		showOutfitEditPanel(/*update = */ true); +		// Switch to the requested panel. +		// *TODO: replace this crap with LLSideTrayPanelContainer +		std::string type = key["type"].asString(); +		if (type == "my_outfits") +		{ +			showOutfitsInventoryPanel(); +		} +		else if (type == "edit_outfit") +		{ +			showOutfitEditPanel(); +		} +		else if (type == "edit_shape") +		{ +			showWearableEditPanel(); +		}  	} + +	mOpened = true;  }  void LLSidepanelAppearance::onFilterEdit(const std::string& search_string) @@ -239,13 +249,6 @@ void LLSidepanelAppearance::onEditAppearanceButtonClicked()  	}  } -void LLSidepanelAppearance::onEditOutfitButtonClicked() -{ -	LLSD key; -	key["type"] = "edit_outfit"; -	LLSideTray::getInstance()->showPanel("sidepanel_appearance", key); -} -  void LLSidepanelAppearance::onNewOutfitButtonClicked()  {  	if (!mOutfitEdit->getVisible()) @@ -254,52 +257,68 @@ void LLSidepanelAppearance::onNewOutfitButtonClicked()  	}  } -void LLSidepanelAppearance::onEditWearBackClicked() +void LLSidepanelAppearance::showOutfitsInventoryPanel()  { -	showOutfitEditPanel(/* update = */ false); +	toggleWearableEditPanel(FALSE); +	toggleOutfitEditPanel(FALSE); +	togglMyOutfitsPanel(TRUE);  } -void LLSidepanelAppearance::showOutfitsInventoryPanel() +void LLSidepanelAppearance::showOutfitEditPanel()  { +	togglMyOutfitsPanel(FALSE);  	toggleWearableEditPanel(FALSE); +	toggleOutfitEditPanel(TRUE); +} + +void LLSidepanelAppearance::showWearableEditPanel(LLWearable *wearable /* = NULL*/) +{ +	togglMyOutfitsPanel(FALSE);  	toggleOutfitEditPanel(FALSE); +	toggleWearableEditPanel(TRUE, wearable);  } -void LLSidepanelAppearance::showOutfitEditPanel(bool update) +void LLSidepanelAppearance::togglMyOutfitsPanel(BOOL visible)  { -	if (!mOutfitEdit) +	if (!mPanelOutfitsInventory || mPanelOutfitsInventory->getVisible() == visible) +	{ +		// visibility isn't changing, hence nothing to do  		return; +	} -	toggleWearableEditPanel(FALSE); -	toggleOutfitEditPanel(TRUE); +	mPanelOutfitsInventory->setVisible(visible); + +	// *TODO: Move these controls to panel_outfits_inventory.xml +	// so that we don't need to toggle them explicitly. +	mFilterEditor->setVisible(visible); +	mNewOutfitBtn->setVisible(visible); +	mCurrOutfitPanel->setVisible(visible); -	if (update) +	if (visible)  	{ -		mOutfitEdit->displayCurrentOutfit(); +		mPanelOutfitsInventory->onOpen(LLSD());  	}  }  void LLSidepanelAppearance::toggleOutfitEditPanel(BOOL visible)  { -	if (!mOutfitEdit) -		return; - -	if (mOutfitEdit->getVisible() == visible) +	if (!mOutfitEdit || mOutfitEdit->getVisible() == visible)  	{  		// visibility isn't changing, hence nothing to do  		return;  	}  	mOutfitEdit->setVisible(visible); -	if (mPanelOutfitsInventory) mPanelOutfitsInventory->setVisible(!visible); -	mFilterEditor->setVisible(!visible); -	mNewOutfitBtn->setVisible(!visible); -	mCurrOutfitPanel->setVisible(!visible); + +	if (visible) +	{ +		mOutfitEdit->onOpen(LLSD()); +	}  }  void LLSidepanelAppearance::toggleWearableEditPanel(BOOL visible, LLWearable *wearable)  { -	if (mEditWearable->getVisible() == visible) +	if (!mEditWearable || mEditWearable->getVisible() == visible)  	{  		// visibility isn't changing, hence nothing to do  		return; @@ -309,24 +328,24 @@ void LLSidepanelAppearance::toggleWearableEditPanel(BOOL visible, LLWearable *we  	{  		wearable = gAgentWearables.getWearable(LLWearableType::WT_SHAPE, 0);  	} -	if (!mEditWearable || !wearable) +	if (!wearable)  	{  		return;  	} -	// Save changes if closing. -	if (!visible) -	{ -		mEditWearable->saveChanges(); -	} -  	// Toggle panel visibility. -	mCurrOutfitPanel->setVisible(!visible); -  	mEditWearable->setVisible(visible);  	mEditWearable->setWearable(wearable); -	mFilterEditor->setVisible(!visible); -	mPanelOutfitsInventory->setVisible(!visible); + +	if (visible) +	{ +		mEditWearable->onOpen(LLSD()); // currently no-op, just for consistency +	} +	else +	{ +		// Save changes if closing. +		mEditWearable->saveChanges(); +	}  }  void LLSidepanelAppearance::refreshCurrentOutfitName(const std::string& name) @@ -356,11 +375,13 @@ void LLSidepanelAppearance::refreshCurrentOutfitName(const std::string& name)  }  //static -void LLSidepanelAppearance::editWearable(LLWearable *wearable, void *data) +void LLSidepanelAppearance::editWearable(LLWearable *wearable, LLView *data)  { -	LLSidepanelAppearance *panel = (LLSidepanelAppearance*) data; -	panel->toggleOutfitEditPanel(FALSE); -	panel->toggleWearableEditPanel(TRUE, wearable); +	LLSidepanelAppearance *panel = dynamic_cast<LLSidepanelAppearance*>(data); +	if (panel) +	{ +		panel->showWearableEditPanel(wearable); +	}  }  // Fetch currently worn items and only enable the New Look button after everything's been diff --git a/indra/newview/llsidepanelappearance.h b/indra/newview/llsidepanelappearance.h index a919b07ed6..f243bbd471 100644 --- a/indra/newview/llsidepanelappearance.h +++ b/indra/newview/llsidepanelappearance.h @@ -47,6 +47,7 @@ class LLPanelOutfitsInventory;  class LLSidepanelAppearance : public LLPanel  { +	LOG_CLASS(LLSidepanelAppearance);  public:  	LLSidepanelAppearance();  	virtual ~LLSidepanelAppearance(); @@ -56,14 +57,15 @@ public:  	void refreshCurrentOutfitName(const std::string& name = ""); -	static void editWearable(LLWearable *wearable, void *data); +	static void editWearable(LLWearable *wearable, LLView *data);  	void fetchInventory();  	void inventoryFetched();  	void onNewOutfitButtonClicked();  	void showOutfitsInventoryPanel(); -	void showOutfitEditPanel(bool update); +	void showOutfitEditPanel(); +	void showWearableEditPanel(LLWearable *wearable = NULL);  	void setWearablesLoading(bool val);  private: @@ -71,10 +73,8 @@ private:  	void onOpenOutfitButtonClicked();  	void onEditAppearanceButtonClicked(); -	void onEditOutfitButtonClicked(); -	void onEditWearBackClicked(); -	//@deprecated use showXXX() methods instead +	void togglMyOutfitsPanel(BOOL visible);  	void toggleOutfitEditPanel(BOOL visible);  	void toggleWearableEditPanel(BOOL visible, LLWearable* wearable = NULL); @@ -100,6 +100,9 @@ private:  	// Search string for filtering landmarks and teleport  	// history locations  	std::string					mFilterSubString; + +	// Gets set to true when we're opened for the first time. +	bool mOpened;  };  #endif //LL_LLSIDEPANELAPPEARANCE_H diff --git a/indra/newview/llsidetray.cpp b/indra/newview/llsidetray.cpp index 3ec1855484..9159f42968 100644 --- a/indra/newview/llsidetray.cpp +++ b/indra/newview/llsidetray.cpp @@ -66,6 +66,21 @@ static const std::string TAB_PANEL_CAPTION_TITLE_BOX = "sidetray_tab_title";  LLSideTray* LLSideTray::sInstance = 0; +/** + * Updates visibility of sidetray tabs buttons according to "SidebarWithButtonsVisibility" setting + * + * @param force_set_visible if true method ignores setting value and set buttons visible. + */ +static void update_tabs_buttons_visibility(bool force_set_visible = false) +{ +	LLView* side_bar_tabs = gViewerWindow->getRootView()->getChildView("side_bar_tabs"); +	if (side_bar_tabs) +	{ +		BOOL visible = LLUI::sSettingGroups["config"]->getBOOL("SidebarWithButtonsVisibility"); +		side_bar_tabs->setVisible(force_set_visible || visible); +	} +} +  LLSideTray* LLSideTray::getInstance()  {  	if (!sInstance) @@ -258,6 +273,8 @@ LLSideTray::LLSideTray(Params& params)  	p.name = "buttons_panel";  	p.mouse_opaque = false;  	mButtonsPanel = LLUICtrlFactory::create<LLPanel>(p); + +	initControlSettings();  } @@ -547,6 +564,7 @@ void LLSideTray::collapseSideBar()  	reflectCollapseChange();  	setFocus( FALSE ); +	update_tabs_buttons_visibility();  }  void LLSideTray::expandSideBar() @@ -572,6 +590,7 @@ void LLSideTray::expandSideBar()  		btn->setImageOverlay( mActiveTab->mImageSelected  );  	} +	update_tabs_buttons_visibility(true);  }  void LLSideTray::highlightFocused() @@ -638,6 +657,9 @@ LLPanel*	LLSideTray::showPanel		(const std::string& panel_name, const LLSD& para  			{  				panel->onOpen(params);  			} + +			update_tabs_buttons_visibility(true); +  			return panel;  		}  	} @@ -720,11 +742,6 @@ bool		LLSideTray::isPanelActive(const std::string& panel_name)  	return (panel->getName() == panel_name);  } - -// *TODO: Eliminate magic constants. -static const S32	fake_offset = 132; -static const S32	fake_top_offset = 18; -  void	LLSideTray::updateSidetrayVisibility()  {  	// set visibility of parent container based on collapsed state @@ -734,3 +751,35 @@ void	LLSideTray::updateSidetrayVisibility()  	}  } +void LLSideTray::initControlSettings() +{ +	// set listeners to process runtime setting changes +	LLUI::sSettingGroups["config"]->getControl("SidebarWithButtonsVisibility")->getSignal()->connect(boost::bind(&LLSideTray::toggleSidetrayAndTabButtonsVisibility, this, _2)); + +	// update visibility according to current value +	toggleSidetrayAndTabButtonsVisibility(LLUI::sSettingGroups["config"]->getBOOL("SidebarWithButtonsVisibility")); +} + +// sidebar visibility is implemented via its expanding/collapsing +void LLSideTray::toggleSidetrayAndTabButtonsVisibility(const LLSD::Boolean& new_visibility) +{ +	// If new_visibility==FALSE it gets invisible but still can be expanded in other ways (Ctrl+I to see My Inventory) + +	// store collapsed state to restore it properly on next call +	static bool was_collapsed = false; + +	if (!new_visibility && !mCollapsed) +	{ +		collapseSideBar(); +		was_collapsed = true; +	} +	// should be visible: expand only if it was expanded when has been collapsed on previous call +	else if (new_visibility && was_collapsed) +	{ +		if (mCollapsed) expandSideBar(); +		was_collapsed = false; +	} + +	update_tabs_buttons_visibility(new_visibility); +} + diff --git a/indra/newview/llsidetray.h b/indra/newview/llsidetray.h index e8fdee9430..ed6b376d5c 100644 --- a/indra/newview/llsidetray.h +++ b/indra/newview/llsidetray.h @@ -179,6 +179,16 @@ private:  			LLSideTray::getInstance()->setEnabled(FALSE);  	} +	/** +	 * Initializes listener of SidebarWithButtonsVisibility setting and updates state according to it. +	 */ +	void initControlSettings(); + +	/** +	 * Updates Sidebar and its Tab Buttons visibility according to passed value. +	 */ +	void toggleSidetrayAndTabButtonsVisibility(const LLSD::Boolean& new_visibility); +  private:  	LLPanel*						mButtonsPanel; diff --git a/indra/newview/llviewercontrol.cpp b/indra/newview/llviewercontrol.cpp index 514f72c334..f02e15706d 100644 --- a/indra/newview/llviewercontrol.cpp +++ b/indra/newview/llviewercontrol.cpp @@ -70,7 +70,6 @@  #include "llvosurfacepatch.h"  #include "llvowlsky.h"  #include "llrender.h" -#include "llbottomtray.h"  #include "llnavigationbar.h"  #include "llfloatertools.h"  #include "llpaneloutfitsinventory.h" @@ -460,30 +459,6 @@ bool toggle_agent_pause(const LLSD& newvalue)  	return true;  } -bool toggle_show_gesture_button(const LLSD& newvalue) -{ -	LLBottomTray::getInstance()->showGestureButton(newvalue.asBoolean()); -	return true; -} - -bool toggle_show_move_button(const LLSD& newvalue) -{ -	LLBottomTray::getInstance()->showMoveButton(newvalue.asBoolean()); -	return true; -} - -bool toggle_show_camera_button(const LLSD& newvalue) -{ -	LLBottomTray::getInstance()->showCameraButton(newvalue.asBoolean()); -	return true; -} - -bool toggle_show_snapshot_button(const LLSD& newvalue) -{ -	LLBottomTray::getInstance()->showSnapshotButton(newvalue.asBoolean()); -	return true; -} -  bool toggle_show_navigation_panel(const LLSD& newvalue)  {  	LLNavigationBar::getInstance()->showNavigationPanel(newvalue.asBoolean()); @@ -638,10 +613,6 @@ void settings_setup_listeners()  	gSavedSettings.getControl("QAMode")->getSignal()->connect(boost::bind(&show_debug_menus));  	gSavedSettings.getControl("UseDebugMenus")->getSignal()->connect(boost::bind(&show_debug_menus));  	gSavedSettings.getControl("AgentPause")->getSignal()->connect(boost::bind(&toggle_agent_pause, _2)); -	gSavedSettings.getControl("ShowGestureButton")->getSignal()->connect(boost::bind(&toggle_show_gesture_button, _2)); -	gSavedSettings.getControl("ShowMoveButton")->getSignal()->connect(boost::bind(&toggle_show_move_button, _2)); -	gSavedSettings.getControl("ShowCameraButton")->getSignal()->connect(boost::bind(&toggle_show_camera_button, _2)); -	gSavedSettings.getControl("ShowSnapshotButton")->getSignal()->connect(boost::bind(&toggle_show_snapshot_button, _2));  	gSavedSettings.getControl("ShowNavbarNavigationPanel")->getSignal()->connect(boost::bind(&toggle_show_navigation_panel, _2));  	gSavedSettings.getControl("ShowNavbarFavoritesPanel")->getSignal()->connect(boost::bind(&toggle_show_favorites_panel, _2));  	gSavedSettings.getControl("ShowObjectRenderingCost")->getSignal()->connect(boost::bind(&toggle_show_object_render_cost, _2)); diff --git a/indra/newview/llviewerinventory.cpp b/indra/newview/llviewerinventory.cpp index a2331bd69a..f0532d5a31 100644 --- a/indra/newview/llviewerinventory.cpp +++ b/indra/newview/llviewerinventory.cpp @@ -101,6 +101,7 @@ public:  		mInventoryItemsDict["Female Gestures"]	= LLTrans::getString("Female Gestures");  		mInventoryItemsDict["Other Gestures"]	= LLTrans::getString("Other Gestures");  		mInventoryItemsDict["Speech Gestures"]	= LLTrans::getString("Speech Gestures"); +		mInventoryItemsDict["Common Gestures"]	= LLTrans::getString("Common Gestures");  		//predefined gestures diff --git a/indra/newview/llviewermenu.cpp b/indra/newview/llviewermenu.cpp index 729424353f..f905892982 100644 --- a/indra/newview/llviewermenu.cpp +++ b/indra/newview/llviewermenu.cpp @@ -3633,6 +3633,14 @@ class LLEditEnableCustomizeAvatar : public view_listener_t  	}  }; +class LLEnableEditShape : public view_listener_t +{ +	bool handleEvent(const LLSD& userdata) +	{ +		return gAgentWearables.isWearableModifiable(LLWearableType::WT_SHAPE, 0); +	} +}; +  bool enable_sit_object()  {  	LLViewerObject* object = LLSelectMgr::getInstance()->getSelection()->getPrimaryObject(); @@ -5604,6 +5612,11 @@ void handle_customize_avatar()  	LLSideTray::getInstance()->showPanel("sidepanel_appearance", LLSD().with("type", "my_outfits"));  } +void handle_edit_shape() +{ +	LLSideTray::getInstance()->showPanel("sidepanel_appearance", LLSD().with("type", "edit_shape")); +} +  void handle_report_abuse()  {  	// Prevent menu from appearing in screen shot. @@ -7712,7 +7725,9 @@ void initialize_menus()  	view_listener_t::addMenu(new LLEditEnableDuplicate(), "Edit.EnableDuplicate");  	view_listener_t::addMenu(new LLEditEnableTakeOff(), "Edit.EnableTakeOff");  	view_listener_t::addMenu(new LLEditEnableCustomizeAvatar(), "Edit.EnableCustomizeAvatar"); +	view_listener_t::addMenu(new LLEnableEditShape(), "Edit.EnableEditShape");  	commit.add("CustomizeAvatar", boost::bind(&handle_customize_avatar)); +	commit.add("EditShape", boost::bind(&handle_edit_shape));  	// View menu  	view_listener_t::addMenu(new LLViewMouselook(), "View.Mouselook"); diff --git a/indra/newview/llviewerwindow.cpp b/indra/newview/llviewerwindow.cpp index 11e8f0de77..e0463e3c4a 100644 --- a/indra/newview/llviewerwindow.cpp +++ b/indra/newview/llviewerwindow.cpp @@ -1669,26 +1669,6 @@ void LLViewerWindow::initWorldUI()  		navbar->showFavoritesPanel(FALSE);  	} -	if (!gSavedSettings.getBOOL("ShowCameraButton")) -	{ -		LLBottomTray::getInstance()->showCameraButton(FALSE); -	} - -	if (!gSavedSettings.getBOOL("ShowSnapshotButton")) -	{ -		LLBottomTray::getInstance()->showSnapshotButton(FALSE); -	} - -	if (!gSavedSettings.getBOOL("ShowMoveButton")) -	{ -		LLBottomTray::getInstance()->showMoveButton(FALSE); -	} - -	if (!gSavedSettings.getBOOL("ShowGestureButton")) -	{ -		LLBottomTray::getInstance()->showGestureButton(FALSE); -	} -  	if ( gHUDView == NULL )  	{  		LLRect hud_rect = full_window; diff --git a/indra/newview/llwearableitemslist.cpp b/indra/newview/llwearableitemslist.cpp index bac66d966a..b209dfecce 100644 --- a/indra/newview/llwearableitemslist.cpp +++ b/indra/newview/llwearableitemslist.cpp @@ -296,6 +296,84 @@ std::string LLPanelDummyClothingListItem::wearableTypeToString(LLWearableType::E  //////////////////////////////////////////////////////////////////////////  ////////////////////////////////////////////////////////////////////////// +/*virtual*/ +bool LLWearableItemNameComparator::doCompare(const LLPanelInventoryListItemBase* wearable_item1, const LLPanelInventoryListItemBase* wearable_item2) const +{ +	std::string name1 = wearable_item1->getItemName(); +	std::string name2 = wearable_item2->getItemName(); + +	LLStringUtil::toUpper(name1); +	LLStringUtil::toUpper(name2); + +	return name1 < name2; +} + +/*virtual*/ +bool LLWearableItemTypeNameComparator::doCompare(const LLPanelInventoryListItemBase* wearable_item1, const LLPanelInventoryListItemBase* wearable_item2) const +{ +	const LLAssetType::EType item_type1 = wearable_item1->getType(); +	const LLAssetType::EType item_type2 = wearable_item2->getType(); + +	LLWearableItemTypeNameComparator::ETypeListOrder item_type_order1 = getTypeListOrder(item_type1); +	LLWearableItemTypeNameComparator::ETypeListOrder item_type_order2 = getTypeListOrder(item_type2); + +	if (item_type_order1 != item_type_order2) +	{ +		// If items are of different asset types we can compare them +		// by types order in the list. +		return item_type_order1 < item_type_order2; +	} + +	if (item_type_order1 & TLO_NOT_CLOTHING) +	{ +		// If both items are of the same asset type except AT_CLOTHING +		// we can compare them by name. +		return LLWearableItemNameComparator::doCompare(wearable_item1, wearable_item2); +	} + +	const LLWearableType::EType item_wearable_type1 = wearable_item1->getWearableType(); +	const LLWearableType::EType item_wearable_type2 = wearable_item2->getWearableType(); + +	if (item_wearable_type1 != item_wearable_type2) +	{ +		// If items are of different clothing types they are compared +		// by clothing types order determined in LLWearableType::EType. +		return item_wearable_type1 < item_wearable_type2; +	} +	else +	{ +		// If both items are of the same clothing type they are compared +		// by description and place in reverse order i.e. outer layer item +		// on top. +		return wearable_item1->getDescription() > wearable_item2->getDescription(); +	} +} + +// static +LLWearableItemTypeNameComparator::ETypeListOrder LLWearableItemTypeNameComparator::getTypeListOrder(LLAssetType::EType item_type) +{ +	switch (item_type) +	{ +	case LLAssetType::AT_OBJECT: +		return TLO_ATTACHMENT; + +	case LLAssetType::AT_CLOTHING: +		return TLO_CLOTHING; + +	case LLAssetType::AT_BODYPART: +		return TLO_BODYPART; + +	default: +		return TLO_UNKNOWN; +	} +} + +////////////////////////////////////////////////////////////////////////// +////////////////////////////////////////////////////////////////////////// +////////////////////////////////////////////////////////////////////////// + +static const LLWearableItemTypeNameComparator WEARABLE_TYPE_NAME_COMPARATOR; +  static const LLDefaultChildRegistry::Register<LLWearableItemsList> r("wearable_items_list");  LLWearableItemsList::Params::Params() @@ -303,7 +381,9 @@ LLWearableItemsList::Params::Params()  LLWearableItemsList::LLWearableItemsList(const LLWearableItemsList::Params& p)  :	LLInventoryItemsList(p) -{} +{ +	setComparator(&WEARABLE_TYPE_NAME_COMPARATOR); +}  // virtual  LLWearableItemsList::~LLWearableItemsList() diff --git a/indra/newview/llwearableitemslist.h b/indra/newview/llwearableitemslist.h index 5e3202c687..2cab5a07a2 100644 --- a/indra/newview/llwearableitemslist.h +++ b/indra/newview/llwearableitemslist.h @@ -172,6 +172,98 @@ private:  };  /** + * @class LLWearableListItemComparator + * + * Abstract comparator of wearable list items. + */ +class LLWearableListItemComparator : public LLFlatListView::ItemComparator +{ +	LOG_CLASS(LLWearableListItemComparator); + +public: +	LLWearableListItemComparator() {}; +	virtual ~LLWearableListItemComparator() {}; + +	virtual bool compare(const LLPanel* item1, const LLPanel* item2) const +	{ +		const LLPanelInventoryListItemBase* wearable_item1 = dynamic_cast<const LLPanelInventoryListItemBase*>(item1); +		const LLPanelInventoryListItemBase* wearable_item2 = dynamic_cast<const LLPanelInventoryListItemBase*>(item2); + +		if (!wearable_item1 || !wearable_item2) +		{ +			llwarning("item1 and item2 cannot be null", 0); +			return true; +		} + +		return doCompare(wearable_item1, wearable_item2); +	} + +protected: + +	/** +	 * Returns true if wearable_item1 < wearable_item2, false otherwise +	 * Implement this method in your particular comparator. +	 */ +	virtual bool doCompare(const LLPanelInventoryListItemBase* wearable_item1, const LLPanelInventoryListItemBase* wearable_item2) const = 0; +}; + +/** + * @class LLWearableItemNameComparator + * + * Comparator for sorting wearable list items by name. + */ +class LLWearableItemNameComparator : public LLWearableListItemComparator +{ +	LOG_CLASS(LLWearableItemNameComparator); + +public: +	LLWearableItemNameComparator() {}; +	virtual ~LLWearableItemNameComparator() {}; + +protected: +	/*virtual*/ bool doCompare(const LLPanelInventoryListItemBase* wearable_item1, const LLPanelInventoryListItemBase* wearable_item2) const; +}; + +/** + * @class LLWearableItemTypeNameComparator + * + * Comparator for sorting wearable list items by type and name. + */ +class LLWearableItemTypeNameComparator : public LLWearableItemNameComparator +{ +	LOG_CLASS(LLWearableItemTypeNameComparator); + +public: +	LLWearableItemTypeNameComparator() {}; +	virtual ~LLWearableItemTypeNameComparator() {}; + +protected: +	/** +	 * Returns "true" if wearable_item1 is placed before wearable_item2 sorted by the following: +	 *   - Attachments (abc order) +	 *   - Clothing +	 *         - by type (types order determined in LLWearableType::EType) +	 *         - outer layer on top +	 *   - Body Parts (abc order), +	 * "false" otherwise. +	 */ +	/*virtual*/ bool doCompare(const LLPanelInventoryListItemBase* wearable_item1, const LLPanelInventoryListItemBase* wearable_item2) const; + +private: +	enum ETypeListOrder +	{ +		TLO_ATTACHMENT	= 0x01, +		TLO_CLOTHING	= 0x02, +		TLO_BODYPART	= 0x04, +		TLO_UNKNOWN		= 0x08, + +		TLO_NOT_CLOTHING = TLO_ATTACHMENT | TLO_BODYPART | TLO_UNKNOWN +	}; + +	static LLWearableItemTypeNameComparator::ETypeListOrder getTypeListOrder(LLAssetType::EType item_type); +}; + +/**   * @class LLWearableItemsList   *   * A flat list of wearable inventory items. diff --git a/indra/newview/skins/default/xui/en/floater_about_land.xml b/indra/newview/skins/default/xui/en/floater_about_land.xml index 40c6b14a4a..20e7c28db0 100644 --- a/indra/newview/skins/default/xui/en/floater_about_land.xml +++ b/indra/newview/skins/default/xui/en/floater_about_land.xml @@ -108,6 +108,9 @@               name="no_selection_text">                  No parcel selected.              </panel.string> +            <panel.string name="time_stamp_template"> +				[wkday,datetime,local] [mth,datetime,local] [day,datetime,local] [hour,datetime,local]:[min,datetime,local]:[second,datetime,local] [year,datetime,local] +			</panel.string>              <text               type="string"               length="1" diff --git a/indra/newview/skins/default/xui/en/menu_avatar_self.xml b/indra/newview/skins/default/xui/en/menu_avatar_self.xml index 0efe598243..b0cfb261cb 100644 --- a/indra/newview/skins/default/xui/en/menu_avatar_self.xml +++ b/indra/newview/skins/default/xui/en/menu_avatar_self.xml @@ -191,6 +191,15 @@          <menu_item_call.on_enable           function="Edit.EnableCustomizeAvatar" />      </menu_item_call> +    <menu_item_call +    label="Edit My Shape" +    layout="topleft" +    name="Edit My Shape"> +       <menu_item_call.on_click +        function="EditShape" /> +       <menu_item_call.on_enable +        function="Edit.EnableEditShape" /> +   </menu_item_call>     <menu_item_call       label="My Friends"       layout="topleft" diff --git a/indra/newview/skins/default/xui/en/menu_bottomtray.xml b/indra/newview/skins/default/xui/en/menu_bottomtray.xml index 5beafef4e4..ccd5388621 100644 --- a/indra/newview/skins/default/xui/en/menu_bottomtray.xml +++ b/indra/newview/skins/default/xui/en/menu_bottomtray.xml @@ -53,6 +53,17 @@               parameter="ShowSnapshotButton" />      </menu_item_check>              <menu_item_check +     label="Sidebar button" +     layout="topleft" +     name="ShowSidebarButton"> +        <menu_item_check.on_click +         function="ToggleControl" +         parameter="ShowSidebarButton" /> +        <menu_item_check.on_check +         function="CheckControl" +         parameter="ShowSidebarButton" /> +    </menu_item_check> +    <menu_item_check       label="Build button"       layout="topleft"       name="ShowBuildButton"> diff --git a/indra/newview/skins/default/xui/en/panel_bottomtray.xml b/indra/newview/skins/default/xui/en/panel_bottomtray.xml index 2cb91fe1f0..2ba7bef502 100644 --- a/indra/newview/skins/default/xui/en/panel_bottomtray.xml +++ b/indra/newview/skins/default/xui/en/panel_bottomtray.xml @@ -48,29 +48,32 @@           left="0"           max_width="320"           min_height="23" -         min_width="216" +         min_width="214"           mouse_opaque="false"           name="chat_bar"           top="4" -         user_resize="false" -         width="310" /> +         user_resize="true" +         width="308" /> +        <!-- +        There is resize bar between chatbar and Speak button. It has 2px width (is is set as 2*UIResizeBarOverlap) +        -->          <layout_panel           auto_resize="false"           follows="right"           height="28"           layout="topleft"           min_height="28" -         min_width="57" +         min_width="59"           mouse_opaque="false"           name="speak_panel"           top_delta="0"           user_resize="false" -         width="108"> +         width="110">              <talk_button               follows="left|right"               height="23"               layout="topleft" -             left="0" +             left="2"               name="talk"               top="5"               width="105"> @@ -190,7 +193,7 @@           min_width="40"           mouse_opaque="false"           name="snapshot_panel" -         width="40"> +         width="39">              <button               follows="left|right"               height="23" @@ -218,6 +221,38 @@           min_height="28"           min_width="52"           mouse_opaque="false" +         name="sidebar_btn_panel" +         user_resize="false" +         width="83"> +<!--*TODO: Implement toggle of sidebar with buttons +Disabled for now. +--> +            <button +             control_name="SidebarWithButtonsVisibility" +             follows="left|right" +             height="23" +             image_pressed="PushButton_Press" +             image_pressed_selected="PushButton_Selected_Press" +             image_selected="PushButton_Selected_Press" +             is_toggle="true" +             label="Sidebar" +             layout="topleft" +             left="0" +             name="sidebar_btn" +             tool_tip="Shows/hides Sidebar" +             top="5" +             use_ellipses="true" +             width="80"> +            </button> +        </layout_panel> +        <layout_panel +         auto_resize="false" +         follows="left|right" +         height="28" +         layout="topleft" +         min_height="28" +         min_width="52" +         mouse_opaque="false"           name="build_btn_panel"           user_resize="false"           width="83"> diff --git a/indra/newview/skins/default/xui/en/panel_nearby_chat_bar.xml b/indra/newview/skins/default/xui/en/panel_nearby_chat_bar.xml index 5dbd8bfe6a..55df70eb71 100644 --- a/indra/newview/skins/default/xui/en/panel_nearby_chat_bar.xml +++ b/indra/newview/skins/default/xui/en/panel_nearby_chat_bar.xml @@ -7,7 +7,7 @@   left="0"   name="chat_bar"   top="21" - width="310"> + width="308">      <line_editor       border_style="line"       border_thickness="1" diff --git a/indra/newview/skins/default/xui/en/sidepanel_appearance.xml b/indra/newview/skins/default/xui/en/sidepanel_appearance.xml index 6a3c148456..32fa6c3b5a 100644 --- a/indra/newview/skins/default/xui/en/sidepanel_appearance.xml +++ b/indra/newview/skins/default/xui/en/sidepanel_appearance.xml @@ -120,6 +120,7 @@ width="333">     height="493"     min_height="410"     width="320" +   visible="false"     left="0"     tab_group="1"     top_pad="6" diff --git a/indra/newview/skins/default/xui/en/strings.xml b/indra/newview/skins/default/xui/en/strings.xml index bf28e78cf6..f8bb36b88a 100644 --- a/indra/newview/skins/default/xui/en/strings.xml +++ b/indra/newview/skins/default/xui/en/strings.xml @@ -3142,7 +3142,7 @@ Abuse Report</string>    <string name="Female Gestures">Female Gestures</string>    <string name="Other Gestures">Other Gestures</string>    <string name="Speech Gestures">Speech Gestures</string> - +  <string name="Common Gestures">Common Gestures</string>    <!-- gestures -->    <string name="Male - Excuse me">Male - Excuse me</string>    <string name="Male - Get lost">Male - Get lost</string> | 
