diff options
| author | simon@Simon-PC.lindenlab.com <simon@Simon-PC.lindenlab.com> | 2012-07-02 16:40:18 -0700 | 
|---|---|---|
| committer | simon@Simon-PC.lindenlab.com <simon@Simon-PC.lindenlab.com> | 2012-07-02 16:40:18 -0700 | 
| commit | f199b298b4bbd01702ea248236d00a1e05b7bdeb (patch) | |
| tree | c9c8a9076ae9cce724e0a6c74b2a8beef7000934 /indra/newview | |
| parent | a96a260a4dc9df6a16b3c917e2e2d2c13a4f7eea (diff) | |
MAINT-971 : [PUBLIC]Renaming a new inventory item while filtering item names
renames parent folder instead.   Reviewed by Kelly
Diffstat (limited to 'indra/newview')
| -rw-r--r-- | indra/newview/llinventoryfunctions.cpp | 50 | ||||
| -rw-r--r-- | indra/newview/llinventoryfunctions.h | 1 | ||||
| -rw-r--r-- | indra/newview/llinventorypanel.cpp | 1 | ||||
| -rw-r--r-- | indra/newview/llpanelmaininventory.cpp | 1 | 
4 files changed, 34 insertions, 19 deletions
| diff --git a/indra/newview/llinventoryfunctions.cpp b/indra/newview/llinventoryfunctions.cpp index ab5b082915..e98d3f88a6 100644 --- a/indra/newview/llinventoryfunctions.cpp +++ b/indra/newview/llinventoryfunctions.cpp @@ -440,7 +440,7 @@ void show_item_original(const LLUUID& item_uuid)  	//sidetray inventory panel  	LLSidepanelInventory *sidepanel_inventory =	LLFloaterSidePanelContainer::getPanel<LLSidepanelInventory>("inventory"); -	bool reset_inventory_filter = !floater_inventory->isInVisibleChain(); +	bool do_reset_inventory_filter = !floater_inventory->isInVisibleChain();  	LLInventoryPanel* active_panel = LLInventoryPanel::getActiveInventoryPanel();  	if (!active_panel)  @@ -460,37 +460,49 @@ void show_item_original(const LLUUID& item_uuid)  	}  	active_panel->setSelection(gInventory.getLinkedItemID(item_uuid), TAKE_FOCUS_NO); -	if(reset_inventory_filter) +	if(do_reset_inventory_filter)  	{ -		//inventory floater -		bool floater_inventory_visible = false; +		reset_inventory_filter(); +	} +} + -		LLFloaterReg::const_instance_list_t& inst_list = LLFloaterReg::getFloaterList("inventory"); -		for (LLFloaterReg::const_instance_list_t::const_iterator iter = inst_list.begin(); iter != inst_list.end(); ++iter) +void reset_inventory_filter() +{ +	//inventory floater +	bool floater_inventory_visible = false; + +	LLFloaterReg::const_instance_list_t& inst_list = LLFloaterReg::getFloaterList("inventory"); +	for (LLFloaterReg::const_instance_list_t::const_iterator iter = inst_list.begin(); iter != inst_list.end(); ++iter) +	{ +		LLFloaterInventory* floater_inventory = dynamic_cast<LLFloaterInventory*>(*iter); +		if (floater_inventory)  		{ -			LLFloaterInventory* floater_inventory = dynamic_cast<LLFloaterInventory*>(*iter); -			if (floater_inventory) -			{ -				LLPanelMainInventory* main_inventory = floater_inventory->getMainInventoryPanel(); +			LLPanelMainInventory* main_inventory = floater_inventory->getMainInventoryPanel(); -				main_inventory->onFilterEdit(""); +			main_inventory->onFilterEdit(""); -				if(floater_inventory->getVisible()) -				{ -					floater_inventory_visible = true; -				} +			if(floater_inventory->getVisible()) +			{ +				floater_inventory_visible = true;  			}  		} -		if(sidepanel_inventory && !floater_inventory_visible) +	} + +	if(!floater_inventory_visible) +	{ +		LLSidepanelInventory *sidepanel_inventory =	LLFloaterSidePanelContainer::getPanel<LLSidepanelInventory>("inventory"); +		if (sidepanel_inventory)  		{  			LLPanelMainInventory* main_inventory = sidepanel_inventory->getMainInventoryPanel(); - -			main_inventory->onFilterEdit(""); +			if (main_inventory) +			{ +				main_inventory->onFilterEdit(""); +			}  		}  	}  } -  void open_outbox()  {  	LLFloaterReg::showInstance("outbox"); diff --git a/indra/newview/llinventoryfunctions.h b/indra/newview/llinventoryfunctions.h index 5cf9c528b0..909f7fd10b 100644 --- a/indra/newview/llinventoryfunctions.h +++ b/indra/newview/llinventoryfunctions.h @@ -56,6 +56,7 @@ void show_item_profile(const LLUUID& item_uuid);  void show_task_item_profile(const LLUUID& item_uuid, const LLUUID& object_id);  void show_item_original(const LLUUID& item_uuid); +void reset_inventory_filter();  void rename_category(LLInventoryModel* model, const LLUUID& cat_id, const std::string& new_name); diff --git a/indra/newview/llinventorypanel.cpp b/indra/newview/llinventorypanel.cpp index 71dd963f28..05c81957c6 100644 --- a/indra/newview/llinventorypanel.cpp +++ b/indra/newview/llinventorypanel.cpp @@ -966,6 +966,7 @@ void LLInventoryPanel::doToSelected(const LLSD& userdata)  void LLInventoryPanel::doCreate(const LLSD& userdata)  { +	reset_inventory_filter();  	menu_create_inventory_item(mFolderRoot, LLFolderBridge::sSelf.get(), userdata);  } diff --git a/indra/newview/llpanelmaininventory.cpp b/indra/newview/llpanelmaininventory.cpp index c11597f532..9f3273da2d 100644 --- a/indra/newview/llpanelmaininventory.cpp +++ b/indra/newview/llpanelmaininventory.cpp @@ -306,6 +306,7 @@ void LLPanelMainInventory::newWindow()  void LLPanelMainInventory::doCreate(const LLSD& userdata)  { +	reset_inventory_filter();  	menu_create_inventory_item(getPanel()->getRootFolder(), NULL, userdata);  } | 
