diff --git a/src/plugins/qt4projectmanager/qt4projectmanagerconstants.h b/src/plugins/qt4projectmanager/qt4projectmanagerconstants.h index abc43b72db8e95cc82c24566139cc49a53df51c7..ccd5c82e76169ea6d8e8b8d303dc24c063528407 100644 --- a/src/plugins/qt4projectmanager/qt4projectmanagerconstants.h +++ b/src/plugins/qt4projectmanager/qt4projectmanagerconstants.h @@ -66,6 +66,7 @@ const char BUILDFILE[] = "Qt4Builder.BuildFile"; const char BUILDSUBDIRCONTEXTMENU[] = "Qt4Builder.BuildSubDirContextMenu"; const char REBUILDSUBDIRCONTEXTMENU[] = "Qt4Builder.RebuildSubDirContextMenu"; const char CLEANSUBDIRCONTEXTMENU[] = "Qt4Builder.CleanSubDirContextMenu"; +const char BUILDFILECONTEXTMENU[] = "Qt4Builder.BuildFileContextMenu"; const char ADDLIBRARY[] = "Qt4.AddLibrary"; const char SEPARATOR[] = "Qt4.Separator"; diff --git a/src/plugins/qt4projectmanager/qt4projectmanagerplugin.cpp b/src/plugins/qt4projectmanager/qt4projectmanagerplugin.cpp index 7f6e3daef7ce4e45cf5abd8179599e7df8ecdb6f..c5de30834a06994189be78317496b7fec1450a1e 100644 --- a/src/plugins/qt4projectmanager/qt4projectmanagerplugin.cpp +++ b/src/plugins/qt4projectmanager/qt4projectmanagerplugin.cpp @@ -182,6 +182,8 @@ bool Qt4ProjectManagerPlugin::initialize(const QStringList &arguments, QString * am->actionContainer(ProjectExplorer::Constants::M_PROJECTCONTEXT); Core::ActionContainer *msubproject = am->actionContainer(ProjectExplorer::Constants::M_SUBPROJECTCONTEXT); + Core::ActionContainer *mfile = + am->actionContainer(ProjectExplorer::Constants::M_FILECONTEXT); //register actions Core::Command *command; @@ -221,6 +223,12 @@ bool Qt4ProjectManagerPlugin::initialize(const QStringList &arguments, QString * msubproject->addAction(command, ProjectExplorer::Constants::G_PROJECT_BUILD); connect(m_cleanSubProjectContextMenu, SIGNAL(triggered()), m_qt4ProjectManager, SLOT(cleanSubDirContextMenu())); + m_buildFileContextMenu = new QAction(tr("Build"), this); + command = am->registerAction(m_buildFileContextMenu, Constants::BUILDFILECONTEXTMENU, projectContext); + command->setAttribute(Core::Command::CA_Hide); + mfile->addAction(command, ProjectExplorer::Constants::G_FILE_OTHER); + connect(m_buildFileContextMenu, SIGNAL(triggered()), m_qt4ProjectManager, SLOT(buildFileContextMenu())); + m_buildSubProjectAction = new Utils::ParameterAction(tr("Build Subproject"), tr("Build Subproject \"%1\""), Utils::ParameterAction::AlwaysEnabled, this); command = am->registerAction(m_buildSubProjectAction, Constants::BUILDSUBDIR, projectContext); @@ -402,6 +410,7 @@ void Qt4ProjectManagerPlugin::updateContextActions(ProjectExplorer::Node *node, m_cleanSubProjectContextMenu->setVisible(subProjectActionsVisible && isProjectNode); m_runQMakeActionContextMenu->setVisible(isProjectNode && buildConfiguration->qmakeStep()); m_buildFileAction->setVisible(buildFilePossible); + m_buildFileContextMenu->setVisible(buildFilePossible); m_buildSubProjectAction->setEnabled(enabled); m_rebuildSubProjectAction->setEnabled(enabled); @@ -412,6 +421,7 @@ void Qt4ProjectManagerPlugin::updateContextActions(ProjectExplorer::Node *node, m_runQMakeActionContextMenu->setEnabled(isProjectNode && !isBuilding && buildConfiguration->qmakeStep()); m_buildFileAction->setEnabled(buildFilePossible && !isBuilding); + m_buildFileContextMenu->setEnabled(buildFilePossible && !isBuilding); } void Qt4ProjectManagerPlugin::buildStateChanged(ProjectExplorer::Project *pro) diff --git a/src/plugins/qt4projectmanager/qt4projectmanagerplugin.h b/src/plugins/qt4projectmanager/qt4projectmanagerplugin.h index b53434cde131d160080cf04c0113513e439c30dd..f01806f98b47d9c3fe71f7c6ba0d662d7faaef07 100644 --- a/src/plugins/qt4projectmanager/qt4projectmanagerplugin.h +++ b/src/plugins/qt4projectmanager/qt4projectmanagerplugin.h @@ -101,6 +101,7 @@ private: QAction *m_subProjectRebuildSeparator; QAction *m_rebuildSubProjectContextMenu; QAction *m_cleanSubProjectContextMenu; + QAction *m_buildFileContextMenu; Utils::ParameterAction *m_buildSubProjectAction; Utils::ParameterAction *m_rebuildSubProjectAction; Utils::ParameterAction *m_cleanSubProjectAction;