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


C++ KActionCollection::action方法代码示例

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


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

示例1: slotStopDebugger

void RubyDebuggerPart::slotStopDebugger()
{
    controller->slotStopDebugger();
    debugger()->clearExecutionPoint();

    delete floatingToolBar;
    floatingToolBar = 0;

    rdbBreakpointWidget->reset();
    framestackWidget->clear();
    variableWidget->varTree()->clear();

//     variableWidget->setEnabled(false);
    framestackWidget->setEnabled(false);
    rdbOutputWidget->setEnabled(false);

//    mainWindow()->setViewAvailable(variableWidget, false);
    mainWindow()->setViewAvailable(framestackWidget, false);
    mainWindow()->setViewAvailable(rdbOutputWidget, false);

    KActionCollection *ac = actionCollection();
    ac->action("debug_run")->setText( i18n("&Start") );
//    ac->action("debug_run")->setIcon( "1rightarrow" );
    ac->action("debug_run")->setToolTip( i18n("Runs the program in the debugger") );
    ac->action("debug_run")->setWhatsThis( i18n("Start in debugger\n\n"
                                           "Starts the debugger with the project's main "
                                           "executable. You may set some breakpoints "
                                           "before this, or you can interrupt the program "
                                           "while it is running, in order to get information "
                                           "about variables, frame stack, and so on.") );

    stateChanged( QString("stopped") );

    core()->running(this, false);
}
开发者ID:,项目名称:,代码行数:35,代码来源:

示例2: 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);
}
开发者ID:KDE,项目名称:kile,代码行数:32,代码来源:filebrowserwidget.cpp

示例3: showRoomContextMenu

void CMapWidget::showRoomContextMenu(void)
{
  CMapRoom *room = (CMapRoom *) getView()->getSelectedElement();

  KActionCollection *acol = getView()->actionCollection();
  QAction *roomSetCurrentPos = acol->action("roomCurrentPos");
  QAction *roomSetLogin = acol->action("roomLoginPoint");	
  KSelectAction *labelMenu=(KSelectAction *) acol->action("labelMenu");

  roomSetCurrentPos->setEnabled(!room->getCurrentRoom());
  roomSetLogin->setEnabled(!room->getLoginRoom());

  switch(room->getLabelPosition())
  {
    case CMapRoom::HIDE      : labelMenu->setCurrentItem(0); break;
    case CMapRoom::NORTH     : labelMenu->setCurrentItem(1); break;
    case CMapRoom::NORTHEAST : labelMenu->setCurrentItem(2); break;
    case CMapRoom::EAST      : labelMenu->setCurrentItem(3); break;
    case CMapRoom::SOUTHEAST : labelMenu->setCurrentItem(4); break;
    case CMapRoom::SOUTH     : labelMenu->setCurrentItem(5); break;
    case CMapRoom::SOUTHWEST : labelMenu->setCurrentItem(6); break;
    case CMapRoom::WEST      : labelMenu->setCurrentItem(7); break;
    case CMapRoom::NORTHWEST : labelMenu->setCurrentItem(8); break;
    case CMapRoom::CUSTOM    : labelMenu->setCurrentItem(9); break;
  }


  showContextMenu (room_menu);
}
开发者ID:adamfur,项目名称:kmuddy,代码行数:29,代码来源:cmapwidget.cpp

示例4: q

K3b::DeviceMenu::Private::Private( DeviceMenu* parent )
:
    q( parent )
{
    KActionCollection* dmActions = k3bappcore->appDeviceManager()->actionCollection();
    q->addAction( dmActions->action( "device_diskinfo" ) );
    q->addSeparator();
    q->addAction( dmActions->action( "device_unmount" ) );
    q->addAction( dmActions->action( "device_mount" ) );
    q->addAction( dmActions->action( "device_eject" ) );
    q->addAction( dmActions->action( "device_load" ) );
    q->addSeparator();
    q->addAction( dmActions->action( "device_set_read_speed" ) );

    q->addSeparator();

    // FIXME: Should we move these actions to K3b::AppDeviceManager?
    actionContinueMultisession = q->addAction( QIcon::fromTheme( "media-optical-data" ), i18n("Continue Multisession Project"), q, SLOT(_k_continueMultisession()) );
    actionCopy = q->addAction( QIcon::fromTheme( "tools-media-optical-copy" ), i18n("Copy &Medium..."), q, SLOT(_k_copy()) );
    actionFormat = q->addAction( QIcon::fromTheme( "tools-media-optical-erase" ), i18n("&Format/Erase rewritable disk..."), q, SLOT(_k_format()) );
    actionRipAudio = q->addAction( QIcon::fromTheme( "tools-rip-audio-cd" ), i18n("Rip Audio CD..."), q, SLOT(_k_ripAudio()) );
    actionRipVideoDVD = q->addAction( QIcon::fromTheme( "tools-rip-video-dvd" ), i18n("Rip Video DVD..."), q, SLOT(_k_ripVideoDVD()) );
    actionRipVcd = q->addAction( QIcon::fromTheme( "tools-rip-video-cd"), i18n("Rip Video CD..."), q, SLOT(_k_ripVcd()) );

    actionCopy->setToolTip( i18n("Open the media copy dialog") );
    actionCopy->setStatusTip( actionCopy->toolTip() );
    actionFormat->setToolTip( i18n("Open the rewritable disk formatting/erasing dialog") );
    actionFormat->setStatusTip( actionFormat->toolTip() );
}
开发者ID:KDE,项目名称:k3b,代码行数:29,代码来源:k3bdevicemenu.cpp

示例5: slotRun

void RubyDebuggerPart::slotRun()
{
    if (controller->stateIsOn(s_programExited)) {
        rdbBreakpointWidget->reset();
    }

    if ( controller->stateIsOn( s_dbgNotStarted ) ) {
        mainWindow()->statusBar()->message(i18n("Debugging program"), 1000);
        mainWindow()->raiseView(rdbOutputWidget);
        appFrontend()->clearView();
        startDebugger();
    } else {
        KActionCollection *ac = actionCollection();
        ac->action("debug_run")->setText( i18n("&Continue") );
        ac->action("debug_run")->setToolTip( i18n("Continues the application execution") );
        ac->action("debug_run")->setWhatsThis( i18n("Continue application execution\n\n"
                                               "Continues the execution of your application in the "
                                               "debugger. This only takes effect when the application "
                                               "has been halted by the debugger (i.e. a breakpoint has "
                                               "been activated or the interrupt was pressed).") );

        mainWindow()->statusBar()->message(i18n("Continuing program"), 1000);
    }

    controller->slotRun();
}
开发者ID:,项目名称:,代码行数:26,代码来源:

示例6: 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);
}
开发者ID:fagu,项目名称:kileip,代码行数:26,代码来源:filebrowserwidget.cpp

示例7: enableAction

void DebuggerManager::enableAction(const QString& action, bool enable)
{
  if(action == "*")
  {
    // Enable/Disable all session related actions + connect/disconnect
    enableAction("debug_request", enable);
    enableAction("debug_run", enable);
    enableAction("debug_trace", enable);
    enableAction("debug_pause", enable);
    enableAction("debug_kill", enable);
    enableAction("debug_stepover", enable);
    enableAction("debug_stepinto", enable);
    enableAction("debug_stepout", enable);
    enableAction("debug_skip", enable);

    enableAction("debug_connect", enable);
    enableAction("debug_disconnect", enable);

    enableAction("debug_breakpoints_toggle", enable);
    enableAction("debug_breakpoints_clear", enable);
    
    enableAction("debug_profiler_open", enable);

  }
  else
  {
    // The action may or may not exist, depending on capabilities of the debugger plugin
    KActionCollection *ac = quantaApp->actionCollection();
    if(ac && ac->action(action))
      ac->action(action)->setEnabled(enable);
  }
}
开发者ID:serghei,项目名称:kde3-kdewebdev,代码行数:32,代码来源:debuggermanager.cpp

示例8: initActions

void KoPageNavigator::initActions()
{
    KActionCollection *actionCollection = d->view->actionCollection();

    d->gotoFirstPageButton->setAction(actionCollection->action(QLatin1String("page_first")));
    d->gotoPreviousPageButton->setAction(actionCollection->action(QLatin1String("page_previous")));
    d->gotoNextPageButton->setAction(actionCollection->action(QLatin1String("page_next")));
    d->gotoLastPageButton->setAction(actionCollection->action(QLatin1String("page_last")));

}
开发者ID:abhishekmurthy,项目名称:Calligra,代码行数:10,代码来源:KoPageNavigator.cpp

示例9: selectReaction

void EditActions::selectReaction(Reaction* reaction) {
    mCurrentReaction = reaction;

    KActionCollection* actionCollection = mTutorialEditor->actionCollection();
    if (mCurrentReaction) {
        actionCollection->action("setReactionData")->setEnabled(true);
        actionCollection->action("removeReaction")->setEnabled(true);
    } else {
        actionCollection->action("setReactionData")->setEnabled(false);
        actionCollection->action("removeReaction")->setEnabled(false);
    }
}
开发者ID:KDE,项目名称:ktutorial,代码行数:12,代码来源:EditActions.cpp

示例10: setCanvas

void KisColorSelectorNgDockerWidget::setCanvas(KisCanvas2 *canvas)
{
    if (m_canvas) {
        m_canvas->disconnect(this);
        KActionCollection *ac = m_canvas->viewManager()->actionCollection();
        ac->takeAction(ac->action("show_color_history"));
        ac->takeAction(ac->action("show_common_colors"));
    }

    m_canvas = canvas;

    m_commonColorsWidget->setCanvas(canvas);
    m_colorHistoryWidget->setCanvas(canvas);
    m_colorSelectorContainer->setCanvas(canvas);

    if (m_canvas && m_canvas->viewManager()) {
        if (m_canvas->viewManager()->nodeManager()) {
            connect(m_canvas->viewManager()->nodeManager(), SIGNAL(sigLayerActivated(KisLayerSP)), SLOT(reactOnLayerChange()), Qt::UniqueConnection);
        }
        KActionCollection* actionCollection = canvas->viewManager()->actionCollection();

        actionCollection->addAction("show_color_history", m_colorHistoryAction);
        actionCollection->addAction("show_common_colors", m_commonColorsAction);
    }

    reactOnLayerChange();
}
开发者ID:TheTypoMaster,项目名称:calligra,代码行数:27,代码来源:kis_color_selector_ng_docker_widget.cpp

示例11: setupShourtcutTips

void Core::setupShourtcutTips(KXMLGUIClient * client)
{
  QPtrList<KXMLGUIClient> clients;
  if (client != 0)
    clients.append(client);
  else
    clients = TopLevel::getInstance()->main()->guiFactory()->clients();
  
  for( QPtrListIterator<KXMLGUIClient> it(clients); it.current(); ++it ) {
    KActionCollection *actionCollection = (*it)->actionCollection();
    for (int i = 0; i < actionCollection->count(); i++) {
      KAction *action = actionCollection->action(i);
            
      QString tooltip = action->toolTip();
      if (tooltip.isEmpty())
        tooltip = action->text().remove('&');
      else {
        int i = tooltip.findRev('(');
        if (i > 0) tooltip = tooltip.left(i).stripWhiteSpace();
      }

      QString shortcut = action->shortcutText();
      if (!shortcut.isEmpty())
        tooltip += " (" + shortcut + ")";
        action->setToolTip(tooltip);
      }
  }
}
开发者ID:serghei,项目名称:kde3-kdevelop,代码行数:28,代码来源:core.cpp

示例12: selectStep

void EditActions::selectStep(Step* step) {
    mCurrentStep = step;

    KActionCollection* actionCollection = mTutorialEditor->actionCollection();
    if (mCurrentStep) {
        actionCollection->action("setStepData")->setEnabled(true);
        actionCollection->action("setStepSetup")->setEnabled(true);
        actionCollection->action("setStepTearDown")->setEnabled(true);
        actionCollection->action("removeStep")->setEnabled(true);
        actionCollection->action("addReaction")->setEnabled(true);
    } else {
        actionCollection->action("setStepData")->setEnabled(false);
        actionCollection->action("setStepSetup")->setEnabled(false);
        actionCollection->action("setStepTearDown")->setEnabled(false);
        actionCollection->action("removeStep")->setEnabled(false);
        actionCollection->action("addReaction")->setEnabled(false);
    }
}
开发者ID:KDE,项目名称:ktutorial,代码行数:18,代码来源:EditActions.cpp

示例13: forward

void KOEventPopupMenu::forward()
{
    KOrg::MainWindow *w = ActionManager::findInstance(KURL());
    if(!w || !mCurrentIncidence)
        return;
    KActionCollection *ac = w->getActionCollection();
    KAction *action = ac->action("schedule_forward");
    action->activate();
}
开发者ID:serghei,项目名称:kde3-kdepim,代码行数:9,代码来源:koeventpopupmenu.cpp

示例14: updateToggleActions

void TabBar::updateToggleActions(int sessionId)
{
    if (sessionId == -1) return;

    KActionCollection* actionCollection = m_mainWindow->actionCollection();
    SessionStack* sessionStack = m_mainWindow->sessionStack();

    QAction* toggleAction = actionCollection->action("toggle-session-prevent-closing");
    toggleAction->setChecked(!sessionStack->isSessionClosable(sessionId));

    toggleAction = actionCollection->action("toggle-session-keyboard-input");
    toggleAction->setChecked(!sessionStack->hasTerminalsWithKeyboardInputEnabled(sessionId));

    toggleAction = actionCollection->action("toggle-session-monitor-activity");
    toggleAction->setChecked(!sessionStack->hasTerminalsWithMonitorActivityDisabled(sessionId));

    toggleAction = actionCollection->action("toggle-session-monitor-silence");
    toggleAction->setChecked(!sessionStack->hasTerminalsWithMonitorSilenceDisabled(sessionId));
}
开发者ID:igordcard,项目名称:yakuake,代码行数:19,代码来源:tabbar.cpp

示例15: addActionToMenu

 void addActionToMenu(KMenu& popup, const char* name)
 {
     QAction* action = mActionCollection->action(name);
     if (!action) {
         kWarning() << "Unknown action" << name;
         return;
     }
     if (action->isEnabled()) {
         popup.addAction(action);
     }
 }
开发者ID:theunbelievablerepo,项目名称:gwenview,代码行数:11,代码来源:thumbnailviewhelper.cpp


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