예제 #1
0
	bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata)
	{
		const std::string filename = upload_pick((void*)LLFilePicker::FFLOAD_XML);
	
		if (filename.empty())
			return true;
	
		llifstream importer(filename);
		LLSD data;
		LLSDSerialize::fromXMLDocument(data, importer);
	
		if (gImportTracker.getState() != ImportTracker::IDLE)
		{
			gImportTracker.clear();
			gImportTracker.cleargroups();
		}
		LLSD data2=data;
		LLSD header=data2["Header"];
		if(header.isDefined())
		{
			if(header["Version"].asInteger() == 2)
			{
				//LLSD obj_llsd=data["Objects"];
				//gImportTracker.prepare(obj_llsd);
				gImportTracker.importer(filename, NULL);
			}
			else
				gImportTracker.import(data);
		}
		else
			gImportTracker.import(data);
		return true;
	}
예제 #2
0
void handle_upload(void* data)
{
	const std::string filename = upload_pick(data);
	if (!filename.empty())
	{
		LLFloaterNameDesc* floaterp = new LLFloaterNameDesc(filename);
		LLUICtrlFactory::getInstance()->buildFloater(floaterp, "floater_name_description.xml");
	}
}
예제 #3
0
	bool handleEvent(const LLSD& userdata)
	{
		std::string filename = upload_pick((void *)LLFilePicker::FFLOAD_IMAGE);
		if (!filename.empty())
		{
			LLFloaterReg::showInstance("upload_image", LLSD(filename));
		}
		return TRUE;
	}
예제 #4
0
	bool handleEvent(const LLSD& userdata)
	{
		std::string filename = upload_pick((void*)LLFilePicker::FFLOAD_WAV);
		if (!filename.empty())
		{
			LLFloaterReg::showInstance("upload_sound", LLSD(filename));
		}
		return true;
	}
예제 #5
0
void handle_upload(void* data)
{
	const char* filename = upload_pick(data);
	if (filename)
	{
		LLFloaterNameDesc* floaterp = new LLFloaterNameDesc(filename);
		gUICtrlFactory->buildFloater(floaterp, "floater_name_description.xml");
	}
}
void handle_upload(void* data)
{
	const std::string filename = upload_pick(data);
	if (!filename.empty())
	{
		LLFloaterNameDesc* floaterp = new LLFloaterNameDesc(filename);
		LLUICtrlFactory::getInstance()->buildFloater(floaterp, "floater_name_description.xml");
		floaterp->childSetLabelArg("ok_btn", "[AMOUNT]", llformat("%d", LLGlobalEconomy::Singleton::getInstance()->getPriceUpload() ));
	}
}
	bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata)
	{
		const std::string filename = upload_pick((void*)LLFilePicker::FFLOAD_ANIM);
		if (!filename.empty())
		{
			LLFloaterAnimPreview* floaterp = new LLFloaterAnimPreview(filename);
			LLUICtrlFactory::getInstance()->buildFloater(floaterp, "floater_animation_preview.xml");
		}
		return true;
	}
	bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata)
	{
		std::string filename = upload_pick((void *)LLFilePicker::FFLOAD_IMAGE);
		if (!filename.empty())
		{
			LLFloaterImagePreview* floaterp = new LLFloaterImagePreview(filename);
			LLUICtrlFactory::getInstance()->buildFloater(floaterp, "floater_image_preview.xml");
		}
		return TRUE;
	}
예제 #9
0
	bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata)
	{
		std::string filename = upload_pick((void*)LLFilePicker::FFLOAD_WAV);
		if (!filename.empty())
		{
			LLFloaterNameDesc* floaterp = new LLFloaterNameDesc(filename);
			LLUICtrlFactory::getInstance()->buildFloater(floaterp, "floater_sound_preview.xml");
		}
		return true;
	}
예제 #10
0
	bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata)
	{
		const char* filename = upload_pick((void*)((S32)LLFilePicker::FFLOAD_ANIM));
		if (filename)
		{
			LLFloaterAnimPreview* floaterp = new LLFloaterAnimPreview(filename);
			gUICtrlFactory->buildFloater(floaterp, "floater_animation_preview.xml");
		}
		return true;
	}
예제 #11
0
	bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata)
	{
		const char* filename = upload_pick((void*)((S32)LLFilePicker::FFLOAD_WAV));
		if (filename)
		{
			LLFloaterNameDesc* floaterp = new LLFloaterNameDesc(filename);
			gUICtrlFactory->buildFloater(floaterp, "floater_sound_preview.xml");
		}
		return true;
	}
예제 #12
0
	bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata)
	{
		const char* filename = upload_pick((void *)(S32)LLFilePicker::FFLOAD_IMAGE);
		if (filename)
		{
			LLFloaterImagePreview* floaterp = new LLFloaterImagePreview(filename);
			gUICtrlFactory->buildFloater(floaterp, "floater_image_preview.xml");
		}
		return TRUE;
	}
예제 #13
0
void handle_upload_object(void* data)
{
	const char* filename = upload_pick(data);
	if (filename)
	{
		// start the import
		LLFloaterImport* floaterp = new LLFloaterImport(filename);
		gUICtrlFactory->buildFloater(floaterp, "floater_import.xml");
	}
}
	bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata)
	{
		std::string filename = upload_pick((void*)LLFilePicker::FFLOAD_WAV);
		if (!filename.empty())
		{
			LLFloaterNameDesc* floaterp = new LLFloaterNameDesc(filename);
			LLUICtrlFactory::getInstance()->buildFloater(floaterp, "floater_sound_preview.xml");
			floaterp->childSetLabelArg("ok_btn", "[AMOUNT]", llformat("%d", LLGlobalEconomy::Singleton::getInstance()->getPriceUpload() ));
		}
		return true;
	}
예제 #15
0
	bool handleEvent(const LLSD& userdata)
	{
		const std::string filename = upload_pick((void*)LLFilePicker::FFLOAD_ANIM);
		if (!filename.empty())
		{
			if (filename.rfind(".anim") != std::string::npos)
			{
				LLFloaterReg::showInstance("upload_anim_anim", LLSD(filename));
			}
			else
			{
				LLFloaterReg::showInstance("upload_anim_bvh", LLSD(filename));
			}
		}
		return true;
	}
예제 #16
0
void LLPanelFriends::onClickImport(void* user_data)
//THIS CODE IS DESIGNED SO THAT EXP/IMP BETWEEN GRIDS WILL FAIL
//because assuming someone having the same name on another grid is the same person is generally a bad idea
//i might add the option to query the user as to intelligently detecting matching names on a alternative grid
// jcool410
{
	//LLPanelFriends* panelp = (LLPanelFriends*)user_data;
	//is_agent_friend(

	const std::string filename = upload_pick((void*)LLFilePicker::FFLOAD_ALL);
		
	if (filename.empty())
		return;

	llifstream importer(filename);
	LLSD data;
	LLSDSerialize::fromXMLDocument(data, importer);
	if(data.has("GRID"))
	{
		std::string grid = gHippoGridManager->getConnectedGrid()->getLoginUri();
		if(grid != data["GRID"])return;
		data.erase("GRID");
	}

#if LL_WINDOWS
	std::string file = filename.substr(filename.find_last_of("\\")+1);
#else
	std::string file = filename.substr(filename.find_last_of("/")+1);
#endif

	std::string importstate = gDirUtilp->getExpandedFilename(LL_PATH_PER_SL_ACCOUNT, "friendimportstate.dat");
	
	llifstream stateload(importstate);
	LLSD importstatellsd;
	LLSDSerialize::fromXMLDocument(importstatellsd, stateload);


	//LLMessageSystem* msg = gMessageSystem;
	LLSD newdata;

	LLSD::map_const_iterator iter;
	for(iter = data.beginMap(); iter != data.endMap(); ++iter)
	{//first= var second = val
		LLSD content = iter->second;
		if(!content.has("name"))continue;
		if(!content.has("see_online"))continue;
		if(!content.has("can_map"))continue;
		if(!content.has("can_mod"))continue;

		LLUUID agent_id = LLUUID(iter->first);
		if(merging && importstatellsd.has(agent_id.asString()))continue;//dont need to request what weve already requested from another list import and have not got a reply yet

		std::string agent_name = content["name"];
		if(!is_agent_friend(agent_id))//dont need to request what we have
		{
			if(merging)importstatellsd[agent_id.asString()] = content;//MERGEEEE
			requestFriendship(agent_id, agent_name, "Imported from "+file);
			newdata[iter->first] = iter->second;
		}else 
		{
			//data.erase(iter->first);
			//--iter;//god help us all
		}
	}
	data = newdata;
	newdata = LLSD();

	if(!merging)
	{
		merging = true;//this hack is to support importing multiple account lists without spamming users but considering LLs fail in forcing silent declines
		importstatellsd = data;
	}

	llofstream export_file;
	export_file.open(importstate);
	LLSDSerialize::toPrettyXML(importstatellsd, export_file);
	export_file.close();
}