Commit b5c874e9 authored by Jan Möbius's avatar Jan Möbius

Ungrouping via rpc for datacontrol

git-svn-id: http://www.openflipper.org/svnrepo/OpenFlipper/branches/Free@7957 383ad7c9-94d9-4d36-a494-682f7c89f535
parent ff30d844
......@@ -333,6 +333,12 @@ class DataControlPlugin : public QObject, BaseInterface, ToolboxInterface, KeyIn
* @return object id of new group or -1 if failed
*/
int groupObjects(IdList _objectIDs, QString _groupName = "");
/** remove an object from its group and place it at the toplevel group
*
* @return successfull
*/
bool unGroupObject(int _id);
/** @} */
......
......@@ -82,6 +82,9 @@ void DataControlPlugin::setDescriptions(){
emit setSlotDescription("groupObjects(idList)",tr("Group given Objects together."),
QStringList(tr("objectIds")), QStringList(tr("List of objects that should be grouped.")));
emit setSlotDescription("unGroupObject(int)",tr("Remove the given object from its group and append to root node."),
QStringList(tr("ObjectId")), QStringList(tr("Object to be removed from group.")));
emit setSlotDescription("objectDelete(int)",tr("Delete an object"),
QStringList(tr("objectId")), QStringList(tr("Delete the given object.")));
......@@ -333,6 +336,21 @@ int DataControlPlugin::groupObjects(IdList _objectIDs, QString _groupName) {
return groupItem->id();
}
bool DataControlPlugin::unGroupObject(int _id) {
BaseObject* obj = 0;
PluginFunctions::getObject(_id,obj);
if ( obj ) {
obj->setParent( PluginFunctions::objectRoot() );
return true;
} else {
emit log( LOGERR, tr( "Unable to get Object with id %1 for ungrouping").arg(_id) );
return false;
}
}
//******************************************************************************
......
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