Commits

eli linden committed 1ff69e7 Merge

Merge

Comments (0)

Files changed (9)

indra/newview/llcofwearables.cpp

 	}
 
 protected:
+	static void replaceWearable()
+	{
+		static LLButton* show_add_wearables_btn =
+				LLSideTray::getInstance()->getChild<LLButton>("show_add_wearables_btn");
+
+		show_add_wearables_btn->onCommit();
+	}
+
 	/*virtual*/ LLContextMenu* createMenu()
 	{
 		LLUICtrl::CommitCallbackRegistry::ScopedRegistrar registrar;
 		functor_t take_off = boost::bind(&LLAppearanceMgr::removeItemFromAvatar, LLAppearanceMgr::getInstance(), _1);
 
 		registrar.add("Clothing.TakeOff", boost::bind(handleMultiple, take_off, mUUIDs));
-		registrar.add("Clothing.MoveUp", boost::bind(moveWearable, selected_id, false));
-		registrar.add("Clothing.MoveDown", boost::bind(moveWearable, selected_id, true));
+		registrar.add("Clothing.Replace", boost::bind(replaceWearable));
 		registrar.add("Clothing.Edit", boost::bind(LLAgentWearables::editWearable, selected_id));
 		registrar.add("Clothing.Create", boost::bind(&CofClothingContextMenu::createNew, this, selected_id));
 
 		std::string param = data.asString();
 		LLUUID selected_id = mUUIDs.back();
 
-		if ("move_up" == param)
-		{
-			return gAgentWearables.canMoveWearable(selected_id, false);
-		}
-		else if ("move_down" == param)
-		{
-			return gAgentWearables.canMoveWearable(selected_id, true);
-		}
-		else if ("take_off" == param)
+		if ("take_off" == param)
 		{
 			return get_is_item_worn(selected_id);
 		}
 		{
 			return mUUIDs.size() == 1 && gAgentWearables.isWearableModifiable(selected_id);
 		}
+		else if ("replace" == param)
+		{
+			return get_is_item_worn(selected_id) && mUUIDs.size() == 1;
+		}
+
 		return true;
 	}
-
-	// We don't use LLAppearanceMgr::moveWearable() directly because
-	// the item may be invalidated between setting the callback and calling it.
-	static bool moveWearable(const LLUUID& item_id, bool closer_to_body)
-	{
-		LLViewerInventoryItem* item = gInventory.getItem(item_id);
-		return LLAppearanceMgr::instance().moveWearable(item, closer_to_body);
-	}
 };
 
 //////////////////////////////////////////////////////////////////////////

indra/newview/llimview.cpp

 	
 	// check to see if this is an Avaline call
 	bool is_avatar = LLVoiceClient::getInstance()->isParticipantAvatar(session_id);
-	childSetVisible("Start IM", is_avatar); // no IM for avaline
-
 	if (caller_name == "anonymous")
 	{
 		caller_name = getString("anonymous");
 		mLifetimeTimer.stop();
 	}
 
+	//it's not possible to connect to existing Ad-Hoc chat through incoming ad-hoc call
+	//and no IM for avaline
+	childSetVisible("Start IM", is_avatar && notify_box_type != "VoiceInviteAdHoc");
+
 	setCanDrag(FALSE);
 
 	return TRUE;

indra/newview/llmoveview.cpp

 	return TRUE;
 }
 
-// virtual
-void LLFloaterMove::setEnabled(BOOL enabled)
-{
-	//we need to enable/disable only buttons, EXT-1061.
-
-	// is called before postBuild() - use findChild here.
-	LLPanel *panel_actions = findChild<LLPanel>("panel_actions");
-	if (panel_actions) panel_actions->setEnabled(enabled);
-
-	showModeButtons(enabled);
-}
-
 // *NOTE: we assume that setVisible() is called on floater close.
 // virtual
 void LLFloaterMove::setVisible(BOOL visible)
 
 	if (isAgentAvatarValid())
 	{
-		setEnabled(!gAgentAvatarp->isSitting());
+		showModeButtons(!gAgentAvatarp->isSitting());
 	}
 }
 
 
 void LLFloaterMove::showModeButtons(BOOL bShow)
 {
-	// is called from setEnabled so can be called before postBuild(), check mModeActionsPanel agains to NULL
-	if (NULL == mModeActionsPanel || mModeActionsPanel->getVisible() == bShow)
+	if (mModeActionsPanel->getVisible() == bShow)
 		return;
 	mModeActionsPanel->setVisible(bShow);
 }
 	LLFloaterMove* instance = LLFloaterReg::findTypedInstance<LLFloaterMove>("moveview");
 	if (instance)
 	{
-		instance->setEnabled(bEnable);
-
 		if (gAgent.getFlying())
 		{
 			instance->showModeButtons(FALSE);
 		}
+		else
+		{
+			instance->showModeButtons(bEnable);
+		}
 	}
 }
 

indra/newview/llmoveview.h

 public:
 
 	/*virtual*/	BOOL	postBuild();
-	/*virtual*/ void	setEnabled(BOOL enabled);
 	/*virtual*/ void	setVisible(BOOL visible);
 	static F32	getYawRate(F32 time);
 	static void setFlyingMode(BOOL fly);

indra/newview/lloutfitslist.cpp

 		registrar.add("Gear.Delete", boost::bind(&LLOutfitListGearMenu::onDelete, this));
 		registrar.add("Gear.Create", boost::bind(&LLOutfitListGearMenu::onCreate, this, _2));
 
+		registrar.add("Gear.WearAdd", boost::bind(&LLOutfitListGearMenu::onAdd, this));
+
 		enable_registrar.add("Gear.OnEnable", boost::bind(&LLOutfitsList::isActionEnabled, mOutfitList, _2));
 		enable_registrar.add("Gear.OnVisible", boost::bind(&LLOutfitListGearMenu::onVisible, this, _2));
 
 		}
 	}
 
+	void onAdd()
+	{
+		const LLUUID& selected_id = getSelectedOutfitID();
+
+		if (selected_id.notNull())
+		{
+			LLAppearanceMgr::getInstance()->addCategoryToCurrentOutfit(selected_id);
+		}
+	}
+
 	void onTakeOff()
 	{
 		// Take off selected items if there are any
 				 && LLAppearanceMgr::getInstance()->getBaseOutfitUUID() == mSelectedOutfitUUID )
 				|| hasWornItemSelected();
 	}
+
+	if (command_name == "wear_add")
+	{
+		if (gAgentWearables.isCOFChangeInProgress())
+		{
+			return false;
+		}
+
+		return LLAppearanceMgr::getCanAddToCOF(mSelectedOutfitUUID);
+	}
+
 	return false;
 }
 

indra/newview/skins/default/xui/en/menu_cof_clothing.xml

          parameter="take_off" />
     </menu_item_call>
     <menu_item_call
-     label="Move Up a Layer"
-     layout="topleft"
-     name="move_up">
-        <on_click
-         function="Clothing.MoveUp" />
-        <on_enable
-         function="Clothing.OnEnable"
-         parameter="move_up" />
-    </menu_item_call>
-    <menu_item_call
-     label="Move Down a Layer"
-     layout="topleft"
-     name="move_down">
-        <on_click
-         function="Clothing.MoveDown" />
-        <on_enable
-         function="Clothing.OnEnable"
-         parameter="move_down" />
-    </menu_item_call>
-    <menu_item_call
      label="Edit"
      layout="topleft"
      name="edit">
          parameter="edit" />
     </menu_item_call>
     <menu_item_call
+     label="Replace"
+     layout="topleft"
+     name="replace">
+        <on_click
+         function="Clothing.Replace" />
+        <on_enable
+         function="Clothing.OnEnable"
+         parameter="replace" />
+    </menu_item_call>
+    <menu_item_call
      label="Create New"
      layout="topleft"
      name="create_new"

indra/newview/skins/default/xui/en/menu_outfit_gear.xml

          parameter="wear" />
     </menu_item_call>
     <menu_item_call
+     label="Wear - Add to Current Outfit"
+     layout="topleft"
+     name="wear_add">
+        <on_click
+         function="Gear.WearAdd" />
+        <on_enable
+         function="Gear.OnEnable"
+         parameter="wear_add" />
+    </menu_item_call>
+    <menu_item_call
      label="Take Off - Remove from Current Outfit"
      layout="topleft"
      name="take_off">

indra/newview/skins/default/xui/en/panel_outfits_inventory.xml

            width="312" />
          <panel
            background_visible="true"
+           bg_alpha_color="DkGray"
            class="panel_wearing"
            follows="all"
            height="490"          
              follows="all"
              height="490"
              keep_one_selected="true"
-             left="1"
+             left="3"
              multi_select="true"
              name="cof_items_list"
              standalone="false"
              top="0"
              translate="false"
-             width="310"
+             width="307"
              worn_indication_enabled="false"
             />
          </panel>

indra/newview/skins/default/xui/en/panel_outfits_list.xml

    layout="topleft"
    left="0"
    top="0"
-   width="313">
+   width="312">
     <accordion
      background_visible="true"
      bg_alpha_color="DkGray2"
      bg_opaque_color="DkGray2"
      no_matched_tabs_text.value="Didn't find what you're looking for? Try [secondlife:///app/search/all/[SEARCH_TERM] Search]."
+     no_matched_tabs_text.v_pad="10"
      no_visible_tabs_text.value="There are no any outfits. Try [secondlife:///app/search/all/ Search]."
      follows="all"
      height="400"