Commit bc89f5dc authored by Thorbjørn Lindeijer's avatar Thorbjørn Lindeijer
Browse files

Merge branch '1.1'

Conflicts:
	src/plugins/debugger/debuggeractions.cpp

Reviewed-by: hjk
parents 7a0baf65 ef1311d0
......@@ -74,6 +74,7 @@ src/xml/lib/
# --------
bin/*.dll
bin/qtcreator.bin
bin/qtcreator_process_stub
bin/qtcreator.exe
doc/qtcreator.qch
tests/manual/cplusplus/cplusplus0
......@@ -18,9 +18,6 @@ Editing
* Improved function argument hint.
* More checkpoints in editor history.
* Ctrl-click for jumping to a symbol definition.
* Context help for form editor widgets.
* Goto slot from form editor now works with multiple inheritance.
* Add signal/slot editor to form editor.
* Improved open documents view (sorted, single-click, close buttons).
* Copying text from the context help browser and output windows didn't work.
......@@ -36,7 +33,7 @@ Debugging
no dumper buildstep anymore.
* New dumper for std::set. Improved QString, QVariant, std::wstring
* Make strategy to load shared objects configurable (auto-solib-add).
* Maximum stack depth configurable.
* Increase number of shown stack frames on request instead of loading them all.
* Improved interaction in the Locals&Watchers view.
Wizards
......@@ -48,6 +45,7 @@ Wizards
Designer
* Added signal/slot editor.
* Fixed "Goto slot" (formatting/multiple inheritance).
* Context help for form editor widgets.
Version control plugins
* Fixed handling of colored git output.
......
......@@ -43,21 +43,6 @@
\endlist
\endtable
\raw HTML
<center>
<object width="425" height="344">
<param name="movie"
value="http://www.youtube.com/v/U7yje3D1UM4&hl=en&fs=1"></param>
<param name="allowFullScreen" value="true"></param>
<param name="allowscriptaccess" value="always"></param>
<embed src="http://www.youtube.com/v/U7yje3D1UM4&hl=en&fs=1"
type="application/x-shockwave-flash" allowscriptaccess="always"
allowfullscreen="true" width="425" height="344">
</embed>
</object>
</center>
\endraw
To learn more about the Qt Creator, click on one of the links below:
\list
......@@ -1438,23 +1423,6 @@
\title Keyboard Shortcuts
\raw HTML
<center>
<object width="480" height="295">
<param name="movie"
value="http://www.youtube.com/v/6WGCxLIjRNg&hl=en&fs=1">
</param>
<param name="allowFullScreen" value="true"></param>
<param name="allowscriptaccess" value="always"></param>
<embed src="http://www.youtube.com/v/6WGCxLIjRNg&hl=en&fs=1"
type="application/x-shockwave-flash" allowscriptaccess="always"
allowfullscreen="true" width="480" height="295">
</embed>
</object>
</center>
\endraw
Qt Creator provides various keyboard shortcuts to aid in the development
process. These shortcuts are listed in the table below:
......
......@@ -202,11 +202,12 @@ QT_END_NAMESPACE
#endif // PRIVATE_OBJECT_ALLOWED
// this can be mangled typenames of nested templates, each char-by-char
// comma-separated integer list
static char qDumpInBuffer[10000];
static char qDumpOutBuffer[100000];
//static char qDumpSize[20];
// This can be mangled typenames of nested templates, each char-by-char
// comma-separated integer list...
Q_DECL_EXPORT char qDumpInBuffer[10000];
// The output buffer.
Q_DECL_EXPORT char qDumpOutBuffer[100000];
namespace {
......@@ -2396,6 +2397,10 @@ static void handleProtocolVersion2and3(QDumper & d)
const char *type = stripNamespace(d.outertype);
// type[0] is usally 'Q', so don't use it
switch (type[1]) {
case 'a':
if (isEqual(type, "map"))
qDumpStdMap(d);
break;
case 'B':
if (isEqual(type, "QByteArray"))
qDumpQByteArray(d);
......@@ -2406,6 +2411,12 @@ static void handleProtocolVersion2and3(QDumper & d)
else if (isEqual(type, "QDir"))
qDumpQDir(d);
break;
case 'e':
if (isEqual(type, "vector"))
qDumpStdVector(d);
else if (isEqual(type, "set"))
qDumpStdSet(d);
break;
case 'F':
if (isEqual(type, "QFile"))
qDumpQFile(d);
......@@ -2418,6 +2429,10 @@ static void handleProtocolVersion2and3(QDumper & d)
else if (isEqual(type, "QHashNode"))
qDumpQHashNode(d);
break;
case 'i':
if (isEqual(type, "list"))
qDumpStdList(d);
break;
case 'I':
if (isEqual(type, "QImage"))
qDumpQImage(d);
......@@ -2510,7 +2525,7 @@ static void handleProtocolVersion2and3(QDumper & d)
extern "C" Q_DECL_EXPORT
void qDumpObjectData440(
void *qDumpObjectData440(
int protocolVersion,
int token,
void *data,
......@@ -2545,18 +2560,18 @@ void qDumpObjectData440(
"\""NS"QMap\","
"\""NS"QMapNode\","
"\""NS"QModelIndex\","
#if QT_VERSION >= 0x040500
#if QT_VERSION >= 0x040500
"\""NS"QMultiMap\","
#endif
#endif
"\""NS"QObject\","
"\""NS"QObjectMethodList\"," // hack to get nested properties display
"\""NS"QObjectPropertyList\","
#if PRIVATE_OBJECT_ALLOWED
#if PRIVATE_OBJECT_ALLOWED
"\""NS"QObjectSignal\","
"\""NS"QObjectSignalList\","
"\""NS"QObjectSlot\","
"\""NS"QObjectSlotList\","
#endif // PRIVATE_OBJECT_ALLOWED
#endif // PRIVATE_OBJECT_ALLOWED
// << "\""NS"QRegion\","
"\""NS"QSet\","
"\""NS"QString\","
......@@ -2565,8 +2580,15 @@ void qDumpObjectData440(
"\""NS"QVariant\","
"\""NS"QVector\","
"\""NS"QWidget\","
#ifdef Q_OS_WIN
"\"basic_string\","
"\"list\","
"\"map\","
"\"set\","
"\"string\","
"\"vector\","
"\"wstring\","
#endif
"\"std::basic_string\","
"\"std::list\","
"\"std::map\","
......@@ -2608,4 +2630,5 @@ void qDumpObjectData440(
else {
qDebug() << "Unsupported protocol version" << protocolVersion;
}
return qDumpOutBuffer;
}
#!/bin/bash
osascript >/dev/null 2>&1 <<EOF
#! /bin/bash
### FIXME:
# - currentTab and geometry stuff does not work with macX 10.4 (tiger)
# - -async is always in effect, i.e., synchronous execution is not implemented
geom=
async=
while test -n "$1"; do
case $1 in
-async)
async=1
shift;;
-geom)
shift
w=${1%%x*}
y=${1#*x}
h=${y%%+*}
y=${y#*+}
x=${y%%+*}
y=${y#*+}
geom="\
set number of columns of currentTab to $w
set number of rows of currentTab to $h
set position of windows whose tabs contains currentTab to {$x, $y}"
shift;;
-e)
shift
break;;
*)
echo "Invalid call" >&2
exit 1;;
esac
done
args=
for i in "$@"; do
i=${i//\\/\\\\\\\\}
i=${i//\"/\\\\\\\"}
i=${i//\$/\\\\\\\$}
i=${i//\`/\\\\\\\`}
args="$args \\\"$i\\\""
done
osascript <<EOF
tell application "Terminal"
do script "$1 $2 +$3 +\"normal $4|\"; exit"
do script "$args; exit"
set currentTab to the result
set number of columns of currentTab to $5
set number of rows of currentTab to $6
set position of windows whose tabs contains currentTab to {$7, $8}
$geom
activate
end tell
EOF
......@@ -43,10 +43,14 @@
#include <windows.h>
QT_BEGIN_NAMESPACE
class QWinEventNotifier;
class QTemporaryFile;
QT_END_NAMESPACE
#endif
QT_BEGIN_NAMESPACE
class QSettings;
class QTemporaryFile;
QT_END_NAMESPACE
namespace Core {
namespace Utils {
......@@ -69,6 +73,13 @@ public:
int exitCode() const { return m_appCode; } // This will be the signal number if exitStatus == CrashExit
QProcess::ExitStatus exitStatus() const { return m_appStatus; }
#ifdef Q_OS_UNIX
void setSettings(QSettings *settings) { m_settings = settings; }
static QString defaultTerminalEmulator();
static QString terminalEmulator(const QSettings *settings);
static void setTerminalEmulator(QSettings *settings, const QString &term);
#endif
signals:
void processError(const QString &error);
// These reflect the state of the actual client process
......@@ -102,15 +113,16 @@ private:
QProcess::ExitStatus m_appStatus;
QLocalServer m_stubServer;
QLocalSocket *m_stubSocket;
QTemporaryFile *m_tempFile;
#ifdef Q_OS_WIN
PROCESS_INFORMATION *m_pid;
HANDLE m_hInferior;
QWinEventNotifier *inferiorFinishedNotifier;
QWinEventNotifier *processFinishedNotifier;
QTemporaryFile *m_tempFile;
#else
QProcess m_process;
QByteArray m_stubServerDir;
QSettings *m_settings;
#endif
};
......
......@@ -30,6 +30,8 @@
#include "consoleprocess.h"
#include <QtCore/QCoreApplication>
#include <QtCore/QDir>
#include <QtCore/QSettings>
#include <QtCore/QTemporaryFile>
#include <QtNetwork/QLocalSocket>
......@@ -48,6 +50,7 @@ ConsoleProcess::ConsoleProcess(QObject *parent)
m_debug = false;
m_appPid = 0;
m_stubSocket = 0;
m_settings = 0;
connect(&m_stubServer, SIGNAL(newConnection()), SLOT(stubConnectionAvailable()));
......@@ -72,8 +75,24 @@ bool ConsoleProcess::start(const QString &program, const QStringList &args)
return false;
}
QStringList xtermArgs;
xtermArgs << "-e"
if (!environment().isEmpty()) {
m_tempFile = new QTemporaryFile();
if (!m_tempFile->open()) {
stubServerShutdown();
emit processError(tr("Cannot create temp file: %1").arg(m_tempFile->errorString()));
delete m_tempFile;
m_tempFile = 0;
return false;
}
foreach (const QString &var, environment()) {
m_tempFile->write(var.toLocal8Bit());
m_tempFile->write("", 1);
}
m_tempFile->flush();
}
QStringList xtermArgs = terminalEmulator(m_settings).split(QLatin1Char(' ')); // FIXME: quoting
xtermArgs
#ifdef Q_OS_MAC
<< (QCoreApplication::applicationDirPath() + "/../Resources/qtcreator_process_stub")
#else
......@@ -82,13 +101,17 @@ bool ConsoleProcess::start(const QString &program, const QStringList &args)
<< (m_debug ? "debug" : "exec")
<< m_stubServer.fullServerName()
<< tr("Press <RETURN> to close this window...")
<< workingDirectory() << environment() << ""
<< workingDirectory()
<< (m_tempFile ? m_tempFile->fileName() : 0)
<< program << args;
m_process.start(QLatin1String("xterm"), xtermArgs);
QString xterm = xtermArgs.takeFirst();
m_process.start(xterm, xtermArgs);
if (!m_process.waitForStarted()) {
stubServerShutdown();
emit processError(tr("Cannot start console emulator xterm."));
emit processError(tr("Cannot start terminal emulator %1.").arg(xterm));
delete m_tempFile;
m_tempFile = 0;
return false;
}
m_executable = program;
......@@ -173,6 +196,10 @@ void ConsoleProcess::readStubOutput()
emit processError(tr("Cannot execute %1: %2")
.arg(m_executable, errorMsg(out.mid(9).toInt())));
} else if (out.startsWith("pid ")) {
// Will not need it any more
delete m_tempFile;
m_tempFile = 0;
m_appPid = out.mid(4).toInt();
emit processStarted();
} else if (out.startsWith("exit ")) {
......@@ -199,6 +226,8 @@ void ConsoleProcess::stubExited()
if (m_stubSocket && m_stubSocket->state() == QLocalSocket::ConnectedState)
m_stubSocket->waitForDisconnected();
stubServerShutdown();
delete m_tempFile;
m_tempFile = 0;
if (m_appPid) {
m_appStatus = QProcess::CrashExit;
m_appCode = -1;
......@@ -207,3 +236,27 @@ void ConsoleProcess::stubExited()
}
emit wrapperStopped();
}
QString ConsoleProcess::defaultTerminalEmulator()
{
// FIXME: enable this once runInTerminal works nicely
#if 0 //def Q_OS_MAC
return QDir::cleanPath(QCoreApplication::applicationDirPath()
+ QLatin1String("/../Resources/runInTerminal.command"));
#else
return QLatin1String("xterm");
#endif
}
QString ConsoleProcess::terminalEmulator(const QSettings *settings)
{
QString dflt = defaultTerminalEmulator() + QLatin1String(" -e");
if (!settings)
return dflt;
return settings->value(QLatin1String("General/TerminalEmulator"), dflt).toString();
}
void ConsoleProcess::setTerminalEmulator(QSettings *settings, const QString &term)
{
return settings->setValue(QLatin1String("General/TerminalEmulator"), term);
}
......@@ -73,18 +73,19 @@ enum {
ArgSocket,
ArgMsg,
ArgDir,
ArgEnv
ArgEnv,
ArgExe
};
/* syntax: $0 {"run"|"debug"} <pid-socket> <continuation-msg> <workdir> <env...> "" <exe> <args...> */
/* syntax: $0 {"run"|"debug"} <pid-socket> <continuation-msg> <workdir> <env-file> <exe> <args...> */
/* exit codes: 0 = ok, 1 = invocation error, 3 = internal error */
int main(int argc, char *argv[])
{
int envIdx = ArgEnv;
int errNo;
int chldPid;
int chldStatus;
int chldPipe[2];
char **env = 0;
struct sockaddr_un sau;
if (argc < ArgEnv) {
......@@ -111,6 +112,35 @@ int main(int argc, char *argv[])
return 1;
}
if (*argv[ArgEnv]) {
FILE *envFd;
char *envdata, *edp;
long size;
int count;
if (!(envFd = fopen(argv[ArgEnv], "r"))) {
fprintf(stderr, "Cannot read creator env file %s: %s\n",
argv[ArgEnv], strerror(errno));
doExit(1);
}
fseek(envFd, 0, SEEK_END);
size = ftell(envFd);
rewind(envFd);
envdata = malloc(size);
if (fread(envdata, 1, size, envFd) != (size_t)size) {
perror("Failed to read env file");
doExit(1);
}
fclose(envFd);
for (count = 0, edp = envdata; edp < envdata + size; ++count)
edp += strlen(edp) + 1;
env = malloc((count + 1) * sizeof(char *));
for (count = 0, edp = envdata; edp < envdata + size; ++count) {
env[count] = edp;
edp += strlen(edp) + 1;
}
env[count] = 0;
}
/* Create execution result notification pipe. */
if (pipe(chldPipe)) {
perror("Cannot create status pipe");
......@@ -142,14 +172,10 @@ int main(int argc, char *argv[])
ptrace(PT_TRACE_ME, 0, 0, 0);
#endif
for (envIdx = ArgEnv; *argv[envIdx]; ++envIdx) ;
if (envIdx != ArgEnv) {
argv[envIdx] = 0;
environ = argv + ArgEnv;
}
++envIdx;
if (env)
environ = env;
execvp(argv[envIdx], argv + envIdx);
execvp(argv[ArgExe], argv + ArgExe);
/* Only expected error: no such file or direcotry, i.e. executable not found */
errNo = errno;
write(chldPipe[1], &errNo, sizeof(errNo)); /* Only realistic error case is SIGPIPE */
......
......@@ -49,6 +49,7 @@
#include <extensionsystem/pluginmanager.h>
#include <utils/consoleprocess.h>
#include <utils/qtcassert.h>
#include <QtCore/QDebug>
......@@ -73,6 +74,7 @@ Q_DECLARE_METATYPE(Core::IEditor*)
using namespace Core;
using namespace Core::Internal;
using namespace Core::Utils;
enum { debugEditorManager=0 };
......@@ -429,15 +431,14 @@ void EditorManager::init()
QString EditorManager::defaultExternalEditor() const
{
#ifdef Q_OS_MAC
return m_d->m_core->resourcePath()
+QLatin1String("/runInTerminal.command vi %f %l %c %W %H %x %y");
#elif defined(Q_OS_UNIX)
return QLatin1String("xterm -geom %Wx%H+%x+%y -e vi %f +%l +\"normal %c|\"");
#elif defined (Q_OS_WIN)
return QLatin1String("notepad %f");
#ifdef Q_OS_UNIX
return ConsoleProcess::defaultTerminalEmulator() + QLatin1String(
# ifdef Q_OS_MAC
" -async"
# endif
" -geom %Wx%H+%x+%y -e vi %f +%l +\"normal %c|\"");
#else
return QString();
return QLatin1String("notepad %f");
#endif
}
......@@ -462,7 +463,7 @@ void EditorManager::removeEditor(IEditor *editor)
}
void EditorManager::handleContextChange(IContext *context)
void EditorManager::handleContextChange(Core::IContext *context)
{
if (debugEditorManager)
qDebug() << Q_FUNC_INFO;
......@@ -1172,9 +1173,8 @@ bool EditorManager::saveFile(IEditor *editor)
return true;
}
if (file->isReadOnly() || fileName.isEmpty()) {
if (file->isReadOnly() || fileName.isEmpty())
return saveFileAs(editor);
}
m_d->m_core->fileManager()->blockFileChange(file);
const bool success = file->save(fileName);
......
......@@ -453,7 +453,7 @@ void FileManager::changedFile(const QString &file)
foreach (IFile *fileinterface, managedFiles(file))
m_changedFiles << fileinterface;
if (wasempty && !m_changedFiles.isEmpty()) {
QTimer::singleShot (200, this, SLOT(checkForReload()));
QTimer::singleShot(200, this, SLOT(checkForReload()));
}
}
......
......@@ -31,11 +31,14 @@
#include "stylehelper.h"
#include "utils/qtcolorbutton.h"
#include <utils/consoleprocess.h>
#include <coreplugin/editormanager/editormanager.h>
#include <coreplugin/icore.h>
#include <QtGui/QMessageBox>
#include "ui_generalsettings.h"
using namespace Core::Utils;
using namespace Core::Internal;
GeneralSettings::GeneralSettings():
......@@ -71,6 +74,13 @@ QWidget *GeneralSettings::createPage(QWidget *parent)
m_page->colorButton->setColor(StyleHelper::baseColor());
m_page->externalEditorEdit->setText(EditorManager::instance()->externalEditor());
#ifdef Q_OS_UNIX
m_page->terminalEdit->setText(ConsoleProcess::terminalEmulator(Core::ICore::instance()->settings()));
#else
m_page->terminalLabel->hide();
m_page->terminalEdit->hide();
m_page->resetTerminalButton->hide();
#endif
connect(m_page->resetButton, SIGNAL(clicked()),
this, SLOT(resetInterfaceColor()));
......@@ -78,6 +88,10 @@ QWidget *GeneralSettings::createPage(QWidget *parent)
this, SLOT(resetExternalEditor()));
connect(m_page->helpExternalEditorButton, SIGNAL(clicked()),
this, SLOT(showHelpForExternalEditor()));
#ifdef Q_OS_UNIX
connect(m_page->resetTerminalButton, SIGNAL(clicked()),
this, SLOT(resetTerminal()));
#endif
return w;
}
......@@ -87,6 +101,10 @@ void GeneralSettings::apply()
// Apply the new base color if accepted
StyleHelper::setBaseColor(m_page->colorButton->color());
EditorManager::instance()->setExternalEditor(m_page->externalEditorEdit->text());
#ifdef Q_OS_UNIX
ConsoleProcess::setTerminalEmulator(Core::ICore::instance()->settings(),
m_page->terminalEdit->text());
#endif
}
void GeneralSettings::finish()
......@@ -104,6 +122,13 @@ void GeneralSettings::resetExternalEditor()
m_page->externalEditorEdit->setText(EditorManager::instance()->defaultExternalEditor());
}
#ifdef Q_OS_UNIX
void GeneralSettings::resetTerminal()
{
m_page->terminalEdit->setText(ConsoleProcess::defaultTerminalEmulator() + QLatin1String(" -e"));
}
#endif
void GeneralSettings::showHelpForExternalEditor()
{
if (m_dialog) {
......
......@@ -59,6 +59,9 @@ private slots:
void resetInterfaceColor();
void resetExternalEditor();
void showHelpForExternalEditor();
#ifdef Q_OS_UNIX
void resetTerminal();
#endif
private: