mirror of
https://github.com/mapmapteam/mapmap.git
synced 2026-06-16 12:33:19 +02:00
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:
@@ -71,6 +71,25 @@ bool MappingManager::removePaint(uid paintId)
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
bool MappingManager::replacePaintMappings(Paint::ptr oldpaint, Paint::ptr newpaint)
|
||||
{
|
||||
// Make sure the paint to which this paint refers to exists in the manager.
|
||||
if (oldpaint && newpaint)
|
||||
{
|
||||
QMap<uid, Mapping::ptr> paintMappings = getPaintMappings(oldpaint);
|
||||
for (QMap<uid, Mapping::ptr>::const_iterator it = paintMappings.constBegin();
|
||||
it != paintMappings.constEnd(); ++it) {
|
||||
Mapping::ptr mapping = it.value();
|
||||
mapping->setPaint(newpaint);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user