示例#1
0
	bool CSettings::LoadConvertProfile(const CString& name, SimpleXmlNode profileNode)
	{
		SettingsManager mgr;
		ImageConvertingParams params;
		std::string saveTo = profileNode.Attribute("Name");
		if (!name.IsEmpty())
			saveTo = WCstringToUtf8(name);
		SettingsNode& image = mgr["Image"];
		BindConvertProfile(image, params);
		mgr.loadFromXmlNode(profileNode);
		ConvertProfiles[Utf8ToWCstring( saveTo)] = params;
		return true;
	}
示例#2
0
	bool CSettings::LoadServerProfiles(SimpleXmlNode root)
	{
		std::vector<SimpleXmlNode> servers;
		root.GetChilds("ServerProfile", servers);

		for (size_t i = 0; i < servers.size(); i++)
		{
			SimpleXmlNode serverProfileNode = servers[i];
			std::string profileName = serverProfileNode.Attribute("ServerProfileId");
			ServerProfile sp;
			SettingsManager mgr;
			sp.bind(mgr.root());
			
			mgr.loadFromXmlNode(serverProfileNode);
			ServerProfiles[Utf8ToWCstring(profileName)] = sp;
		}
		return true;
	}