diff options
| author | Thorbjørn Lindeijer <thorbjorn.lindeijer@nokia.com> | 2009-06-11 15:03:37 +0200 |
|---|---|---|
| committer | Thorbjørn Lindeijer <thorbjorn.lindeijer@nokia.com> | 2009-06-11 15:14:40 +0200 |
| commit | 8bf032833ae396c29c1a764137b8d30e90a7ed82 (patch) | |
| tree | b572fc47533a6075f755770a59038da58dc9c9ca /src | |
| parent | 0d8456a73ebfbeb8a8089ed8a73ae2b1aba646cf (diff) | |
| download | qt-creator-8bf032833ae396c29c1a764137b8d30e90a7ed82.tar.gz | |
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.
Diffstat (limited to 'src')
| -rw-r--r-- | src/plugins/projectexplorer/projectexplorer.cpp | 52 | ||||
| -rw-r--r-- | 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 9c2dfacb49..26912f5d42 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()"<<building; + qDebug() << "BuildManager::isBuilding()" << building; - if (m_currentProject == 0) { - 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_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 fc60b3129e..858a8ed5a4 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; |
