| 126 | } |
| 127 | |
| 128 | PickKnobDialog::PickKnobDialog(DockablePanel* panel, |
| 129 | QWidget* parent) |
| 130 | : QDialog(parent) |
| 131 | , _imp( new PickKnobDialogPrivate(panel) ) |
| 132 | { |
| 133 | NodeSettingsPanel* nodePanel = dynamic_cast<NodeSettingsPanel*>(panel); |
| 134 | |
| 135 | assert(nodePanel); |
| 136 | if (!nodePanel) { |
| 137 | throw std::logic_error("PickKnobDialog::PickKnobDialog()"); |
| 138 | } |
| 139 | NodeGuiPtr nodeGui = nodePanel->getNode(); |
| 140 | NodePtr node = nodeGui->getNode(); |
| 141 | NodeGroup* isGroup = node->isEffectGroup(); |
| 142 | NodeCollectionPtr collec = node->getGroup(); |
| 143 | NodeGroup* isCollecGroup = dynamic_cast<NodeGroup*>( collec.get() ); |
| 144 | NodesList collectNodes = collec->getNodes(); |
| 145 | for (NodesList::iterator it = collectNodes.begin(); it != collectNodes.end(); ++it) { |
| 146 | if ( !(*it)->getParentMultiInstance() && (*it)->isActivated() && ( (*it)->getKnobs().size() > 0 ) ) { |
| 147 | _imp->allNodes.push_back(*it); |
| 148 | } |
| 149 | } |
| 150 | if (isCollecGroup) { |
| 151 | _imp->allNodes.push_back( isCollecGroup->getNode() ); |
| 152 | } |
| 153 | if (isGroup) { |
| 154 | NodesList groupnodes = isGroup->getNodes(); |
| 155 | for (NodesList::iterator it = groupnodes.begin(); it != groupnodes.end(); ++it) { |
| 156 | if ( (*it)->getNodeGui() && |
| 157 | !(*it)->getParentMultiInstance() && |
| 158 | (*it)->isActivated() && |
| 159 | ( (*it)->getKnobs().size() > 0 ) ) { |
| 160 | _imp->allNodes.push_back(*it); |
| 161 | } |
| 162 | } |
| 163 | } |
| 164 | QStringList nodeNames; |
| 165 | for (NodesList::iterator it = _imp->allNodes.begin(); it != _imp->allNodes.end(); ++it) { |
| 166 | QString name = QString::fromUtf8( (*it)->getLabel().c_str() ); |
| 167 | nodeNames.push_back(name); |
| 168 | } |
| 169 | nodeNames.sort(); |
| 170 | |
| 171 | _imp->mainLayout = new QGridLayout(this); |
| 172 | _imp->selectNodeLabel = new Label( tr("Node:") ); |
| 173 | _imp->nodeSelectionCombo = new CompleterLineEdit(nodeNames, nodeNames, false, this); |
| 174 | _imp->nodeSelectionCombo->setToolTip( NATRON_NAMESPACE::convertFromPlainText(tr("Input the name of a node in the current project."), NATRON_NAMESPACE::WhiteSpaceNormal) ); |
| 175 | _imp->nodeSelectionCombo->setFocus(Qt::PopupFocusReason); |
| 176 | |
| 177 | _imp->knobSelectionCombo = new ComboBox(this); |
| 178 | QObject::connect( _imp->knobSelectionCombo, SIGNAL(currentIndexChanged(int)), this, SLOT(onKnobComboIndexChanged(int)) ); |
| 179 | QString useAliasTt = NATRON_NAMESPACE::convertFromPlainText(tr("If checked, an alias of the selected parameter will be created, coyping entirely its state. " |
| 180 | "Only the script-name, label and tooltip will be editable.\n" |
| 181 | "For choice parameters this will also " |
| 182 | "dynamically refresh the menu entries when the original parameter's menu is changed.\n" |
| 183 | "When unchecked, a simple expression will be set linking the two parameters, but things such as dynamic menus " |
| 184 | "will be disabled."), NATRON_NAMESPACE::WhiteSpaceNormal); |
| 185 | _imp->useAliasLabel = new Label(tr("Make Alias:"), this); |
nothing calls this directly
no test coverage detected