BackupPlugin.cc 14.4 KB
Newer Older
Jan Möbius's avatar
Jan Möbius committed
1
/*===========================================================================*\
Jan Möbius's avatar
Jan Möbius committed
2
3
*                                                                            *
*                              OpenFlipper                                   *
Jan Möbius's avatar
Jan Möbius committed
4
*      Copyright (C) 2001-2014 by Computer Graphics Group, RWTH Aachen       *
Jan Möbius's avatar
Jan Möbius committed
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
*                           www.openflipper.org                              *
*                                                                            *
*--------------------------------------------------------------------------- *
*  This file is part of OpenFlipper.                                         *
*                                                                            *
*  OpenFlipper is free software: you can redistribute it and/or modify       *
*  it under the terms of the GNU Lesser General Public License as            *
*  published by the Free Software Foundation, either version 3 of            *
*  the License, or (at your option) any later version with the               *
*  following exceptions:                                                     *
*                                                                            *
*  If other files instantiate templates or use macros                        *
*  or inline functions from this file, or you compile this file and          *
*  link it with other files to produce an executable, this file does         *
*  not by itself cause the resulting executable to be covered by the         *
*  GNU Lesser General Public License. This exception does not however        *
*  invalidate any other reasons why the executable file might be             *
*  covered by the GNU Lesser General Public License.                         *
*                                                                            *
*  OpenFlipper is distributed in the hope that it will be useful,            *
*  but WITHOUT ANY WARRANTY; without even the implied warranty of            *
*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the             *
*  GNU Lesser General Public License for more details.                       *
*                                                                            *
*  You should have received a copy of the GNU LesserGeneral Public           *
*  License along with OpenFlipper. If not,                                   *
*  see <http://www.gnu.org/licenses/>.                                       *
*                                                                            *
Jan Möbius's avatar
Jan Möbius committed
33
34
35
\*===========================================================================*/

/*===========================================================================*\
Jan Möbius's avatar
Jan Möbius committed
36
37
38
39
40
*                                                                            *
*   $Revision$                                                       *
*   $LastChangedBy$                                                *
*   $Date$                     *
*                                                                            *
Jan Möbius's avatar
Jan Möbius committed
41
\*===========================================================================*/
Jan Möbius's avatar
 
Jan Möbius committed
42

43
#include "BackupPlugin.hh"
Matthias Möller's avatar
Matthias Möller committed
44
45
46
47
48
49
#if QT_VERSION >= 0x050000 
  #include <QtWidgets>
#else
  #include <QtGui>
#endif

Jan Möbius's avatar
 
Jan Möbius committed
50
51
52
53
#include <iostream>
#include <OpenFlipper/BasePlugin/PluginFunctions.hh>
#include <OpenFlipper/common/GlobalOptions.hh>

Dirk Wilden's avatar
Dirk Wilden committed
54
#include "GroupBackup.hh"
Jan Möbius's avatar
 
Jan Möbius committed
55

56
57
58
59
60
61
62
63
64
65
66
67
68
69
//-----------------------------------------------------------------------------
BackupPlugin::BackupPlugin():
backupMenu_(0),
backupsEnabledAction_(0),
undoMenuAction_(0),
redoMenuAction_(0),
undoToolAction_(0),
redoToolAction_(0),
undoContextAction_(0),
redoContextAction_(0)
{

}

Dirk Wilden's avatar
Dirk Wilden committed
70
//-----------------------------------------------------------------------------
Jan Möbius's avatar
 
Jan Möbius committed
71
72
73
74
75
76
77

void BackupPlugin::pluginsInitialized() {

  // Create Backup menu
  emit getMenubarMenu(tr("&Backup"), backupMenu_, true );

  if ( OpenFlipper::Options::gui() ) {
Dirk Wilden's avatar
Dirk Wilden committed
78
    //construct the menu
Jan Möbius's avatar
 
Jan Möbius committed
79
80
81
    backupsEnabledAction_ = new QAction("Backups Enabled",0);
    backupsEnabledAction_->setCheckable(true);
    connect (backupsEnabledAction_, SIGNAL(triggered(bool)), this, SLOT(slotEnableDisableBackups()) );
82

Dirk Wilden's avatar
Dirk Wilden committed
83
84
85
86
    undoMenuAction_ = new QAction(tr("&Undo"), this);
    undoMenuAction_->setEnabled(false);
    undoMenuAction_->setStatusTip(tr("Undo the last action."));
    undoMenuAction_->setIcon(QIcon(OpenFlipper::Options::iconDirStr()+OpenFlipper::Options::dirSeparator()+"edit-undo.png") );
87
    connect(undoMenuAction_, SIGNAL(triggered()), this, SIGNAL( undo() ) );
88

Dirk Wilden's avatar
Dirk Wilden committed
89
90
91
92
    redoMenuAction_ = new QAction(tr("&Redo"), this);
    redoMenuAction_->setEnabled(false);
    redoMenuAction_->setStatusTip(tr("Redo the last action"));
    redoMenuAction_->setIcon(QIcon(OpenFlipper::Options::iconDirStr()+OpenFlipper::Options::dirSeparator()+"edit-redo.png") );
93
    connect(redoMenuAction_, SIGNAL(triggered()), this, SIGNAL( redo() ) );
Dirk Wilden's avatar
Dirk Wilden committed
94
95
96
97
98

    backupMenu_->addAction(undoMenuAction_);
    backupMenu_->addAction(redoMenuAction_);
    backupMenu_->addSeparator();
    backupMenu_->addAction(backupsEnabledAction_);
Jan Möbius's avatar
 
Jan Möbius committed
99
100
101

    // Add a backup Toolbar
    QToolBar* toolbar = new QToolBar("Backup Toolbar");
102

Jan Möbius's avatar
 
Jan Möbius committed
103
    //Undo
Dirk Wilden's avatar
Dirk Wilden committed
104
105
106
107
    undoToolAction_ = new QAction(tr("&Undo"), this);
    undoToolAction_->setEnabled(false);
    undoToolAction_->setStatusTip(tr("Undo the last action."));
    undoToolAction_->setIcon(QIcon(OpenFlipper::Options::iconDirStr()+OpenFlipper::Options::dirSeparator()+"edit-undo.png") );
108
    connect(undoToolAction_, SIGNAL(triggered()), this, SIGNAL( undo() ) );
Dirk Wilden's avatar
Dirk Wilden committed
109
    toolbar->addAction(undoToolAction_);
110

Jan Möbius's avatar
 
Jan Möbius committed
111
    //Redo
Dirk Wilden's avatar
Dirk Wilden committed
112
113
114
115
    redoToolAction_ = new QAction(tr("&Redo"), this);
    redoToolAction_->setEnabled(false);
    redoToolAction_->setStatusTip(tr("Redo the last action"));
    redoToolAction_->setIcon(QIcon(OpenFlipper::Options::iconDirStr()+OpenFlipper::Options::dirSeparator()+"edit-redo.png") );
116
    connect(redoToolAction_, SIGNAL(triggered()), this, SIGNAL( redo() ) );
Dirk Wilden's avatar
Dirk Wilden committed
117
    toolbar->addAction(redoToolAction_);
118

Jan Möbius's avatar
 
Jan Möbius committed
119
    emit addToolbar( toolbar );
120

Jan Möbius's avatar
 
Jan Möbius committed
121
122
123
    //the release event does not contain the modifier
    emit registerKey(Qt::Key_Z,  Qt::ControlModifier, tr("Undo Action"));
    emit registerKey(Qt::Key_Z, (Qt::ControlModifier | Qt::ShiftModifier),   tr("Redo Action"));
124

Dirk Wilden's avatar
Dirk Wilden committed
125
126
127
128
129
130
131
132
133
134
135
136
137
138
    //add actions for the context menu
    undoContextAction_ = new QAction(tr("&Undo"), this);
    undoContextAction_->setEnabled(false);
    undoContextAction_->setStatusTip(tr("Undo the last action."));
    undoContextAction_->setIcon(QIcon(OpenFlipper::Options::iconDirStr()+OpenFlipper::Options::dirSeparator()+"edit-undo.png") );
    connect(undoContextAction_, SIGNAL(triggered()), this, SLOT(slotObjectUndo()) );
    emit addContextMenuItem(undoContextAction_, DATA_ALL, CONTEXTOBJECTMENU);

    redoContextAction_ = new QAction(tr("&Redo"), this);
    redoContextAction_->setEnabled(false);
    redoContextAction_->setStatusTip(tr("Redo the last action"));
    redoContextAction_->setIcon(QIcon(OpenFlipper::Options::iconDirStr()+OpenFlipper::Options::dirSeparator()+"edit-redo.png") );
    connect(redoContextAction_, SIGNAL(triggered()), this, SLOT(slotObjectRedo()) );
    emit addContextMenuItem(redoContextAction_, DATA_ALL, CONTEXTOBJECTMENU);
Jan Möbius's avatar
 
Jan Möbius committed
139
140
141
  }
}

Dirk Wilden's avatar
Dirk Wilden committed
142
143
//-----------------------------------------------------------------------------

Jan Möbius's avatar
 
Jan Möbius committed
144
void BackupPlugin::slotAllCleared(){
Dirk Wilden's avatar
Dirk Wilden committed
145
146
  globalBackup_.clear();
}
Jan Möbius's avatar
 
Jan Möbius committed
147

Dirk Wilden's avatar
Dirk Wilden committed
148
149
150
//-----------------------------------------------------------------------------

void BackupPlugin::updateButtons() {
151

Dirk Wilden's avatar
Dirk Wilden committed
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
  if ( globalBackup_.undoAvailable() ){
    undoMenuAction_->setText( tr("Undo '%1'").arg( globalBackup_.undoName() ) );
    undoMenuAction_->setEnabled(true);
    undoToolAction_->setText( tr("Undo '%1'").arg( globalBackup_.undoName() ) );
    undoToolAction_->setEnabled(true);
  } else {
    undoMenuAction_->setText( tr("Undo") );
    undoMenuAction_->setEnabled(false);
    undoToolAction_->setText( tr("Undo") );
    undoToolAction_->setEnabled(false);
  }

  if ( globalBackup_.redoAvailable() ){
    redoMenuAction_->setText( tr("Redo '%1'").arg( globalBackup_.redoName() ) );
    redoMenuAction_->setEnabled(true);
    redoToolAction_->setText( tr("Redo '%1'").arg( globalBackup_.redoName() ) );
    redoToolAction_->setEnabled(true);
  } else {
    redoMenuAction_->setText( tr("Redo") );
    redoMenuAction_->setEnabled(false);
    redoToolAction_->setText( tr("Redo") );
    redoToolAction_->setEnabled(false);
  }
Jan Möbius's avatar
 
Jan Möbius committed
175

Dirk Wilden's avatar
Dirk Wilden committed
176
  backupsEnabledAction_->setChecked( OpenFlipper::Options::backupEnabled() );
Jan Möbius's avatar
 
Jan Möbius committed
177
178
}

Dirk Wilden's avatar
Dirk Wilden committed
179
180
//-----------------------------------------------------------------------------

Jan Möbius's avatar
 
Jan Möbius committed
181
182
183
184
void BackupPlugin::slotEnableDisableBackups() {
  OpenFlipper::Options::enableBackup(backupsEnabledAction_->isChecked());
}

Dirk Wilden's avatar
Dirk Wilden committed
185
186
//-----------------------------------------------------------------------------

Jan Möbius's avatar
 
Jan Möbius committed
187
188
189
190
191
void BackupPlugin::slotKeyEvent( QKeyEvent* _event ){
   switch (_event->key())
   {
      case Qt::Key_Z :
         if ( _event->modifiers() == Qt::ControlModifier )
Dirk Wilden's avatar
Dirk Wilden committed
192
           emit undo();
Jan Möbius's avatar
 
Jan Möbius committed
193
         else if ( _event->modifiers() == (Qt::ControlModifier | Qt::ShiftModifier) )
Dirk Wilden's avatar
Dirk Wilden committed
194
           emit redo();
Jan Möbius's avatar
 
Jan Möbius committed
195
196
197
198
199
200
         break;
      default:
         break;
  }
}

Dirk Wilden's avatar
Dirk Wilden committed
201
202
//-----------------------------------------------------------------------------

Jan Möbius's avatar
 
Jan Möbius committed
203
204
205
void BackupPlugin::objectDeleted(int _objectid) {
}

Dirk Wilden's avatar
Dirk Wilden committed
206
//-----------------------------------------------------------------------------
Jan Möbius's avatar
 
Jan Möbius committed
207

Dirk Wilden's avatar
Dirk Wilden committed
208
void BackupPlugin::slotUpdateContextMenu( int _objectId ){
Jan Möbius's avatar
 
Jan Möbius committed
209

Dirk Wilden's avatar
Dirk Wilden committed
210
211
212
213
214
  //disable everything
  undoContextAction_->setText( tr("Undo") );
  undoContextAction_->setEnabled(false);
  redoContextAction_->setText( tr("Redo") );
  redoContextAction_->setEnabled(false);
Jan Möbius's avatar
 
Jan Möbius committed
215

Dirk Wilden's avatar
Dirk Wilden committed
216
217
218
  //get backup data
  BaseObjectData* object = 0;
  PluginFunctions::getObject(_objectId, object);
Jan Möbius's avatar
 
Jan Möbius committed
219

Dirk Wilden's avatar
Dirk Wilden committed
220
  if ( object != 0 ){
Jan Möbius's avatar
 
Jan Möbius committed
221

Dirk Wilden's avatar
Dirk Wilden committed
222
    if ( object->hasObjectData( OBJECT_BACKUPS ) ){
Jan Möbius's avatar
Jan Möbius committed
223
224
225

      //get backup object data
      BackupData* backupData = dynamic_cast< BackupData* >(object->objectData(OBJECT_BACKUPS));
Jan Möbius's avatar
 
Jan Möbius committed
226

Dirk Wilden's avatar
Dirk Wilden committed
227
228
229
230
231
      if ( backupData->undoAvailable() ){
        undoContextAction_->setData(_objectId);
        undoContextAction_->setText( tr("Undo '%1'").arg( backupData->undoName() ) );
        undoContextAction_->setEnabled( !backupData->undoBlocked() );
      }
Jan Möbius's avatar
 
Jan Möbius committed
232

Dirk Wilden's avatar
Dirk Wilden committed
233
234
235
236
      if ( backupData->redoAvailable() ){
        redoContextAction_->setData(_objectId);
        redoContextAction_->setText( tr("Redo '%1'").arg( backupData->redoName() ) );
        redoContextAction_->setEnabled( !backupData->redoBlocked() );
Jan Möbius's avatar
 
Jan Möbius committed
237
238
239
      }
    }
  }
Dirk Wilden's avatar
Dirk Wilden committed
240

Jan Möbius's avatar
 
Jan Möbius committed
241
242
}

Dirk Wilden's avatar
Dirk Wilden committed
243
//-----------------------------------------------------------------------------
Jan Möbius's avatar
 
Jan Möbius committed
244

Dirk Wilden's avatar
Dirk Wilden committed
245
void BackupPlugin::slotObjectUndo(){
246

Dirk Wilden's avatar
Dirk Wilden committed
247
248
  int id = undoContextAction_->data().toInt();
  emit undo(id);
Jan Möbius's avatar
 
Jan Möbius committed
249
250
}

Dirk Wilden's avatar
Dirk Wilden committed
251
//-----------------------------------------------------------------------------
Jan Möbius's avatar
 
Jan Möbius committed
252

Dirk Wilden's avatar
Dirk Wilden committed
253
void BackupPlugin::slotObjectRedo(){
254

Dirk Wilden's avatar
Dirk Wilden committed
255
256
257
  int id = undoContextAction_->data().toInt();
  emit redo(id);
}
Jan Möbius's avatar
 
Jan Möbius committed
258

Dirk Wilden's avatar
Dirk Wilden committed
259
//-----------------------------------------------------------------------------
Jan Möbius's avatar
 
Jan Möbius committed
260

Dirk Wilden's avatar
Dirk Wilden committed
261
void BackupPlugin::slotCreateBackup( int _objectid, QString _name, UpdateType _type){
262

Dirk Wilden's avatar
Dirk Wilden committed
263
264
  if ( !OpenFlipper::Options::backupEnabled() )
    return;
Jan Möbius's avatar
 
Jan Möbius committed
265

Dirk Wilden's avatar
Dirk Wilden committed
266
  BaseObjectData* object;
Jan Möbius's avatar
 
Jan Möbius committed
267

Dirk Wilden's avatar
Dirk Wilden committed
268
269
270
271
  if ( !PluginFunctions::getObject(_objectid,object) ){
    emit log(LOGWARN,"Unable to find backup object with id " + QString::number(_objectid));
    return;
  }
Jan Möbius's avatar
 
Jan Möbius committed
272

Dirk Wilden's avatar
Dirk Wilden committed
273
274
  //tell TypePlugin to Backup
  emit generateBackup( _objectid, _name, _type );
Jan Möbius's avatar
 
Jan Möbius committed
275

Dirk Wilden's avatar
Dirk Wilden committed
276
277
278
  //add global backup
  IdList groupIds;
  groupIds.push_back( _objectid );
Jan Möbius's avatar
 
Jan Möbius committed
279

Dirk Wilden's avatar
Dirk Wilden committed
280
  bool skipBackup = false;
Jan Möbius's avatar
 
Jan Möbius committed
281

Dirk Wilden's avatar
Dirk Wilden committed
282
283
284
  if ( globalBackup_.undoAvailable() ){
    //skip 'Original Object' Backups in global view
    BackupData* backupData = dynamic_cast< BackupData* >(object->objectData(OBJECT_BACKUPS));
Jan Möbius's avatar
 
Jan Möbius committed
285

Dirk Wilden's avatar
Dirk Wilden committed
286
287
288
    if ( backupData != 0 )
      skipBackup = !backupData->undoAvailable();
  }
Jan Möbius's avatar
 
Jan Möbius committed
289

Dirk Wilden's avatar
Dirk Wilden committed
290
291
292
293
  if ( !skipBackup ){
    GroupBackup* backup = new GroupBackup(groupIds, _name);
    globalBackup_.storeBackup( backup );
  }
Jan Möbius's avatar
 
Jan Möbius committed
294

Dirk Wilden's avatar
Dirk Wilden committed
295
296
297
  updateButtons();
  emit log(LOGOUT,"Created backup for " + QString::number(_objectid)+ " , Name : '" + _name + "'" );
}
Jan Möbius's avatar
 
Jan Möbius committed
298

Dirk Wilden's avatar
Dirk Wilden committed
299
//-----------------------------------------------------------------------------
Jan Möbius's avatar
 
Jan Möbius committed
300

Dirk Wilden's avatar
Dirk Wilden committed
301
void BackupPlugin::slotCreateBackup( IdList _objectids , QString _name, std::vector<UpdateType> _types){
Jan Möbius's avatar
 
Jan Möbius committed
302

Dirk Wilden's avatar
Dirk Wilden committed
303
304
  if ( !OpenFlipper::Options::backupEnabled() )
    return;
Jan Möbius's avatar
 
Jan Möbius committed
305

Dirk Wilden's avatar
Dirk Wilden committed
306
  IdList groupIds;
307

Dirk Wilden's avatar
Dirk Wilden committed
308
309
  if ( _objectids.size() != _types.size() ){
    emit log(LOGWARN,"Unable to create backup sizes of ids and updateTypes do not match!");
Jan Möbius's avatar
 
Jan Möbius committed
310
311
312
    return;
  }

Dirk Wilden's avatar
Dirk Wilden committed
313
314
  //generate backups on all objects
  for (unsigned int i=0; i < _objectids.size(); ++i){
Jan Möbius's avatar
 
Jan Möbius committed
315

Dirk Wilden's avatar
Dirk Wilden committed
316
    BaseObjectData* object;
Jan Möbius's avatar
 
Jan Möbius committed
317

Dirk Wilden's avatar
Dirk Wilden committed
318
319
320
321
    if ( !PluginFunctions::getObject(_objectids[i],object) ){
      emit log(LOGWARN,"Unable to find backup object with id " + QString::number(_objectids[i]));
      continue;
    }
Jan Möbius's avatar
 
Jan Möbius committed
322

Dirk Wilden's avatar
Dirk Wilden committed
323
324
325
326
    //tell TypePlugin to generate a backup
    emit generateBackup( _objectids[i], _name, _types[i] );
    groupIds.push_back(  _objectids[i] );
  }
Jan Möbius's avatar
 
Jan Möbius committed
327

Dirk Wilden's avatar
Dirk Wilden committed
328
  //add global backup
Jan Möbius's avatar
Typo    
Jan Möbius committed
329
  if ( ! groupIds.empty() ){
330

Dirk Wilden's avatar
Dirk Wilden committed
331
332
    GroupBackup* backup = new GroupBackup(groupIds, _name);
    globalBackup_.storeBackup( backup );
Jan Möbius's avatar
 
Jan Möbius committed
333

Dirk Wilden's avatar
Dirk Wilden committed
334
335
    updateButtons();
    emit log(LOGOUT,"Created grouped backup, Name : '" + _name + "'" );
Jan Möbius's avatar
 
Jan Möbius committed
336
337
338
  }
}

Dirk Wilden's avatar
Dirk Wilden committed
339
//-----------------------------------------------------------------------------
340

Dirk Wilden's avatar
Dirk Wilden committed
341
void BackupPlugin::slotUndo(int _objectid){
342

343
  emit aboutToRestore(_objectid);
Dirk Wilden's avatar
Dirk Wilden committed
344
  globalBackup_.undo(_objectid);
345
  emit restored(_objectid);
Dirk Wilden's avatar
Dirk Wilden committed
346
  emit updatedObject(_objectid, UPDATE_ALL);
347

Dirk Wilden's avatar
Dirk Wilden committed
348
  updateButtons();
Jan Möbius's avatar
 
Jan Möbius committed
349
350
}

Dirk Wilden's avatar
Dirk Wilden committed
351
//-----------------------------------------------------------------------------
Jan Möbius's avatar
 
Jan Möbius committed
352

Dirk Wilden's avatar
Dirk Wilden committed
353
void BackupPlugin::slotUndo(){
354
355
  GroupBackup* group = dynamic_cast< GroupBackup* >( globalBackup_.currentState() );

Isaak Lim's avatar
Isaak Lim committed
356
357
358
359
360
  if (group) {
    IdList ids = group->objectIDs();
    IdList::const_iterator it, end;
    for (it = ids.begin(), end = ids.end(); it != end; ++it)
      emit aboutToRestore(*it);
361

Isaak Lim's avatar
Isaak Lim committed
362
    globalBackup_.undo();
Jan Möbius's avatar
 
Jan Möbius committed
363

Dirk Wilden's avatar
Dirk Wilden committed
364
365
    for (unsigned int i=0; i < group->objectIDs().size(); i++)
      emit updatedObject(group->objectIDs()[i], UPDATE_ALL);
Jan Möbius's avatar
 
Jan Möbius committed
366

Isaak Lim's avatar
Isaak Lim committed
367
368
369
    updateButtons();
  } else
    emit log(LOGWARN,"Unable to find the current GroupBackup");
Dirk Wilden's avatar
Dirk Wilden committed
370
}
Jan Möbius's avatar
 
Jan Möbius committed
371

Dirk Wilden's avatar
Dirk Wilden committed
372
//-----------------------------------------------------------------------------
Jan Möbius's avatar
 
Jan Möbius committed
373

Dirk Wilden's avatar
Dirk Wilden committed
374
void BackupPlugin::slotRedo(int _objectid){
Jan Möbius's avatar
 
Jan Möbius committed
375

376
  emit aboutToRestore(_objectid);
Dirk Wilden's avatar
Dirk Wilden committed
377
  globalBackup_.redo(_objectid);
378
  emit restored(_objectid);
Dirk Wilden's avatar
Dirk Wilden committed
379
  emit updatedObject(_objectid, UPDATE_ALL);
Jan Möbius's avatar
 
Jan Möbius committed
380

Dirk Wilden's avatar
Dirk Wilden committed
381
  updateButtons();
Jan Möbius's avatar
 
Jan Möbius committed
382
383
}

Dirk Wilden's avatar
Dirk Wilden committed
384
//-----------------------------------------------------------------------------
Jan Möbius's avatar
 
Jan Möbius committed
385

Dirk Wilden's avatar
Dirk Wilden committed
386
387
void BackupPlugin::slotRedo(){
  globalBackup_.redo();
Jan Möbius's avatar
 
Jan Möbius committed
388

Dirk Wilden's avatar
Dirk Wilden committed
389
  GroupBackup* group = dynamic_cast< GroupBackup* >( globalBackup_.currentState() );
Jan Möbius's avatar
 
Jan Möbius committed
390

Dirk Wilden's avatar
Dirk Wilden committed
391
392
393
  if ( group != 0)
    for (unsigned int i=0; i < group->objectIDs().size(); i++)
      emit updatedObject(group->objectIDs()[i], UPDATE_ALL);
Jan Möbius's avatar
 
Jan Möbius committed
394

Dirk Wilden's avatar
Dirk Wilden committed
395
  updateButtons();
Jan Möbius's avatar
 
Jan Möbius committed
396
397
}

Dirk Wilden's avatar
Dirk Wilden committed
398
//-----------------------------------------------------------------------------
Jan Möbius's avatar
 
Jan Möbius committed
399

Matthias Möller's avatar
Matthias Möller committed
400
#if QT_VERSION < 0x050000
Jan Möbius's avatar
 
Jan Möbius committed
401
Q_EXPORT_PLUGIN2( backupplugin , BackupPlugin );
Matthias Möller's avatar
Matthias Möller committed
402
#endif
Jan Möbius's avatar
 
Jan Möbius committed
403