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

Method onSettingsButtonClicked

Gui/NodeSettingsPanel.cpp:170–208  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

168}
169
170void
171NodeSettingsPanel::onSettingsButtonClicked()
172{
173 Menu menu(this);
174 //menu.setFont(QFont(appFont,appFontSize));
175 NodeGuiPtr node = getNode();
176 NodePtr master = node->getNode()->getMasterNode();
177 QAction* importPresets = new QAction(tr("Import presets"), &menu);
178 QObject::connect( importPresets, SIGNAL(triggered()), this, SLOT(onImportPresetsActionTriggered()) );
179 QAction* exportAsPresets = new QAction(tr("Export as presets"), &menu);
180 QObject::connect( exportAsPresets, SIGNAL(triggered()), this, SLOT(onExportPresetsActionTriggered()) );
181
182 menu.addAction(importPresets);
183 menu.addAction(exportAsPresets);
184 menu.addSeparator();
185
186 QAction* manageUserParams = new QAction(tr("Manage user parameters..."), &menu);
187 QObject::connect( manageUserParams, SIGNAL(triggered()), this, SLOT(onManageUserParametersActionTriggered()) );
188 menu.addAction(manageUserParams);
189
190 menu.addSeparator();
191
192
193 QAction* setKeyOnAll = new QAction(tr("Set key on all parameters"), &menu);
194 QObject::connect( setKeyOnAll, SIGNAL(triggered()), this, SLOT(setKeyOnAllParameters()) );
195 QAction* removeAnimationOnAll = new QAction(tr("Remove animation on all parameters"), &menu);
196 QObject::connect( removeAnimationOnAll, SIGNAL(triggered()), this, SLOT(removeAnimationOnAllParameters()) );
197 menu.addAction(setKeyOnAll);
198 menu.addAction(removeAnimationOnAll);
199
200 if ( master || !node->getDagGui() || !node->getDagGui()->getGui() || node->getDagGui()->getGui()->isGUIFrozen() ) {
201 importPresets->setEnabled(false);
202 exportAsPresets->setEnabled(false);
203 setKeyOnAll->setEnabled(false);
204 removeAnimationOnAll->setEnabled(false);
205 }
206
207 menu.exec( _settingsButton->mapToGlobal( _settingsButton->pos() ) );
208}
209
210void
211NodeSettingsPanel::onImportPresetsActionTriggered()

Callers

nothing calls this directly

Calls 10

getMasterNodeMethod · 0.80
addActionMethod · 0.80
addSeparatorMethod · 0.80
getDagGuiMethod · 0.80
isGUIFrozenMethod · 0.80
getNodeFunction · 0.70
getNodeMethod · 0.45
getGuiMethod · 0.45
setEnabledMethod · 0.45
execMethod · 0.45

Tested by

no test coverage detected