Removed the Build Project Only actions from the menu

They can still be assigned shortcuts for those who really need them. The
description has been updated to "Build Without Dependencies", so that
their function is clearer.
This commit is contained in:
Thorbjørn Lindeijer
2009-06-11 15:03:37 +02:00
parent 0d8456a73e
commit 8bf032833a
2 changed files with 16 additions and 37 deletions

View File

@@ -525,33 +525,17 @@ bool ProjectExplorerPlugin::initialize(const QStringList &arguments, QString *er
mbuild->addAction(cmd, Constants::G_BUILD_PROJECT); mbuild->addAction(cmd, Constants::G_BUILD_PROJECT);
mproject->addAction(cmd, Constants::G_PROJECT_BUILD); mproject->addAction(cmd, Constants::G_PROJECT_BUILD);
// build project only menu // build without dependencies action
Core::ActionContainer *mpo = am->createMenu(Constants::BUILDPROJECTONLYMENU); m_buildProjectOnlyAction = new QAction(tr("Build Without Dependencies"), this);
m_buildProjectOnlyMenu = mpo->menu();
m_buildProjectOnlyMenu->setTitle(tr("Project Only"));
mbuild->addMenu(mpo, Constants::G_BUILD_PROJECT);
mproject->addMenu(mpo, Constants::G_PROJECT_BUILD);
// build action
m_buildProjectOnlyAction = new QAction(tr("Build"), this);
cmd = am->registerAction(m_buildProjectOnlyAction, Constants::BUILDPROJECTONLY, globalcontext); cmd = am->registerAction(m_buildProjectOnlyAction, Constants::BUILDPROJECTONLY, globalcontext);
cmd->setAttribute(Core::Command::CA_UpdateText);
cmd->setDefaultText(m_buildProjectOnlyAction->text());
mpo->addAction(cmd);
// rebuild action // rebuild without dependencies action
m_rebuildProjectOnlyAction = new QAction(tr("Rebuild"), this); m_rebuildProjectOnlyAction = new QAction(tr("Rebuild Without Dependencies"), this);
cmd = am->registerAction(m_rebuildProjectOnlyAction, Constants::REBUILDPROJECTONLY, globalcontext); cmd = am->registerAction(m_rebuildProjectOnlyAction, Constants::REBUILDPROJECTONLY, globalcontext);
cmd->setAttribute(Core::Command::CA_UpdateText);
cmd->setDefaultText(m_rebuildProjectOnlyAction->text());
mpo->addAction(cmd);
// clean action // clean without dependencies action
m_cleanProjectOnlyAction = new QAction(tr("Clean"), this); m_cleanProjectOnlyAction = new QAction(tr("Clean Without Dependencies"), this);
cmd = am->registerAction(m_cleanProjectOnlyAction, Constants::CLEANPROJECTONLY, globalcontext); cmd = am->registerAction(m_cleanProjectOnlyAction, Constants::CLEANPROJECTONLY, globalcontext);
cmd->setAttribute(Core::Command::CA_UpdateText);
cmd->setDefaultText(m_cleanProjectOnlyAction->text());
mpo->addAction(cmd);
// Add Set Build Configuration to menu // Add Set Build Configuration to menu
mbuild->addMenu(mbc, Constants::G_BUILD_PROJECT); mbuild->addMenu(mbc, Constants::G_BUILD_PROJECT);
@@ -1287,23 +1271,17 @@ void ProjectExplorerPlugin::updateActions()
bool enableBuildActions = m_currentProject && ! (m_buildManager->isBuilding(m_currentProject)); bool enableBuildActions = m_currentProject && ! (m_buildManager->isBuilding(m_currentProject));
bool hasProjects = !m_session->projects().isEmpty(); bool hasProjects = !m_session->projects().isEmpty();
bool building = m_buildManager->isBuilding(); bool building = m_buildManager->isBuilding();
QString projectName = m_currentProject ? m_currentProject->name() : QString();
if (debug) if (debug)
qDebug()<<"BuildManager::isBuilding()"<<building; qDebug() << "BuildManager::isBuilding()" << building;
if (m_currentProject == 0) { m_unloadAction->setParameter(projectName);
m_unloadAction->setParameter(QString());
m_buildProjectOnlyMenu->setTitle(tr("Current Project"));
} else {
m_unloadAction->setParameter(m_currentProject->name());
m_buildProjectOnlyMenu->setTitle(tr("Project \"%1\"").arg(m_currentProject->name()));
}
m_buildAction->setEnabled(enableBuildActions); m_buildAction->setEnabled(enableBuildActions);
m_rebuildAction->setEnabled(enableBuildActions); m_rebuildAction->setEnabled(enableBuildActions);
m_cleanAction->setEnabled(enableBuildActions); m_cleanAction->setEnabled(enableBuildActions);
m_buildProjectOnlyMenu->setEnabled(enableBuildActions);
m_buildProjectOnlyAction->setEnabled(enableBuildActions); m_buildProjectOnlyAction->setEnabled(enableBuildActions);
m_rebuildProjectOnlyAction->setEnabled(enableBuildActions); m_rebuildProjectOnlyAction->setEnabled(enableBuildActions);
m_cleanProjectOnlyAction->setEnabled(enableBuildActions); m_cleanProjectOnlyAction->setEnabled(enableBuildActions);
@@ -1349,15 +1327,17 @@ bool ProjectExplorerPlugin::saveModifiedFiles()
} else { } else {
bool cancelled = false; bool cancelled = false;
bool alwaysSave = false; bool alwaysSave = false;
Core::ICore::instance()->fileManager()->saveModifiedFiles(filesToSave, &cancelled, QString::null, "Always save files before build", &alwaysSave);
if (cancelled) { Core::FileManager *fm = Core::ICore::instance()->fileManager();
fm->saveModifiedFiles(filesToSave, &cancelled, QString::null,
"Always save files before build", &alwaysSave);
if (cancelled)
return false; return false;
} if (alwaysSave)
if (alwaysSave) {
m_projectExplorerSettings.saveBeforeBuild = true; m_projectExplorerSettings.saveBeforeBuild = true;
} }
} }
}
return true; return true;
} }

View File

@@ -253,7 +253,6 @@ private:
QAction *m_removeFileAction; QAction *m_removeFileAction;
QAction *m_renameFileAction; QAction *m_renameFileAction;
QMenu *m_buildProjectOnlyMenu;
QMenu *m_buildConfigurationMenu; QMenu *m_buildConfigurationMenu;
QActionGroup *m_buildConfigurationActionGroup; QActionGroup *m_buildConfigurationActionGroup;
QMenu *m_runConfigurationMenu; QMenu *m_runConfigurationMenu;