MCPcopy Create free account
hub / github.com/KDE/kdevelop / setupActions

Method setupActions

kdevplatform/shell/projectcontroller.cpp:542–618  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

540}
541
542void ProjectController::setupActions()
543{
544 Q_D(ProjectController);
545
546 KActionCollection * ac =
547 d->m_core->uiControllerInternal()->defaultMainWindow()->actionCollection();
548
549 QAction*action;
550
551 d->m_openProject = action = ac->addAction( QStringLiteral("project_open") );
552 action->setText(i18nc( "@action", "Open / Import Project..." ) );
553 action->setToolTip( i18nc( "@info:tooltip", "Open or import project" ) );
554 action->setWhatsThis( i18nc( "@info:whatsthis", "Open an existing KDevelop project or import "
555 "an existing Project into KDevelop. This entry "
556 "allows one to select a KDevelop project file "
557 "or an existing directory to open it in KDevelop. "
558 "When opening an existing directory that does "
559 "not yet have a KDevelop project file, the file "
560 "will be created." ) );
561 action->setIcon(QIcon::fromTheme(QStringLiteral("project-open")));
562 connect(action, &QAction::triggered, this, [&] { openProject(); });
563
564 d->m_fetchProject = action = ac->addAction( QStringLiteral("project_fetch") );
565 action->setText(i18nc( "@action", "Fetch Project..." ) );
566 action->setIcon( QIcon::fromTheme( QStringLiteral("edit-download") ) );
567 action->setToolTip( i18nc( "@info:tooltip", "Fetch project" ) );
568 action->setWhatsThis( i18nc( "@info:whatsthis", "Guides the user through the project fetch "
569 "and then imports it into KDevelop." ) );
570// action->setIcon(QIcon::fromTheme("project-open"));
571 connect( action, &QAction::triggered, this, &ProjectController::fetchProject );
572
573// action = ac->addAction( "project_close" );
574// action->setText( i18n( "C&lose Project" ) );
575// connect( action, SIGNAL(triggered(bool)), SLOT(closeProject()) );
576// action->setToolTip( i18n( "Close project" ) );
577// action->setWhatsThis( i18n( "Closes the current project." ) );
578// action->setEnabled( false );
579
580 d->m_closeProject = action = ac->addAction( QStringLiteral("project_close") );
581 connect(action, &QAction::triggered,
582 this, [this] { Q_D(ProjectController); d->closeSelectedProjects(); } );
583 action->setText( i18nc( "@action", "Close Project(s)" ) );
584 action->setIcon( QIcon::fromTheme( QStringLiteral("project-development-close") ) );
585 action->setToolTip( i18nc( "@info:tooltip", "Closes all currently selected projects" ) );
586 action->setEnabled( false );
587
588 d->m_openConfig = action = ac->addAction( QStringLiteral("project_open_config") );
589 connect(action, &QAction::triggered,
590 this, [this] { Q_D(ProjectController); d->openProjectConfig(); } );
591 action->setText( i18nc("@action", "Open Configuration..." ) );
592 action->setIcon( QIcon::fromTheme(QStringLiteral("configure")) );
593 action->setEnabled( false );
594
595 action = ac->addAction( QStringLiteral("commit_current_project") );
596 connect( action, &QAction::triggered, this, &ProjectController::commitCurrentProject );
597 action->setText( i18nc("@action", "Commit Current Project..." ) );
598 action->setIconText( i18nc("@action", "Commit..." ) );
599 action->setIcon( QIcon::fromTheme(QStringLiteral("svn-commit")) );

Callers

nothing calls this directly

Calls 14

defaultMainWindowMethod · 0.80
uiControllerInternalMethod · 0.80
setToolTipMethod · 0.80
setIconMethod · 0.80
closeSelectedProjectsMethod · 0.80
KConfigGroupClass · 0.70
actionCollectionMethod · 0.45
addActionMethod · 0.45
setTextMethod · 0.45
setEnabledMethod · 0.45
openProjectConfigMethod · 0.45
areaChangedMethod · 0.45

Tested by

no test coverage detected