Commits

VirLinden committed f07c6b0

support for edit classified slapp

Comments (0)

Files changed (3)

indra/newview/llpanelpicks.cpp

 		else if (mRequestVerb == "edit")
 		{
 			llwarns << "edit in progress" << llendl;
+			// open the new classified panel on the Me > Picks sidetray
+			LLSD params;
+			params["id"] = gAgent.getID();
+			params["open_tab_name"] = "panel_picks";
+			params["show_tab_panel"] = "edit_classified";
+			params["classified_id"] = c_info->classified_id;
+			LLSideTray::getInstance()->showPanel("panel_me", params);
 		}
 	}
 
 	getProfilePanel()->openPanel(mPanelClassifiedInfo, params);
 }
 
+void LLPanelPicks::openClassifiedEdit(const LLSD& params)
+{
+	LLUUID classified_id = params["classified_id"].asUUID();;
+	llinfos << "opening classified " << classified_id << " for edit" << llendl;
+	editClassified(classified_id);
+}
+
 void LLPanelPicks::showAccordion(const std::string& name, bool show)
 {
 	LLAccordionCtrlTab* tab = getChild<LLAccordionCtrlTab>(name);
 	{
 		return;
 	}
+	editClassified(c_item->getClassifiedId());
+}
+
+void LLPanelPicks::editClassified(const LLUUID&  classified_id)
+{
+	// HACK - find item by classified id.  Should be a better way.
+	std::vector<LLPanel*> items;
+	mClassifiedsList->getItems(items);
+	LLClassifiedItem* c_item = NULL;
+	for(std::vector<LLPanel*>::iterator it = items.begin(); it != items.end(); ++it)
+	{
+		LLClassifiedItem *test_item = dynamic_cast<LLClassifiedItem*>(*it);
+		if (test_item && test_item->getClassifiedId() == classified_id)
+		{
+			c_item = test_item;
+			break;
+		}
+	}
+	if (!c_item)
+	{
+		llwarns << "item not found for classified_id " << classified_id << llendl;
+		return;
+	}
 
 	LLSD params;
 	params["classified_id"] = c_item->getClassifiedId();

indra/newview/llpanelpicks.h

 	void onPanelClassifiedClose(LLPanelClassifiedInfo* panel);
 	void onPanelPickEdit();
 	void onPanelClassifiedEdit();
+	void editClassified(const LLUUID&  classified_id);
 	void onClickMenuEdit();
 
 	bool onEnableMenuItem(const LLSD& user_data);
 	void openPickInfo();
 	void openClassifiedInfo();
 	void openClassifiedInfo(const LLSD& params);
+	void openClassifiedEdit(const LLSD& params);
 	friend class LLPanelProfile;
 
 	void showAccordion(const std::string& name, bool show);

indra/newview/llpanelprofile.cpp

 				picks->openClassifiedInfo(params);
 			}
 		}
+		else if (panel == "edit_classified")
+		{
+			LLPanelPicks* picks = dynamic_cast<LLPanelPicks *>(getTabContainer()[PANEL_PICKS]);
+			if (picks)
+			{
+				LLSD params = key;
+				params.erase("show_tab_panel");
+				params.erase("open_tab_name");
+				picks->openClassifiedEdit(params);
+			}
+		}
 	}
 }