Change the uri of existing media or color paint with double-click

When double-clicking a paint QListWidgetItem, the uri of that paint can be
altered.

A new signal is sent to ColorMapper and TextureMapper objects so that they can
update heir color and texture paints respectively. Mappings of the old paint are
transferred to the new paint.

TODO: the active mapping may be lost in some cases, needs some more testing.
This commit is contained in:
Vasilis Liaskovitis
2014-05-22 11:30:25 +02:00
parent 1da6d0479a
commit 1aace8a578
9 changed files with 133 additions and 32 deletions
+3 -2
View File
@@ -96,7 +96,8 @@ void ProjectReader::parsePaint(const QDomElement& paint)
QString x = paint.firstChildElement("x").text();
QString y = paint.firstChildElement("y").text();
uid id = _window->createMediaPaint(paintAttrId.toInt(), uri, x.toFloat(), y.toFloat());
uid id = _window->createMediaPaint(paintAttrId.toInt(), uri, x.toFloat(), y.toFloat(),
std::tr1::shared_ptr<Paint>(static_cast<Paint*>(0)));
if (id == NULL_UID)
_xml.raiseError(QObject::tr("Cannot create media with uri %1.").arg(uri));
}
@@ -105,7 +106,7 @@ void ProjectReader::parsePaint(const QDomElement& paint)
QString rgb = paint.firstChildElement("rgb").text();
QColor color(rgb);
uid id = _window->createColorPaint(paintAttrId.toInt(), color);
uid id = _window->createColorPaint(paintAttrId.toInt(), color, std::tr1::shared_ptr<Paint>(static_cast<Paint*>(0)));
if (id == NULL_UID)
_xml.raiseError(QObject::tr("Cannot create color with RGB hex code %1.").arg(rgb));