forked from qt-creator/qt-creator
Qt4PM: Add Build File context menu entry
Task-number: QTCREATORBUG-106 Change-Id: I50e2068648e6d58405de63ef5f1b575e69b676da Reviewed-by: Daniel Teske <daniel.teske@nokia.com>
This commit is contained in:
committed by
Daniel Teske
parent
9aa69344c5
commit
473c28e128
@@ -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";
|
||||
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user