The method SetGroupName.
--HG-- branch : feature
This commit is contained in:
parent
a8feb5d0c0
commit
9c63c4f794
|
@ -1494,3 +1494,35 @@ QDomElement VAbstractPattern::CreateGroup(quint32 id, const QString &name, const
|
||||||
|
|
||||||
return group;
|
return group;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
void VAbstractPattern::SetGroupName(quint32 id, const QString &name)
|
||||||
|
{
|
||||||
|
QDomElement groups = CreateGroups();
|
||||||
|
if (not groups.isNull())
|
||||||
|
{
|
||||||
|
QDomElement group = elementById(id);
|
||||||
|
if (group.isElement())
|
||||||
|
{
|
||||||
|
group.setAttribute(AttrName, name);
|
||||||
|
modified = true;
|
||||||
|
emit patternChanged(false);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (groups.childNodes().isEmpty())
|
||||||
|
{
|
||||||
|
QDomNode parent = groups.parentNode();
|
||||||
|
parent.removeChild(groups);
|
||||||
|
}
|
||||||
|
|
||||||
|
qDebug("Can't get group by id = %u.", id);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
qDebug("Can't get tag Groups.");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
|
@ -118,6 +118,7 @@ public:
|
||||||
|
|
||||||
QDomElement CreateGroups();
|
QDomElement CreateGroups();
|
||||||
QDomElement CreateGroup(quint32 id, const QString &name, const QMap<quint32, quint32> &groupData);
|
QDomElement CreateGroup(quint32 id, const QString &name, const QMap<quint32, quint32> &groupData);
|
||||||
|
void SetGroupName(quint32 id, const QString &name);
|
||||||
|
|
||||||
static const QString TagPattern;
|
static const QString TagPattern;
|
||||||
static const QString TagCalculation;
|
static const QString TagCalculation;
|
||||||
|
|
|
@ -67,6 +67,12 @@ void AddGroup::undo()
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
if (groups.childNodes().isEmpty())
|
||||||
|
{
|
||||||
|
QDomNode parent = groups.parentNode();
|
||||||
|
parent.removeChild(groups);
|
||||||
|
}
|
||||||
|
|
||||||
qCDebug(vUndo, "Can't get group by id = %u.", nodeId);
|
qCDebug(vUndo, "Can't get group by id = %u.", nodeId);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user