MCPcopy Create free account
hub / github.com/NatronGitHub/Natron / AddKnobDialog

Method AddKnobDialog

Gui/AddKnobDialog.cpp:415–1050  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

413} // getChoiceIndexFromKnobType
414
415AddKnobDialog::AddKnobDialog(DockablePanel* panel,
416 const KnobIPtr& knob,
417 const std::string& selectedPageName,
418 const std::string& selectedGroupName,
419 QWidget* parent)
420 : QDialog(parent)
421 , _imp( new AddKnobDialogPrivate(panel) )
422{
423 _imp->knob = knob;
424 assert( !knob || knob->isUserKnob() );
425
426 {
427 EffectInstance* effect = dynamic_cast<EffectInstance*>( panel->getHolder() );
428 QString title = QString::fromUtf8("Add Parameter");
429 if (!knob) {
430 // Add...
431 if (effect) {
432 title += QString::fromUtf8(" to ");
433 title += QString::fromUtf8( effect->getScriptName().c_str() );
434 }
435 } else {
436 // Edit...
437 title = QString::fromUtf8("Edit Parameter ");
438 if (effect) {
439 title += QString::fromUtf8( effect->getScriptName().c_str() );
440 title += QChar::fromLatin1('.');
441 }
442 title += QString::fromUtf8( knob->getName().c_str() );
443 }
444 setWindowTitle(title);
445 }
446
447 //QFont font(NATRON_FONT,NATRON_FONT_SIZE_11);
448
449 _imp->vLayout = new QVBoxLayout(this);
450 _imp->vLayout->setContentsMargins(0, 0, 15, 0);
451
452 _imp->mainContainer = new QWidget(this);
453 _imp->mainLayout = new QFormLayout(_imp->mainContainer);
454 _imp->mainLayout->setLabelAlignment(Qt::AlignVCenter | Qt::AlignRight);
455 _imp->mainLayout->setFormAlignment(Qt::AlignVCenter | Qt::AlignLeft);
456 _imp->mainLayout->setSpacing(3);
457 _imp->mainLayout->setContentsMargins(0, 0, 15, 0);
458
459 _imp->vLayout->addWidget(_imp->mainContainer);
460
461 {
462 KnobIPtr isAlias;
463 KnobIPtr listener;
464 if (knob) {
465 KnobI::ListenerDimsMap listeners;
466 knob->getListeners(listeners);
467 if ( !listeners.empty() ) {
468 listener = listeners.begin()->first.lock();
469 if (listener) {
470 isAlias = listener->getAliasMaster();
471 }
472 if (isAlias != knob) {

Callers

nothing calls this directly

Calls 15

convertFromPlainTextFunction · 0.85
getNameMethod · 0.80
addWidgetMethod · 0.80
getListenersMethod · 0.80
emptyMethod · 0.80
getAliasMasterMethod · 0.80
addRowMethod · 0.80
getIsSecretMethod · 0.80
getParentKnobMethod · 0.80
isNewLineActivatedMethod · 0.80
setEnabled_natronMethod · 0.80
getHintToolTipMethod · 0.80

Tested by

no test coverage detected