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

Added copyObject to LoadSaveInterface ( just a skeleton)


git-svn-id: http://www.openflipper.org/svnrepo/OpenFlipper/branches/Free@5840 383ad7c9-94d9-4d36-a494-682f7c89f535
parent f2ac31f8
...@@ -74,6 +74,13 @@ class LoadSaveInterface { ...@@ -74,6 +74,13 @@ class LoadSaveInterface {
*/ */
virtual void addEmptyObject( DataType /*_type*/, int& /*_id*/) {}; virtual void addEmptyObject( DataType /*_type*/, int& /*_id*/) {};
/** Create a copy of an existing object
*
* @param _oldId id of the object to copy
* @param _newId id of the new object created
*/
virtual void copyObject( int /*_oldId*/, int& /*_newId*/) {};
/** /**
* *
* @param _id Object to Save * @param _id Object to Save
......
...@@ -487,9 +487,12 @@ private: ...@@ -487,9 +487,12 @@ private:
/// Slot adding empty object from Menu /// Slot adding empty object from Menu
void slotAddEmptyObjectMenu(); void slotAddEmptyObjectMenu();
/// Slot adding empty object from Menu of a given type /// Slot adding empty object of a given type
void slotAddEmptyObject( DataType _type , int& _id ); void slotAddEmptyObject( DataType _type , int& _id );
/// Slot copying an object
void slotCopyObject( int _oldId , int& _newId );
/// Exit Application /// Exit Application
void slotExit(); void slotExit();
......
...@@ -895,6 +895,10 @@ void Core::loadPlugin(QString filename, bool silent){ ...@@ -895,6 +895,10 @@ void Core::loadPlugin(QString filename, bool silent){
connect(plugin , SIGNAL( addEmptyObject( DataType, int& )) , connect(plugin , SIGNAL( addEmptyObject( DataType, int& )) ,
this , SLOT( slotAddEmptyObject( DataType, int&) ),Qt::DirectConnection); this , SLOT( slotAddEmptyObject( DataType, int&) ),Qt::DirectConnection);
if ( checkSignal(plugin,"copyObject(int,int&)" ) )
connect(plugin , SIGNAL( copyObject( int, int& )) ,
this , SLOT( slotCopyObject( int, int&) ),Qt::DirectConnection);
if ( checkSignal(plugin,"emptyObjectAdded(int)" ) ) if ( checkSignal(plugin,"emptyObjectAdded(int)" ) )
connect(plugin , SIGNAL( emptyObjectAdded( int ) ) , connect(plugin , SIGNAL( emptyObjectAdded( int ) ) ,
this , SLOT( slotEmptyObjectAdded ( int ) ),Qt::DirectConnection); this , SLOT( slotEmptyObjectAdded ( int ) ),Qt::DirectConnection);
......
...@@ -181,6 +181,14 @@ void Core::slotAddEmptyObject( DataType _type , int& _id ) { ...@@ -181,6 +181,14 @@ void Core::slotAddEmptyObject( DataType _type , int& _id ) {
_id = addEmptyObject( _type ); _id = addEmptyObject( _type );
} }
/// Slot creating a copy of an existing object
void slotCopyObject( int _oldId , int& _newId ) {
std::cerr << "slotCopyObject" << std::endl;
_newId = 99;
}
/// Slot for loading a given file /// Slot for loading a given file
void Core::slotLoad(QString _filename, DataType _type, int& _id) { void Core::slotLoad(QString _filename, DataType _type, int& _id) {
_id = loadObject(_type,_filename); _id = loadObject(_type,_filename);
......
Supports Markdown
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