Commit 0a00f143 authored by Jan Möbius's avatar Jan Möbius

CopyObject for scripting

git-svn-id: http://www.openflipper.org/svnrepo/OpenFlipper/branches/Free@4975 383ad7c9-94d9-4d36-a494-682f7c89f535
parent fac6a680
......@@ -257,6 +257,9 @@ class DataControlPlugin : public QObject, BaseInterface, ToolboxInterface, KeyIn
/// Delete the given object
void deleteObject(int objectId);
/// Creates an object copy
int copyObject( int objectId );
/// Get the id of an object by its name
int getObject( QString _name );
......
......@@ -61,6 +61,9 @@ void DataControlPlugin::setDescriptions(){
emit setSlotDescription("deleteObject(int)","Delete an object",
QStringList("objectId"), QStringList("Delete the given object."));
emit setSlotDescription("copyObject(int)","Create a copy of an object",
QStringList("objectId"), QStringList("Object to copy."));
}
......@@ -75,6 +78,19 @@ int DataControlPlugin::getObject( QString _name ) {
return object->id();
}
int DataControlPlugin::copyObject( int objectId ) {
int newObject = PluginFunctions::copyObject( objectId );
if ( newObject == -1 )
std::cerr << "Unable to copy object" << std::endl;
else
emit updatedObject(newObject);
return newObject;
}
/// Returns the name of an object with given id
QString DataControlPlugin::getObjectName( int objectId ) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment