Commit 9f45f037 authored by Matthias Möller's avatar Matthias Möller

add scripting and vsi funtion to create backups

git-svn-id: http://www.openflipper.org/svnrepo/OpenFlipper/branches/Free@19592 383ad7c9-94d9-4d36-a494-682f7c89f535
parent 3b13179f
......@@ -137,6 +137,12 @@ void BackupPlugin::pluginsInitialized() {
connect(redoContextAction_, SIGNAL(triggered()), this, SLOT(slotObjectRedo()) );
emit addContextMenuItem(redoContextAction_, DATA_ALL, CONTEXTOBJECTMENU);
}
//createBackup(int _objectId, QString _name, UpdateType _type= UPDATE_ALL)
emit setSlotDescription("createBackup(int,QString)", tr("Creates a backup which can be restored via undo."),
QString("objectId,name").split(","), QString("Id of the object,name of the backup").split(","));
emit setSlotDescription("createBackup(int,QString,UpdateType)", tr("Creates a backup which can be restored via undo."),
QString("objectId,name,type").split(","), QString("Id of the object,name of the backup,updatetypes which are changed").split(","));
}
//-----------------------------------------------------------------------------
......@@ -397,6 +403,13 @@ void BackupPlugin::slotRedo(){
//-----------------------------------------------------------------------------
void BackupPlugin::createBackup(int _objectId, QString _name, UpdateType _type)
{
slotCreateBackup(_objectId,_name,_type);
}
//-----------------------------------------------------------------------------
#if QT_VERSION < 0x050000
Q_EXPORT_PLUGIN2( backupplugin , BackupPlugin );
#endif
......
......@@ -78,6 +78,8 @@ signals:
// BaseInterface
void updateView();
void updatedObject(int _identifier, const UpdateType& _type);
void setSlotDescription(QString _slotName , QString _slotDescription,
QStringList _parameters , QStringList _descriptions);
// LoggingInterface
void log(Logtype _type, QString _message);
......@@ -142,6 +144,8 @@ private slots:
public slots:
QString version() { return QString("0.1"); };
void createBackup(int _objectId, QString _name, UpdateType _type= UPDATE_ALL);
public:
~BackupPlugin() {};
BackupPlugin();
......
include (plugin)
openflipper_plugin()
openflipper_plugin(INSTALLDATA VsiMetadata)
<OpenFlipper>
<element name="backup_createBackup">
<category>Object Manipulation</category>
<short>Create Backup</short>
<long>Creates a backup which can be restored via undo.</long>
<dataflow>true</dataflow>
<inputs>
<input name="obj" type="ObjectId">
<short>ID</short>
<long>ID of an object</long>
</input>
<input name="name" type="String">
<short>Name</short>
<long>Name of the backup</long>
</input>
</inputs>
<code>
backup.createBackup([input="obj"],[input="name"]);
</code>
</element>
</OpenFlipper>
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