File: propertyEditor.C

package info (click to toggle)
ball 1.5.0%2Bgit20180813.37fc53c-3
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 239,848 kB
  • sloc: cpp: 326,149; ansic: 4,208; python: 2,303; yacc: 1,778; lex: 1,099; xml: 958; sh: 322; makefile: 93
file content (735 lines) | stat: -rw-r--r-- 18,796 bytes parent folder | download | duplicates (4)
1
2
3
4
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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
#include <BALL/VIEW/WIDGETS/propertyEditor.h>

#ifndef BALL_CONCEPT_PROPERTY_H
# include <BALL/CONCEPT/property.h>
#endif

#ifndef BALL_VIEW_KERNEL_ICONLOADER_H
# include <BALL/VIEW/KERNEL/iconLoader.h>
#endif

#include <QtWidgets/QMenu>
#include <QtWidgets/QAction>
#include <QtWidgets/QSpinBox>
#include <QtWidgets/QCheckBox>
#include <QtWidgets/QLineEdit>
#include <QtWidgets/QMessageBox>
#include <QtWidgets/QInputDialog>
#include <QtGui/QDoubleValidator>
#include <QtWidgets/QPushButton>
#include <QtWidgets/QScrollBar>

#include <limits>

namespace BALL
{
	namespace VIEW
	{
		PropertyEditor::PropertyEditor(QWidget* parent, bool editable)
			: QWidget(parent),
			  has_changes_(false),
			  is_editable_(editable),
			  manager_(0)
		{
			setupUi_();
		}

		PropertyEditor::PropertyEditor(PropertyManager* man, QWidget* parent, bool editable)
			: QWidget(parent),
			  has_changes_(false),
			  is_editable_(editable)
		{
			setupUi_();
			setPropertyManager(man);
		}

		void PropertyEditor::setEditable(bool mode)
		{
			if(is_editable_ != mode)
			{
				is_editable_ = mode;

				QObject* child;
				Q_FOREACH(child, ui_.editors->children())
				{
					PropEditorWidget* editor = qobject_cast<PropEditorWidget*>(child);
					if(editor)
					{
						editor->setEditable(is_editable_);
					}
				}
			}
		}

		bool PropertyEditor::isEditable() const
		{
			return is_editable_;
		}

		void PropertyEditor::setupUi_()
		{
			ui_.setupUi(this);

			//Insert a layout for the editors
			QBoxLayout* layout = new QBoxLayout(QBoxLayout::TopToBottom, ui_.editors);
			ui_.editors->setLayout(layout);
			layout->addStretch();

			//Setup the add_button
			ui_.add_button->setVisible(is_editable_);
			ui_.add_button->setIcon(IconLoader::instance().getIcon("actions/list-add"));

			//Create the menu which is used for the addition of new properties
			//Ideally this should be replaced by some kind of registry
			QMenu* menu = new QMenu(this);
			QAction* action = menu->addAction("Bool");
			connect(action, SIGNAL(triggered()), this, SLOT(createNewBool_()));
			action = menu->addAction("Integer");
			connect(action, SIGNAL(triggered()), this, SLOT(createNewInt_()));
			action = menu->addAction("Unsigned Integer");
			connect(action, SIGNAL(triggered()), this, SLOT(createNewUInt_()));
			action = menu->addAction("Float");
			connect(action, SIGNAL(triggered()), this, SLOT(createNewFloat_()));
			action = menu->addAction("Double");
			connect(action, SIGNAL(triggered()), this, SLOT(createNewDouble_()));
			action = menu->addAction("String");
			connect(action, SIGNAL(triggered()), this, SLOT(createNewString_()));

			ui_.add_button->setMenu(menu);
		}

		void PropertyEditor::setPropertyManager(PropertyManager* man)
		{
			manager_ = man;
			size_t num_properties = man->countNamedProperties();

			new_properties_.clear();
			deleted_properties_.clear();

			setUpdatesEnabled(false);

			//First we need to remove all
			QObject* child;
			Q_FOREACH(child, ui_.editors->children())
			{
				PropEditorWidget* editor = qobject_cast<PropEditorWidget*>(child);
				if(editor)
				{
					child->deleteLater();
				}
			}

			//And then add the properties of the new manager
			for(size_t i = 0; i < num_properties; ++i)
			{
				addProperty_(man->getNamedProperty(i));
			}

			setUpdatesEnabled(true);
		}

		void PropertyEditor::apply()
		{
			if(!has_changes_)
			{
				return;
			}

			setUpdatesEnabled(false);

			//Delete all properties which have been scheduled for deletion
			PropEditorWidget* prop;
			Q_FOREACH(prop, deleted_properties_)
			{
				deleteProperty_(prop);
			}

			//Apply all other properties
			QObject* child;
			Q_FOREACH(child, ui_.editors->children())
			{
				PropEditorWidget* editor = qobject_cast<PropEditorWidget*>(child);
				if(editor)
				{
					editor->apply(manager_, true);
				}
			}

			//Clear the lists of changes
			new_properties_.clear();
			deleted_properties_.clear();

			has_changes_ = false;

			setUpdatesEnabled(true);
		}

		void PropertyEditor::reset()
		{
			if(!has_changes_)
			{
				return;
			}

			setUpdatesEnabled(false);

			//The user discarded the newly added properties
			PropEditorWidget* prop;
			Q_FOREACH(prop, new_properties_)
			{
				deleteProperty_(prop);
			}

			//And wants us to reread the old property values
			QObject* child;
			Q_FOREACH(child, ui_.editors->children())
			{
				PropEditorWidget* editor = qobject_cast<PropEditorWidget*>(child);
				if(editor)
				{
					editor->show();
					//TODO: handle the case a property does no longer exist
					editor->reset(manager_);
				}
			}

			//Clear the lists of changes
			new_properties_.clear();
			deleted_properties_.clear();

			has_changes_ = false;

			setUpdatesEnabled(true);
		}

		/*
		 * Helpers for the creation of new editors/properties
		 */
		void PropertyEditor::createNewBool_()
		{
			QString name = chooseName_("New Bool Property");
			if(!name.isNull()) {
				NamedProperty p(name.toStdString(), false);
				new_properties_.append(addProperty_(new BoolEditorWidget(p, ui_.editors)));

				valueChanged_();
			}
		}

		void PropertyEditor::createNewInt_()
		{
			QString name = chooseName_("New Integer Property");
			if(!name.isNull()) {
				NamedProperty p(name.toStdString(), (int)0);
				new_properties_.append(addProperty_(new IntEditorWidget(p, ui_.editors)));

				valueChanged_();
			}
		}

		void PropertyEditor::createNewUInt_()
		{
			QString name = chooseName_("New Unsigned Integer Property");
			if(!name.isNull()) {
				NamedProperty p(name.toStdString(), (unsigned int)0);
				new_properties_.append(addProperty_(new UIntEditorWidget(p, ui_.editors)));

				valueChanged_();
			}
		}

		void PropertyEditor::createNewFloat_()
		{
			QString name = chooseName_("New Float Property");
			if(!name.isNull()) {
				NamedProperty p(name.toStdString(), 0.0f);
				new_properties_.append(addProperty_(new FloatEditorWidget(p, ui_.editors)));

				valueChanged_();
			}
		}

		void PropertyEditor::createNewDouble_()
		{
			QString name = chooseName_("New Double Property");
			if(!name.isNull()) {
				NamedProperty p(name.toStdString(), 0.0);
				new_properties_.append(addProperty_(new DoubleEditorWidget(p, ui_.editors)));

				valueChanged_();
			}
		}

		void PropertyEditor::createNewString_()
		{
			QString name = chooseName_("New String Property");
			if(!name.isNull()) {
				NamedProperty p(name.toStdString(), "");
				new_properties_.append(addProperty_(new StringEditorWidget(p, ui_.editors)));

				valueChanged_();
			}
		}

		PropEditorWidget* PropertyEditor::addProperty_(const NamedProperty& prop)
		{
			return addProperty_(createEditorWidget_(prop));
		}

		PropEditorWidget* PropertyEditor::addProperty_(PropEditorWidget* w)
		{
			if(w)
			{
				connect(w, SIGNAL(deleteProperty()), this, SLOT(scheduleDelete_()));
				connect(w, SIGNAL(duplicateProperty()), this, SLOT(scheduleDuplicate_()));
				connect(w, SIGNAL(valueChanged()), this, SLOT(valueChanged_()));

				w->setEditable(is_editable_);
				static_cast<QBoxLayout*>(ui_.editors->layout())->insertWidget(ui_.editors->layout()->count() - 1, w);
			}

			return w;
		}

		PropEditorWidget* PropertyEditor::createEditorWidget_(const NamedProperty& prop)
		{
			//Ideally this should be replaced by some kind of registry
			switch(prop.getType())
			{
				case NamedProperty::BOOL:
					return new BoolEditorWidget  (prop, ui_.editors);
				case NamedProperty::INT:
					return new IntEditorWidget   (prop, ui_.editors);
				case NamedProperty::UNSIGNED_INT:
					return new UIntEditorWidget  (prop, ui_.editors);
				case NamedProperty::FLOAT:
					return new FloatEditorWidget (prop, ui_.editors);
				case NamedProperty::DOUBLE:
					return new FloatEditorWidget (prop, ui_.editors);
				case NamedProperty::STRING:
					return new StringEditorWidget(prop, ui_.editors);
				case NamedProperty::SMART_OBJECT:
					if (dynamic_cast<PDBInfo*>(prop.getSmartObject().get()) != NULL)
					{
						return new PDBInfoEditorWidget(* (PDBInfo*)prop.getSmartObject().get(), ui_.editors);
					}
					else
					{
						return new PropDeleteWidget(prop, ui_.editors);
					}
				default:
					return NULL;
			}
		}

		void PropertyEditor::deleteProperty_(PropEditorWidget* editor)
		{
			//Thoroughly delete a property
			manager_->clearProperty(String(editor->getName()));
			layout()->removeWidget(editor);
			editor->setParent(0);
			editor->deleteLater();
		}

		void PropertyEditor::scheduleDelete_()
		{
			PropEditorWidget* editor = qobject_cast<PropEditorWidget*>(sender());

			if(!editor)
			{
				return;
			}

			//If the user wants to delete a newly created property this can happen right away
			//otherwise we schedule the property for release
			int index = new_properties_.indexOf(editor);
			if(index == - 1)
			{
				deleted_properties_.append(editor);
				editor->hide();
			} else {
				new_properties_.removeAt(index);
				deleteProperty_(editor);
			}

			valueChanged_();
		}

		void PropertyEditor::scheduleDuplicate_()
		{
			PropEditorWidget* editor = qobject_cast<PropEditorWidget*>(sender());

			if(!editor)
			{
				return;
			}

			//Get a name and create a new property editor
			QString name = chooseName_(editor->getName());
			if(!name.isNull()) {
				new_properties_.append(addProperty_(editor->clone(name.toStdString(), ui_.editors)));

				valueChanged_();
			}
		}

		QString PropertyEditor::chooseName_(const QString& initial)
		{
			bool ok = true;
			do {
				QString new_name = QInputDialog::getText(this, tr("Insert name"), tr("Name"),
				                                         QLineEdit::Normal, initial, &ok);

				if(!ok) {
					return QString::null;
				}

				//We need to check the inserted name against all properties and properties scheduled for creation
				bool not_used = true;
				PropEditorWidget* e;
				Q_FOREACH(e, new_properties_)
				{
					if(e->getName() == new_name)
					{
						not_used = false;
						break;
					}
				}

				if(!manager_->hasProperty(String(new_name)) && not_used) {
					return new_name;
				} else {
					QMessageBox::warning(this, tr("Property already exists"),
					                           tr("A property with given name already exists, please enter a new name."));
				}
			} while(true);
		}

		void PropertyEditor::valueChanged_()
		{
			//We only want to emit this signal once
			if(!has_changes_)
			{
				Q_EMIT valueChanged();

				has_changes_ = true;
			}
		}

		bool PropertyEditor::hasChanges() const
		{
			return has_changes_;
		}

		/*
		 * Editors
		 */
		PropEditorWidget::PropEditorWidget(const std::string& name, QWidget* parent)
			: QWidget(parent),
			  name_(name.c_str())
		{
			setupUi_();
			ui_.label_->setText(getName());
		}

		const QString& PropEditorWidget::getName() const
		{
			return name_;
		}

		void PropEditorWidget::setEditable(bool mode)
		{
			ui_.delete_button->setVisible(mode);
			ui_.duplicate_button->setVisible(mode);

			setEnabled(mode);
		}

		bool PropEditorWidget::isEditable() const
		{
			return ui_.delete_button->isVisible();
		}

		void PropEditorWidget::apply(PropertyManager* man, bool create)
		{
			if(!man) {
				return;
			}

			if(create || man->hasProperty(String(getName())))
			{
				apply_(man);
			}
		}

		bool PropEditorWidget::addWidget_(int i, QWidget* w)
		{
			QBoxLayout* l = qobject_cast<QBoxLayout*>(layout());
			if(!l) {
				return false;
			}

			l->insertWidget(i, w);
			return true;
		}

		void PropEditorWidget::setupUi_()
		{
			ui_.setupUi(this);
			IconLoader& loader= IconLoader::instance();
			ui_.delete_button->setIcon(loader.getIcon("actions/edit-delete"));
			ui_.duplicate_button->setIcon(loader.getIcon("actions/edit-copy"));
			connect(ui_.delete_button, SIGNAL(clicked()), this, SIGNAL(deleteProperty()));
			connect(ui_.duplicate_button, SIGNAL(clicked()), this, SIGNAL(duplicateProperty()));
		}

		void PropEditorWidget::reset(PropertyManager* man)
		{
			if(!man) {
				return;
			}

			String name(getName());
			if(man->hasProperty(name))
			{
				reset_(man->getProperty(name));
			}
		}

		//BOOL
		BoolEditorWidget::BoolEditorWidget(const NamedProperty& prop, QWidget* parent)
			: PropEditorWidget(prop.getName(), parent)
		{
			box_ = new QCheckBox("", this);
			box_->setChecked(prop.getBool());

			connect(box_, SIGNAL(toggled(bool)), this, SIGNAL(valueChanged()));
			addWidget_(1, box_);
		}

		void BoolEditorWidget::apply_(PropertyManager* man)
		{
			man->setProperty(String(getName()), box_->isChecked());
		}

		void BoolEditorWidget::reset_(const NamedProperty& prop)
		{
			box_->setChecked(prop.getBool());
		}

		BoolEditorWidget* BoolEditorWidget::clone(const std::string& name, QWidget* parent)
		{
			NamedProperty prop(name, box_->isChecked());
			return new BoolEditorWidget(prop, parent);
		}

		//INT
		IntEditorWidget::IntEditorWidget(const NamedProperty& prop, QWidget* parent)
			: PropEditorWidget(prop.getName(), parent)
		{
			box_   = new QSpinBox(this);

			box_->setValue(prop.getInt());
			box_->setMinimum(std::numeric_limits<int>::min());
			box_->setMaximum(std::numeric_limits<int>::max());

			connect(box_, SIGNAL(valueChanged(int)), this, SIGNAL(valueChanged()));

			addWidget_(1, box_);
		}

		void IntEditorWidget::apply_(PropertyManager* man)
		{
			man->setProperty(String(getName()), (int)box_->value());
		}

		void IntEditorWidget::reset_(const NamedProperty& prop)
		{
			box_->setValue(prop.getInt());
		}

		IntEditorWidget* IntEditorWidget::clone(const std::string& name, QWidget* parent)
		{
			NamedProperty prop(name, (int)box_->value());
			return new IntEditorWidget(prop, parent);
		}

		//UNSIGNED INT
		UIntEditorWidget::UIntEditorWidget(const NamedProperty& prop, QWidget* parent)
			: PropEditorWidget(prop.getName(), parent)
		{
			box_   = new QSpinBox(this);

			box_->setMinimum(0);
			box_->setMaximum(std::numeric_limits<int>::max());
			box_->setValue(prop.getUnsignedInt());

			connect(box_, SIGNAL(valueChanged(int)), this, SIGNAL(valueChanged()));

			addWidget_(1, box_);
		}

		UIntEditorWidget* UIntEditorWidget::clone(const std::string& name, QWidget* parent)
		{
			NamedProperty prop(name, (unsigned int)box_->value());
			return new UIntEditorWidget(prop, parent);
		}

		void UIntEditorWidget::apply_(PropertyManager* man)
		{
			man->setProperty(String(getName()), (unsigned int)box_->value());
		}

		void UIntEditorWidget::reset_(const NamedProperty& prop)
		{
			box_->setValue(prop.getUnsignedInt());
		}

		//FLOAT
		FloatEditorWidget::FloatEditorWidget(const NamedProperty& prop, QWidget* parent)
			: PropEditorWidget(prop.getName(), parent)
		{
			edit_  = new QLineEdit(this);

			edit_->setText(QString::number(prop.getFloat()));
			edit_->setValidator(new QDoubleValidator(std::numeric_limits<float>::min(), std::numeric_limits<float>::max(), 20, this));

			connect(edit_, SIGNAL(textEdited(const QString&)), this, SIGNAL(valueChanged()));

			addWidget_(1, edit_);
		}

		FloatEditorWidget* FloatEditorWidget::clone(const std::string& name, QWidget* parent)
		{
			NamedProperty prop(name, edit_->text().toFloat());
			return new FloatEditorWidget(prop, parent);
		}

		void FloatEditorWidget::apply_(PropertyManager* man)
		{
			man->setProperty(String(getName()), edit_->text().toFloat());
		}

		void FloatEditorWidget::reset_(const NamedProperty& prop)
		{
			edit_->setText(QString::number(prop.getFloat()));
		}

		//DOUBLE
		DoubleEditorWidget::DoubleEditorWidget(const NamedProperty& prop, QWidget* parent)
			: PropEditorWidget(prop.getName(), parent)
		{
			edit_  = new QLineEdit(this);

			edit_->setText(QString::number(prop.getDouble()));
			edit_->setValidator(new QDoubleValidator(this));

			connect(edit_, SIGNAL(textEdited(const QString&)), this, SIGNAL(valueChanged()));

			addWidget_(1, edit_);
		}

		DoubleEditorWidget* DoubleEditorWidget::clone(const std::string& name, QWidget* parent)
		{
			NamedProperty prop(name, edit_->text().toDouble());
			return new DoubleEditorWidget(prop, parent);
		}

		void DoubleEditorWidget::apply_(PropertyManager* man)
		{
			man->setProperty(String(getName()), edit_->text().toDouble());
		}

		void DoubleEditorWidget::reset_(const NamedProperty& prop)
		{
			edit_->setText(QString::number(prop.getDouble()));
		}

		//STRING
		StringEditorWidget::StringEditorWidget(const NamedProperty& prop, QWidget* parent)
			: PropEditorWidget(prop.getName(), parent)
		{
			edit_  = new QLineEdit(prop.getString().c_str(), this);

			connect(edit_, SIGNAL(textEdited(const QString&)), this, SIGNAL(valueChanged()));

			addWidget_(1, edit_);
		}

		StringEditorWidget* StringEditorWidget::clone(const std::string& name, QWidget* parent)
		{
			NamedProperty prop(name, edit_->text().toStdString());
			return new StringEditorWidget(prop, parent);
		}

		void StringEditorWidget::apply_(PropertyManager* man)
		{
			man->setProperty(String(getName()), edit_->text().toStdString());
		}

		void StringEditorWidget::reset_(const NamedProperty& prop)
		{
			edit_->setText(prop.getString().c_str());
		}

		// SMART_OBJECTs

		PDBInfoEditorWidget::PDBInfoEditorWidget(const PDBInfo &prop, QWidget *parent)
			: PropEditorWidget("PDBINFO", parent)
		{
			editorDialog_ = new EditorPDBInfoDialog(this);
			localCopy_ = prop;
			ui_.duplicate_button->setEnabled(false);
			QPushButton* launchEditor = new QPushButton(tr("Edit..."),this);
			connect(launchEditor,SIGNAL(clicked()),this,SLOT(startEditorDialog()));
			addWidget_(1,launchEditor);
		}

		PDBInfoEditorWidget* PDBInfoEditorWidget::clone(const std::string &, QWidget *parent)
		{
			return new PDBInfoEditorWidget(localCopy_, parent);
		}

		void PDBInfoEditorWidget::startEditorDialog()
		{
			PDBRecords& skipped = localCopy_.getSkippedRecords();
			// copy the text over to the editor component
			editorDialog_->ui_.textEditor->clear();
			for (PDBRecords::iterator it = skipped.begin();
				 it != skipped.end();
				 ++it)
			{
				editorDialog_->ui_.textEditor->appendPlainText((*it).c_str());
			}
			// then fire up the editor
			if (editorDialog_->exec() == QDialog::Accepted) {
				QStringList lines = editorDialog_->ui_.textEditor->toPlainText().split("\n");

				int n = 0;
				skipped.clear();
				Q_FOREACH(QString line, lines) {
					skipped.push_back(String(line));
					n++;
				}
				// don't forget to emit this -- else changes won't be written back!
				Q_EMIT valueChanged();
			}
		}

		void PDBInfoEditorWidget::apply_(PropertyManager *man)
		{
			boost::shared_ptr<PersistentObject> ptr(new PDBInfo(localCopy_));
			NamedProperty prop(String(getName()), ptr);
			man->setProperty(prop);
		}

		void PDBInfoEditorWidget::reset_(const NamedProperty &prop)
		{
			if (dynamic_cast<PDBInfo*>(prop.getSmartObject().get()) != NULL)
			{
				localCopy_ = * (PDBInfo*) (prop.getSmartObject().get());
			}
		}

	}
}