本文整理汇总了C++中KToggleAction::setCheckedState方法的典型用法代码示例。如果您正苦于以下问题:C++ KToggleAction::setCheckedState方法的具体用法?C++ KToggleAction::setCheckedState怎么用?C++ KToggleAction::setCheckedState使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类KToggleAction
的用法示例。
在下文中一共展示了KToggleAction::setCheckedState方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: guiItem
KToggleAction *showStatusbar(const QObject *recvr, const char *slot, KActionCollection *parent, const char *_name)
{
KToggleAction *ret;
ret = new KToggleAction(i18n("Show St&atusbar"), 0, recvr, slot, parent, _name ? _name : name(ShowStatusbar));
ret->setWhatsThis(
i18n("Show Statusbar<p>"
"Shows the statusbar, which is the bar at the bottom of the window used for status information."));
KGuiItem guiItem(i18n("Hide St&atusbar"), QString::null, QString::null,
i18n("Hide Statusbar<p>"
"Hides the statusbar, which is the bar at the bottom of the window used for status information."));
ret->setCheckedState(guiItem);
ret->setChecked(true);
return ret;
}
示例2: registerToolView
void GUIClient::registerToolView (ToolView *tv)
{
QString aname = QString("kate_mdi_toolview_") + tv->id;
// try to read the action shortcut
KShortcut sc;
KConfig *cfg = kapp->config();
QString _grp = cfg->group();
cfg->setGroup("Shortcuts");
sc = KShortcut( cfg->readEntry( aname, "" ) );
cfg->setGroup( _grp );
KToggleAction *a = new ToggleToolViewAction(i18n("Show %1").arg(tv->text),
sc,tv, actionCollection(), aname.latin1() );
a->setCheckedState(i18n("Hide %1").arg(tv->text));
m_toolViewActions.append(a);
m_toolMenu->insert(a);
m_toolToAction.insert (tv, a);
updateActions();
}
示例3: initActions
void KMMainView::initActions()
{
KIconSelectAction *vact = new KIconSelectAction(i18n("&View"), 0, m_actions, "view_change");
QStringList iconlst;
iconlst << "view_icon"
<< "view_detailed"
<< "view_tree";
vact->setItems(QStringList::split(',', i18n("&Icons,&List,&Tree"), false), iconlst);
vact->setCurrentItem(0);
connect(vact, SIGNAL(activated(int)), SLOT(slotChangeView(int)));
KActionMenu *stateAct = new KActionMenu(i18n("Start/Stop Printer"), "kdeprint_printstate", m_actions, "printer_state_change");
stateAct->setDelayed(false);
stateAct->insert(
new KAction(i18n("&Start Printer"), "kdeprint_enableprinter", 0, this, SLOT(slotChangePrinterState()), m_actions, "printer_start"));
stateAct->insert(new KAction(i18n("Sto&p Printer"), "kdeprint_stopprinter", 0, this, SLOT(slotChangePrinterState()), m_actions, "printer_stop"));
stateAct = new KActionMenu(i18n("Enable/Disable Job Spooling"), "kdeprint_queuestate", m_actions, "printer_spool_change");
stateAct->setDelayed(false);
stateAct->insert(
new KAction(i18n("&Enable Job Spooling"), "kdeprint_enableprinter", 0, this, SLOT(slotChangePrinterState()), m_actions, "printer_enable"));
stateAct->insert(
new KAction(i18n("&Disable Job Spooling"), "kdeprint_stopprinter", 0, this, SLOT(slotChangePrinterState()), m_actions, "printer_disable"));
new KAction(i18n("&Remove"), "edittrash", 0, this, SLOT(slotRemove()), m_actions, "printer_remove");
new KAction(i18n("&Configure..."), "configure", 0, this, SLOT(slotConfigure()), m_actions, "printer_configure");
new KAction(i18n("Add &Printer/Class..."), "kdeprint_addprinter", 0, this, SLOT(slotAdd()), m_actions, "printer_add");
new KAction(i18n("Add &Special (pseudo) Printer..."), "kdeprint_addpseudo", 0, this, SLOT(slotAddSpecial()), m_actions, "printer_add_special");
new KAction(i18n("Set as &Local Default"), "kdeprint_defaulthard", 0, this, SLOT(slotHardDefault()), m_actions, "printer_hard_default");
new KAction(i18n("Set as &User Default"), "kdeprint_defaultsoft", 0, this, SLOT(slotSoftDefault()), m_actions, "printer_soft_default");
new KAction(i18n("&Test Printer..."), "kdeprint_testprinter", 0, this, SLOT(slotTest()), m_actions, "printer_test");
new KAction(i18n("Configure &Manager..."), "kdeprint_configmgr", 0, this, SLOT(slotManagerConfigure()), m_actions, "manager_configure");
new KAction(i18n("Initialize Manager/&View"), "reload", 0, this, SLOT(slotInit()), m_actions, "view_refresh");
KIconSelectAction *dact = new KIconSelectAction(i18n("&Orientation"), 0, m_actions, "orientation_change");
iconlst.clear();
iconlst << "view_top_bottom"
<< "view_left_right";
dact->setItems(QStringList::split(',', i18n("&Vertical,&Horizontal"), false), iconlst);
dact->setCurrentItem(0);
connect(dact, SIGNAL(activated(int)), SLOT(slotChangeDirection(int)));
new KAction(i18n("R&estart Server"), "kdeprint_restartsrv", 0, this, SLOT(slotServerRestart()), m_actions, "server_restart");
new KAction(i18n("Configure &Server..."), "kdeprint_configsrv", 0, this, SLOT(slotServerConfigure()), m_actions, "server_configure");
KToggleAction *tact = new KToggleAction(i18n("Show &Toolbar"), 0, m_actions, "view_toolbar");
tact->setCheckedState(i18n("Hide &Toolbar"));
connect(tact, SIGNAL(toggled(bool)), SLOT(slotToggleToolBar(bool)));
tact = new KToggleAction(i18n("Show Me&nu Toolbar"), 0, m_actions, "view_menubar");
tact->setCheckedState(i18n("Hide Me&nu Toolbar"));
connect(tact, SIGNAL(toggled(bool)), SLOT(slotToggleMenuBar(bool)));
tact = new KToggleAction(i18n("Show Pr&inter Details"), "kdeprint_printer_infos", 0, m_actions, "view_printerinfos");
tact->setCheckedState(KGuiItem(i18n("Hide Pr&inter Details"), "kdeprint_printer_infos"));
tact->setChecked(true);
connect(tact, SIGNAL(toggled(bool)), SLOT(slotShowPrinterInfos(bool)));
tact = new KToggleAction(i18n("Toggle Printer &Filtering"), "filter", 0, m_actions, "view_pfilter");
tact->setChecked(KMManager::self()->isFilterEnabled());
connect(tact, SIGNAL(toggled(bool)), SLOT(slotToggleFilter(bool)));
new KAction(i18n("%1 &Handbook").arg("KDEPrint"), "contents", 0, this, SLOT(slotHelp()), m_actions, "invoke_help");
new KAction(i18n("%1 &Web Site").arg("KDEPrint"), "network", 0, this, SLOT(slotHelp()), m_actions, "invoke_web");
KActionMenu *mact = new KActionMenu(i18n("Pri&nter Tools"), "package_utilities", m_actions, "printer_tool");
mact->setDelayed(false);
connect(mact->popupMenu(), SIGNAL(activated(int)), SLOT(slotToolSelected(int)));
QStringList files = KGlobal::dirs()->findAllResources("data", "kdeprint/tools/*.desktop");
for(QStringList::ConstIterator it = files.begin(); it != files.end(); ++it)
{
KSimpleConfig conf(*it);
conf.setGroup("Desktop Entry");
mact->popupMenu()->insertItem(conf.readEntry("Name", "Unnamed"), mact->popupMenu()->count());
m_toollist << conf.readEntry("X-KDE-Library");
}
// add actions to the toolbar
m_actions->action("printer_add")->plug(m_toolbar);
m_actions->action("printer_add_special")->plug(m_toolbar);
m_toolbar->insertLineSeparator();
m_actions->action("printer_state_change")->plug(m_toolbar);
m_actions->action("printer_spool_change")->plug(m_toolbar);
m_toolbar->insertSeparator();
m_actions->action("printer_hard_default")->plug(m_toolbar);
m_actions->action("printer_soft_default")->plug(m_toolbar);
m_actions->action("printer_remove")->plug(m_toolbar);
m_toolbar->insertSeparator();
m_actions->action("printer_configure")->plug(m_toolbar);
m_actions->action("printer_test")->plug(m_toolbar);
m_actions->action("printer_tool")->plug(m_toolbar);
m_pactionsindex = m_toolbar->insertSeparator();
m_toolbar->insertLineSeparator();
m_actions->action("server_restart")->plug(m_toolbar);
m_actions->action("server_configure")->plug(m_toolbar);
m_toolbar->insertLineSeparator();
m_actions->action("manager_configure")->plug(m_toolbar);
m_actions->action("view_refresh")->plug(m_toolbar);
m_toolbar->insertLineSeparator();
m_actions->action("view_printerinfos")->plug(m_toolbar);
m_actions->action("view_change")->plug(m_toolbar);
m_actions->action("orientation_change")->plug(m_toolbar);
//.........这里部分代码省略.........
示例4: initActions
void KPrView::initActions()
{
//setComponentData(KPrFactory::componentData());
if (!koDocument()->isReadWrite() )
setXMLFile( "stage_readonly.rc" );
else
setXMLFile( "stage.rc" );
#ifdef CAN_USE_QTWEBKIT
// do special stage stuff here
m_actionExportHtml = new QAction(i18n("Export as HTML..."), this);
actionCollection()->addAction("file_export_html", m_actionExportHtml);
connect(m_actionExportHtml, SIGNAL(triggered()), this, SLOT(exportToHtml()));
#endif
m_actionViewModeNormal = new QAction(m_normalMode->name(), this);
m_actionViewModeNormal->setCheckable(true);
m_actionViewModeNormal->setChecked(true);
m_actionViewModeNormal->setShortcut(QKeySequence("CTRL+F5"));
actionCollection()->addAction("view_normal", m_actionViewModeNormal);
connect(m_actionViewModeNormal, SIGNAL(triggered()), this, SLOT(showNormal()));
m_actionViewModeNotes = new QAction(m_notesMode->name(), this);
m_actionViewModeNotes->setCheckable(true);
m_actionViewModeNotes->setShortcut(QKeySequence("CTRL+F6"));
actionCollection()->addAction("view_notes", m_actionViewModeNotes);
connect(m_actionViewModeNotes, SIGNAL(triggered()), this, SLOT(showNotes()));
m_actionViewModeSlidesSorter = new QAction(m_slidesSorterMode->name(), this);
m_actionViewModeSlidesSorter->setCheckable(true);
m_actionViewModeSlidesSorter->setShortcut(QKeySequence("CTRL+F7"));
actionCollection()->addAction("view_slides_sorter", m_actionViewModeSlidesSorter);
connect(m_actionViewModeSlidesSorter, SIGNAL(triggered()), this, SLOT(showSlidesSorter()));
if ( QAction *action = actionCollection()->action("view_masterpages") )
action->setShortcut(QKeySequence("CTRL+F8"));
m_actionInsertPictures = new QAction(i18n("Insert Pictures as Slides..."), this);
actionCollection()->addAction("insert_pictures", m_actionInsertPictures);
connect(m_actionInsertPictures, SIGNAL(activated()), this, SLOT(insertPictures()));
QActionGroup *viewModesGroup = new QActionGroup(this);
viewModesGroup->addAction(m_actionViewModeNormal);
viewModesGroup->addAction(m_actionViewModeNotes);
viewModesGroup->addAction(m_actionViewModeSlidesSorter);
m_actionCreateAnimation = new QAction( i18n( "Create Appear Animation" ), this );
actionCollection()->addAction( "edit_createanimation", m_actionCreateAnimation );
connect( m_actionCreateAnimation, SIGNAL(activated()), this, SLOT(createAnimation()) );
m_actionEditCustomSlideShows = new QAction( i18n( "Edit Custom Slide Shows..." ), this );
actionCollection()->addAction( "edit_customslideshows", m_actionEditCustomSlideShows );
connect( m_actionEditCustomSlideShows, SIGNAL(activated()), this, SLOT(editCustomSlideShows()) );
m_actionStartPresentation = new KActionMenu(koIcon("view-presentation"), i18n("Start Presentation"), this);
actionCollection()->addAction( "slideshow_start", m_actionStartPresentation );
connect( m_actionStartPresentation, SIGNAL(activated()), this, SLOT(startPresentation()) );
QAction* action = new QAction( i18n( "From Current Slide" ), this );
action->setShortcut(QKeySequence("Shift+F5"));
m_actionStartPresentation->addAction( action );
connect( action, SIGNAL(activated()), this, SLOT(startPresentation()) );
action = new QAction( i18n( "From First Slide" ), this );
action->setShortcut(QKeySequence("F5"));
m_actionStartPresentation->addAction( action );
connect( action, SIGNAL(activated()), this, SLOT(startPresentationFromBeginning()) );
KToggleAction *showStatusbarAction = new KToggleAction(i18n("Show Status Bar"), this);
showStatusbarAction->setCheckedState(KGuiItem(i18n("Hide Status Bar")));
showStatusbarAction->setToolTip(i18n("Shows or hides the status bar"));
actionCollection()->addAction("showStatusBar", showStatusbarAction);
connect(showStatusbarAction, SIGNAL(toggled(bool)), this, SLOT(showStatusBar(bool)));
//Update state of status bar action
if (showStatusbarAction && statusBar()){
showStatusbarAction->setChecked(! statusBar()->isHidden());
}
action = new QAction( i18n( "Configure Slide Show..." ), this );
actionCollection()->addAction( "slideshow_configure", action );
connect( action, SIGNAL(activated()), this, SLOT(configureSlideShow()) );
action = new QAction( i18n( "Configure Presenter View..." ), this );
actionCollection()->addAction( "slideshow_presenterview", action );
connect( action, SIGNAL(activated()), this, SLOT(configurePresenterView()) );
m_actionDrawOnPresentation = new QAction( i18n( "Draw on the presentation..." ), this );
m_actionDrawOnPresentation->setShortcut(Qt::Key_P);
m_actionDrawOnPresentation->setShortcutContext(Qt::ApplicationShortcut);
actionCollection()->addAction( "draw_on_presentation", m_actionDrawOnPresentation );
connect( m_actionDrawOnPresentation, SIGNAL(activated()), this, SLOT(drawOnPresentation()) );
m_actionDrawOnPresentation->setEnabled(false);
m_actionHighlightPresentation = new QAction( i18n( "Highlight the presentation..." ), this );
m_actionHighlightPresentation->setShortcut(Qt::Key_H);
m_actionHighlightPresentation->setShortcutContext(Qt::ApplicationShortcut);
actionCollection()->addAction( "highlight_presentation", m_actionHighlightPresentation );
connect( m_actionHighlightPresentation, SIGNAL(activated()), this, SLOT(highlightPresentation()) );
m_actionHighlightPresentation->setEnabled(false);
m_actionBlackPresentation = new QAction( i18n( "Blackscreen on the presentation..." ), this );
//.........这里部分代码省略.........
示例5: 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");
}
示例6: initMainWidget
//.........这里部分代码省略.........
connect(action, SIGNAL(triggered(bool)), d->mainWidget, SLOT(slotPrevUnreadArticle()));
action->setShortcut(QKeySequence(Qt::Key_Minus));
action = coll->addAction("go_next_unread_article");
action->setIcon(KIcon("go-next"));
action->setText(i18n("Ne&xt Unread Article"));
connect(action, SIGNAL(triggered(bool)), d->mainWidget, SLOT(slotNextUnreadArticle()));
action->setShortcuts(KShortcut(Qt::Key_Plus, Qt::Key_Equal));
action = coll->addAction("article_delete");
action->setIcon(KIcon("edit-delete"));
action->setText(i18n("&Delete"));
connect(action, SIGNAL(triggered(bool)), d->mainWidget, SLOT(slotArticleDelete()));
action->setShortcuts(KShortcut( "Delete" ));
KActionMenu* statusMenu = coll->add<KActionMenu>("article_set_status");
statusMenu->setText(i18n("&Mark As"));
statusMenu->setEnabled( false );
d->speakSelectedArticlesAction = coll->addAction("akr_texttospeech");
d->speakSelectedArticlesAction->setIcon(KIcon("media-playback-start"));
d->speakSelectedArticlesAction->setText(i18n("&Speak Selected Articles"));
connect(d->speakSelectedArticlesAction, SIGNAL(triggered(bool)), d->mainWidget, SLOT(slotTextToSpeechRequest()));
action = coll->addAction("akr_aborttexttospeech");
action->setText(i18n( "&Stop Speaking" ));
action->setIcon(KIcon("media-playback-stop"));
connect(action, SIGNAL(triggered(bool)),SpeechClient::self(), SLOT(slotAbortJobs()));
//action->setShortcuts(Qt::Key_Escape);
action->setEnabled(false);
connect(SpeechClient::self(), SIGNAL(signalActivated(bool)), action, SLOT(setEnabled(bool)));
action = coll->addAction("article_set_status_read");
action->setText(i18nc("as in: mark as read","&Read"));
action->setIcon(KIcon("mail-mark-read"));
action->setToolTip(i18n("Mark selected article as read"));
action->setShortcuts(KShortcut( "Ctrl+E" ));
connect(action, SIGNAL(triggered(bool)), d->mainWidget, SLOT(slotSetSelectedArticleRead()));
statusMenu->addAction(action);
action = coll->addAction("article_set_status_new");
action->setText(i18nc("as in: mark as new", "&New"));
action->setIcon(KIcon("mail-mark-unread-new"));
action->setShortcuts(KShortcut( "Ctrl+N" ));
action->setToolTip(i18n("Mark selected article as new"));
connect(action, SIGNAL(triggered(bool)), d->mainWidget, SLOT(slotSetSelectedArticleNew()));
statusMenu->addAction(action);
action = coll->addAction("article_set_status_unread");
action->setText(i18nc("as in: mark as unread", "&Unread"));
action->setIcon(KIcon("mail-mark-unread"));
action->setToolTip(i18n("Mark selected article as unread"));
action->setShortcuts(KShortcut( "Ctrl+U" ));
connect(action, SIGNAL(triggered(bool)), d->mainWidget, SLOT(slotSetSelectedArticleUnread()));
statusMenu->addAction(action);
KToggleAction* importantAction = coll->add<KToggleAction>("article_set_status_important");
importantAction->setText(i18n("&Mark as Important"));
importantAction->setIcon(KIcon("mail-mark-important"));
KShortcut importantSC( "Ctrl+I" );
importantSC.setAlternate( Qt::Key_I );
importantAction->setShortcuts( importantSC );
importantAction->setCheckedState(KGuiItem(i18n("Remove &Important Mark")));
connect(importantAction, SIGNAL(triggered(bool)), d->mainWidget, SLOT(slotArticleToggleKeepFlag(bool)));
action = coll->addAction("feedstree_move_up");
action->setText(i18n("Move Node Up"));
connect(action, SIGNAL(triggered(bool)), mainWidget, SLOT(slotMoveCurrentNodeUp()));
action->setShortcuts(KShortcut( "Shift+Alt+Up" ));
action = coll->addAction("feedstree_move_down");
action->setText(i18n("Move Node Down"));
connect(action, SIGNAL(triggered(bool)), mainWidget, SLOT(slotMoveCurrentNodeDown()));
action->setShortcuts(KShortcut( "Shift+Alt+Down" ));
action = coll->addAction(i18n("Move Node Left"));
action->setText(i18n("Move Node Left"));
connect(action, SIGNAL(triggered(bool)), mainWidget, SLOT(slotMoveCurrentNodeLeft()));
action->setShortcuts(KShortcut( "Shift+Alt+Left" ));
action = coll->addAction("feedstree_move_right");
action->setText(i18n("Move Node Right"));
connect(action, SIGNAL(triggered(bool)), mainWidget, SLOT(slotMoveCurrentNodeRight()));
action->setShortcuts(KShortcut( "Shift+Alt+Right" ));
action = coll->addAction("file_sendlink");
action->setIcon(KIcon("mail-message-new"));
action->setText(i18n("Send &Link Address..."));
connect(action, SIGNAL(triggered(bool)), mainWidget, SLOT(slotSendLink()));
action = coll->addAction("file_sendfile");
action->setIcon(KIcon("mail-message-new"));
action->setText(i18n("Send &File..."));
connect(action, SIGNAL(triggered(bool)), mainWidget, SLOT(slotSendFile()));
setArticleActionsEnabled( false );
}
示例7: grp
//.........这里部分代码省略.........
}
m_d->totalRefresh = new KAction(i18n("Total Refresh"), this);
actionCollection()->addAction("total_refresh", m_d->totalRefresh);
m_d->totalRefresh->setShortcut(QKeySequence(Qt::CTRL + Qt::SHIFT + Qt::Key_R));
connect(m_d->totalRefresh, SIGNAL(triggered()), this, SLOT(slotTotalRefresh()));
m_d->createTemplate = new KAction( i18n( "&Create Template From Image..." ), this);
actionCollection()->addAction("createTemplate", m_d->createTemplate);
connect(m_d->createTemplate, SIGNAL(triggered()), this, SLOT(slotCreateTemplate()));
m_d->mirrorCanvas = new KToggleAction(i18n("Mirror View"), this);
m_d->mirrorCanvas->setChecked(false);
actionCollection()->addAction("mirror_canvas", m_d->mirrorCanvas);
m_d->mirrorCanvas->setShortcut(QKeySequence(Qt::Key_M));
connect(m_d->mirrorCanvas, SIGNAL(toggled(bool)),m_d->canvasController, SLOT(mirrorCanvas(bool)));
KAction *rotateCanvasRight = new KAction(i18n("Rotate Canvas Right"), this);
actionCollection()->addAction("rotate_canvas_right", rotateCanvasRight);
rotateCanvasRight->setShortcut(QKeySequence("Ctrl+]"));
connect(rotateCanvasRight, SIGNAL(triggered()),m_d->canvasController, SLOT(rotateCanvasRight15()));
KAction *rotateCanvasLeft = new KAction(i18n("Rotate Canvas Left"), this);
actionCollection()->addAction("rotate_canvas_left", rotateCanvasLeft);
rotateCanvasLeft->setShortcut(QKeySequence("Ctrl+["));
connect(rotateCanvasLeft, SIGNAL(triggered()),m_d->canvasController, SLOT(rotateCanvasLeft15()));
KAction *resetCanvasTransformations = new KAction(i18n("Reset Canvas Transformations"), this);
actionCollection()->addAction("reset_canvas_transformations", resetCanvasTransformations);
resetCanvasTransformations->setShortcut(QKeySequence("Ctrl+'"));
connect(resetCanvasTransformations, SIGNAL(triggered()),m_d->canvasController, SLOT(resetCanvasTransformations()));
KToggleAction *tAction = new KToggleAction(i18n("Show Status Bar"), this);
tAction->setCheckedState(KGuiItem(i18n("Hide Status Bar")));
tAction->setChecked(true);
tAction->setToolTip(i18n("Shows or hides the status bar"));
actionCollection()->addAction("showStatusBar", tAction);
connect(tAction, SIGNAL(toggled(bool)), this, SLOT(showStatusBar(bool)));
tAction = new KToggleAction(i18n("Show Canvas Only"), this);
tAction->setCheckedState(KGuiItem(i18n("Return to Window")));
tAction->setToolTip(i18n("Shows just the canvas or the whole window"));
QList<QKeySequence> shortcuts;
shortcuts << QKeySequence(Qt::Key_Tab);
tAction->setShortcuts(shortcuts);
tAction->setChecked(false);
actionCollection()->addAction("view_show_just_the_canvas", tAction);
connect(tAction, SIGNAL(toggled(bool)), this, SLOT(showJustTheCanvas(bool)));
//Workaround, by default has the same shortcut as mirrorCanvas
KAction* action = dynamic_cast<KAction*>(actionCollection()->action("format_italic"));
if (action) {
action->setShortcut(QKeySequence(), KAction::DefaultShortcut);
action->setShortcut(QKeySequence(), KAction::ActiveShortcut);
}
//Workaround, by default has the same shortcut as hide/show dockers
action = dynamic_cast<KAction*>(shell()->actionCollection()->action("view_toggledockers"));
if (action) {
action->setShortcut(QKeySequence(), KAction::DefaultShortcut);
action->setShortcut(QKeySequence(), KAction::ActiveShortcut);
}
if (shell())
{
KoToolBoxFactory toolBoxFactory(m_d->canvasController);