本文整理汇总了C++中KActionMenu::setDelayed方法的典型用法代码示例。如果您正苦于以下问题:C++ KActionMenu::setDelayed方法的具体用法?C++ KActionMenu::setDelayed怎么用?C++ KActionMenu::setDelayed使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类KActionMenu
的用法示例。
在下文中一共展示了KActionMenu::setDelayed方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: setupToolbar
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);
}
示例2: 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 ();
}
示例3: setupToolbar
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);
}
示例4: 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;
}
示例5: KMainWindow
/**
* Constructor. Connect all of the object and the job control.
*/
KAudioCreator::KAudioCreator( QWidget* parent, const char* name) :
KMainWindow(parent, name)
{
janusWidget = new KJanusWidget(this, name, KJanusWidget::Tabbed);
setCentralWidget(janusWidget);
QVBox *frame = janusWidget->addVBoxPage(i18n("&CD Tracks"), QString::null, SmallIcon("cdaudio_unmount", 32));
tracks = new TracksImp(frame, "Tracks");
ripper = new Ripper ( frame, "Rip" );
encoder = new Encoder( frame, "Encoder" );
frame = janusWidget->addVBoxPage( i18n("&Jobs"), QString::null, SmallIcon( "run", 32 ) );
jobQue = new JobQueImp( frame, "Que" );
resize(500, 440);
/*KAction *eject = */new KAction( i18n("&Eject CD"), 0, tracks,
SLOT( eject() ), actionCollection(), "eject" );
(void)new KAction( i18n("&Configure KAudioCreator..."), 0, this,
SLOT( showSettings() ), actionCollection(), "configure_kaudiocreator" );
KAction *selectAll = new KAction( i18n( "Select &All Tracks"), 0, tracks,
SLOT( selectAllTracks() ), actionCollection(), "select_all" ) ;
KAction *deselectAll = new KAction( i18n( "Deselect &All Tracks"), 0, tracks,
SLOT( deselectAllTracks() ), actionCollection(), "deselect_all" );
selectAll->setEnabled( false );
deselectAll->setEnabled( false );
KActionMenu *actActionMenu = new KActionMenu( i18n("Rip &Selection"), "rip", actionCollection(), "rip" );
actActionMenu->setDelayed(true); //needed for checking "all accounts"
actActionMenu->setEnabled( false );
connect( actActionMenu, SIGNAL( activated() ), tracks, SLOT( startSession() ) );
ripMenu = actActionMenu->popupMenu();
connect( ripMenu, SIGNAL( activated(int) ), this, SLOT( slotRipSelection(int)) );
connect( ripMenu, SIGNAL( aboutToShow() ), this, SLOT( getRipMenu()) );
KAction *rip = new KAction( i18n( "Rip &Selection" ), 0, tracks,
SLOT( startSession() ), actionCollection(), "rip_selected" );
rip->setEnabled( false );
connect( jobQue, SIGNAL( removeJob(int) ), this, SLOT( updateStatus() ) );
connect( jobQue, SIGNAL( removeJob(int) ), ripper, SLOT( removeJob(int) ) );
connect( jobQue, SIGNAL( removeJob(int) ), encoder, SLOT( removeJob(int)) );
connect( ripper, SIGNAL( updateProgress(int, int) ) , jobQue, SLOT( updateProgress(int,int) ) );
connect( ripper, SIGNAL( addJob(Job*, const QString &) ), jobQue, SLOT( addJob(Job*, const QString &)) );
connect( ripper, SIGNAL( eject(const QString &) ) , tracks, SLOT( ejectDevice(const QString &)) );
connect( ripper, SIGNAL( encodeWav(Job *) ) , encoder, SLOT( encodeWav(Job *)) );
connect( ripper, SIGNAL( jobsChanged() ) , this, SLOT( updateStatus() ) );
connect( encoder, SIGNAL( updateProgress(int, int) ) , jobQue, SLOT( updateProgress(int,int)) );
connect( encoder, SIGNAL( addJob(Job*, const QString&)), jobQue, SLOT( addJob(Job*, const QString &)) );
connect( encoder, SIGNAL( jobsChanged() ) , this, SLOT( updateStatus() ) );
connect( tracks, SIGNAL( hasCD(bool) ) , this, SLOT( hasCD(bool) ) );
connect( tracks, SIGNAL( ripTrack(Job *) ), ripper, SLOT( ripTrack(Job *)) );
connect( tracks, SIGNAL( hasTracks(bool) ), rip, SLOT( setEnabled(bool)) );
connect( tracks, SIGNAL( hasTracks(bool) ), actActionMenu, SLOT( setEnabled(bool)) );
connect( tracks, SIGNAL( hasTracks(bool) ), deselectAll, SLOT( setEnabled(bool)) );
connect( tracks, SIGNAL( hasTracks(bool) ), selectAll, SLOT( setEnabled(bool)) );
(void)new KAction(i18n("Remove &Completed Jobs"), 0, jobQue,
SLOT(clearDoneJobs()), actionCollection(), "clear_done_jobs" );
KAction *edit = new KAction(i18n("&Edit Album..."), 0, tracks,
SLOT(editInformation()), actionCollection(), "edit_cd");
connect(tracks, SIGNAL(hasCD(bool)), edit, SLOT(setEnabled(bool)));
edit->setEnabled( false );
(void)new KAction(i18n("Encode &File..."), 0, this,
SLOT(encodeFile()), actionCollection(), "encode_file");
KAction *cddb = new KAction(i18n("&CDDB Lookup"), 0, tracks,
SLOT(performCDDB()), actionCollection(), "cddb_now");
connect(tracks, SIGNAL(hasCD(bool)), cddb, SLOT(setEnabled(bool)));
cddb->setEnabled( false );
KStdAction::configureNotifications(this, SLOT(configureNotifications()),
actionCollection());
KStdAction::quit( this, SLOT(close()), actionCollection(), "quit" );
// Init statusbar
statusBar()->insertItem(i18n("No Audio CD detected"), 0 );
hasCD(tracks->hasCD());
setupGUI();
}
示例6: setupActions
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" )));
//.........这里部分代码省略.........
示例7: setupActions
//.........这里部分代码省略.........
redownloadSelectedAction->setText(i18nc("redownload selected transfer item", "Redownload Selected"));
redownloadSelectedAction->setIcon(KIcon("view-refresh"));
connect(redownloadSelectedAction, SIGNAL(triggered()), SLOT(slotRedownloadSelected()));
KAction *startAllAction = actionCollection()->addAction("start_all_download");
startAllAction->setText(i18n("Start All"));
startAllAction->setIcon(KIcon("media-seek-forward"));
startAllAction->setShortcuts(KShortcut("Ctrl+R"));
startAllAction->setHelpText(i18n("Starts / resumes all transfers"));
connect(startAllAction, SIGNAL(triggered()), SLOT(slotStartAllDownload()));
KAction *startSelectedAction = actionCollection()->addAction("start_selected_download");
startSelectedAction->setText(i18n("Start Selected"));
startSelectedAction->setIcon(KIcon("media-playback-start"));
startSelectedAction->setHelpText(i18n("Starts / resumes selected transfer"));
connect(startSelectedAction, SIGNAL(triggered()), SLOT(slotStartSelectedDownload()));
KAction *stopAllAction = actionCollection()->addAction("stop_all_download");
stopAllAction->setText(i18n("Pause All"));
stopAllAction->setIcon(KIcon("media-playback-pause"));
stopAllAction->setShortcuts(KShortcut("Ctrl+P"));
stopAllAction->setHelpText(i18n("Pauses all transfers"));
connect(stopAllAction, SIGNAL(triggered()), SLOT(slotStopAllDownload()));
KAction *stopSelectedAction = actionCollection()->addAction("stop_selected_download");
stopSelectedAction->setText(i18n("Stop Selected"));
stopSelectedAction->setIcon(KIcon("media-playback-pause"));
stopSelectedAction->setHelpText(i18n("Pauses selected transfer"));
connect(stopSelectedAction, SIGNAL(triggered()), SLOT(slotStopSelectedDownload()));
KActionMenu *startActionMenu = new KActionMenu(KIcon("media-playback-start"), i18n("Start"),
actionCollection());
actionCollection()->addAction("start_menu", startActionMenu);
startActionMenu->setDelayed(true);
startActionMenu->addAction(startSelectedAction);
startActionMenu->addAction(startAllAction);
connect(startActionMenu, SIGNAL(triggered()), SLOT(slotStartDownload()));
KActionMenu *stopActionMenu = new KActionMenu(KIcon("media-playback-pause"), i18n("Pause"),
actionCollection());
actionCollection()->addAction("stop_menu", stopActionMenu);
stopActionMenu->setDelayed(true);
stopActionMenu->addAction(stopSelectedAction);
stopActionMenu->addAction(stopAllAction);
connect(stopActionMenu, SIGNAL(triggered()), SLOT(slotStopDownload()));
KAction *openDestAction = actionCollection()->addAction("transfer_open_dest");
openDestAction->setText(i18n("Open Destination"));
openDestAction->setIcon(KIcon("document-open"));
connect(openDestAction, SIGNAL(triggered()), SLOT(slotTransfersOpenDest()));
KAction *openFileAction = actionCollection()->addAction("transfer_open_file");
openFileAction->setText(i18n("Open File"));
openFileAction->setIcon(KIcon("document-open"));
connect(openFileAction, SIGNAL(triggered()), SLOT(slotTransfersOpenFile()));
KAction *showDetailsAction = new KToggleAction(KIcon("document-properties"), i18n("Show Details"), actionCollection());
actionCollection()->addAction("transfer_show_details", showDetailsAction);
connect(showDetailsAction, SIGNAL(triggered()), SLOT(slotTransfersShowDetails()));
KAction *copyUrlAction = actionCollection()->addAction("transfer_copy_source_url");
copyUrlAction->setText(i18n("Copy URL to Clipboard"));
copyUrlAction->setIcon(KIcon("edit-copy"));
connect(copyUrlAction, SIGNAL(triggered()), SLOT(slotTransfersCopySourceUrl()));
KAction *transferHistoryAction = actionCollection()->addAction("transfer_history");
示例8: 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;
//.........这里部分代码省略.........
示例9: 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");
}
示例10: setupActions
void MainWindow::setupActions()
{
kDebug() << "setup actions...";
// this let shortcuts work..
actionCollection()->addAssociatedWidget(this);
KAction *a;
// new window action
a = new KAction(KIcon("window-new"), i18n("&New Window"), this);
a->setShortcut(KShortcut(Qt::CTRL | Qt::Key_N));
actionCollection()->addAction(QL1S("new_window"), a);
connect(a, SIGNAL(triggered(bool)), Application::instance(), SLOT(newWindow()));
// Standard Actions
KStandardAction::open(this, SLOT(fileOpen()), actionCollection());
KStandardAction::saveAs(this, SLOT(fileSaveAs()), actionCollection());
KStandardAction::print(this, SLOT(printRequested()), actionCollection());
KStandardAction::quit(this , SLOT(close()), actionCollection());
a = KStandardAction::find(m_findBar, SLOT(show()), actionCollection());
KShortcut findShortcut = KStandardShortcut::find();
findShortcut.setAlternate(Qt::Key_Slash);
a->setShortcut(findShortcut);
KStandardAction::findNext(this, SLOT(findNext()) , actionCollection());
KStandardAction::findPrev(this, SLOT(findPrevious()) , actionCollection());
a = KStandardAction::fullScreen(this, SLOT(viewFullScreen(bool)), this, actionCollection());
KShortcut fullScreenShortcut = KStandardShortcut::fullScreen();
fullScreenShortcut.setAlternate(Qt::Key_F11);
a->setShortcut(fullScreenShortcut);
a = actionCollection()->addAction(KStandardAction::Home);
connect(a, SIGNAL(triggered(Qt::MouseButtons, Qt::KeyboardModifiers)), this, SLOT(homePage(Qt::MouseButtons, Qt::KeyboardModifiers)));
KStandardAction::preferences(this, SLOT(preferences()), actionCollection());
a = KStandardAction::redisplay(m_view, SLOT(webReload()), actionCollection());
a->setText(i18n("Reload"));
KShortcut reloadShortcut = KStandardShortcut::reload();
reloadShortcut.setAlternate(Qt::CTRL + Qt::Key_R);
a->setShortcut(reloadShortcut);
a = new KAction(KIcon("process-stop"), i18n("&Stop"), this);
a->setShortcut(KShortcut(Qt::CTRL | Qt::Key_Period));
actionCollection()->addAction(QL1S("stop"), a);
connect(a, SIGNAL(triggered(bool)), m_view, SLOT(webStop()));
// stop reload Action
m_stopReloadAction = new KAction(this);
actionCollection()->addAction(QL1S("stop_reload") , m_stopReloadAction);
m_stopReloadAction->setShortcutConfigurable(false);
connect(m_view, SIGNAL(browserTabLoading(bool)), this, SLOT(browserLoading(bool)));
browserLoading(false); //first init for blank start page
a = new KAction(i18n("Open Location"), this);
KShortcut openLocationShortcut(Qt::CTRL + Qt::Key_L);
openLocationShortcut.setAlternate(Qt::Key_F6);
a->setShortcut(openLocationShortcut);
actionCollection()->addAction(QL1S("open_location"), a);
connect(a, SIGNAL(triggered(bool)) , this, SLOT(openLocation()));
// set zoom bar actions
m_zoomBar->setupActions(this);
// tab list
m_tabListMenu = new KMenu();
m_tabListMenu->addAction("hack"); // necessary to show the menu on the right side the first time
connect(m_tabListMenu, SIGNAL(aboutToShow()), this, SLOT(aboutToShowTabListMenu()));
connect(m_tabListMenu, SIGNAL(triggered(QAction*)), this, SLOT(openActionTab(QAction*)));
KActionMenu *tabAction = new KActionMenu(i18n("Tab List"), this);
tabAction->setMenu(m_tabListMenu);
tabAction->setIcon(KIcon("document-multiple"));
tabAction->setDelayed(false);
actionCollection()->addAction(QL1S("tab_list"), tabAction);
// =============================== Tools Actions =================================
a = new KAction(i18n("View Page S&ource"), this);
a->setIcon(KIcon("application-xhtml+xml"));
a->setShortcut(KShortcut(Qt::CTRL + Qt::Key_U));
actionCollection()->addAction(QL1S("page_source"), a);
connect(a, SIGNAL(triggered(bool)), this, SLOT(viewPageSource()));
a = Application::instance()->privateBrowsingAction();
a->setShortcut(Qt::ControlModifier + Qt::ShiftModifier + Qt::Key_P);
actionCollection()->addAction(QL1S("private_browsing"), a);
a = new KAction(KIcon("edit-clear"), i18n("Clear Private Data..."), this);
a->setShortcut(Qt::ControlModifier + Qt::ShiftModifier + Qt::Key_Delete);
actionCollection()->addAction(QL1S("clear_private_data"), a);
connect(a, SIGNAL(triggered(bool)), this, SLOT(clearPrivateData()));
// ========================= History related actions ==============================
a = actionCollection()->addAction(KStandardAction::Back);
connect(a, SIGNAL(triggered(Qt::MouseButtons, Qt::KeyboardModifiers)), this, SLOT(openPrevious(Qt::MouseButtons, Qt::KeyboardModifiers)));
m_historyBackMenu = new KMenu(this);
a->setMenu(m_historyBackMenu);
connect(m_historyBackMenu, SIGNAL(aboutToShow()), this, SLOT(aboutToShowBackMenu()));
//.........这里部分代码省略.........
示例11: KBookmarkHandler
//.........这里部分代码省略.........
menu->clear();
menu->insertItem( SmallIconSet( Pana::icon( "files" ) ), i18n( "&Load" ), MakePlaylist );
menu->insertItem( SmallIconSet( Pana::icon( "add_playlist" ) ), i18n( "&Append to Playlist" ), AppendToPlaylist );
menu->insertItem( SmallIconSet( Pana::icon( "queue_track" ) ), i18n( "&Queue Track" ), QueueTrack );
menu->insertItem( SmallIconSet( Pana::icon( "queue_track" ) ), i18n( "&Queue Tracks" ), QueueTracks );
menu->insertItem( SmallIconSet( Pana::icon( "save" ) ), i18n( "&Save as Playlist..." ), SavePlaylist );
menu->insertSeparator();
if (!m_medium)
menu->insertItem( SmallIconSet( Pana::icon( "device" ) ), i18n( "&Transfer to Media Device" ), MediaDevice );
menu->insertItem( SmallIconSet( Pana::icon( "collection" ) ), i18n( "&Organize Files..." ), OrganizeFiles );
menu->insertItem( SmallIconSet( Pana::icon( "collection" ) ), i18n( "&Copy Files to Collection..." ), CopyToCollection );
menu->insertItem( SmallIconSet( Pana::icon( "collection" ) ), i18n( "&Move Files to Collection..." ), MoveToCollection );
menu->insertItem( SmallIconSet( Pana::icon( "burn" ) ), i18n("Burn to CD..."), BurnCd );
menu->insertSeparator();
menu->insertItem( i18n( "&Select All Files" ), SelectAllFiles );
menu->insertSeparator();
actionCollection->action( "delete" )->setIcon( Pana::icon( "remove" ) );
actionCollection->action( "delete" )->plug( menu );
menu->insertSeparator();
menu->insertItem( SmallIconSet( Pana::icon( "info" ) ), i18n( "Edit Track &Information..." ), EditTags );
actionCollection->action( "properties" )->plug( menu );
menu->setItemEnabled( BurnCd, K3bExporter::isAvailable() );
connect( menu, SIGNAL(aboutToShow()), SLOT(prepareContextMenu()) );
connect( menu, SIGNAL(activated( int )), SLOT(contextMenuActivated( int )) );
}
{
KActionMenu *a;
a = static_cast<KActionMenu*>( actionCollection->action( "sorting menu" ) );
a->setIcon( Pana::icon( "configure" ) );
a->setDelayed( false ); //TODO should be done by KDirOperator
actionCollection->action( "delete" )->setShortcut( KShortcut( SHIFT + Key_Delete ) );
a = new KActionMenu( i18n("Bookmarks"), "bookmark", actionCollection, "bookmarks" );
a->setDelayed( false );
new KBookmarkHandler( m_dir, a->popupMenu() );
}
{
if ( KAction *a = actionCollection->action( "up" ) )
a->plug( toolbar );
if ( KAction *a = actionCollection->action( "back" ) )
a->plug( toolbar );
if ( KAction *a = actionCollection->action( "forward" ) )
a->plug( toolbar );
if ( KAction *a = actionCollection->action( "home" ) )
a->plug( toolbar );
if ( KAction *a = actionCollection->action( "reload" ) ) {
a->setIcon( Pana::icon( "refresh" ) );
a->plug( toolbar );
}
toolbar->insertLineSeparator();
if ( KAction *a = actionCollection->action( "short view" ) )
a->plug( toolbar );
if ( KAction *a = actionCollection->action( "detailed view" ) )
a->plug( toolbar );
toolbar->insertLineSeparator();
if ( KAction *a = actionCollection->action( "sorting menu" ) )
a->plug( toolbar );
if ( KAction *a = actionCollection->action( "bookmarks" ) )
a->plug( toolbar );
KAction *gotoCurrent = new KAction( i18n("Go To Current Track Folder"), Pana::icon( "music" ), 0,
this, SLOT( gotoCurrentFolder() ), actionCollection );
gotoCurrent->plug( toolbar );
disconnect( actionCollection->action( "up" ), SIGNAL( activated() ), m_dir, SLOT( cdUp() ) );
connect( actionCollection->action( "up" ), SIGNAL( activated() ), m_dir, SLOT( myCdUp() ) );
disconnect( actionCollection->action( "home" ), SIGNAL( activated() ), m_dir, SLOT( home() ) );
connect( actionCollection->action( "home" ), SIGNAL( activated() ), m_dir, SLOT( myHome() ) );
}
connect( m_filter, SIGNAL(textChanged( const QString& )), SLOT(setFilter( const QString& )) );
connect( m_combo, SIGNAL(urlActivated( const KURL& )), SLOT(setUrl( const KURL& )) );
connect( m_combo, SIGNAL(returnPressed( const QString& )), SLOT(setUrl( const QString& )) );
connect( m_dir, SIGNAL(viewChanged( KFileView* )), SLOT(slotViewChanged( KFileView* )) );
connect( m_dir, SIGNAL(fileSelected( const KFileItem* )), SLOT(activate( const KFileItem* )) );
connect( m_dir, SIGNAL(urlEntered( const KURL& )), SLOT(urlChanged( const KURL& )) );
connect( m_dir, SIGNAL(urlEntered( const KURL& )), searchPane, SLOT(urlChanged( const KURL& )) );
connect( m_dir, SIGNAL(dropped( const KFileItem*, QDropEvent*, const KURL::List& )),
SLOT(dropped( const KFileItem*, QDropEvent*, const KURL::List& )) );
setSpacing( 4 );
setFocusProxy( m_dir ); //so the dirOperator is focused when we get focus events
// Toolbar is more than 250px wide, BrowserBar doesn't allow that. -> Resizing issues.
setMinimumWidth( 250 /* toolbar->sizeHint().width() */ );
}