Commit fac6a680 authored by Jan Möbius's avatar Jan Möbius
Browse files

Scripting function to delete an object

git-svn-id: http://www.openflipper.org/svnrepo/OpenFlipper/branches/Free@4969 383ad7c9-94d9-4d36-a494-682f7c89f535
parent 5ecf1880
...@@ -254,6 +254,9 @@ class DataControlPlugin : public QObject, BaseInterface, ToolboxInterface, KeyIn ...@@ -254,6 +254,9 @@ class DataControlPlugin : public QObject, BaseInterface, ToolboxInterface, KeyIn
/// Get the Objects name from the id /// Get the Objects name from the id
QString getObjectName( int objectId ); QString getObjectName( int objectId );
/// Delete the given object
void deleteObject(int objectId);
/// Get the id of an object by its name /// Get the id of an object by its name
int getObject( QString _name ); int getObject( QString _name );
......
...@@ -58,6 +58,9 @@ void DataControlPlugin::setDescriptions(){ ...@@ -58,6 +58,9 @@ void DataControlPlugin::setDescriptions(){
emit setSlotDescription("groupObjects(idList)","Group given Objects together.", emit setSlotDescription("groupObjects(idList)","Group given Objects together.",
QStringList("objectIds"), QStringList("List of objects that should be grouped.")); QStringList("objectIds"), QStringList("List of objects that should be grouped."));
emit setSlotDescription("deleteObject(int)","Delete an object",
QStringList("objectId"), QStringList("Delete the given object."));
} }
...@@ -97,6 +100,18 @@ void DataControlPlugin::hideObject( int objectId ) { ...@@ -97,6 +100,18 @@ void DataControlPlugin::hideObject( int objectId ) {
object->hide(); object->hide();
} }
void DataControlPlugin::deleteObject( int objectId ) {
BaseObjectData* object;
if ( ! PluginFunctions::getObject(objectId,object) )
return;
if ( object == 0)
return;
PluginFunctions::deleteObject(objectId);
}
/// Show object with the given id /// Show object with the given id
void DataControlPlugin::showObject( int objectId ) { void DataControlPlugin::showObject( 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