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

This commit is contained in:
hjk
2009-01-16 16:15:28 +01:00
11 changed files with 170 additions and 88 deletions

View File

@@ -246,7 +246,17 @@
\row \row
\i Switch between Header and Source \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 \endtable
@@ -256,12 +266,6 @@
Up/Down/Page Up/Page Down - hold ctrl to prevent the cursor from moving 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 To switch to an external editor, select \gui{Open in external editor} from
@@ -270,15 +274,9 @@
*/ */
/*!
*/
/*! /*!
\contentspage index.html \contentspage index.html
\previouspage creator-editor-settings.html \previouspage creator-code-editor.html
\page creator-build-settings.html \page creator-build-settings.html
\nextpage creator-creating-project.html \nextpage creator-creating-project.html
@@ -840,8 +838,8 @@
\section2 Viewing Versioning History and Change Details \section2 Viewing Versioning History and Change Details
The versioning history of a file can be displayed by selecting the The versioning history of a file can be displayed by selecting the
\gui{Log} (for \bold{git}) or \gui{Filelog (for \bold{Perforce} and \gui{Log} (for \bold{git}) or \gui{Filelog} (for \bold{Perforce} and
\bold{Subversion})} option. Typically, the log output will contain the \bold{Subversion}) option. Typically, the log output will contain the
date, the commit message, and a change or revision identifier. If you date, the commit message, and a change or revision identifier. If you
click on the identifier, a description of the change including the diff click on the identifier, a description of the change including the diff
will be displayed. will be displayed.

View File

@@ -80,9 +80,9 @@ CMakeProject::~CMakeProject()
// TODO make this function work even if it is reparsing // TODO make this function work even if it is reparsing
void CMakeProject::parseCMakeLists(const QDir &directory) void CMakeProject::parseCMakeLists(const QDir &directory)
{ {
createCbpFile(directory); createCbpFile(buildDirectory(QString()));
QString cbpFile = findCbpFile(directory); QString cbpFile = findCbpFile(buildDirectory(QString()));
CMakeCbpParser cbpparser; CMakeCbpParser cbpparser;
qDebug()<<"Parsing file "<<cbpFile; 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 // TODO we need to pass on the same paremeters as the cmakestep
qDebug()<<"Creating cbp file"; qDebug()<<"Creating cbp file";
directory.mkpath(directory.absolutePath());
QProcess cmake; QProcess cmake;
cmake.setWorkingDirectory(directory.absolutePath()); cmake.setWorkingDirectory(directory.absolutePath());
cmake.start("cmake", QStringList() << "-GCodeBlocks - Unix Makefiles"); cmake.start("cmake", QStringList() << ".." << "-GCodeBlocks - Unix Makefiles");
cmake.waitForFinished(-1); cmake.waitForFinished(-1);
qDebug()<<"cmake output: \n"<<cmake.readAll(); qDebug()<<"cmake output: \n"<<cmake.readAll();
} }
@@ -240,7 +241,7 @@ QString CMakeProject::buildDirectory(const QString &buildConfiguration) const
{ {
QString buildDirectory = value(buildConfiguration, "buildDirectory").toString(); QString buildDirectory = value(buildConfiguration, "buildDirectory").toString();
if (buildDirectory.isEmpty()) if (buildDirectory.isEmpty())
buildDirectory = QFileInfo(m_fileName).absolutePath(); buildDirectory = QFileInfo(m_fileName).absolutePath() + "/qtcreator-build";
return buildDirectory; return buildDirectory;
} }
@@ -523,7 +524,7 @@ void CMakeCbpParser::parseTargetOption()
{ {
if (attributes().hasAttribute("output")) if (attributes().hasAttribute("output"))
m_target.executable = attributes().value("output").toString(); 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; m_targetType = true;
else if (attributes().hasAttribute("working_dir")) else if (attributes().hasAttribute("working_dir"))
m_target.workingDirectory = attributes().value("working_dir").toString(); m_target.workingDirectory = attributes().value("working_dir").toString();

View File

@@ -190,3 +190,4 @@ void CoreImpl::openFiles(const QStringList &arguments)
{ {
m_mainwindow->openFiles(arguments); m_mainwindow->openFiles(arguments);
} }

View File

@@ -521,6 +521,9 @@ bool ProjectExplorerPlugin::initialize(const QStringList & /*arguments*/, QStrin
cmd = am->registerAction(m_runAction, Constants::RUN, globalcontext); cmd = am->registerAction(m_runAction, Constants::RUN, globalcontext);
cmd->setDefaultKeySequence(QKeySequence(tr("Ctrl+R"))); cmd->setDefaultKeySequence(QKeySequence(tr("Ctrl+R")));
mbuild->addAction(cmd, Constants::G_BUILD_RUN); 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); mproject->addAction(cmd, Constants::G_PROJECT_RUN);
Core::ActionContainer *mrc = am->createMenu(Constants::RUNCONFIGURATIONMENU); 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_cleanAction, SIGNAL(triggered()), this, SLOT(cleanProject()));
connect(m_cleanSessionAction, SIGNAL(triggered()), this, SLOT(cleanSession())); connect(m_cleanSessionAction, SIGNAL(triggered()), this, SLOT(cleanSession()));
connect(m_runAction, SIGNAL(triggered()), this, SLOT(runProject())); 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_cancelBuildAction, SIGNAL(triggered()), this, SLOT(cancelBuild()));
connect(m_debugAction, SIGNAL(triggered()), this, SLOT(debugProject())); connect(m_debugAction, SIGNAL(triggered()), this, SLOT(debugProject()));
connect(m_dependenciesAction, SIGNAL(triggered()), this, SLOT(editDependencies())); connect(m_dependenciesAction, SIGNAL(triggered()), this, SLOT(editDependencies()));
@@ -1348,7 +1352,16 @@ void ProjectExplorerPlugin::cleanSession()
void ProjectExplorerPlugin::runProject() void ProjectExplorerPlugin::runProject()
{ {
Project *pro = startupProject(); runProjectImpl(startupProject());
}
void ProjectExplorerPlugin::runProjectContextMenu()
{
runProjectImpl(m_currentProject);
}
void ProjectExplorerPlugin::runProjectImpl(Project *pro)
{
if (!pro) if (!pro)
return; return;
@@ -1434,10 +1447,14 @@ IRunConfigurationRunner *ProjectExplorerPlugin::findRunner(QSharedPointer<RunCon
void ProjectExplorerPlugin::updateRunAction() void ProjectExplorerPlugin::updateRunAction()
{ {
const Project *project = startupProject(); 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 canDebug = project && !m_debuggingRunControl && findRunner(project->activeRunConfiguration(), ProjectExplorer::Constants::DEBUGMODE);
const bool building = m_buildManager->isBuilding(); const bool building = m_buildManager->isBuilding();
m_runAction->setEnabled(canRun && !building); 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); m_debugAction->setEnabled(canDebug && !building);
} }

View File

@@ -156,6 +156,7 @@ private slots:
void restoreSession(); void restoreSession();
void loadSession(const QString &session); void loadSession(const QString &session);
void runProject(); void runProject();
void runProjectContextMenu();
void savePersistentSettings(); void savePersistentSettings();
void goToTaskWindow(); void goToTaskWindow();
@@ -188,6 +189,7 @@ private slots:
void currentModeChanged(Core::IMode *mode); void currentModeChanged(Core::IMode *mode);
private: private:
void runProjectImpl(Project *pro);
void setCurrent(Project *project, QString filePath, Node *node); void setCurrent(Project *project, QString filePath, Node *node);
QStringList allFilesWithDependencies(Project *pro); QStringList allFilesWithDependencies(Project *pro);
@@ -223,6 +225,7 @@ private:
QAction *m_cleanAction; QAction *m_cleanAction;
QAction *m_cleanSessionAction; QAction *m_cleanSessionAction;
QAction *m_runAction; QAction *m_runAction;
QAction *m_runActionContextMenu;
QAction *m_cancelBuildAction; QAction *m_cancelBuildAction;
QAction *m_debugAction; QAction *m_debugAction;
QAction *m_dependenciesAction; QAction *m_dependenciesAction;

View File

@@ -57,6 +57,7 @@ const char * const BUILDCONFIGURATIONMENU = "ProjectExplorer.BuildConfigurationM
const char * const CANCELBUILD = "ProjectExplorer.CancelBuild"; const char * const CANCELBUILD = "ProjectExplorer.CancelBuild";
const char * const RUNCONFIGURATIONMENU = "ProjectExplorer.RunConfigurationMenu"; const char * const RUNCONFIGURATIONMENU = "ProjectExplorer.RunConfigurationMenu";
const char * const RUN = "ProjectExplorer.Run"; const char * const RUN = "ProjectExplorer.Run";
const char * const RUNCONTEXTMENU = "ProjectExplorer.RunContextMenu";
const char * const STOP = "ProjectExplorer.Stop"; const char * const STOP = "ProjectExplorer.Stop";
const char * const DEBUG = "ProjectExplorer.Debug"; const char * const DEBUG = "ProjectExplorer.Debug";
const char * const DEPENDENCIES = "ProjectExplorer.Dependencies"; const char * const DEPENDENCIES = "ProjectExplorer.Dependencies";

View File

@@ -62,8 +62,9 @@ bool GdbMacrosBuildStep::init(const QString &buildConfiguration)
void GdbMacrosBuildStep::run(QFutureInterface<bool> & fi) 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>() QString dumperPath = ExtensionSystem::PluginManager::instance()->getObject<Core::ICore>()
->resourcePath() + "/gdbmacros/"; ->resourcePath() + "/gdbmacros/";
QStringList files; QStringList files;
@@ -128,6 +129,38 @@ void GdbMacrosBuildStep::run(QFutureInterface<bool> & fi)
qmake.waitForFinished(); qmake.waitForFinished();
fi.reportResult(true); fi.reportResult(true);
} else {
// 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();
}
foreach(const QString &dir, directories) {
QDir destination(destDir + dir);
destination.rmdir(destDir + dir);
}
QDir(destDir).rmdir(destDir);
fi.reportResult(true);
}
} }
QString GdbMacrosBuildStep::name() QString GdbMacrosBuildStep::name()

View File

@@ -38,6 +38,9 @@
#include "qt4project.h" #include "qt4project.h"
#include "qt4projectmanager.h" #include "qt4projectmanager.h"
#include "ui_qt4buildconfigwidget.h" #include "ui_qt4buildconfigwidget.h"
#include <extensionsystem/pluginmanager.h>
#include <coreplugin/mainwindow.h>
#include "qt4projectmanagerconstants.h"
#include <QtGui/QFileDialog> #include <QtGui/QFileDialog>
@@ -76,9 +79,11 @@ Qt4BuildConfigWidget::Qt4BuildConfigWidget(Qt4Project *project)
connect(m_ui->importLabel, SIGNAL(linkActivated(QString)), connect(m_ui->importLabel, SIGNAL(linkActivated(QString)),
this, SLOT(importLabelClicked())); this, SLOT(importLabelClicked()));
connect(m_ui->manageQtVersionPushButtons, SIGNAL(clicked()),
this, SLOT(manageQtVersions()));
connect(m_pro->qt4ProjectManager()->versionManager(), SIGNAL(qtVersionsChanged()), connect(m_pro->qt4ProjectManager()->versionManager(), SIGNAL(qtVersionsChanged()),
this, SLOT(setupQtVersionsComboBox())); this, SLOT(setupQtVersionsComboBox()));
} }
Qt4BuildConfigWidget::~Qt4BuildConfigWidget() Qt4BuildConfigWidget::~Qt4BuildConfigWidget()
@@ -86,6 +91,13 @@ Qt4BuildConfigWidget::~Qt4BuildConfigWidget()
delete m_ui; 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 QString Qt4BuildConfigWidget::displayName() const
{ {
return tr("General"); return tr("General");

View File

@@ -64,6 +64,7 @@ private slots:
void shadowBuildLineEditTextChanged(); void shadowBuildLineEditTextChanged();
void importLabelClicked(); void importLabelClicked();
void qtVersionComboBoxCurrentIndexChanged(const QString &); void qtVersionComboBoxCurrentIndexChanged(const QString &);
void manageQtVersions();
private: private:
Ui::Qt4BuildConfigWidget *m_ui; Ui::Qt4BuildConfigWidget *m_ui;

View File

@@ -61,6 +61,13 @@
</property> </property>
</widget> </widget>
</item> </item>
<item>
<widget class="QPushButton" name="manageQtVersionPushButtons">
<property name="text">
<string>Manage Qt Versions</string>
</property>
</widget>
</item>
<item> <item>
<widget class="QLabel" name="invalidQtWarningLabel"> <widget class="QLabel" name="invalidQtWarningLabel">
<property name="text"> <property name="text">

View File

@@ -610,9 +610,13 @@ void Qt4Project::addDefaultBuild()
makeStep = new MakeStep(this); makeStep = new MakeStep(this);
insertBuildStep(2, makeStep); insertBuildStep(2, makeStep);
GdbMacrosBuildStep *gdbmacrosCleanStep = new GdbMacrosBuildStep(this);
gdbmacrosCleanStep->setValue("clean", true);
insertCleanStep(0, gdbmacrosCleanStep);
MakeStep* cleanStep = new MakeStep(this); MakeStep* cleanStep = new MakeStep(this);
cleanStep->setValue("clean", true); cleanStep->setValue("clean", true);
insertCleanStep(0, cleanStep); insertCleanStep(1, cleanStep);
ProjectLoadWizard wizard(this); ProjectLoadWizard wizard(this);
wizard.execDialog(); wizard.execDialog();
@@ -629,6 +633,10 @@ void Qt4Project::addDefaultBuild()
if (v.isValid() && v.toBool()) { if (v.isValid() && v.toBool()) {
GdbMacrosBuildStep *gdbmacrostep = new GdbMacrosBuildStep(this); GdbMacrosBuildStep *gdbmacrostep = new GdbMacrosBuildStep(this);
insertBuildStep(0, gdbmacrostep); insertBuildStep(0, gdbmacrostep);
GdbMacrosBuildStep *gdbmacrosCleanStep = new GdbMacrosBuildStep(this);
gdbmacrosCleanStep ->setValue("clean", true);
insertCleanStep(0, gdbmacrosCleanStep );
break; break;
} }
} }