diff options
author | Orgad Shaneh <orgads@gmail.com> | 2012-05-14 22:46:23 +0300 |
---|---|---|
committer | Daniel Teske <daniel.teske@nokia.com> | 2012-05-18 12:23:05 +0200 |
commit | 473c28e12805dd9ecb67855e18c9268891d182dc (patch) | |
tree | f4d0f09876a750793c1578ffa7682ed32f2fca8d /src/plugins/qt4projectmanager/qt4projectmanagerplugin.cpp | |
parent | 9aa69344c589ba2d73de6826f8fec69286df89b8 (diff) | |
download | qt-creator-473c28e12805dd9ecb67855e18c9268891d182dc.tar.gz |
Qt4PM: Add Build File context menu entry
Task-number: QTCREATORBUG-106
Change-Id: I50e2068648e6d58405de63ef5f1b575e69b676da
Reviewed-by: Daniel Teske <daniel.teske@nokia.com>
Diffstat (limited to 'src/plugins/qt4projectmanager/qt4projectmanagerplugin.cpp')
-rw-r--r-- | src/plugins/qt4projectmanager/qt4projectmanagerplugin.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/plugins/qt4projectmanager/qt4projectmanagerplugin.cpp b/src/plugins/qt4projectmanager/qt4projectmanagerplugin.cpp index 7f6e3daef7..c5de30834a 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) |