Commit 9100e963 authored by hjk's avatar hjk
Browse files

Merge branch 'master' of git@scm.dev.nokia.troll.no:creator/mainline

parents 34583ce5 8b4f6d36
......@@ -231,7 +231,7 @@
To deselect, use \key{Ctrl+Shift+U}.
\row
\i Moving lines up and down
\i
\i
\row
\i Completion
......@@ -246,7 +246,17 @@
\row
\i Switch between Header and Source
\i
\i Use \key{F4}.
\row
\i Increasing and Decreasing Font Size
\i Use \key{Ctrl+Scroll Wheel}
\row
\i Follow Symbols under The Cursor
\i Use \key{F2} and \key{Shift+F2}. This feature works with
namespaces, classes, methods, variables, include statements,
and macros.
\endtable
......@@ -256,12 +266,6 @@
Up/Down/Page Up/Page Down - hold ctrl to prevent the cursor from moving
F2 and Shift F2 - follows symbols under the cursor (works for namespaces, classes, methods, variables, includes, macros).
F4 - switch header and source
Ctrl + Scroll wheel -- used to quickly change the font size (handy for presentatiaons)
To switch to an external editor, select \gui{Open in external editor} from
......@@ -270,15 +274,9 @@
*/
/*!
*/
/*!
\contentspage index.html
\previouspage creator-editor-settings.html
\previouspage creator-code-editor.html
\page creator-build-settings.html
\nextpage creator-creating-project.html
......@@ -840,8 +838,8 @@
\section2 Viewing Versioning History and Change Details
The versioning history of a file can be displayed by selecting the
\gui{Log} (for \bold{git}) or \gui{Filelog (for \bold{Perforce} and
\bold{Subversion})} option. Typically, the log output will contain the
\gui{Log} (for \bold{git}) or \gui{Filelog} (for \bold{Perforce} and
\bold{Subversion}) option. Typically, the log output will contain the
date, the commit message, and a change or revision identifier. If you
click on the identifier, a description of the change including the diff
will be displayed.
......
......@@ -80,9 +80,9 @@ CMakeProject::~CMakeProject()
// TODO make this function work even if it is reparsing
void CMakeProject::parseCMakeLists(const QDir &directory)
{
createCbpFile(directory);
createCbpFile(buildDirectory(QString()));
QString cbpFile = findCbpFile(directory);
QString cbpFile = findCbpFile(buildDirectory(QString()));
CMakeCbpParser cbpparser;
qDebug()<<"Parsing file "<<cbpFile;
......@@ -153,9 +153,10 @@ void CMakeProject::createCbpFile(const QDir &directory)
// TODO we need to pass on the same paremeters as the cmakestep
qDebug()<<"Creating cbp file";
directory.mkpath(directory.absolutePath());
QProcess cmake;
cmake.setWorkingDirectory(directory.absolutePath());
cmake.start("cmake", QStringList() << "-GCodeBlocks - Unix Makefiles");
cmake.start("cmake", QStringList() << ".." << "-GCodeBlocks - Unix Makefiles");
cmake.waitForFinished(-1);
qDebug()<<"cmake output: \n"<<cmake.readAll();
}
......@@ -240,7 +241,7 @@ QString CMakeProject::buildDirectory(const QString &buildConfiguration) const
{
QString buildDirectory = value(buildConfiguration, "buildDirectory").toString();
if (buildDirectory.isEmpty())
buildDirectory = QFileInfo(m_fileName).absolutePath();
buildDirectory = QFileInfo(m_fileName).absolutePath() + "/qtcreator-build";
return buildDirectory;
}
......@@ -523,7 +524,7 @@ void CMakeCbpParser::parseTargetOption()
{
if (attributes().hasAttribute("output"))
m_target.executable = attributes().value("output").toString();
else if (attributes().hasAttribute("type") && attributes().value("type") == "1")
else if (attributes().hasAttribute("type") && (attributes().value("type") == "1" || attributes().value("type") == "0"))
m_targetType = true;
else if (attributes().hasAttribute("working_dir"))
m_target.workingDirectory = attributes().value("working_dir").toString();
......
......@@ -190,3 +190,4 @@ void CoreImpl::openFiles(const QStringList &arguments)
{
m_mainwindow->openFiles(arguments);
}
......@@ -521,6 +521,9 @@ bool ProjectExplorerPlugin::initialize(const QStringList & /*arguments*/, QStrin
cmd = am->registerAction(m_runAction, Constants::RUN, globalcontext);
cmd->setDefaultKeySequence(QKeySequence(tr("Ctrl+R")));
mbuild->addAction(cmd, Constants::G_BUILD_RUN);
m_runActionContextMenu = new QAction(runIcon, tr("Run"), this);
cmd = am->registerAction(m_runActionContextMenu, Constants::RUNCONTEXTMENU, globalcontext);
mproject->addAction(cmd, Constants::G_PROJECT_RUN);
Core::ActionContainer *mrc = am->createMenu(Constants::RUNCONFIGURATIONMENU);
......@@ -616,6 +619,7 @@ bool ProjectExplorerPlugin::initialize(const QStringList & /*arguments*/, QStrin
connect(m_cleanAction, SIGNAL(triggered()), this, SLOT(cleanProject()));
connect(m_cleanSessionAction, SIGNAL(triggered()), this, SLOT(cleanSession()));
connect(m_runAction, SIGNAL(triggered()), this, SLOT(runProject()));
connect(m_runActionContextMenu, SIGNAL(triggered()), this, SLOT(runProjectContextMenu()));
connect(m_cancelBuildAction, SIGNAL(triggered()), this, SLOT(cancelBuild()));
connect(m_debugAction, SIGNAL(triggered()), this, SLOT(debugProject()));
connect(m_dependenciesAction, SIGNAL(triggered()), this, SLOT(editDependencies()));
......@@ -1348,7 +1352,16 @@ void ProjectExplorerPlugin::cleanSession()
void ProjectExplorerPlugin::runProject()
{
Project *pro = startupProject();
runProjectImpl(startupProject());
}
void ProjectExplorerPlugin::runProjectContextMenu()
{
runProjectImpl(m_currentProject);
}
void ProjectExplorerPlugin::runProjectImpl(Project *pro)
{
if (!pro)
return;
......@@ -1434,10 +1447,14 @@ IRunConfigurationRunner *ProjectExplorerPlugin::findRunner(QSharedPointer<RunCon
void ProjectExplorerPlugin::updateRunAction()
{
const Project *project = startupProject();
const bool canRun = project && findRunner(project->activeRunConfiguration(), ProjectExplorer::Constants::RUNMODE);
bool canRun = project && findRunner(project->activeRunConfiguration(), ProjectExplorer::Constants::RUNMODE);
const bool canDebug = project && !m_debuggingRunControl && findRunner(project->activeRunConfiguration(), ProjectExplorer::Constants::DEBUGMODE);
const bool building = m_buildManager->isBuilding();
m_runAction->setEnabled(canRun && !building);
canRun = m_currentProject && findRunner(m_currentProject->activeRunConfiguration(), ProjectExplorer::Constants::RUNMODE);
m_runActionContextMenu->setEnabled(canRun && !building);
m_debugAction->setEnabled(canDebug && !building);
}
......
......@@ -156,6 +156,7 @@ private slots:
void restoreSession();
void loadSession(const QString &session);
void runProject();
void runProjectContextMenu();
void savePersistentSettings();
void goToTaskWindow();
......@@ -188,6 +189,7 @@ private slots:
void currentModeChanged(Core::IMode *mode);
private:
void runProjectImpl(Project *pro);
void setCurrent(Project *project, QString filePath, Node *node);
QStringList allFilesWithDependencies(Project *pro);
......@@ -223,6 +225,7 @@ private:
QAction *m_cleanAction;
QAction *m_cleanSessionAction;
QAction *m_runAction;
QAction *m_runActionContextMenu;
QAction *m_cancelBuildAction;
QAction *m_debugAction;
QAction *m_dependenciesAction;
......
......@@ -57,6 +57,7 @@ const char * const BUILDCONFIGURATIONMENU = "ProjectExplorer.BuildConfigurationM
const char * const CANCELBUILD = "ProjectExplorer.CancelBuild";
const char * const RUNCONFIGURATIONMENU = "ProjectExplorer.RunConfigurationMenu";
const char * const RUN = "ProjectExplorer.Run";
const char * const RUNCONTEXTMENU = "ProjectExplorer.RunContextMenu";
const char * const STOP = "ProjectExplorer.Stop";
const char * const DEBUG = "ProjectExplorer.Debug";
const char * const DEPENDENCIES = "ProjectExplorer.Dependencies";
......
......@@ -62,72 +62,105 @@ bool GdbMacrosBuildStep::init(const QString &buildConfiguration)
void GdbMacrosBuildStep::run(QFutureInterface<bool> & fi)
{
// TODO CONFIG handling
QVariant v = value("clean");
if (v.isNull() || v.toBool() == false) {
// Normal run
QString dumperPath = ExtensionSystem::PluginManager::instance()->getObject<Core::ICore>()
->resourcePath() + "/gdbmacros/";
QStringList files;
files << "gdbmacros.cpp"
<< "gdbmacros.pro";
QString destDir = m_buildDirectory + "/qtc-gdbmacros/";
QDir dir;
dir.mkpath(destDir);
foreach (const QString &file, files) {
QFile destination(destDir + file);
if (destination.exists())
destination.remove();
QFile::copy(dumperPath + file, destDir + file);
}
QString dumperPath = ExtensionSystem::PluginManager::instance()->getObject<Core::ICore>()
->resourcePath() + "/gdbmacros/";
QStringList files;
files << "gdbmacros.cpp"
<< "gdbmacros.pro";
Qt4Project *qt4Project = static_cast<Qt4Project *>(project());
QProcess qmake;
qmake.setEnvironment(qt4Project->environment(m_buildConfiguration).toStringList());
qmake.setWorkingDirectory(destDir);
QStringList configarguments;
QStringList makeArguments;
// Find qmake step...
QMakeStep *qmakeStep = qt4Project->qmakeStep();
// Find out which configuration is used in this build configuration
// and what kind of CONFIG we need to pass to qmake for that
if (qmakeStep->value(m_buildConfiguration, "buildConfiguration").isValid()) {
QtVersion::QmakeBuildConfig defaultBuildConfiguration = qt4Project->qtVersion(m_buildConfiguration)->defaultBuildConfig();
QtVersion::QmakeBuildConfig projectBuildConfiguration = QtVersion::QmakeBuildConfig(qmakeStep->value(m_buildConfiguration, "buildConfiguration").toInt());
if ((defaultBuildConfiguration & QtVersion::BuildAll) && !(projectBuildConfiguration & QtVersion::BuildAll))
configarguments << "CONFIG-=debug_and_release";
if (!(defaultBuildConfiguration & QtVersion::BuildAll) && (projectBuildConfiguration & QtVersion::BuildAll))
configarguments << "CONFIG+=debug_and_release";
if ((defaultBuildConfiguration & QtVersion::DebugBuild) && !(projectBuildConfiguration & QtVersion::DebugBuild))
configarguments << "CONFIG+=release";
if (!(defaultBuildConfiguration & QtVersion::DebugBuild) && (projectBuildConfiguration & QtVersion::DebugBuild))
configarguments << "CONFIG+=debug";
if (projectBuildConfiguration & QtVersion::BuildAll)
makeArguments << (projectBuildConfiguration & QtVersion::DebugBuild ? "debug" : "release");
} else {
// Old style with CONFIG+=debug_and_release
configarguments << "CONFIG+=debug_and_release";
const MakeStep *ms = qt4Project->makeStep();
QStringList makeargs = ms->value(m_buildConfiguration, "makeargs").toStringList();
if (makeargs.contains("debug")) {
makeArguments << "debug";
} else if (makeargs.contains("release")) {
makeArguments << "release";
}
}
QString mkspec = qt4Project->qtVersion(m_buildConfiguration)->mkspec();
qmake.start(m_qmake, QStringList()<<"-spec"<<mkspec<<configarguments<<"gdbmacros.pro");
qmake.waitForFinished();
QString destDir = m_buildDirectory + "/qtc-gdbmacros/";
QDir dir;
dir.mkpath(destDir);
foreach (const QString &file, files) {
QFile destination(destDir + file);
if (destination.exists())
destination.remove();
QFile::copy(dumperPath + file, destDir + file);
}
Qt4Project *qt4Project = static_cast<Qt4Project *>(project());
QProcess qmake;
qmake.setEnvironment(qt4Project->environment(m_buildConfiguration).toStringList());
qmake.setWorkingDirectory(destDir);
QStringList configarguments;
QStringList makeArguments;
// Find qmake step...
QMakeStep *qmakeStep = qt4Project->qmakeStep();
// Find out which configuration is used in this build configuration
// and what kind of CONFIG we need to pass to qmake for that
if (qmakeStep->value(m_buildConfiguration, "buildConfiguration").isValid()) {
QtVersion::QmakeBuildConfig defaultBuildConfiguration = qt4Project->qtVersion(m_buildConfiguration)->defaultBuildConfig();
QtVersion::QmakeBuildConfig projectBuildConfiguration = QtVersion::QmakeBuildConfig(qmakeStep->value(m_buildConfiguration, "buildConfiguration").toInt());
if ((defaultBuildConfiguration & QtVersion::BuildAll) && !(projectBuildConfiguration & QtVersion::BuildAll))
configarguments << "CONFIG-=debug_and_release";
if (!(defaultBuildConfiguration & QtVersion::BuildAll) && (projectBuildConfiguration & QtVersion::BuildAll))
configarguments << "CONFIG+=debug_and_release";
if ((defaultBuildConfiguration & QtVersion::DebugBuild) && !(projectBuildConfiguration & QtVersion::DebugBuild))
configarguments << "CONFIG+=release";
if (!(defaultBuildConfiguration & QtVersion::DebugBuild) && (projectBuildConfiguration & QtVersion::DebugBuild))
configarguments << "CONFIG+=debug";
if (projectBuildConfiguration & QtVersion::BuildAll)
makeArguments << (projectBuildConfiguration & QtVersion::DebugBuild ? "debug" : "release");
qmake.start(qt4Project->qtVersion(m_buildConfiguration)->makeCommand(), makeArguments);
qmake.waitForFinished();
fi.reportResult(true);
} else {
// Old style with CONFIG+=debug_and_release
configarguments << "CONFIG+=debug_and_release";
const MakeStep *ms = qt4Project->makeStep();
QStringList makeargs = ms->value(m_buildConfiguration, "makeargs").toStringList();
if (makeargs.contains("debug")) {
makeArguments << "debug";
} else if (makeargs.contains("release")) {
makeArguments << "release";
// Clean step, we want to remove the directory
QString destDir = m_buildDirectory + "/qtc-gdbmacros/";
Qt4Project *qt4Project = static_cast<Qt4Project *>(project());
QProcess make;
make.setEnvironment(qt4Project->environment(m_buildConfiguration).toStringList());
make.setWorkingDirectory(destDir);
make.start(qt4Project->qtVersion(m_buildConfiguration)->makeCommand(), QStringList()<<"distclean");
make.waitForFinished();
QStringList files;
files << "gdbmacros.cpp"
<< "gdbmacros.pro";
QStringList directories;
directories << "debug"
<< "release";
foreach(const QString &file, files) {
QFile destination(destDir + file);
destination.remove();
}
}
QString mkspec = qt4Project->qtVersion(m_buildConfiguration)->mkspec();
qmake.start(m_qmake, QStringList()<<"-spec"<<mkspec<<configarguments<<"gdbmacros.pro");
qmake.waitForFinished();
foreach(const QString &dir, directories) {
QDir destination(destDir + dir);
destination.rmdir(destDir + dir);
}
qmake.start(qt4Project->qtVersion(m_buildConfiguration)->makeCommand(), makeArguments);
qmake.waitForFinished();
fi.reportResult(true);
QDir(destDir).rmdir(destDir);
fi.reportResult(true);
}
}
QString GdbMacrosBuildStep::name()
......
......@@ -38,6 +38,9 @@
#include "qt4project.h"
#include "qt4projectmanager.h"
#include "ui_qt4buildconfigwidget.h"
#include <extensionsystem/pluginmanager.h>
#include <coreplugin/mainwindow.h>
#include "qt4projectmanagerconstants.h"
#include <QtGui/QFileDialog>
......@@ -76,9 +79,11 @@ Qt4BuildConfigWidget::Qt4BuildConfigWidget(Qt4Project *project)
connect(m_ui->importLabel, SIGNAL(linkActivated(QString)),
this, SLOT(importLabelClicked()));
connect(m_ui->manageQtVersionPushButtons, SIGNAL(clicked()),
this, SLOT(manageQtVersions()));
connect(m_pro->qt4ProjectManager()->versionManager(), SIGNAL(qtVersionsChanged()),
this, SLOT(setupQtVersionsComboBox()));
}
Qt4BuildConfigWidget::~Qt4BuildConfigWidget()
......@@ -86,6 +91,13 @@ Qt4BuildConfigWidget::~Qt4BuildConfigWidget()
delete m_ui;
}
void Qt4BuildConfigWidget::manageQtVersions()
{
Core::ICore *core = ExtensionSystem::PluginManager::instance()->getObject<Core::ICore>();
core->showOptionsDialog(Constants::QT_CATEGORY, Constants::QTVERSION_PAGE);
}
QString Qt4BuildConfigWidget::displayName() const
{
return tr("General");
......
......@@ -64,6 +64,7 @@ private slots:
void shadowBuildLineEditTextChanged();
void importLabelClicked();
void qtVersionComboBoxCurrentIndexChanged(const QString &);
void manageQtVersions();
private:
Ui::Qt4BuildConfigWidget *m_ui;
......
......@@ -61,6 +61,13 @@
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="manageQtVersionPushButtons">
<property name="text">
<string>Manage Qt Versions</string>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="invalidQtWarningLabel">
<property name="text">
......
......@@ -610,9 +610,13 @@ void Qt4Project::addDefaultBuild()
makeStep = new MakeStep(this);
insertBuildStep(2, makeStep);
GdbMacrosBuildStep *gdbmacrosCleanStep = new GdbMacrosBuildStep(this);
gdbmacrosCleanStep->setValue("clean", true);
insertCleanStep(0, gdbmacrosCleanStep);
MakeStep* cleanStep = new MakeStep(this);
cleanStep->setValue("clean", true);
insertCleanStep(0, cleanStep);
insertCleanStep(1, cleanStep);
ProjectLoadWizard wizard(this);
wizard.execDialog();
......@@ -629,6 +633,10 @@ void Qt4Project::addDefaultBuild()
if (v.isValid() && v.toBool()) {
GdbMacrosBuildStep *gdbmacrostep = new GdbMacrosBuildStep(this);
insertBuildStep(0, gdbmacrostep);
GdbMacrosBuildStep *gdbmacrosCleanStep = new GdbMacrosBuildStep(this);
gdbmacrosCleanStep ->setValue("clean", true);
insertCleanStep(0, gdbmacrosCleanStep );
break;
}
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment