Commit 5f8962b4 authored by Dirk Wilden's avatar Dirk Wilden
Browse files

changes needed for backups and selections

git-svn-id: http://www.openflipper.org/svnrepo/OpenFlipper/branches/Free@11275 383ad7c9-94d9-4d36-a494-682f7c89f535
parent 5585e4b1
...@@ -62,60 +62,19 @@ ...@@ -62,60 +62,19 @@
// === Backup Communication ============================ // === Backup Communication ============================
//======================================================================================== //========================================================================================
void Core::slotBackupGroup(QString _name, int& _groupId ) { /// Slot for generating type specific backups
if ( sender() != 0 ) { void Core::slotGenerateBackup( int _id, QString _name, UpdateType _type ) {
if ( sender()->metaObject() != 0 ) {
_name = QString(sender()->metaObject()->className()) + ": " + _name;
if ( OpenFlipper::Options::doSlotDebugging() )
emit log(LOGINFO,"slotBackupGroup( " + _name + " ) called by " + QString( sender()->metaObject()->className() ) );
}
}
_groupId = nextBackupGroupId_; BaseObjectData* obj = 0;
emit createBackupGroup( _name , nextBackupGroupId_); PluginFunctions::getObject(_id, obj);
++nextBackupGroupId_;
}
/// Called if a backup is requested by the plugins
void Core::slotBackup( int _objectId, QString _name, int& _internalId, int _groupId ) {
if ( sender() != 0 ) {
if ( sender()->metaObject() != 0 ) {
_name = QString(sender()->metaObject()->className()) + ": " + _name;
if ( OpenFlipper::Options::doSlotDebugging() )
emit log(LOGINFO,"slotBackup( " + QString::number(_objectId) + ", " + _name + "," + QString::number(_internalId) + (" ) called by ") + QString( sender()->metaObject()->className() ) );
}
}
_internalId = nextBackupId_; if (obj == 0)
emit createBackup( _objectId , _name , nextBackupId_, _groupId); return;
++nextBackupId_;
}
/// Called if a backup is requested by the plugins (convenience function without getting id of the object)
void Core::slotBackup( int _objectId, QString _name ) {
if ( sender() != 0 ) {
if ( sender()->metaObject() != 0 ) {
_name = QString(sender()->metaObject()->className()) + ": " + _name;
if ( OpenFlipper::Options::doSlotDebugging() )
emit log(LOGINFO,"slotBackup( " + QString::number(_objectId) + ", " + _name + tr(" ) called by ") + QString( sender()->metaObject()->className() ) );
}
}
emit createBackup( _objectId , _name , nextBackupId_); // Type plugins
++nextBackupId_; for (int i=0; i < (int)supportedDataTypes_.size(); i++)
} if ( supportedDataTypes_[i].type & obj->dataType() )
supportedDataTypes_[i].plugin->generateBackup(_id, _name, _type);
void Core::slotRestoreGroup( int _groupId) {
emit restoreGroup(_groupId);
}
void Core::slotRestore( int _objectId, int _internalId ) {
emit restoreObject(_objectId,_internalId);
} }
//============================================================================= //=============================================================================
...@@ -285,7 +285,7 @@ signals: ...@@ -285,7 +285,7 @@ signals:
void showFloodFillSelectionMode(QString _handleName, bool _show, SelectionInterface::PrimitiveType _associatedTypes); void showFloodFillSelectionMode(QString _handleName, bool _show, SelectionInterface::PrimitiveType _associatedTypes);
/// SelectionInterface: This signal is emitted when standard toggle selection has been performed /// SelectionInterface: This signal is emitted when standard toggle selection has been performed
void toggleSelection(QPoint _position, SelectionInterface::PrimitiveType _currentType, bool _deselect); void toggleSelection(QMouseEvent* _event, SelectionInterface::PrimitiveType _currentType, bool _deselect);
/// SelectionInterface: This signal is emitted when standard lasso selection has been performed /// SelectionInterface: This signal is emitted when standard lasso selection has been performed
void lassoSelection(QMouseEvent* _event, SelectionInterface::PrimitiveType _currentType, bool _deselect); void lassoSelection(QMouseEvent* _event, SelectionInterface::PrimitiveType _currentType, bool _deselect);
...@@ -297,13 +297,13 @@ signals: ...@@ -297,13 +297,13 @@ signals:
void surfaceLassoSelection(QMouseEvent* _event, SelectionInterface::PrimitiveType _currentType, bool _deselect); void surfaceLassoSelection(QMouseEvent* _event, SelectionInterface::PrimitiveType _currentType, bool _deselect);
/// SelectionInterface: This signal is emitted when standard sphere selection has been performed /// SelectionInterface: This signal is emitted when standard sphere selection has been performed
void sphereSelection(QPoint _position, double _radius, SelectionInterface::PrimitiveType _currentType, bool _deselect); void sphereSelection(QMouseEvent* _event, double _radius, SelectionInterface::PrimitiveType _currentType, bool _deselect);
/// SelectionInterface: This signal is emitted when standard closest boundary selection has been performed /// SelectionInterface: This signal is emitted when standard closest boundary selection has been performed
void closestBoundarySelection(QPoint _position, SelectionInterface::PrimitiveType _currentType, bool _deselect); void closestBoundarySelection(QMouseEvent* _event, SelectionInterface::PrimitiveType _currentType, bool _deselect);
/// SelectionInterface: This signal is emitted when standard flood fill selection has been performed /// SelectionInterface: This signal is emitted when standard flood fill selection has been performed
void floodFillSelection(QPoint _position, double _maxAngle, SelectionInterface::PrimitiveType _currentType, bool _deselect); void floodFillSelection(QMouseEvent* _event, double _maxAngle, SelectionInterface::PrimitiveType _currentType, bool _deselect);
/// SelectionInterface: This signal is emitted when a custom selection operation has been performed /// SelectionInterface: This signal is emitted when a custom selection operation has been performed
void customSelection(QMouseEvent* _event, SelectionInterface::PrimitiveType _currentType, QString _customIdentifier, bool _deselect); void customSelection(QMouseEvent* _event, SelectionInterface::PrimitiveType _currentType, QString _customIdentifier, bool _deselect);
...@@ -347,33 +347,25 @@ signals: ...@@ -347,33 +347,25 @@ signals:
/// This signal is emitted before the core deletes its data and exits /// This signal is emitted before the core deletes its data and exits
void saveOnExit( INIFile& _ini ); void saveOnExit( INIFile& _ini );
/// Tell plugins to create a backup group /// Tell backup-plugin to create a backup
void createBackupGroup( QString _name , int _groupId); void createBackup( int _objectid, QString _name, UpdateType _type = UPDATE_ALL);
void createBackup( IdList _objectids, QString _name, std::vector<UpdateType> _types);
/// Tell plugins to create a backup
void createBackup( int _objectId , QString _name , int _internalId, int groupId = -1); /// Tell backup-plugin to undo/redo
void undo(int _objectid);
/// Tell Plugins to make a backup persistent void redo(int _objectid);
void makeBackupPersistent(int _objectid, int _internalId); void undo();
void redo();
/// Tell Backup Plugin to restore a group with the given group id
void restoreGroup( int _groupId); /// Backup Plugin tells other Plugins that a restore will happen
void aboutToRestore(int _objectId, UpdateType _type);
/// Tell Backup Plugin to restore an object with the given backup id
void restoreObject( int _objectId, int _internalId);
/** \brief Backup Plugin tells other Plugins that a restore will happen
*/
void aboutToRestore(int _objectId , int _internalId);
/** \brief Backup Plugin tells other Plugins that they should restore their own data /// Backup Plugin tells other Plugins that they should restore their own data
*/ void restore(int _objectId, UpdateType _type);
void restore(int _objectId , int _internalId);
/** \brief Backup Plugin tells other Plugins that a restore has happened /// Backup Plugin tells other Plugins that a restore has happened
*/ void restored( int _objectId, UpdateType _type);
void restored( int _objectId , int _internalId);
/// Tell the plugins that a file has been opened ( -> Database) /// Tell the plugins that a file has been opened ( -> Database)
void openedFile( int _id ); void openedFile( int _id );
...@@ -481,21 +473,6 @@ signals: ...@@ -481,21 +473,6 @@ signals:
///Called by plugins if a multi-texture's sub textures should be fetched ///Called by plugins if a multi-texture's sub textures should be fetched
void slotGetSubTextures( int _id, QString _multiTextureName, QStringList& _subTextures ); void slotGetSubTextures( int _id, QString _multiTextureName, QStringList& _subTextures );
/// Called if a backup group is requested by the plugins
void slotBackupGroup(QString _name, int& _groupId );
/// Called if a backup is requested by the plugins
void slotBackup( int _objectId, QString _name, int& _internalId, int _groupId = -1 );
/// Called if a backup is requested by the plugins
void slotBackup( int _objectId, QString _name );
/// Called if a group restore is requested by the plugins
void slotRestoreGroup( int _groupId);
/// Called if a backup is requested by the plugins
void slotRestore( int _objectId, int _internalId = -1 );
/// A plugin wants to load a given file /// A plugin wants to load a given file
void slotLoad(QString _filename, DataType _type, int& _id); void slotLoad(QString _filename, DataType _type, int& _id);
...@@ -549,7 +526,7 @@ signals: ...@@ -549,7 +526,7 @@ signals:
void slotShowFloodFillSelectionMode(QString _handleName, bool _show, SelectionInterface::PrimitiveType _associatedTypes); void slotShowFloodFillSelectionMode(QString _handleName, bool _show, SelectionInterface::PrimitiveType _associatedTypes);
/// SelectionInterface: Called when toggle selection operation has been performed /// SelectionInterface: Called when toggle selection operation has been performed
void slotToggleSelection(QPoint _position, SelectionInterface::PrimitiveType _currentType, bool _deselect); void slotToggleSelection(QMouseEvent* _event, SelectionInterface::PrimitiveType _currentType, bool _deselect);
/// SelectionInterface: Called when lasso selection operation has been performed /// SelectionInterface: Called when lasso selection operation has been performed
void slotLassoSelection(QMouseEvent* _event, SelectionInterface::PrimitiveType _currentType, bool _deselect); void slotLassoSelection(QMouseEvent* _event, SelectionInterface::PrimitiveType _currentType, bool _deselect);
...@@ -561,13 +538,13 @@ signals: ...@@ -561,13 +538,13 @@ signals:
void slotSurfaceLassoSelection(QMouseEvent* _event, SelectionInterface::PrimitiveType _currentType, bool _deselect); void slotSurfaceLassoSelection(QMouseEvent* _event, SelectionInterface::PrimitiveType _currentType, bool _deselect);
/// SelectionInterface: Called when sphere selection operation has been performed /// SelectionInterface: Called when sphere selection operation has been performed
void slotSphereSelection(QPoint _position, double _radius, SelectionInterface::PrimitiveType _currentType, bool _deselect); void slotSphereSelection(QMouseEvent* _event, double _radius, SelectionInterface::PrimitiveType _currentType, bool _deselect);
/// SelectionInterface: Called when closest boundary selection operation has been performed /// SelectionInterface: Called when closest boundary selection operation has been performed
void slotClosestBoundarySelection(QPoint _position, SelectionInterface::PrimitiveType _currentType, bool _deselect); void slotClosestBoundarySelection(QMouseEvent* _event, SelectionInterface::PrimitiveType _currentType, bool _deselect);
/// SelectionInterface: Called when flood fill selection operation has been performed /// SelectionInterface: Called when flood fill selection operation has been performed
void slotFloodFillSelection(QPoint _position, double _maxAngle, SelectionInterface::PrimitiveType _currentType, bool _deselect); void slotFloodFillSelection(QMouseEvent* _event, double _maxAngle, SelectionInterface::PrimitiveType _currentType, bool _deselect);
/// SelectionInterface: Called when custom selection operation has been performed /// SelectionInterface: Called when custom selection operation has been performed
void slotCustomSelection(QMouseEvent* _event, SelectionInterface::PrimitiveType _currentType, QString _customIdentifier, bool _deselect); void slotCustomSelection(QMouseEvent* _event, SelectionInterface::PrimitiveType _currentType, QString _customIdentifier, bool _deselect);
...@@ -933,6 +910,9 @@ private slots: ...@@ -933,6 +910,9 @@ private slots:
/// Open Recent file /// Open Recent file
void slotRecentOpen(QAction* _action); void slotRecentOpen(QAction* _action);
/// Slot for generating type specific backups
void slotGenerateBackup( int _id, QString _name, UpdateType _type );
public slots: public slots:
/// Add a Toolbox from a plugin or from scripting /// Add a Toolbox from a plugin or from scripting
......
...@@ -1126,13 +1126,13 @@ void Core::loadPlugin(QString filename, bool silent, QString& _licenseErrors, QO ...@@ -1126,13 +1126,13 @@ void Core::loadPlugin(QString filename, bool silent, QString& _licenseErrors, QO
connect(this , SIGNAL(showFloodFillSelectionMode(QString,bool,SelectionInterface::PrimitiveType)), connect(this , SIGNAL(showFloodFillSelectionMode(QString,bool,SelectionInterface::PrimitiveType)),
plugin , SLOT(slotShowFloodFillSelectionMode(QString,bool,SelectionInterface::PrimitiveType)),Qt::DirectConnection); plugin , SLOT(slotShowFloodFillSelectionMode(QString,bool,SelectionInterface::PrimitiveType)),Qt::DirectConnection);
if ( checkSignal(plugin,"toggleSelection(QPoint,SelectionInterface::PrimitiveType,bool)") ) if ( checkSignal(plugin,"toggleSelection(QMouseEvent*,SelectionInterface::PrimitiveType,bool)") )
connect(plugin , SIGNAL(toggleSelection(QPoint,SelectionInterface::PrimitiveType,bool)), connect(plugin , SIGNAL(toggleSelection(QMouseEvent*,SelectionInterface::PrimitiveType,bool)),
this , SLOT(slotToggleSelection(QPoint,SelectionInterface::PrimitiveType,bool)),Qt::DirectConnection); this , SLOT(slotToggleSelection(QMouseEvent*,SelectionInterface::PrimitiveType,bool)),Qt::DirectConnection);
if ( checkSlot( plugin , "slotToggleSelection(QPoint,SelectionInterface::PrimitiveType,bool)" ) ) if ( checkSlot( plugin , "slotToggleSelection(QMouseEvent*,SelectionInterface::PrimitiveType,bool)" ) )
connect(this , SIGNAL(toggleSelection(QPoint,SelectionInterface::PrimitiveType,bool)), connect(this , SIGNAL(toggleSelection(QMouseEvent*,SelectionInterface::PrimitiveType,bool)),
plugin , SLOT(slotToggleSelection(QPoint,SelectionInterface::PrimitiveType,bool)),Qt::DirectConnection); plugin , SLOT(slotToggleSelection(QMouseEvent*,SelectionInterface::PrimitiveType,bool)),Qt::DirectConnection);
if ( checkSignal(plugin,"lassoSelection(QMouseEvent*,SelectionInterface::PrimitiveType,bool)") ) if ( checkSignal(plugin,"lassoSelection(QMouseEvent*,SelectionInterface::PrimitiveType,bool)") )
connect(plugin , SIGNAL(lassoSelection(QMouseEvent*,SelectionInterface::PrimitiveType,bool)), connect(plugin , SIGNAL(lassoSelection(QMouseEvent*,SelectionInterface::PrimitiveType,bool)),
...@@ -1158,29 +1158,29 @@ void Core::loadPlugin(QString filename, bool silent, QString& _licenseErrors, QO ...@@ -1158,29 +1158,29 @@ void Core::loadPlugin(QString filename, bool silent, QString& _licenseErrors, QO
connect(this , SIGNAL(surfaceLassoSelection(QMouseEvent*,SelectionInterface::PrimitiveType,bool)), connect(this , SIGNAL(surfaceLassoSelection(QMouseEvent*,SelectionInterface::PrimitiveType,bool)),
plugin , SLOT(slotSurfaceLassoSelection(QMouseEvent*,SelectionInterface::PrimitiveType,bool)),Qt::DirectConnection); plugin , SLOT(slotSurfaceLassoSelection(QMouseEvent*,SelectionInterface::PrimitiveType,bool)),Qt::DirectConnection);
if ( checkSignal(plugin,"sphereSelection(QPoint,double,SelectionInterface::PrimitiveType,bool)") ) if ( checkSignal(plugin,"sphereSelection(QMouseEvent*,double,SelectionInterface::PrimitiveType,bool)") )
connect(plugin , SIGNAL(sphereSelection(QPoint,double,SelectionInterface::PrimitiveType,bool)), connect(plugin , SIGNAL(sphereSelection(QMouseEvent*,double,SelectionInterface::PrimitiveType,bool)),
this , SLOT(slotSphereSelection(QPoint,double,SelectionInterface::PrimitiveType,bool)),Qt::DirectConnection); this , SLOT(slotSphereSelection(QMouseEvent*,double,SelectionInterface::PrimitiveType,bool)),Qt::DirectConnection);
if ( checkSlot( plugin , "slotSphereSelection(QPoint,double,SelectionInterface::PrimitiveType,bool)" ) ) if ( checkSlot( plugin , "slotSphereSelection(QMouseEvent*,double,SelectionInterface::PrimitiveType,bool)" ) )
connect(this , SIGNAL(sphereSelection(QPoint,double,SelectionInterface::PrimitiveType,bool)), connect(this , SIGNAL(sphereSelection(QMouseEvent*,double,SelectionInterface::PrimitiveType,bool)),
plugin , SLOT(slotSphereSelection(QPoint,double,SelectionInterface::PrimitiveType,bool)),Qt::DirectConnection); plugin , SLOT(slotSphereSelection(QMouseEvent*,double,SelectionInterface::PrimitiveType,bool)),Qt::DirectConnection);
if ( checkSignal(plugin,"closestBoundarySelection(QPoint,SelectionInterface::PrimitiveType,bool)") ) if ( checkSignal(plugin,"closestBoundarySelection(QMouseEvent*,SelectionInterface::PrimitiveType,bool)") )
connect(plugin , SIGNAL(closestBoundarySelection(QPoint,SelectionInterface::PrimitiveType,bool)), connect(plugin , SIGNAL(closestBoundarySelection(QMouseEvent*,SelectionInterface::PrimitiveType,bool)),
this , SLOT(slotClosestBoundarySelection(QPoint,SelectionInterface::PrimitiveType,bool)),Qt::DirectConnection); this , SLOT(slotClosestBoundarySelection(QMouseEvent*,SelectionInterface::PrimitiveType,bool)),Qt::DirectConnection);
if ( checkSlot( plugin , "slotClosestBoundarySelection(QPoint,SelectionInterface::PrimitiveType,bool)" ) ) if ( checkSlot( plugin , "slotClosestBoundarySelection(QMouseEvent*,SelectionInterface::PrimitiveType,bool)" ) )
connect(this , SIGNAL(closestBoundarySelection(QPoint,SelectionInterface::PrimitiveType,bool)), connect(this , SIGNAL(closestBoundarySelection(QMouseEvent*,SelectionInterface::PrimitiveType,bool)),
plugin , SLOT(slotClosestBoundarySelection(QPoint,SelectionInterface::PrimitiveType,bool)),Qt::DirectConnection); plugin , SLOT(slotClosestBoundarySelection(QMouseEvent*,SelectionInterface::PrimitiveType,bool)),Qt::DirectConnection);
if ( checkSignal(plugin,"floodFillSelection(QPoint,double,SelectionInterface::PrimitiveType,bool)") ) if ( checkSignal(plugin,"floodFillSelection(QMouseEvent*,double,SelectionInterface::PrimitiveType,bool)") )
connect(plugin , SIGNAL(floodFillSelection(QPoint,double,SelectionInterface::PrimitiveType,bool)), connect(plugin , SIGNAL(floodFillSelection(QMouseEvent*,double,SelectionInterface::PrimitiveType,bool)),
this , SLOT(slotFloodFillSelection(QPoint,double,SelectionInterface::PrimitiveType,bool)),Qt::DirectConnection); this , SLOT(slotFloodFillSelection(QMouseEvent*,double,SelectionInterface::PrimitiveType,bool)),Qt::DirectConnection);
if ( checkSlot( plugin , "slotFloodFillSelection(QPoint,double,SelectionInterface::PrimitiveType,bool)" ) ) if ( checkSlot( plugin , "slotFloodFillSelection(QMouseEvent*,double,SelectionInterface::PrimitiveType,bool)" ) )
connect(this , SIGNAL(floodFillSelection(QPoint,double,SelectionInterface::PrimitiveType,bool)), connect(this , SIGNAL(floodFillSelection(QMouseEvent*,double,SelectionInterface::PrimitiveType,bool)),
plugin , SLOT(slotFloodFillSelection(QPoint,double,SelectionInterface::PrimitiveType,bool)),Qt::DirectConnection); plugin , SLOT(slotFloodFillSelection(QMouseEvent*,double,SelectionInterface::PrimitiveType,bool)),Qt::DirectConnection);
if ( checkSignal(plugin,"customSelection(QMouseEvent*,SelectionInterface::PrimitiveType,QString,bool)") ) if ( checkSignal(plugin,"customSelection(QMouseEvent*,SelectionInterface::PrimitiveType,QString,bool)") )
connect(plugin , SIGNAL(customSelection(QMouseEvent*,SelectionInterface::PrimitiveType,QString,bool)), connect(plugin , SIGNAL(customSelection(QMouseEvent*,SelectionInterface::PrimitiveType,QString,bool)),
...@@ -1420,72 +1420,75 @@ void Core::loadPlugin(QString filename, bool silent, QString& _licenseErrors, QO ...@@ -1420,72 +1420,75 @@ void Core::loadPlugin(QString filename, bool silent, QString& _licenseErrors, QO
if ( backupPlugin ) { if ( backupPlugin ) {
supported = supported + "Backups "; supported = supported + "Backups ";
// Incoming Signal that a backup group should be created // Incoming Signal that a backup should be created
// send to local slot generating group id and delivers to all other plugins if ( checkSignal( plugin , "createBackup(int,QString,UpdateType)" ) ) {
if ( checkSignal( plugin , "createBackupGroup(QString,int&)" ) ) { connect(plugin , SIGNAL(createBackup(int,QString,UpdateType)) ,
connect(plugin , SIGNAL(createBackupGroup(QString , int&)) , this , SIGNAL(createBackup(int,QString,UpdateType)),Qt::DirectConnection );
this , SLOT(slotBackupGroup(QString , int&)),Qt::DirectConnection );
} }
// Signal send from core to plugins that they should create a backup group // Signal send from core to plugins that they should create a backup
if ( checkSlot( plugin , "slotBackupGroup(QString,int)" ) ) { if ( checkSlot( plugin , "slotCreateBackup(int,QString,UpdateType)" ) ) {
connect(this , SIGNAL(createBackupGroup(QString,int)) , connect(this , SIGNAL(createBackup(int,QString,UpdateType)),
plugin , SLOT( slotBackupGroup(QString,int) ),Qt::DirectConnection); plugin , SLOT( slotCreateBackup(int,QString,UpdateType) ),Qt::DirectConnection);
} }
// Incoming Signal that a backup should be created // Incoming Signal that a backup should be created
// send to local slot generating backup id and delivers to all other plugins if ( checkSignal( plugin , "createBackup(IdList,QString,std::vector<UpdateType>)" ) ) {
if ( checkSignal( plugin , "createBackup(int,QString,int&,int)" ) ) { connect(plugin , SIGNAL(createBackup(IdList,QString,std::vector<UpdateType>)) ,
connect(plugin , SIGNAL(createBackup( int , QString , int&, int)) , this , SIGNAL(createBackup(IdList,QString,std::vector<UpdateType>)),Qt::DirectConnection );
this , SLOT(slotBackup( int , QString , int&, int)),Qt::DirectConnection );
} }
// send to local slot generating backup id and delivers to all other plugins
if ( checkSignal( plugin , "createBackup(int,QString)" ) ) {
connect(plugin , SIGNAL(createBackup( int , QString)) ,
this , SLOT(slotBackup( int , QString)),Qt::DirectConnection );
}
// Signal send from core to plugins that they should create a backup // Signal send from core to plugins that they should create a backup
if ( checkSlot( plugin , "slotBackup(int,QString,int,int)" ) ) { if ( checkSlot( plugin , "slotCreateBackup(IdList,QString,std::vector<UpdateType>)" ) ) {
connect(this , SIGNAL(createBackup(int,QString,int,int)) , connect(this , SIGNAL(createBackup(IdList,QString,std::vector<UpdateType>)),
plugin , SLOT( slotBackup(int,QString,int,int) ),Qt::DirectConnection); plugin , SLOT( slotCreateBackup(IdList,QString,std::vector<UpdateType>) ),Qt::DirectConnection);
} }
// Signal send from plugin to core that a backup should be made persistent
if ( checkSignal( plugin , "makeBackupPersistent(int,int)" ) ) { // Signal from plugin to restore an object with the given id
connect(plugin , SIGNAL(makeBackupPersistent(int,int)) , if ( checkSignal( plugin , "undo(int)" ) ) {
this , SIGNAL( makeBackupPersistent(int,int)) ,Qt::DirectConnection); connect(plugin , SIGNAL(undo(int)) ,
this , SIGNAL(undo(int)),Qt::DirectConnection );
} }
// Signal send from core to Backup plugin that the given backup should be persistent // Signal send from core to backup plugin that it should restore the given object
if ( checkSlot( plugin , "slotMakeBackupPersistent(int,int)" ) ) { if ( checkSlot( plugin , "slotUndo(int)" ) ) {
connect(this , SIGNAL(makeBackupPersistent(int,int)) , connect(this , SIGNAL(undo(int)),
plugin , SLOT( slotMakeBackupPersistent(int,int) ),Qt::DirectConnection); plugin , SLOT( slotUndo(int) ),Qt::DirectConnection);
} }
// Signal from plugin to restore an object with the given id // Signal from plugin to restore an object with the given id
if ( checkSignal( plugin , "restoreObject(int,int)" ) ) { if ( checkSignal( plugin , "redo(int)" ) ) {
connect(plugin , SIGNAL(restoreObject(int,int)) , connect(plugin , SIGNAL(redo(int)) ,
this , SLOT(slotRestore( int , int)),Qt::DirectConnection ); this , SIGNAL(redo(int)),Qt::DirectConnection );
} }
// Signal send from core to backup plugin that it should restore the given object // Signal send from core to backup plugin that it should restore the given object
if ( checkSlot( plugin , "slotRestoreObject(int,int)" ) ) { if ( checkSlot( plugin , "slotRedo(int)" ) ) {
connect(this , SIGNAL(restoreObject(int,int)) , connect(this , SIGNAL(redo(int)),
plugin , SLOT( slotRestoreObject(int,int) ),Qt::DirectConnection); plugin , SLOT( slotRedo(int) ),Qt::DirectConnection);
} }
// Signal from plugin to restore an object with the given id
if ( checkSignal( plugin , "undo()" ) ) {
connect(plugin , SIGNAL(undo()) ,
this , SIGNAL(undo()),Qt::DirectConnection );
}
// Signal send from core to backup plugin that it should restore the given object
if ( checkSlot( plugin , "slotUndo()" ) ) {
connect(this , SIGNAL(undo()),
plugin , SLOT( slotUndo() ),Qt::DirectConnection);
}
// Signal from plugin to restore a group with the given id // Signal from plugin to restore an object with the given id
if ( checkSignal( plugin , "restoreGroup(int)" ) ) { if ( checkSignal( plugin , "redo()" ) ) {
connect(plugin , SIGNAL(restoreGroup(int)) , connect(plugin , SIGNAL(redo()) ,
this , SLOT(slotRestoreGroup(int)),Qt::DirectConnection ); this , SIGNAL(redo()),Qt::DirectConnection );
} }
// Signal send from core to backup plugin that it should restore the given group // Signal send from core to backup plugin that it should restore the given object
if ( checkSlot( plugin , "slotRestoreGroup(int)" ) ) { if ( checkSlot( plugin , "slotRedo()" ) ) {
connect(this , SIGNAL(restoreGroup(int)) , connect(this , SIGNAL(redo()),
plugin , SLOT( slotRestoreGroup(int) ),Qt::DirectConnection); plugin , SLOT( slotRedo() ),Qt::DirectConnection);
} }
//==================================================================================== //====================================================================================
...@@ -1493,21 +1496,21 @@ void Core::loadPlugin(QString filename, bool silent, QString& _licenseErrors, QO ...@@ -1493,21 +1496,21 @@ void Core::loadPlugin(QString filename, bool silent, QString& _licenseErrors, QO
//==================================================================================== //====================================================================================
// Stage one : restore will happen soon // Stage one : restore will happen soon
if ( checkSignal( plugin , "aboutToRestore(int,int)" ) ) { if ( checkSignal( plugin , "aboutToRestore(int,UpdateType)" ) ) {
connect(plugin , SIGNAL( aboutToRestore(int,int)) , connect(plugin , SIGNAL( aboutToRestore(int,UpdateType)) ,
this , SIGNAL( aboutToRestore(int,int) ),Qt::DirectConnection); this , SIGNAL( aboutToRestore(int,UpdateType) ),Qt::DirectConnection);
} }
// Stage two: Core restore done, plugins should restore // Stage two: Core restore done, plugins should restore
if ( checkSignal( plugin , "restore(int,int)" ) ) { if ( checkSignal( plugin , "restore(int,UpdateType)" ) ) {
connect(plugin , SIGNAL(restore(int,int)) , connect(plugin , SIGNAL(restore(int,UpdateType)) ,
this , SIGNAL( restore(int,int) ),Qt::DirectConnection); this , SIGNAL( restore(int,UpdateType) ),Qt::DirectConnection);
} }
// Stage three: Restore complete // Stage three: Restore complete
if ( checkSignal( plugin , "restored(int,int)" ) ) { if ( checkSignal( plugin , "restored(int,UpdateType)" ) ) {
connect(plugin , SIGNAL(restored(int,int)) , connect(plugin , SIGNAL(restored(int,UpdateType)) ,
this , SIGNAL( restored(int,int) ),Qt::DirectConnection); this , SIGNAL( restored(int,UpdateType) ),Qt::DirectConnection);
} }
//==================================================================================== //====================================================================================
...@@ -1515,23 +1518,28 @@ void Core::loadPlugin(QString filename, bool silent, QString& _licenseErrors, QO ...@@ -1515,23 +1518,28 @@ void Core::loadPlugin(QString filename, bool silent, QString& _licenseErrors, QO
//==================================================================================== //====================================================================================
// Stage one : restore will happen soon // Stage one : restore will happen soon
if ( checkSlot( plugin , "slotAboutToRestore(int,int)" ) ) { if ( checkSlot( plugin , "slotAboutToRestore(int,UpdateType)" ) ) {
connect(this , SIGNAL( aboutToRestore(int,int)) , connect(this , SIGNAL( aboutToRestore(int,UpdateType)) ,
plugin , SLOT( slotAboutToRestore(int,int) ),Qt::DirectConnection); plugin , SLOT( slotAboutToRestore(int,UpdateType) ),Qt::DirectConnection);
} }
// Stage one : restore will happen soon // Stage one : restore will happen soon
if ( checkSlot( plugin , "slotRestore(int,int)" ) ) { if ( checkSlot( plugin , "slotRestore(int,UpdateType)" ) ) {
connect(this , SIGNAL( restore(int,int)) , connect(this , SIGNAL( restore(int,UpdateType)) ,
plugin , SLOT( slotRestore(int,int) ),Qt::DirectConnection); plugin , SLOT( slotRestore(int,UpdateType) ),Qt::DirectConnection);
} }
// Stage one : restore will happen soon // Stage one : restore will happen soon
if ( checkSlot( plugin , "slotRestored(int,int)" ) ) { if ( checkSlot( plugin , "slotRestored(int,UpdateType)" ) ) {
connect(this , SIGNAL( restored(int,int)) , connect(this , SIGNAL( restored(int,UpdateType)) ,
plugin , SLOT( slotRestored(int,int) ),Qt::DirectConnection); plugin , SLOT( slotRestored(int,UpdateType) ),Qt::DirectConnection);
}
// Signal from plugin to restore a group with the given id
if ( checkSignal( plugin , "generateBackup(int,QString,UpdateType)" ) ) {
connect(plugin , SIGNAL(generateBackup(int,QString,UpdateType)) ,
this , SLOT(slotGenerateBackup(int,QString,UpdateType)),Qt::DirectConnection );
} }
} }
//Check if the plugin supports LoadSave-Interface //Check if the plugin supports LoadSave-Interface
......
...@@ -110,8 +110,8 @@ void Core::slotShowFloodFillSelectionMode(QString _handleName, bool _show, Selec ...@@ -110,8 +110,8 @@ void Core::slotShowFloodFillSelectionMode(QString _handleName, bool _show, Selec
emit showFloodFillSelectionMode(_handleName, _show, _associatedTypes); emit showFloodFillSelectionMode(_handleName, _show, _associatedTypes);
} }
void Core::slotToggleSelection(QPoint _position, SelectionInterface::PrimitiveType _currentType, bool _deselect) { void Core::slotToggleSelection(QMouseEvent* _event, SelectionInterface::PrimitiveType _currentType, bool _deselect) {
emit toggleSelection(_position, _currentType, _deselect); emit toggleSelection(_event, _currentType, _deselect);
} }
void Core::slotLassoSelection(QMouseEvent* _event, SelectionInterface::PrimitiveType _currentType, bool _deselect) { void Core::slotLassoSelection(QMouseEvent* _event, SelectionInterface::PrimitiveType _currentType, bool _deselect) {
...@@ -126,16 +126,16 @@ void Core::slotSurfaceLassoSelection(QMouseEvent* _event, SelectionInterface::Pr ...@@ -126,16 +126,16 @@ void Core::slotSurfaceLassoSelection(QMouseEvent* _event, SelectionInterface::Pr
emit surfaceLassoSelection(_event, _currentType, _deselect); emit surfaceLassoSelection(_event, _currentType, _deselect);
} }
void Core::slotSphereSelection(QPoint _position, double _radius, SelectionInterface::PrimitiveType _currentType, bool _deselect) { void Core::slotSphereSelection(QMouseEvent* _event, double _radius, SelectionInterface::PrimitiveType _currentType, bool _deselect) {
emit sphereSelection(_position, _radius, _currentType, _deselect); emit sphereSelection(_event, _radius, _currentType, _deselect);
} }