comparison widgets/PropertyBox.cpp @ 1266:a34a2a25907c

Untabify
author Chris Cannam
date Thu, 01 Mar 2018 18:02:22 +0000
parents 312f99a9f2aa
children fc9d9f1103fa
comparison
equal deleted inserted replaced
1265:6e724c81f18f 1266:a34a2a25907c
60 m_showButton(0), 60 m_showButton(0),
61 m_playButton(0) 61 m_playButton(0)
62 { 62 {
63 #ifdef DEBUG_PROPERTY_BOX 63 #ifdef DEBUG_PROPERTY_BOX
64 cerr << "PropertyBox[" << this << "(\"" << 64 cerr << "PropertyBox[" << this << "(\"" <<
65 container->getPropertyContainerName() << "\" at " << container << ")]::PropertyBox" << endl; 65 container->getPropertyContainerName() << "\" at " << container << ")]::PropertyBox" << endl;
66 #endif 66 #endif
67 67
68 m_mainBox = new QVBoxLayout; 68 m_mainBox = new QVBoxLayout;
69 setLayout(m_mainBox); 69 setLayout(m_mainBox);
70 70
96 blockSignals(true); 96 blockSignals(true);
97 97
98 size_t i; 98 size_t i;
99 99
100 for (i = 0; i < properties.size(); ++i) { 100 for (i = 0; i < properties.size(); ++i) {
101 updatePropertyEditor(properties[i]); 101 updatePropertyEditor(properties[i]);
102 } 102 }
103 103
104 blockSignals(false); 104 blockSignals(false);
105 105
106 m_layout->setRowStretch(m_layout->rowCount(), 10); 106 m_layout->setRowStretch(m_layout->rowCount(), 10);
126 #ifdef DEBUG_PROPERTY_BOX 126 #ifdef DEBUG_PROPERTY_BOX
127 cerr << "PropertyBox[" << this << ":" << m_container << "]::populateViewPlayFrame" << endl; 127 cerr << "PropertyBox[" << this << ":" << m_container << "]::populateViewPlayFrame" << endl;
128 #endif 128 #endif
129 129
130 if (m_viewPlayFrame) { 130 if (m_viewPlayFrame) {
131 delete m_viewPlayFrame; 131 delete m_viewPlayFrame;
132 m_viewPlayFrame = 0; 132 m_viewPlayFrame = 0;
133 } 133 }
134 134
135 if (!m_container) return; 135 if (!m_container) return;
136 136
137 Layer *layer = dynamic_cast<Layer *>(m_container); 137 Layer *layer = dynamic_cast<Layer *>(m_container);
138 if (layer) { 138 if (layer) {
139 disconnect(layer, SIGNAL(modelReplaced()), 139 disconnect(layer, SIGNAL(modelReplaced()),
140 this, SLOT(populateViewPlayFrame())); 140 this, SLOT(populateViewPlayFrame()));
141 connect(layer, SIGNAL(modelReplaced()), 141 connect(layer, SIGNAL(modelReplaced()),
142 this, SLOT(populateViewPlayFrame())); 142 this, SLOT(populateViewPlayFrame()));
143 } 143 }
144 144
145 PlayParameters *params = m_container->getPlayParameters(); 145 PlayParameters *params = m_container->getPlayParameters();
146 if (!params && !layer) return; 146 if (!params && !layer) return;
147 147
167 m_playButton->setCheckable(true); 167 m_playButton->setCheckable(true);
168 m_playButton->setIcon(IconLoader().load("speaker")); 168 m_playButton->setIcon(IconLoader().load("speaker"));
169 m_playButton->setToolTip(tr("Click to toggle playback")); 169 m_playButton->setToolTip(tr("Click to toggle playback"));
170 m_playButton->setChecked(!params->isPlayMuted()); 170 m_playButton->setChecked(!params->isPlayMuted());
171 m_playButton->setFixedSize(buttonSize); 171 m_playButton->setFixedSize(buttonSize);
172 connect(m_playButton, SIGNAL(toggled(bool)), 172 connect(m_playButton, SIGNAL(toggled(bool)),
173 this, SLOT(playAudibleButtonChanged(bool))); 173 this, SLOT(playAudibleButtonChanged(bool)));
174 connect(m_playButton, SIGNAL(mouseEntered()), 174 connect(m_playButton, SIGNAL(mouseEntered()),
175 this, SLOT(mouseEnteredWidget())); 175 this, SLOT(mouseEnteredWidget()));
176 connect(m_playButton, SIGNAL(mouseLeft()), 176 connect(m_playButton, SIGNAL(mouseLeft()),
177 this, SLOT(mouseLeftWidget())); 177 this, SLOT(mouseLeftWidget()));
178 connect(params, SIGNAL(playAudibleChanged(bool)), 178 connect(params, SIGNAL(playAudibleChanged(bool)),
179 this, SLOT(playAudibleChanged(bool))); 179 this, SLOT(playAudibleChanged(bool)));
180 180
181 LevelPanToolButton *levelPan = new LevelPanToolButton; 181 LevelPanToolButton *levelPan = new LevelPanToolButton;
182 levelPan->setFixedSize(buttonSize); 182 levelPan->setFixedSize(buttonSize);
183 levelPan->setImageSize((buttonSize.height() * 3) / 4); 183 levelPan->setImageSize((buttonSize.height() * 3) / 4);
184 layout->addWidget(levelPan, 0, col++, Qt::AlignCenter); 184 layout->addWidget(levelPan, 0, col++, Qt::AlignCenter);
193 connect(levelPan, SIGNAL(mouseEntered()), 193 connect(levelPan, SIGNAL(mouseEntered()),
194 this, SLOT(mouseEnteredWidget())); 194 this, SLOT(mouseEnteredWidget()));
195 connect(levelPan, SIGNAL(mouseLeft()), 195 connect(levelPan, SIGNAL(mouseLeft()),
196 this, SLOT(mouseLeftWidget())); 196 this, SLOT(mouseLeftWidget()));
197 197
198 layout->addWidget(m_playButton, 0, col++, Qt::AlignCenter); 198 layout->addWidget(m_playButton, 0, col++, Qt::AlignCenter);
199 199
200 if (params->getPlayClipId() != "") { 200 if (params->getPlayClipId() != "") {
201 NotifyingToolButton *playParamButton = new NotifyingToolButton; 201 NotifyingToolButton *playParamButton = new NotifyingToolButton;
202 playParamButton->setObjectName("playParamButton"); 202 playParamButton->setObjectName("playParamButton");
203 playParamButton->setIcon(IconLoader().load("faders")); 203 playParamButton->setIcon(IconLoader().load("faders"));
214 214
215 layout->setColumnStretch(col++, 10); 215 layout->setColumnStretch(col++, 10);
216 216
217 if (layer) { 217 if (layer) {
218 218
219 QLabel *showLabel = new QLabel(tr("Show")); 219 QLabel *showLabel = new QLabel(tr("Show"));
220 layout->addWidget(showLabel, 0, col++, Qt::AlignVCenter | Qt::AlignRight); 220 layout->addWidget(showLabel, 0, col++, Qt::AlignVCenter | Qt::AlignRight);
221 221
222 m_showButton = new LEDButton(palette().highlight().color()); 222 m_showButton = new LEDButton(palette().highlight().color());
223 layout->addWidget(m_showButton, 0, col++, Qt::AlignVCenter | Qt::AlignLeft); 223 layout->addWidget(m_showButton, 0, col++, Qt::AlignVCenter | Qt::AlignLeft);
224 connect(m_showButton, SIGNAL(stateChanged(bool)), 224 connect(m_showButton, SIGNAL(stateChanged(bool)),
225 this, SIGNAL(showLayer(bool))); 225 this, SIGNAL(showLayer(bool)));
226 connect(m_showButton, SIGNAL(mouseEntered()), 226 connect(m_showButton, SIGNAL(mouseEntered()),
227 this, SLOT(mouseEnteredWidget())); 227 this, SLOT(mouseEnteredWidget()));
228 connect(m_showButton, SIGNAL(mouseLeft()), 228 connect(m_showButton, SIGNAL(mouseLeft()),
229 this, SLOT(mouseLeftWidget())); 229 this, SLOT(mouseLeftWidget()));
230 } 230 }
239 239
240 int min = 0, max = 0, value = 0, deflt = 0; 240 int min = 0, max = 0, value = 0, deflt = 0;
241 value = m_container->getPropertyRangeAndValue(name, &min, &max, &deflt); 241 value = m_container->getPropertyRangeAndValue(name, &min, &max, &deflt);
242 242
243 bool have = (m_propertyControllers.find(name) != 243 bool have = (m_propertyControllers.find(name) !=
244 m_propertyControllers.end()); 244 m_propertyControllers.end());
245 245
246 QString groupName = m_container->getPropertyGroupName(name); 246 QString groupName = m_container->getPropertyGroupName(name);
247 QString propertyLabel = m_container->getPropertyLabel(name); 247 QString propertyLabel = m_container->getPropertyLabel(name);
248 QString iconName = m_container->getPropertyIconName(name); 248 QString iconName = m_container->getPropertyIconName(name);
249 249
250 #ifdef DEBUG_PROPERTY_BOX 250 #ifdef DEBUG_PROPERTY_BOX
251 cerr << "PropertyBox[" << this 251 cerr << "PropertyBox[" << this
252 << "(\"" << m_container->getPropertyContainerName() 252 << "(\"" << m_container->getPropertyContainerName()
253 << "\")]"; 253 << "\")]";
254 cerr << "::updatePropertyEditor(\"" << name << "\"):"; 254 cerr << "::updatePropertyEditor(\"" << name << "\"):";
255 cerr << " value " << value << ", have " << have << ", group \"" 255 cerr << " value " << value << ", have " << have << ", group \""
256 << groupName << "\"" << endl; 256 << groupName << "\"" << endl;
257 #endif 257 #endif
258 258
259 QString groupLabel = groupName; 259 QString groupLabel = groupName;
260 if (groupName == QString()) { 260 if (groupName == QString()) {
261 groupName = "ungrouped: " + name; // not tr(), this is internal id 261 groupName = "ungrouped: " + name; // not tr(), this is internal id
298 298
299 case PropertyContainer::ToggleProperty: 299 case PropertyContainer::ToggleProperty:
300 { 300 {
301 QAbstractButton *button; 301 QAbstractButton *button;
302 302
303 if (!(button = qobject_cast<QAbstractButton *>(existing))) { 303 if (!(button = qobject_cast<QAbstractButton *>(existing))) {
304 #ifdef DEBUG_PROPERTY_BOX 304 #ifdef DEBUG_PROPERTY_BOX
305 cerr << "PropertyBox: creating new checkbox" << endl; 305 cerr << "PropertyBox: creating new checkbox" << endl;
306 #endif 306 #endif
307 if (iconName != "") { 307 if (iconName != "") {
308 button = new NotifyingPushButton(); 308 button = new NotifyingPushButton();
309 button->setCheckable(true); 309 button->setCheckable(true);
310 QIcon icon(IconLoader().load(iconName)); 310 QIcon icon(IconLoader().load(iconName));
313 button->setFixedSize(WidgetScale::scaleQSize(QSize(18, 18))); 313 button->setFixedSize(WidgetScale::scaleQSize(QSize(18, 18)));
314 } else { 314 } else {
315 button = new NotifyingCheckBox(); 315 button = new NotifyingCheckBox();
316 button->setObjectName(name); 316 button->setObjectName(name);
317 } 317 }
318 connect(button, SIGNAL(toggled(bool)), 318 connect(button, SIGNAL(toggled(bool)),
319 this, SLOT(propertyControllerChanged(bool))); 319 this, SLOT(propertyControllerChanged(bool)));
320 connect(button, SIGNAL(mouseEntered()), 320 connect(button, SIGNAL(mouseEntered()),
321 this, SLOT(mouseEnteredWidget())); 321 this, SLOT(mouseEnteredWidget()));
322 connect(button, SIGNAL(mouseLeft()), 322 connect(button, SIGNAL(mouseLeft()),
323 this, SLOT(mouseLeftWidget())); 323 this, SLOT(mouseLeftWidget()));
324 button->setToolTip(propertyLabel); 324 button->setToolTip(propertyLabel);
328 delete existing; 328 delete existing;
329 } else { 329 } else {
330 groupLayout->addWidget(button, 0, groupLayout->columnCount()); 330 groupLayout->addWidget(button, 0, groupLayout->columnCount());
331 } 331 }
332 332
333 m_propertyControllers[name] = button; 333 m_propertyControllers[name] = button;
334 } 334 }
335 335
336 if (button->isChecked() != (value > 0)) { 336 if (button->isChecked() != (value > 0)) {
337 button->blockSignals(true); 337 button->blockSignals(true);
338 button->setChecked(value > 0); 338 button->setChecked(value > 0);
339 button->blockSignals(false); 339 button->blockSignals(false);
340 } 340 }
341 break; 341 break;
342 } 342 }
343 343
344 case PropertyContainer::RangeProperty: 344 case PropertyContainer::RangeProperty:
345 { 345 {
346 AudioDial *dial; 346 AudioDial *dial;
347 347
348 if ((dial = qobject_cast<AudioDial *>(existing))) { 348 if ((dial = qobject_cast<AudioDial *>(existing))) {
349 if (rangeChanged) { 349 if (rangeChanged) {
350 dial->blockSignals(true); 350 dial->blockSignals(true);
351 dial->setMinimum(min); 351 dial->setMinimum(min);
352 dial->setMaximum(max); 352 dial->setMaximum(max);
353 dial->setRangeMapper(m_container->getNewPropertyRangeMapper(name)); 353 dial->setRangeMapper(m_container->getNewPropertyRangeMapper(name));
354 dial->blockSignals(false); 354 dial->blockSignals(false);
355 } 355 }
356 } else { 356 } else {
357 #ifdef DEBUG_PROPERTY_BOX 357 #ifdef DEBUG_PROPERTY_BOX
358 cerr << "PropertyBox: creating new dial" << endl; 358 cerr << "PropertyBox: creating new dial" << endl;
359 #endif 359 #endif
360 dial = new AudioDial(); 360 dial = new AudioDial();
361 dial->setObjectName(name); 361 dial->setObjectName(name);
362 dial->setMinimum(min); 362 dial->setMinimum(min);
363 dial->setMaximum(max); 363 dial->setMaximum(max);
364 dial->setPageStep(1); 364 dial->setPageStep(1);
365 dial->setNotchesVisible((max - min) <= 12); 365 dial->setNotchesVisible((max - min) <= 12);
366 // important to set the range mapper before the default, 366 // important to set the range mapper before the default,
367 // because the range mapper is used to map the default 367 // because the range mapper is used to map the default
368 dial->setRangeMapper(m_container->getNewPropertyRangeMapper(name)); 368 dial->setRangeMapper(m_container->getNewPropertyRangeMapper(name));
369 dial->setDefaultValue(deflt); 369 dial->setDefaultValue(deflt);
370 dial->setShowToolTip(true); 370 dial->setShowToolTip(true);
371 connect(dial, SIGNAL(valueChanged(int)), 371 connect(dial, SIGNAL(valueChanged(int)),
372 this, SLOT(propertyControllerChanged(int))); 372 this, SLOT(propertyControllerChanged(int)));
373 connect(dial, SIGNAL(mouseEntered()), 373 connect(dial, SIGNAL(mouseEntered()),
374 this, SLOT(mouseEnteredWidget())); 374 this, SLOT(mouseEnteredWidget()));
375 connect(dial, SIGNAL(mouseLeft()), 375 connect(dial, SIGNAL(mouseLeft()),
376 this, SLOT(mouseLeftWidget())); 376 this, SLOT(mouseLeftWidget()));
377 377
383 delete existing; 383 delete existing;
384 } else { 384 } else {
385 groupLayout->addWidget(dial, 0, groupLayout->columnCount()); 385 groupLayout->addWidget(dial, 0, groupLayout->columnCount());
386 } 386 }
387 387
388 m_propertyControllers[name] = dial; 388 m_propertyControllers[name] = dial;
389 } 389 }
390 390
391 if (dial->value() != value) { 391 if (dial->value() != value) {
392 dial->blockSignals(true); 392 dial->blockSignals(true);
393 dial->setValue(value); 393 dial->setValue(value);
394 dial->blockSignals(false); 394 dial->blockSignals(false);
395 } 395 }
396 break; 396 break;
397 } 397 }
398 398
399 case PropertyContainer::ColourProperty: 399 case PropertyContainer::ColourProperty:
400 { 400 {
401 ColourComboBox *cb; 401 ColourComboBox *cb;
402 402
403 if (!(cb = qobject_cast<ColourComboBox *>(existing))) { 403 if (!(cb = qobject_cast<ColourComboBox *>(existing))) {
404 404
405 #ifdef DEBUG_PROPERTY_BOX 405 #ifdef DEBUG_PROPERTY_BOX
406 cerr << "PropertyBox: creating new colour combobox" << endl; 406 cerr << "PropertyBox: creating new colour combobox" << endl;
407 #endif 407 #endif
408 cb = new ColourComboBox(true); 408 cb = new ColourComboBox(true);
409 cb->setObjectName(name); 409 cb->setObjectName(name);
410 410
411 connect(cb, SIGNAL(colourChanged(int)), 411 connect(cb, SIGNAL(colourChanged(int)),
412 this, SLOT(propertyControllerChanged(int))); 412 this, SLOT(propertyControllerChanged(int)));
413 connect(cb, SIGNAL(mouseEntered()), 413 connect(cb, SIGNAL(mouseEntered()),
414 this, SLOT(mouseEnteredWidget())); 414 this, SLOT(mouseEnteredWidget()));
415 connect(cb, SIGNAL(mouseLeft()), 415 connect(cb, SIGNAL(mouseLeft()),
416 this, SLOT(mouseLeftWidget())); 416 this, SLOT(mouseLeftWidget()));
417 417
422 delete existing; 422 delete existing;
423 } else { 423 } else {
424 groupLayout->addWidget(cb, 0, groupLayout->columnCount()); 424 groupLayout->addWidget(cb, 0, groupLayout->columnCount());
425 } 425 }
426 426
427 m_propertyControllers[name] = cb; 427 m_propertyControllers[name] = cb;
428 } 428 }
429 429
430 if (cb->currentIndex() != value) { 430 if (cb->currentIndex() != value) {
431 cb->blockSignals(true); 431 cb->blockSignals(true);
432 cb->setCurrentIndex(value); 432 cb->setCurrentIndex(value);
433 cb->blockSignals(false); 433 cb->blockSignals(false);
440 { 440 {
441 ColourMapComboBox *cb; 441 ColourMapComboBox *cb;
442 442
443 if (!(cb = qobject_cast<ColourMapComboBox *>(existing))) { 443 if (!(cb = qobject_cast<ColourMapComboBox *>(existing))) {
444 #ifdef DEBUG_PROPERTY_BOX 444 #ifdef DEBUG_PROPERTY_BOX
445 cerr << "PropertyBox: creating new colourmap combobox" << endl; 445 cerr << "PropertyBox: creating new colourmap combobox" << endl;
446 #endif 446 #endif
447 cb = new ColourMapComboBox(false); 447 cb = new ColourMapComboBox(false);
448 cb->setObjectName(name); 448 cb->setObjectName(name);
449 449
450 connect(cb, SIGNAL(colourMapChanged(int)), 450 connect(cb, SIGNAL(colourMapChanged(int)),
451 this, SLOT(propertyControllerChanged(int))); 451 this, SLOT(propertyControllerChanged(int)));
452 connect(cb, SIGNAL(mouseEntered()), 452 connect(cb, SIGNAL(mouseEntered()),
453 this, SLOT(mouseEnteredWidget())); 453 this, SLOT(mouseEnteredWidget()));
454 connect(cb, SIGNAL(mouseLeft()), 454 connect(cb, SIGNAL(mouseLeft()),
455 this, SLOT(mouseLeftWidget())); 455 this, SLOT(mouseLeftWidget()));
456 456
461 delete existing; 461 delete existing;
462 } else { 462 } else {
463 groupLayout->addWidget(cb, 0, groupLayout->columnCount()); 463 groupLayout->addWidget(cb, 0, groupLayout->columnCount());
464 } 464 }
465 465
466 m_propertyControllers[name] = cb; 466 m_propertyControllers[name] = cb;
467 } 467 }
468 468
469 if (cb->currentIndex() != value) { 469 if (cb->currentIndex() != value) {
470 cb->blockSignals(true); 470 cb->blockSignals(true);
471 cb->setCurrentIndex(value); 471 cb->setCurrentIndex(value);
472 cb->blockSignals(false); 472 cb->blockSignals(false);
476 } 476 }
477 477
478 case PropertyContainer::ValueProperty: 478 case PropertyContainer::ValueProperty:
479 case PropertyContainer::UnitsProperty: 479 case PropertyContainer::UnitsProperty:
480 { 480 {
481 NotifyingComboBox *cb; 481 NotifyingComboBox *cb;
482 482
483 if (!(cb = qobject_cast<NotifyingComboBox *>(existing))) { 483 if (!(cb = qobject_cast<NotifyingComboBox *>(existing))) {
484 #ifdef DEBUG_PROPERTY_BOX 484 #ifdef DEBUG_PROPERTY_BOX
485 cerr << "PropertyBox: creating new combobox" << endl; 485 cerr << "PropertyBox: creating new combobox" << endl;
486 #endif 486 #endif
487 cb = new NotifyingComboBox(); 487 cb = new NotifyingComboBox();
488 cb->setObjectName(name); 488 cb->setObjectName(name);
489 cb->setDuplicatesEnabled(false); 489 cb->setDuplicatesEnabled(false);
490 } 490 }
491 491
492 if (!have || rangeChanged) { 492 if (!have || rangeChanged) {
493 493
520 cb->setEditable(true); 520 cb->setEditable(true);
521 } 521 }
522 } 522 }
523 523
524 if (!have) { 524 if (!have) {
525 connect(cb, SIGNAL(activated(int)), 525 connect(cb, SIGNAL(activated(int)),
526 this, SLOT(propertyControllerChanged(int))); 526 this, SLOT(propertyControllerChanged(int)));
527 connect(cb, SIGNAL(mouseEntered()), 527 connect(cb, SIGNAL(mouseEntered()),
528 this, SLOT(mouseEnteredWidget())); 528 this, SLOT(mouseEnteredWidget()));
529 connect(cb, SIGNAL(mouseLeft()), 529 connect(cb, SIGNAL(mouseLeft()),
530 this, SLOT(mouseLeftWidget())); 530 this, SLOT(mouseLeftWidget()));
531 531
532 cb->setToolTip(propertyLabel); 532 cb->setToolTip(propertyLabel);
533 groupLayout->addWidget(cb, 0, groupLayout->columnCount()); 533 groupLayout->addWidget(cb, 0, groupLayout->columnCount());
534 m_propertyControllers[name] = cb; 534 m_propertyControllers[name] = cb;
535 } else if (existing != cb) { 535 } else if (existing != cb) {
536 groupLayout->replaceWidget(existing, cb); 536 groupLayout->replaceWidget(existing, cb);
537 delete existing; 537 delete existing;
538 } 538 }
539 539
540 cb->blockSignals(true); 540 cb->blockSignals(true);
553 } 553 }
554 } 554 }
555 } 555 }
556 cb->blockSignals(false); 556 cb->blockSignals(false);
557 557
558 break; 558 break;
559 } 559 }
560 560
561 case PropertyContainer::InvalidProperty: 561 case PropertyContainer::InvalidProperty:
562 default: 562 default:
563 break; 563 break;
564 } 564 }
565 } 565 }
566 566
567 void 567 void
568 PropertyBox::propertyContainerPropertyChanged(PropertyContainer *pc) 568 PropertyBox::propertyContainerPropertyChanged(PropertyContainer *pc)
577 size_t i; 577 size_t i;
578 578
579 blockSignals(true); 579 blockSignals(true);
580 580
581 for (i = 0; i < properties.size(); ++i) { 581 for (i = 0; i < properties.size(); ++i) {
582 updatePropertyEditor(properties[i]); 582 updatePropertyEditor(properties[i]);
583 } 583 }
584 584
585 blockSignals(false); 585 blockSignals(false);
586 } 586 }
587 587
590 { 590 {
591 blockSignals(true); 591 blockSignals(true);
592 592
593 PropertyContainer::PropertyList properties = m_container->getProperties(); 593 PropertyContainer::PropertyList properties = m_container->getProperties();
594 for (size_t i = 0; i < properties.size(); ++i) { 594 for (size_t i = 0; i < properties.size(); ++i) {
595 updatePropertyEditor(properties[i], true); 595 updatePropertyEditor(properties[i], true);
596 } 596 }
597 597
598 blockSignals(false); 598 blockSignals(false);
599 } 599 }
600 600
632 { 632 {
633 QObject *obj = sender(); 633 QObject *obj = sender();
634 QString name = obj->objectName(); 634 QString name = obj->objectName();
635 635
636 #ifdef DEBUG_PROPERTY_BOX 636 #ifdef DEBUG_PROPERTY_BOX
637 SVDEBUG << "PropertyBox::propertyControllerChanged(" << name << ", " << value << ")" << endl; 637 SVDEBUG << "PropertyBox::propertyControllerChanged(" << name << ", " << value << ")" << endl;
638 #endif 638 #endif
639 639
640 PropertyContainer::PropertyType type = m_container->getPropertyType(name); 640 PropertyContainer::PropertyType type = m_container->getPropertyType(name);
641 641
642 Command *c = 0; 642 Command *c = 0;
650 (name, UnitDatabase::getInstance()->getUnitId(unit)); 650 (name, UnitDatabase::getInstance()->getUnitId(unit));
651 } 651 }
652 652
653 } else if (type != PropertyContainer::InvalidProperty) { 653 } else if (type != PropertyContainer::InvalidProperty) {
654 654
655 c = m_container->getSetPropertyCommand(name, value); 655 c = m_container->getSetPropertyCommand(name, value);
656 } 656 }
657 657
658 if (c) CommandHistory::getInstance()->addCommand(c, true, true); 658 if (c) CommandHistory::getInstance()->addCommand(c, true, true);
659 659
660 updateContextHelp(obj); 660 updateContextHelp(obj);