diff --git a/DataControl - DataUpdate.odg b/DataControl - DataUpdate.odg new file mode 100644 index 0000000000000000000000000000000000000000..f5c833a8043315bfda0997c8d569d2af867797df Binary files /dev/null and b/DataControl - DataUpdate.odg differ diff --git a/DataControlPlugin.hh b/DataControlPlugin.hh index 09e4697639d867779dc09a86fbbf2d2f6d7eee33..42c750556d3868096938118380e07ced13ded734 100644 --- a/DataControlPlugin.hh +++ b/DataControlPlugin.hh @@ -83,6 +83,7 @@ class DataControlPlugin : public QObject, BaseInterface, ToolboxInterface, KeyIn void addContextMenuItem(QAction* _action , DataType _objectType , ContextMenuType _type ); // LoadSaveInterface void deleteObject( int _id ); + void emptyObjectAdded( int _id ); private slots : // BaseInterface void pluginsInitialized(); diff --git a/DataControlPluginScripting.cc b/DataControlPluginScripting.cc index 339cd20b3834f518d01d740c093b7e949b3408b8..f9f70e9b90beeed610bdb037a4557ce034b0a4c0 100644 --- a/DataControlPluginScripting.cc +++ b/DataControlPluginScripting.cc @@ -129,8 +129,10 @@ int DataControlPlugin::copyObject( int objectId ) { if ( newObject == -1 ) std::cerr << "Unable to copy object" << std::endl; - else + else{ + emit emptyObjectAdded(newObject); emit updatedObject(newObject); + } return newObject; } diff --git a/Popup.cc b/Popup.cc index 3580a6fe56438c6a8d051b399a0c6754275dee27..8a7bab582db3a0c37d6f0480f81db8dec4abdf41 100644 --- a/Popup.cc +++ b/Popup.cc @@ -142,10 +142,14 @@ void DataControlPlugin::slotCopy() { BaseObject* copyItem = model_->getItem( indexList[i] ); - // remove the whole subtree below this item - if ( PluginFunctions::copyObject(copyItem->id()) == -1 ) { + int newObject = PluginFunctions::copyObject(copyItem->id()); + + if ( newObject == -1 ) { emit log(LOGERR, "Unable to copy object" ); continue; + } else { + emit emptyObjectAdded( newObject ); + emit updatedObject( newObject ); } }