本文整理汇总了C++中KActionMenu::insert方法的典型用法代码示例。如果您正苦于以下问题:C++ KActionMenu::insert方法的具体用法?C++ KActionMenu::insert怎么用?C++ KActionMenu::insert使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类KActionMenu
的用法示例。
在下文中一共展示了KActionMenu::insert方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Plugin
KGet_plug_in::KGet_plug_in( QObject* parent, const char* name )
: Plugin( parent, name )
{
QPixmap pix = KGlobal::iconLoader()->loadIcon("kget",
KIcon::MainToolbar);
KActionMenu *menu = new KActionMenu( i18n("Download Manager"), pix,
actionCollection(), "kget_menu" );
menu->setDelayed( false );
connect( menu->popupMenu(), SIGNAL( aboutToShow() ), SLOT( showPopup() ));
m_paToggleDropTarget=new KToggleAction(i18n("Show Drop Target"),
KShortcut(),
this, SLOT(slotShowDrop()),
actionCollection(), "show_drop" );
menu->insert( m_paToggleDropTarget );
KAction *action = new KAction(i18n("List All Links"), KShortcut(),
this, SLOT( slotShowLinks() ),
actionCollection(), "show_links");
menu->insert( action );
p_dcopServer= new DCOPClient();
p_dcopServer->attach ();
}
示例2: actionMenu
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;
}
示例3: 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;
}
示例4: setupActions
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");
}
示例5: if
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;
}