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

Method populateMenu

Gui/ViewerGL.cpp:3235–3316  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3233}
3234
3235void
3236ViewerGL::populateMenu()
3237{
3238 // always running in the main thread
3239 assert( qApp && qApp->thread() == QThread::currentThread() );
3240 _imp->menu->clear();
3241 QAction* displayOverlaysAction = new ActionWithShortcut(kShortcutGroupViewer, kShortcutIDActionHideOverlays, kShortcutDescActionHideOverlays, _imp->menu);
3242
3243 displayOverlaysAction->setCheckable(true);
3244 displayOverlaysAction->setChecked(_imp->overlay);
3245 QObject::connect( displayOverlaysAction, SIGNAL(triggered()), this, SLOT(toggleOverlays()) );
3246 QAction* toggleWipe = new ActionWithShortcut(kShortcutGroupViewer, kShortcutIDToggleWipe, kShortcutDescToggleWipe, _imp->menu);
3247 toggleWipe->setCheckable(true);
3248 toggleWipe->setChecked(getViewerTab()->getCompositingOperator() != eViewerCompositingOperatorNone);
3249 QObject::connect( toggleWipe, SIGNAL(triggered()), this, SLOT(toggleWipe()) );
3250 _imp->menu->addAction(toggleWipe);
3251
3252
3253 QAction* centerWipe = new ActionWithShortcut(kShortcutGroupViewer, kShortcutIDCenterWipe, kShortcutDescCenterWipe, _imp->menu);
3254 QObject::connect( centerWipe, SIGNAL(triggered()), this, SLOT(centerWipe()) );
3255 _imp->menu->addAction(centerWipe);
3256
3257 QAction* goToPrevLayer = new ActionWithShortcut(kShortcutGroupViewer, kShortcutIDPrevLayer, kShortcutDescPrevLayer, _imp->menu);
3258 QObject::connect( goToPrevLayer, SIGNAL(triggered()), _imp->viewerTab, SLOT(previousLayer()) );
3259 _imp->menu->addAction(goToPrevLayer);
3260 QAction* goToNextLayer = new ActionWithShortcut(kShortcutGroupViewer, kShortcutIDNextLayer, kShortcutDescNextLayer, _imp->menu);
3261 QObject::connect( goToNextLayer, SIGNAL(triggered()), _imp->viewerTab, SLOT(nextLayer()) );
3262 _imp->menu->addAction(goToNextLayer);
3263
3264 QAction* switchAB = new ActionWithShortcut(kShortcutGroupViewer, kShortcutIDSwitchInputAAndB, kShortcutDescSwitchInputAAndB, _imp->menu);
3265 QObject::connect( switchAB, SIGNAL(triggered()), _imp->viewerTab, SLOT(switchInputAAndB()) );
3266 _imp->menu->addAction(switchAB);
3267
3268 Menu* showHideMenu = new Menu(tr("Show/Hide"), _imp->menu);
3269 //showHideMenu->setFont(QFont(appFont,appFontSize));
3270 _imp->menu->addAction( showHideMenu->menuAction() );
3271
3272
3273 QAction* showHidePlayer, *showHideLeftToolbar, *showHideRightToolbar, *showHideTopToolbar, *showHideInfobar, *showHideTimeline;
3274 QAction* showAll, *hideAll;
3275
3276 showHidePlayer = new ActionWithShortcut(kShortcutGroupViewer, kShortcutIDActionHidePlayer, kShortcutDescActionHidePlayer,
3277 showHideMenu);
3278
3279 showHideLeftToolbar = new ActionWithShortcut(kShortcutGroupViewer, kShortcutIDActionHideLeft, kShortcutDescActionHideLeft,
3280 showHideMenu);
3281 showHideRightToolbar = new ActionWithShortcut(kShortcutGroupViewer, kShortcutIDActionHideRight, kShortcutDescActionHideRight,
3282 showHideMenu);
3283 showHideTopToolbar = new ActionWithShortcut(kShortcutGroupViewer, kShortcutIDActionHideTop, kShortcutDescActionHideTop,
3284 showHideMenu);
3285 showHideInfobar = new ActionWithShortcut(kShortcutGroupViewer, kShortcutIDActionHideInfobar, kShortcutDescActionHideInfobar,
3286 showHideMenu);
3287 showHideTimeline = new ActionWithShortcut(kShortcutGroupViewer, kShortcutIDActionHideTimeline, kShortcutDescActionHideTimeline,
3288 showHideMenu);
3289
3290
3291 showAll = new ActionWithShortcut(kShortcutGroupViewer, kShortcutIDActionShowAll, kShortcutDescActionShowAll,
3292 showHideMenu);

Callers

nothing calls this directly

Calls 5

setCheckableMethod · 0.80
addActionMethod · 0.80
clearMethod · 0.45
setCheckedMethod · 0.45

Tested by

no test coverage detected