Minor improvements in connection and IPC (multiple instances not fully

supported yet)
This commit is contained in:
brunoherbelin
2020-10-25 23:14:47 +01:00
parent 7fba62bc49
commit cb6a0aefa4
8 changed files with 69 additions and 18 deletions

View File

@@ -107,6 +107,21 @@ void Settings::Save()
SourceConfNode->SetAttribute("res", application.source.res);
pRoot->InsertEndChild(SourceConfNode);
// bloc connections
{
XMLElement *connectionsNode = xmlDoc.NewElement( "Connections" );
map<int, std::string>::iterator iter;
for (iter=application.instance_names.begin(); iter != application.instance_names.end(); iter++)
{
XMLElement *connection = xmlDoc.NewElement( "Instance" );
connection->SetAttribute("name", iter->second.c_str());
connection->SetAttribute("id", iter->first);
connectionsNode->InsertEndChild(connection);
}
pRoot->InsertEndChild(connectionsNode);
}
// bloc views
{
XMLElement *viewsNode = xmlDoc.NewElement( "Views" );
@@ -326,6 +341,22 @@ void Settings::Load()
}
// bloc Connections
{
XMLElement * pElement = pRoot->FirstChildElement("Connections");
if (pElement)
{
XMLElement* connectionNode = pElement->FirstChildElement("Instance");
for( ; connectionNode ; connectionNode=connectionNode->NextSiblingElement())
{
int id = 0;
connectionNode->QueryIntAttribute("id", &id);
application.instance_names[id] = connectionNode->Attribute("name");
}
}
}
// bloc history of recent
{
XMLElement * pElement = pRoot->FirstChildElement("Recent");