From 8bf032833ae396c29c1a764137b8d30e90a7ed82 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thorbj=C3=B8rn=20Lindeijer?= Date: Thu, 11 Jun 2009 15:03:37 +0200 Subject: [PATCH] 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. --- .../projectexplorer/projectexplorer.cpp | 52 ++++++------------- src/plugins/projectexplorer/projectexplorer.h | 1 - 2 files changed, 16 insertions(+), 37 deletions(-) diff --git a/src/plugins/projectexplorer/projectexplorer.cpp b/src/plugins/projectexplorer/projectexplorer.cpp index 9c2dfacb493..26912f5d42c 100644 --- a/src/plugins/projectexplorer/projectexplorer.cpp +++ b/src/plugins/projectexplorer/projectexplorer.cpp @@ -525,33 +525,17 @@ bool ProjectExplorerPlugin::initialize(const QStringList &arguments, QString *er mbuild->addAction(cmd, Constants::G_BUILD_PROJECT); mproject->addAction(cmd, Constants::G_PROJECT_BUILD); - // build project only menu - Core::ActionContainer *mpo = am->createMenu(Constants::BUILDPROJECTONLYMENU); - 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); + // build without dependencies action + m_buildProjectOnlyAction = new QAction(tr("Build Without Dependencies"), this); cmd = am->registerAction(m_buildProjectOnlyAction, Constants::BUILDPROJECTONLY, globalcontext); - cmd->setAttribute(Core::Command::CA_UpdateText); - cmd->setDefaultText(m_buildProjectOnlyAction->text()); - mpo->addAction(cmd); - // rebuild action - m_rebuildProjectOnlyAction = new QAction(tr("Rebuild"), this); + // rebuild without dependencies action + m_rebuildProjectOnlyAction = new QAction(tr("Rebuild Without Dependencies"), this); cmd = am->registerAction(m_rebuildProjectOnlyAction, Constants::REBUILDPROJECTONLY, globalcontext); - cmd->setAttribute(Core::Command::CA_UpdateText); - cmd->setDefaultText(m_rebuildProjectOnlyAction->text()); - mpo->addAction(cmd); - // clean action - m_cleanProjectOnlyAction = new QAction(tr("Clean"), this); + // clean without dependencies action + m_cleanProjectOnlyAction = new QAction(tr("Clean Without Dependencies"), this); 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 mbuild->addMenu(mbc, Constants::G_BUILD_PROJECT); @@ -1287,23 +1271,17 @@ void ProjectExplorerPlugin::updateActions() bool enableBuildActions = m_currentProject && ! (m_buildManager->isBuilding(m_currentProject)); bool hasProjects = !m_session->projects().isEmpty(); bool building = m_buildManager->isBuilding(); + QString projectName = m_currentProject ? m_currentProject->name() : QString(); if (debug) - qDebug()<<"BuildManager::isBuilding()"<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_unloadAction->setParameter(projectName); m_buildAction->setEnabled(enableBuildActions); m_rebuildAction->setEnabled(enableBuildActions); m_cleanAction->setEnabled(enableBuildActions); - m_buildProjectOnlyMenu->setEnabled(enableBuildActions); m_buildProjectOnlyAction->setEnabled(enableBuildActions); m_rebuildProjectOnlyAction->setEnabled(enableBuildActions); m_cleanProjectOnlyAction->setEnabled(enableBuildActions); @@ -1349,13 +1327,15 @@ bool ProjectExplorerPlugin::saveModifiedFiles() } else { bool cancelled = 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; - } - if (alwaysSave) { + if (alwaysSave) m_projectExplorerSettings.saveBeforeBuild = true; - } } } return true; diff --git a/src/plugins/projectexplorer/projectexplorer.h b/src/plugins/projectexplorer/projectexplorer.h index fc60b3129e6..858a8ed5a40 100644 --- a/src/plugins/projectexplorer/projectexplorer.h +++ b/src/plugins/projectexplorer/projectexplorer.h @@ -253,7 +253,6 @@ private: QAction *m_removeFileAction; QAction *m_renameFileAction; - QMenu *m_buildProjectOnlyMenu; QMenu *m_buildConfigurationMenu; QActionGroup *m_buildConfigurationActionGroup; QMenu *m_runConfigurationMenu;