void KonqCopyToMenu::addActionsTo(QMenu* menu) { KMenu* mainCopyMenu = new KonqCopyToMainMenu(menu, d, Copy); mainCopyMenu->setTitle(i18nc("@title:menu", "Copy To")); mainCopyMenu->menuAction()->setObjectName( QLatin1String("copyTo_submenu" )); // for the unittest menu->addMenu(mainCopyMenu); if (!d->m_readOnly) { KMenu* mainMoveMenu = new KonqCopyToMainMenu(menu, d, Move); mainMoveMenu->setTitle(i18nc("@title:menu", "Move To")); mainMoveMenu->menuAction()->setObjectName( QLatin1String("moveTo_submenu" )); // for the unittest menu->addMenu(mainMoveMenu); } }
void BlockAnalyzer::contextMenuEvent( QContextMenuEvent * ) { KMenu *menu = new KMenu( this ); menu->setTitle( i18n( "Framerate" ) ); QAction *a = menu->addAction( i18n("50 fps"), this, SLOT( set50fps() ) ); if( timeout() == 50 ) a->setChecked( true ); a = menu->addAction( i18n("33 fps"), this, SLOT( set33fps() ) ); if( timeout() == 33 ) a->setChecked( true ); a = menu->addAction( i18n("25 fps"), this, SLOT( set25fps() ) ); if( timeout() == 25 ) a->setChecked( true ); a = menu->addAction( i18n("20 fps"), this, SLOT( set20fps() ) ); if( timeout() == 20 ) a->setChecked( true ); a = menu->addAction( i18n("10 fps"), this, SLOT( set10fps() ) ); if( timeout() == 10 ) a->setChecked( true ); #if defined HAVE_LIBVISUAL menu->addSeparator(); menu->addAction( Amarok::actionCollection()->action( "visualizations" ) ); #endif menu->exec(); }
void Amor::slotMouseClicked(const QPoint &pos) { bool restartTimer = mTimer->isActive(); // Stop the animation while the menu is open. if( restartTimer ) { mTimer->stop(); } if( !mMenu ) { KHelpMenu* help = new KHelpMenu( 0, KGlobal::mainComponent().aboutData(), false ); KMenu* helpMenu = help->menu(); #ifdef __GNUC__ #warning the following is kinda dirty and should be done by KHelpMenu::menu() I think. (hermier) #endif helpMenu->setIcon( SmallIcon( QLatin1String( "help-contents" ) ) ); helpMenu->setTitle( i18nc( "@action:inmenu Amor", "&Help" ) ); mMenu = new KMenu( 0 ); mMenu->addTitle( QLatin1String( "Amor" ) ); // I really don't want this i18n'ed mMenu->addAction( SmallIcon( QLatin1String ("configure" ) ), i18nc( "@action:inmenu Amor", "&Configure..." ), this, SLOT(slotConfigure()) ); mMenu->addSeparator(); mMenu->addMenu( helpMenu ); mMenu->addAction( SmallIcon( QLatin1String( "application-exit" ) ), i18nc( "@action:inmenu Amor", "&Quit" ), kapp, SLOT(quit()) ); } mMenu->exec( pos ); if( restartTimer ) { mTimer->setSingleShot( true ); mTimer->start( 1000 ); } }