当前位置: 首页>>代码示例>>C++>>正文


C++ KActionMenu类代码示例

本文整理汇总了C++中KActionMenu的典型用法代码示例。如果您正苦于以下问题:C++ KActionMenu类的具体用法?C++ KActionMenu怎么用?C++ KActionMenu使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了KActionMenu类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: slotJourneysIconClicked

void TitleWidget::slotJourneysIconClicked()
{
    KActionMenu *journeysAction = qobject_cast<KActionMenu*>( m_journeysAction );
    Q_ASSERT( journeysAction );

    // Show the journeys menu under the journey search icon
    journeysAction->menu()->exec( QCursor::pos() );
}
开发者ID:KDE,项目名称:publictransport,代码行数:8,代码来源:titlewidget.cpp

示例2: QAction

void FileBrowserWidget::setupToolbar()
{
	KActionCollection *coll = m_dirOperator->actionCollection();
	m_toolbar->addAction(coll->action("back"));
	m_toolbar->addAction(coll->action("forward"));

	QAction *action = new QAction(this);
	action->setIcon(QIcon::fromTheme("document-open"));
	action->setText(i18n("Open selected"));
	connect(action, SIGNAL(triggered()), this, SLOT(emitFileSelectedSignal()));
	m_toolbar->addAction(action);

	QAction *showOnlyLaTexFilesAction = new QAction(this);
	showOnlyLaTexFilesAction->setText(i18n("Show LaTeX Files Only"));
	showOnlyLaTexFilesAction->setCheckable(true);
	showOnlyLaTexFilesAction->setChecked(KileConfig::showLaTeXFilesOnly());
	connect(showOnlyLaTexFilesAction, SIGNAL(triggered(bool)), this, SLOT(toggleShowLaTeXFilesOnly(bool)));

	// section for settings menu
	KActionMenu *optionsMenu = new KActionMenu(QIcon::fromTheme("configure"), i18n("Options"), this);
	optionsMenu->setDelayed(false);
	optionsMenu->addAction(m_dirOperator->actionCollection()->action("short view"));
	optionsMenu->addAction(m_dirOperator->actionCollection()->action("detailed view"));
	optionsMenu->addAction(m_dirOperator->actionCollection()->action("tree view"));
	optionsMenu->addAction(m_dirOperator->actionCollection()->action("detailed tree view"));
	optionsMenu->addSeparator();
	optionsMenu->addAction(showOnlyLaTexFilesAction);
	optionsMenu->addAction(m_dirOperator->actionCollection()->action("show hidden"));

	m_toolbar->addSeparator();
	m_toolbar->addAction(optionsMenu);
}
开发者ID:KDE,项目名称:kile,代码行数:32,代码来源:filebrowserwidget.cpp

示例3: KAction

void FileBrowserWidget::setupToolbar()
{
	KActionCollection *coll = m_dirOperator->actionCollection();
	m_toolbar->addAction(coll->action("back"));
	m_toolbar->addAction(coll->action("forward"));

	KAction *action = new KAction(this);
	action->setIcon(SmallIcon("document-open"));
	action->setText(i18n("Open selected"));
	connect(action, SIGNAL(triggered()), this, SLOT(emitFileSelectedSignal()));
	m_toolbar->addAction(action);


	// section for settings menu
	KActionMenu *optionsMenu = new KActionMenu(KIcon("configure"), i18n("Options"), this);
	optionsMenu->setDelayed(false);
	optionsMenu->addAction(m_dirOperator->actionCollection()->action("short view"));
	optionsMenu->addAction(m_dirOperator->actionCollection()->action("detailed view"));
	optionsMenu->addAction(m_dirOperator->actionCollection()->action("tree view"));
	optionsMenu->addAction(m_dirOperator->actionCollection()->action("detailed tree view"));
	optionsMenu->addSeparator();
	optionsMenu->addAction(m_dirOperator->actionCollection()->action("show hidden"));

	m_toolbar->addSeparator();
	m_toolbar->addAction(optionsMenu);
}
开发者ID:fagu,项目名称:kileip,代码行数:26,代码来源:filebrowserwidget.cpp

示例4: actionByName

void MainWindow::initToolsMenu()
{
    if (!m_toolsMenu)
        return;

    m_toolsMenu->menu()->clear();

    m_toolsMenu->addAction(actionByName(KStandardAction::name(KStandardAction::Open)));
    m_toolsMenu->addAction(actionByName(KStandardAction::name(KStandardAction::SaveAs)));
    m_toolsMenu->addAction(actionByName(KStandardAction::name(KStandardAction::Print)));
    m_toolsMenu->addAction(actionByName(KStandardAction::name(KStandardAction::Find)));

    QAction *action = actionByName(KStandardAction::name(KStandardAction::Zoom));
    action->setCheckable(true);
    connect (m_zoomBar, SIGNAL(visibilityChanged(bool)), action, SLOT(setChecked(bool)));
    m_toolsMenu->addAction(action);

    m_toolsMenu->addAction(actionByName(QL1S("encodings")));

    m_toolsMenu->addSeparator();

    m_toolsMenu->addAction(actionByName(QL1S("private_browsing")));
    m_toolsMenu->addAction(actionByName(QL1S("clear_private_data")));

    m_toolsMenu->addSeparator();

    KActionMenu *webMenu = new KActionMenu(KIcon("applications-development-web"), i18n("Development"), this);
    webMenu->addAction(actionByName(QL1S("web_inspector")));
    webMenu->addAction(actionByName(QL1S("page_source")));
    webMenu->addAction(actionByName(QL1S("net_analyzer")));
    m_toolsMenu->addAction(webMenu);

    m_toolsMenu->addSeparator();

    action = m_bookmarksBar->toolBar()->toggleViewAction();
    action->setText(i18n("Bookmarks Toolbar"));
    action->setIcon(KIcon("bookmarks-bar"));
    m_toolsMenu->addAction(action);

    m_toolsMenu->addAction(actionByName(QL1S("show_history_panel")));
    m_toolsMenu->addAction(actionByName(QL1S("show_bookmarks_panel")));
    m_toolsMenu->addAction(actionByName(KStandardAction::name(KStandardAction::FullScreen)));

    m_toolsMenu->addSeparator();

    this->setHelpMenuEnabled(true);
    helpMenu()->setIcon(KIcon("help-browser"));
    m_toolsMenu->addAction(helpMenu()->menuAction());
    m_toolsMenu->addAction(actionByName(KStandardAction::name(KStandardAction::Preferences)));
}
开发者ID:Fxrh,项目名称:rekonq,代码行数:50,代码来源:mainwindow.cpp

示例5: KActionMenu

KActionMenu * Account::actionMenu()
{
	//default implementation
	KActionMenu *menu = new KActionMenu( accountId(), myself()->onlineStatus().iconFor( this ),  this );
	QString nick = myself()->property( Kopete::Global::Properties::self()->nickName()).value().toString();

	menu->popupMenu()->insertTitle( myself()->onlineStatus().iconFor( myself() ),
		nick.isNull() ? accountLabel() : i18n( "%2 <%1>" ).arg( accountLabel(), nick )
	);

	OnlineStatusManager::self()->createAccountStatusActions(this, menu);
	menu->popupMenu()->insertSeparator();
	menu->insert( new KAction ( i18n( "Properties" ),  0, this, SLOT( editAccount() ), menu, "actionAccountProperties" ) );

	return menu;
}
开发者ID:serghei,项目名称:kde3-kdenetwork,代码行数:16,代码来源:kopeteaccount.cpp

示例6: QLatin1String

void KBookmarkMenuImporter::newFolder(const QString &text, bool, const QString &)
{
    QString _text = KStringHandler::csqueeze(text).replace('&', QLatin1String("&&"));
    KActionMenu *actionMenu = new KImportedBookmarkActionMenu(QIcon::fromTheme(QStringLiteral("folder")), _text, this);
    mstack.top()->parentMenu()->addAction(actionMenu);
    mstack.top()->m_actions.append(actionMenu);
    KImportedBookmarkMenu *subMenu = new KImportedBookmarkMenu(m_pManager, m_menu->owner(), actionMenu->menu());
    mstack.top()->m_lstSubMenus.append(subMenu);

    mstack.push(subMenu);
}
开发者ID:KDE,项目名称:kbookmarks,代码行数:11,代码来源:kbookmarkmenu.cpp

示例7: KActionMenu

KActionMenu *JabberTransport::actionMenu ()
{
	KActionMenu *menu = new KActionMenu( accountId(), myself()->onlineStatus().iconFor( this ),  this );
	QString nick = myself()->property( Kopete::Global::Properties::self()->nickName()).value().toString();

	menu->popupMenu()->insertTitle( myself()->onlineStatus().iconFor( myself() ),
	nick.isNull() ? accountLabel() : i18n( "%2 <%1>" ).arg( accountLabel(), nick )
								  );
	
	QPtrList<KAction> *customActions = myself()->customContextMenuActions(  );
	if( customActions && !customActions->isEmpty() )
	{
		menu->popupMenu()->insertSeparator();

		for( KAction *a = customActions->first(); a; a = customActions->next() )
			a->plug( menu->popupMenu() );
	}
	delete customActions;

	return menu;

/*	KActionMenu *m_actionMenu = Kopete::Account::actionMenu();

	m_actionMenu->popupMenu()->insertSeparator();

	m_actionMenu->insert(new KAction (i18n ("Join Groupchat..."), "jabber_group", 0,
		this, SLOT (slotJoinNewChat ()), this, "actionJoinChat"));

	m_actionMenu->popupMenu()->insertSeparator();

	m_actionMenu->insert ( new KAction ( i18n ("Services..."), "jabber_serv_on", 0,
										 this, SLOT ( slotGetServices () ), this, "actionJabberServices") );

	m_actionMenu->insert ( new KAction ( i18n ("Send Raw Packet to Server..."), "mail_new", 0,
										 this, SLOT ( slotSendRaw () ), this, "actionJabberSendRaw") );

	m_actionMenu->insert ( new KAction ( i18n ("Edit User Info..."), "identity", 0,
										 this, SLOT ( slotEditVCard () ), this, "actionEditVCard") );

	return m_actionMenu;*/
}
开发者ID:serghei,项目名称:kde3-kdenetwork,代码行数:41,代码来源:jabbertransport.cpp

示例8: SLOT

void MainWindow::createActions()
{
    KStandardAction::open( this, SLOT(slotFileOpen()), actionCollection() );
    KStandardAction::openRecent( this, SLOT(slotFileOpenRecent()), actionCollection() );
    KStandardAction::save( this, SLOT(slotFileSave()), actionCollection() );
    KStandardAction::saveAs( this, SLOT(slotFileSaveAs()), actionCollection() );
    KStandardAction::close( this, SLOT(slotViewClose()), actionCollection() );
    KStandardAction::print( this, SLOT(slotFilePrint()), actionCollection() );
    KStandardAction::quit( this, SLOT(slotFileQuit()), actionCollection() );
    KStandardAction::undo( this, SLOT(slotUndo()), actionCollection() );
    KStandardAction::redo( this, SLOT(slotRedo()), actionCollection() );
    KStandardAction::cut( this, SLOT(slotCut()), actionCollection() );
    KStandardAction::copy( this, SLOT(slotCopy()), actionCollection() );
    KStandardAction::paste( this, SLOT(slotPaste()), actionCollection() );

    KActionMenu *newActionMenu = new KActionMenu( KIcon("document-new"), i18n("&New"), this );
    actionCollection()->addAction( KStandardAction::name(KStandardAction::New), newActionMenu );
    connect( newActionMenu, SIGNAL(activated()), this, SLOT(slotFileNew()) );

    KAction *action;
    action = actionCollection()->addAction( QString("newfile_asm") );
    action->setText( i18n("Assembly") );
    action->setIcon( KIcon("") );
    connect( action, SIGNAL(triggered()), this, SLOT(slotFileNewAssembly()) );
    newActionMenu->addAction( action );

    action = actionCollection()->addAction( QString("newfile_c") );
    action->setText( i18n("C source") );
    action->setIcon( KIcon("text-x-csrc") );
    connect( action, SIGNAL(triggered()), this, SLOT(slotFileNewC()) );
    newActionMenu->addAction( action );

    action = actionCollection()->addAction( QString("ktechlab_circuit") );
    action->setText( i18n("Circuit") );
    action->setIcon( KIcon("ktechlab_circuit") );
    connect( action, SIGNAL(triggered()), this, SLOT(slotFileNewCircuit()) );
    newActionMenu->addAction( action );

    action = actionCollection()->addAction( QString("ktechlab_flowcode") );
    action->setText( i18n("FlowCode") );
    action->setIcon( KIcon("ktechlab_flowcode") );
    connect( action, SIGNAL(triggered()), this, SLOT(slotFileNewFlowCode()) );
    newActionMenu->addAction( action );

    action = actionCollection()->addAction( QString("ktechlab_mechanics") );
    action->setText( i18n("Mechanics") );
    action->setIcon( KIcon("") );
    connect( action, SIGNAL(triggered()), this, SLOT(slotFileNewMechanics()) );
    newActionMenu->addAction( action );

    action = actionCollection()->addAction( QString("ktechlab_microbe") );
    action->setText( i18n("Microbe") );
    action->setIcon( KIcon("ktechlab_microbe") );
    connect( action, SIGNAL(triggered()), this, SLOT(slotFileNewMicrobe()) );
    newActionMenu->addAction( action );
}
开发者ID:appillai,项目名称:ktechlab,代码行数:56,代码来源:mainwindow.cpp

示例9: KBookmarkActionMenu

QAction *KBookmarkMenu::actionForBookmark(const KBookmark &bm)
{
    if (bm.isGroup()) {
        //qDebug() << "Creating bookmark submenu named " << bm.text();
        KActionMenu *actionMenu = new KBookmarkActionMenu(bm, this);
        m_actions.append(actionMenu);
        KBookmarkMenu *subMenu = new KBookmarkMenu(m_pManager, m_pOwner, actionMenu->menu(), bm.address());
        m_lstSubMenus.append(subMenu);
        return actionMenu;
    } else if (bm.isSeparator()) {
        QAction *sa = new QAction(this);
        sa->setSeparator(true);
        m_actions.append(sa);
        return sa;
    } else {
        //qDebug() << "Creating bookmark menu item for " << bm.text();
        QAction *action = new KBookmarkAction(bm, m_pOwner, this);
        m_actions.append(action);
        return action;
    }
}
开发者ID:KDE,项目名称:kbookmarks,代码行数:21,代码来源:kbookmarkmenu.cpp

示例10: KActionMenu

KActionMenu *TabBar::setupHistoryActions()
{
    MainWindow *w = rApp->mainWindow();
    MainView *mv = qobject_cast<MainView *>(parent());

    QAction *openLastClosedTabAction = w->actionByName(QL1S("open_last_closed_tab"));

    bool closedTabsAvailable = (mv->recentlyClosedTabs().size() > 0);
    openLastClosedTabAction->setEnabled(closedTabsAvailable);

    KActionMenu *am = new KActionMenu(KIcon("tab-new"), i18n("Closed Tabs"), this);
    am->setDelayed(false);
    am->setEnabled(closedTabsAvailable);

    if (am->menu())
        am->menu()->clear();

    if (!closedTabsAvailable)
        return am;

    for (int i = 0; i < mv->recentlyClosedTabs().count(); ++i)
    {
        TabHistory item = mv->recentlyClosedTabs().at(i);
        KAction *a = new KAction(rApp->iconManager()->iconForUrl(item.url), item.title, this);
        a->setData(i);
        connect(a, SIGNAL(triggered()), mv, SLOT(openClosedTab()));
        am->addAction(a);
    }

    return am;
}
开发者ID:Arakmar,项目名称:rekonq,代码行数:31,代码来源:tabbar.cpp

示例11: kdDebug

KActionMenu* WPAccount::actionMenu()
{
	kdDebug(14170) <<  "WPAccount::actionMenu()" << endl;

	/// How to remove an action from Kopete::Account::actionMenu()? GF

	KActionMenu *theActionMenu = new KActionMenu(accountId() , myself()->onlineStatus().iconFor(this), this);
	theActionMenu->popupMenu()->insertTitle(myself()->onlineStatus().iconFor(this), i18n("WinPopup (%1)").arg(accountId()));

	if (mProtocol)
	{
		KAction *goOnline = new KAction("Online", QIconSet(mProtocol->WPOnline.iconFor(this)), 0,
										 this, SLOT(connect()), theActionMenu, "actionGoAvailable");
		goOnline->setEnabled(isConnected() && isAway());
		theActionMenu->insert(goOnline);

		KAction *goAway = new KAction("Away", QIconSet(mProtocol->WPAway.iconFor(this)), 0,
									  this, SLOT(goAway()), theActionMenu, "actionGoAway");
		goAway->setEnabled(isConnected() && !isAway());
		theActionMenu->insert(goAway);

		/// One can not really go offline manually - appears online as long as samba server is running. GF

		theActionMenu->popupMenu()->insertSeparator();
		theActionMenu->insert(new KAction(i18n("Properties"),  0,
							  this, SLOT(editAccount()), theActionMenu, "actionAccountProperties"));

	}

	return theActionMenu;
}
开发者ID:serghei,项目名称:kde3-kdenetwork,代码行数:31,代码来源:wpaccount.cpp

示例12: kdWarning

KAction *XMLActionHandler::createAction( KActionCollection *parent )
{
//    kdDebug(80001) << "Creating Action, type is " << type << endl;
//    kdDebug(80001) << "text=" << text << ", icons=" << icons << endl;
//    kdDebug(80001) << "keys=" << keys << ", name=" << name << endl;

    if ( !parent ) {
	kdWarning() << "Create action called but no parent set" << endl;
	return 0;
    }

    KAction *act=0;

    if ( ad.type.isEmpty() || (ad.type == "KAction") ) {
	act = new KAction( ad.text, ad.icons, ad.keys, 0, 0, parent, ad.name.latin1() );
    }
    else if ( ad.type == "KToggleAction" ) {
	act = new KToggleAction( ad.text, ad.icons, ad.keys, 0, 0, parent, ad.name.latin1() );
    }
    else if ( ad.type == "KRadioAction" ) {
	KRadioAction *ra = new KRadioAction( ad.text, ad.icons, ad.keys, 0, 0, parent, ad.name.latin1() );
	if ( ad.exclusive )
	    ra->setExclusiveGroup( ad.group );

	act = ra;
    }
    else if ( ad.type == "KStdAction" ) {
	for ( int i = KStdAction::ActionNone ; i < KStdAction::ConfigureNotifications ; i++ ) {
	    if ( KStdAction::stdName(static_cast<KStdAction::StdAction>(i)) == ad.name )
		act = KStdAction::create( (KStdAction::StdAction)i, 0, 0, parent );
	}
    }
    else if ( ad.type == "KListAction" ) {
	KListAction *la = new KListAction( ad.text, ad.icons, ad.keys, 0, 0, parent, ad.name.latin1() );
	la->setItems( ad.items );
	ad.items.clear();
	act = la;
    }
    else if ( ad.type == "KActionMenu" ) {
	KActionMenu *am = new KActionMenu( ad.text, ad.icons, parent, ad.name.latin1() );

	for ( QStringList::Iterator it = ad.items.begin() ; it != ad.items.end() ; ++it ) {
	    KAction *a = parent->action( (*it).latin1() );
	    if ( a )
		am->insert( a );
	}
	ad.items.clear();
	act = am;
    }
    else {
	kdWarning() << "Unknown ActionType " << ad.type << endl;
	return 0;
    }

    if ( !act ) {
	kdWarning() << "Unable to create action" << endl;
	return act;
    }

    if ( !ad.group.isEmpty() )
	act->setGroup( ad.group );

    act->setStatusText( ad.status );
    act->setWhatsThis( ad.whatsthis );

    QObject::connect( actclient, SIGNAL( destroyed() ), act, SLOT( deleteLater() ) );

    return act;
}
开发者ID:Kst-plot,项目名称:kst-subversion-archive,代码行数:69,代码来源:xmlactionclient.cpp

示例13: SLOT

void JuK::setupActions()
{
    ActionCollection::actions()->setWidget(this);

    KStdAction::quit(this, SLOT(slotQuit()), actions());
    KStdAction::undo(this, SLOT(slotUndo()), actions());
    KStdAction::cut(kapp,   SLOT(cut()),   actions());
    KStdAction::copy(kapp,  SLOT(copy()),  actions());
    KStdAction::paste(kapp, SLOT(paste()), actions());
    KStdAction::clear(kapp, SLOT(clear()), actions());
    KStdAction::selectAll(kapp, SLOT(selectAll()), actions());

    new KAction(i18n("Remove From Playlist"), "edit_remove", 0, kapp, SLOT(clear()), actions(), "removeFromPlaylist");

    KActionMenu *actionMenu = new KActionMenu(i18n("&Random Play"), "roll", actions(), "actionMenu");
    actionMenu->setDelayed(false);

    KRadioAction *ka = new KRadioAction(i18n("&Disable Random Play"), "player_playlist", 0, actions(), "disableRandomPlay");
    ka->setExclusiveGroup("randomPlayGroup");
    actionMenu->insert(ka);

    m_randomPlayAction = new KRadioAction(i18n("Use &Random Play"), "roll", 0, actions(), "randomPlay");
    m_randomPlayAction->setExclusiveGroup("randomPlayGroup");
    actionMenu->insert(m_randomPlayAction);

    ka = new KRadioAction(i18n("Use &Album Random Play"), "roll", 0, actions(), "albumRandomPlay");
    ka->setExclusiveGroup("randomPlayGroup");
    connect(ka, SIGNAL(toggled(bool)), SLOT(slotCheckAlbumNextAction(bool)));
    actionMenu->insert(ka);

    new KAction(i18n("&Play"),  "player_play",  0, m_player, SLOT(play()),  actions(), "play");
    new KAction(i18n("P&ause"), "player_pause", 0, m_player, SLOT(pause()), actions(), "pause");
    new KAction(i18n("&Stop"),  "player_stop",  0, m_player, SLOT(stop()),  actions(), "stop");

    new KToolBarPopupAction(i18n("previous track", "Previous"), "player_start", KShortcut(), m_player, SLOT(back()), actions(), "back");
    new KAction(i18n("next track", "&Next"), "player_end", KShortcut(), m_player, SLOT(forward()), actions(), "forward");
    new KToggleAction(i18n("&Loop Playlist"), 0, KShortcut(), actions(), "loopPlaylist");
    KToggleAction *resizeColumnAction =
        new KToggleAction(i18n("&Resize Playlist Columns Manually"),
	                  KShortcut(), actions(), "resizeColumnsManually");
    resizeColumnAction->setCheckedState(i18n("&Resize Column Headers Automatically"));

    // the following are not visible by default

    new KAction(i18n("Mute"),         "mute",        0, m_player, SLOT(mute()),        actions(), "mute");
    new KAction(i18n("Volume Up"),    "volumeUp",    0, m_player, SLOT(volumeUp()),    actions(), "volumeUp");
    new KAction(i18n("Volume Down"),  "volumeDown",  0, m_player, SLOT(volumeDown()),  actions(), "volumeDown");
    new KAction(i18n("Play / Pause"), "playPause",   0, m_player, SLOT(playPause()),   actions(), "playPause");
    new KAction(i18n("Seek Forward"), "seekForward", 0, m_player, SLOT(seekForward()), actions(), "seekForward");
    new KAction(i18n("Seek Back"),    "seekBack",    0, m_player, SLOT(seekBack()),    actions(), "seekBack");

    //////////////////////////////////////////////////
    // settings menu
    //////////////////////////////////////////////////

    m_toggleSplashAction =
	new KToggleAction(i18n("Show Splash Screen on Startup"),
			  KShortcut(), actions(), "showSplashScreen");
    m_toggleSplashAction->setCheckedState(i18n("Hide Splash Screen on Startup"));
    m_toggleSystemTrayAction =
	new KToggleAction(i18n("&Dock in System Tray"),
			  KShortcut(), actions(), "toggleSystemTray");
    m_toggleDockOnCloseAction =
	new KToggleAction(i18n("&Stay in System Tray on Close"),
			  KShortcut(), actions(), "dockOnClose");
    m_togglePopupsAction =
	new KToggleAction(i18n("Popup &Track Announcement"),
			  KShortcut(), this, 0, actions(), "togglePopups");
    new KToggleAction(i18n("Save &Play Queue on Exit"),
                      KShortcut(), this, 0, actions(), "saveUpcomingTracks");

    connect(m_toggleSystemTrayAction, SIGNAL(toggled(bool)),
	    this, SLOT(slotToggleSystemTray(bool)));


    m_outputSelectAction = PlayerManager::playerSelectAction(actions());

    if(m_outputSelectAction)
        m_outputSelectAction->setCurrentItem(0);

    new KAction(i18n("&Tag Guesser..."), 0, 0, this, SLOT(slotConfigureTagGuesser()),
		actions(), "tagGuesserConfig");

    new KAction(i18n("&File Renamer..."), 0, 0, this, SLOT(slotConfigureFileRenamer()),
		actions(), "fileRenamerConfig");

    KStdAction::keyBindings(this, SLOT(slotEditKeys()), actions());

    //////////////////////////////////////////////////
    // just in the toolbar
    //////////////////////////////////////////////////

    m_sliderAction = new SliderAction(i18n("Track Position"), actions(),
				      "trackPositionAction");
}
开发者ID:serghei,项目名称:kde3-kdemultimedia,代码行数:95,代码来源:juk.cpp

示例14: SLOT

void JuK::setupActions()
{
    KActionCollection *collection = ActionCollection::actions();

    // Setup KDE standard actions that JuK uses.

    KStandardAction::quit(this, SLOT(slotQuit()), collection);
    KStandardAction::undo(this, SLOT(slotUndo()), collection);
    KStandardAction::cut(collection);
    KStandardAction::copy(collection);
    KStandardAction::paste(collection);
    KAction *clear = KStandardAction::clear(collection);
    KStandardAction::selectAll(collection);
    KStandardAction::keyBindings(this, SLOT(slotEditKeys()), collection);


    // Setup the menu which handles the random play options.
    KActionMenu *actionMenu = collection->add<KActionMenu>("actionMenu");
    actionMenu->setText(i18n("&Random Play"));
    actionMenu->setIcon(KIcon( QLatin1String( "media-playlist-shuffle" )));
    actionMenu->setDelayed(false);

    QActionGroup* randomPlayGroup = new QActionGroup(this);

    QAction *act = collection->add<KToggleAction>("disableRandomPlay");
    act->setText(i18n("&Disable Random Play"));
    act->setIcon(KIcon( QLatin1String( "go-down" )));
    act->setActionGroup(randomPlayGroup);
    actionMenu->addAction(act);

    m_randomPlayAction = collection->add<KToggleAction>("randomPlay");
    m_randomPlayAction->setText(i18n("Use &Random Play"));
    m_randomPlayAction->setIcon(KIcon( QLatin1String( "media-playlist-shuffle" )));
    m_randomPlayAction->setActionGroup(randomPlayGroup);
    actionMenu->addAction(m_randomPlayAction);

    act = collection->add<KToggleAction>("albumRandomPlay");
    act->setText(i18n("Use &Album Random Play"));
    act->setIcon(KIcon( QLatin1String( "media-playlist-shuffle" )));
    act->setActionGroup(randomPlayGroup);
    connect(act, SIGNAL(triggered(bool)), SLOT(slotCheckAlbumNextAction(bool)));
    actionMenu->addAction(act);

    act = collection->addAction("removeFromPlaylist", clear, SLOT(clear()));
    act->setText(i18n("Remove From Playlist"));
    act->setIcon(KIcon( QLatin1String( "list-remove" )));

    act = collection->add<KToggleAction>("crossfadeTracks");
    act->setText(i18n("Crossfade Between Tracks"));
    connect(act, SIGNAL(triggered(bool)), m_player, SLOT(setCrossfadeEnabled(bool)));

    act = collection->addAction("play", m_player, SLOT(play()));
    act->setText(i18n("&Play"));
    act->setIcon(KIcon( QLatin1String( "media-playback-start" )));

    act = collection->addAction("pause", m_player, SLOT(pause()));
    act->setText(i18n("P&ause"));
    act->setIcon(KIcon( QLatin1String( "media-playback-pause" )));

    act = collection->addAction("stop", m_player, SLOT(stop()));
    act->setText(i18n("&Stop"));
    act->setIcon(KIcon( QLatin1String( "media-playback-stop" )));

    act = new KToolBarPopupAction(KIcon( QLatin1String( "media-skip-backward") ), i18nc("previous track", "Previous" ), collection);
    collection->addAction("back", act);
    connect(act, SIGNAL(triggered(bool)), m_player, SLOT(back()));

    act = collection->addAction("forward", m_player, SLOT(forward()));
    act->setText(i18nc("next track", "&Next"));
    act->setIcon(KIcon( QLatin1String( "media-skip-forward" )));

    act = collection->addAction("loopPlaylist");
    act->setText(i18n("&Loop Playlist"));
    act->setCheckable(true);

    act = collection->add<KToggleAction>("resizeColumnsManually");
    act->setText(i18n("&Resize Playlist Columns Manually"));

    // the following are not visible by default

    act = collection->addAction("mute", m_player, SLOT(mute()));
    act->setText(i18nc("silence playback", "Mute"));
    act->setIcon(KIcon( QLatin1String( "audio-volume-muted" )));

    act = collection->addAction("volumeUp", m_player, SLOT(volumeUp()));
    act->setText(i18n("Volume Up"));
    act->setIcon(KIcon( QLatin1String( "audio-volume-high" )));

    act = collection->addAction("volumeDown", m_player, SLOT(volumeDown()));
    act->setText(i18n("Volume Down"));
    act->setIcon(KIcon( QLatin1String( "audio-volume-low" )));

    act = collection->addAction("playPause", m_player, SLOT(playPause()));
    act->setText(i18n("Play / Pause"));
    act->setIcon(KIcon( QLatin1String( "media-playback-start" )));

    act = collection->addAction("seekForward", m_player, SLOT(seekForward()));
    act->setText(i18n("Seek Forward"));
    act->setIcon(KIcon( QLatin1String( "media-seek-forward" )));

//.........这里部分代码省略.........
开发者ID:kryptBlue,项目名称:juk,代码行数:101,代码来源:juk.cpp

示例15: KexiView

KexiReportView::KexiReportView(QWidget *parent)
        : KexiView(parent), m_preRenderer(0), m_reportDocument(0) //! @todo KEXI3, m_kexi(0), m_functions(0)
{
    setObjectName("KexiReportDesigner_DataView");

    m_reportView = new KReportView(this);
    layout()->addWidget(m_reportView);

#ifndef KEXI_MOBILE
    m_pageSelector = new KexiRecordNavigator(*m_reportView->scrollArea(), m_reportView);
    m_pageSelector->setInsertingButtonVisible(false);
    m_pageSelector->setInsertingEnabled(false);
    m_pageSelector->setLabelText(xi18nc("Page selector label", "Page:"));
    m_pageSelector->setButtonToolTipText(KexiRecordNavigator::ButtonFirst, xi18n("Go to first page"));
    m_pageSelector->setButtonWhatsThisText(KexiRecordNavigator::ButtonFirst, xi18n("Goes to first page"));
    m_pageSelector->setButtonToolTipText(KexiRecordNavigator::ButtonPrevious, xi18n("Go to previous page"));
    m_pageSelector->setButtonWhatsThisText(KexiRecordNavigator::ButtonPrevious, xi18n("Goes to previous page"));
    m_pageSelector->setButtonToolTipText(KexiRecordNavigator::ButtonNext, xi18n("Go to next page"));
    m_pageSelector->setButtonWhatsThisText(KexiRecordNavigator::ButtonNext, xi18n("Goes to next page"));
    m_pageSelector->setButtonToolTipText(KexiRecordNavigator::ButtonLast, xi18n("Go to last page"));
    m_pageSelector->setButtonWhatsThisText(KexiRecordNavigator::ButtonLast, xi18n("Goes to last page"));
    m_pageSelector->setNumberFieldToolTips(xi18n("Current page number"), xi18n("Number of pages"));
    m_pageSelector->setRecordHandler(this);
#endif

    // -- setup local actions
    QList<QAction*> viewActions;
    QAction* a;

#ifndef KEXI_MOBILE
    viewActions << (a = new QAction(koIcon("document-print"), xi18n("Print"), this));
    a->setObjectName("print_report");
    a->setToolTip(xi18n("Print report"));
    a->setWhatsThis(xi18n("Prints the current report."));
    connect(a, SIGNAL(triggered()), this, SLOT(slotPrintReport()));

    KActionMenu *exportMenu = new KActionMenu(koIcon("document-export"), xi18nc("@title:menu","E&xport As"), this);
    exportMenu->setObjectName("report_export_as");
    exportMenu->setDelayed(false);
#endif

#ifdef KEXI_MOBILE
    viewActions << (a = new QAction(xi18n("Export:"), this));
    a->setEnabled(false); //!TODO this is a bit of a dirty way to add what looks like a label to the toolbar!
    // " ", not "", is said to be needed in maemo, the icon didn't display properly without it
    viewActions << (a = new QAction(koIcon("application-vnd.oasis.opendocument.text"), QLatin1String(" "), this));
#else
    exportMenu->addAction(a = new QAction(koIcon("application-vnd.oasis.opendocument.text"),
                                          xi18nc("open dialog to export as text document", "Text Document..."), this));
#endif
    a->setObjectName("export_as_text_document");
    a->setToolTip(xi18n("Export the report as a text document (in OpenDocument Text format)"));
    a->setWhatsThis(xi18n("Exports the report as a text document (in OpenDocument Text format)."));
    a->setEnabled(true);
    connect(a, SIGNAL(triggered()), this, SLOT(slotExportAsTextDocument()));

#ifdef KEXI_MOBILE
    viewActions << (a = new QAction(koIcon("application-pdf"), QLatin1String(" "), this));
#else
    exportMenu->addAction(a = new QAction(koIcon("application-pdf"),
                                          xi18nc("Portable Document Format...", "PDF..."), this));
#endif
    a->setObjectName("export_as_pdf");
    a->setToolTip(xi18n("Export as PDF"));
    a->setWhatsThis(xi18n("Exports the current report as PDF."));
    a->setEnabled(true);
    connect(a, SIGNAL(triggered()), this, SLOT(slotExportAsPdf()));

#ifdef KEXI_MOBILE
    viewActions << (a = new QAction(koIcon("application-vnd.oasis.opendocument.spreadsheet"), QLatin1String(" "), this));
#else
    exportMenu->addAction(a = new QAction(koIcon("application-vnd.oasis.opendocument.spreadsheet"),
                                          xi18nc("open dialog to export as spreadsheet", "Spreadsheet..."), this));
#endif
    a->setObjectName("export_as_spreadsheet");
    a->setToolTip(xi18n("Export the report as a spreadsheet (in OpenDocument Spreadsheet format)"));
    a->setWhatsThis(xi18n("Exports the report as a spreadsheet (in OpenDocument Spreadsheet format)."));
    a->setEnabled(true);
    connect(a, SIGNAL(triggered()), this, SLOT(slotExportAsSpreadsheet()));

#ifdef KEXI_MOBILE
    viewActions << (a = new QAction(koIcon("text-html"), QLatin1String(" "), this));
#else
    exportMenu->addAction(a = new QAction(koIcon("text-html"),
                                          xi18nc("open dialog to export as web page", "Web Page..."), this));
#endif
    a->setObjectName("export_as_web_page");
    a->setToolTip(xi18n("Export the report as a web page (in HTML format)"));
    a->setWhatsThis(xi18n("Exports the report as a web page (in HTML format)."));
    a->setEnabled(true);
    connect(a, SIGNAL(triggered()), this, SLOT(slotExportAsWebPage()));

    setViewActions(viewActions);

#ifndef KEXI_MOBILE
    // setup main menu actions
    QList<QAction*> mainMenuActions;

    mainMenuActions << exportMenu;

//.........这里部分代码省略.........
开发者ID:TheTypoMaster,项目名称:calligra,代码行数:101,代码来源:kexireportview.cpp


注:本文中的KActionMenu类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。