Commit 8bdfdba0 authored by dt's avatar dt
Browse files

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

parents 0afed96f 05f0b60f
......@@ -25,16 +25,39 @@ Editing
* 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.
* Fixed "Go to slot..." functionality in the integrated QDesigner
Building, Running and Debugging
Building and Running
* Experimental support for generic Makefile based projects.
* Improved .pro file parsing, handling scopes and $$system directive.
* Support subdir.file in .pro files.
* Experimental cdb debugger.
* Option to start application in external terminal.
Debugging
* Possibility to attach debugger to core files.
* Debugger understands std::set now.
* Changed approach to dumper loading: Build once per used Qt version,
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.
* Improved interaction in the Locals&Watchers view.
* Experimental cdb debugger.
Wizards
* It is now possible to choose file suffixes in the options dialog.
* Code of language change event is now generated correctly (added call
to base class).
Designer
* Added signal/slot editor.
* Fixed "Goto slot" (formatting/multiple inheritance).
Version control plugins
* Fixed handling of colored git output.
* Made svn 1.6 work.
* Added syntax highlighting to the git submit editor.
* Made git submit editor remove comment lines.
* Added configuration options for submit editors (user fields, word
wrapping).
Platform Specific
......
......@@ -179,7 +179,7 @@ static inline QStringList getPluginPaths()
// 1) "plugins" (Win/Linux)
QString pluginPath = rootDirPath;
pluginPath += QDir::separator();
#ifdef QT_ARCH_X86_64
#if defined(QT_ARCH_X86_64) && defined(Q_OS_UNIX) && !defined(Q_OS_MAC)
pluginPath += QLatin1String("lib64");
#else
pluginPath += QLatin1String("lib");
......
......@@ -123,8 +123,9 @@ const char * const ZOOM_WINDOW = "QtCreator.ZoomWindow";
const char * const SPLIT = "QtCreator.Split";
const char * const SPLIT_SIDE_BY_SIDE = "QtCreator.SplitSideBySide";
const char * const UNSPLIT = "QtCreator.Unsplit";
const char * const GOTO_OTHER_WINDOW = "QtCreator.GotoOtherWindow";
const char * const REMOVE_CURRENT_SPLIT = "QtCreator.RemoveCurrentSplit";
const char * const REMOVE_ALL_SPLITS = "QtCreator.RemoveAllSplits";
const char * const GOTO_OTHER_SPLIT = "QtCreator.GotoOtherSplit";
const char * const SAVEASDEFAULT = "QtCreator.SaveAsDefaultLayout";
const char * const RESTOREDEFAULT = "QtCreator.RestoreDefaultLayout";
const char * const CLOSE = "QtCreator.Close";
......
......@@ -154,8 +154,9 @@ struct EditorManagerPrivate {
QAction *m_openInExternalEditorAction;
QAction *m_splitAction;
QAction *m_splitSideBySideAction;
QAction *m_unsplitAction;
QAction *m_gotoOtherWindowAction;
QAction *m_removeCurrentSplitAction;
QAction *m_removeAllSplitsAction;
QAction *m_gotoOtherSplitAction;
QList<IEditor *> m_editorHistory;
QList<EditLocation *> m_navigationHistory;
......@@ -331,27 +332,33 @@ EditorManager::EditorManager(ICore *core, QWidget *parent) :
m_d->m_splitAction = new QAction(tr("Split"), this);
cmd = am->registerAction(m_d->m_splitAction, Constants::SPLIT, editManagerContext);
cmd->setDefaultKeySequence(QKeySequence(tr("Ctrl+E,1")));
cmd->setDefaultKeySequence(QKeySequence(tr("Ctrl+E,2")));
mwindow->addAction(cmd, Constants::G_WINDOW_SPLIT);
connect(m_d->m_splitAction, SIGNAL(triggered()), this, SLOT(split()));
m_d->m_splitSideBySideAction = new QAction(tr("Split Side by Side"), this);
cmd = am->registerAction(m_d->m_splitSideBySideAction, Constants::SPLIT_SIDE_BY_SIDE, editManagerContext);
cmd->setDefaultKeySequence(QKeySequence(tr("Ctrl+E,2")));
cmd->setDefaultKeySequence(QKeySequence(tr("Ctrl+E,3")));
mwindow->addAction(cmd, Constants::G_WINDOW_SPLIT);
connect(m_d->m_splitSideBySideAction, SIGNAL(triggered()), this, SLOT(splitSideBySide()));
m_d->m_unsplitAction = new QAction(tr("Unsplit"), this);
cmd = am->registerAction(m_d->m_unsplitAction, Constants::UNSPLIT, editManagerContext);
m_d->m_removeCurrentSplitAction = new QAction(tr("Remove Current Split"), this);
cmd = am->registerAction(m_d->m_removeCurrentSplitAction, Constants::REMOVE_CURRENT_SPLIT, editManagerContext);
cmd->setDefaultKeySequence(QKeySequence(tr("Ctrl+E,0")));
mwindow->addAction(cmd, Constants::G_WINDOW_SPLIT);
connect(m_d->m_unsplitAction, SIGNAL(triggered()), this, SLOT(unsplit()));
connect(m_d->m_removeCurrentSplitAction, SIGNAL(triggered()), this, SLOT(removeCurrentSplit()));
m_d->m_removeAllSplitsAction = new QAction(tr("Remove All Splits"), this);
cmd = am->registerAction(m_d->m_removeAllSplitsAction, Constants::REMOVE_ALL_SPLITS, editManagerContext);
cmd->setDefaultKeySequence(QKeySequence(tr("Ctrl+E,1")));
mwindow->addAction(cmd, Constants::G_WINDOW_SPLIT);
connect(m_d->m_removeAllSplitsAction, SIGNAL(triggered()), this, SLOT(removeAllSplits()));
m_d->m_gotoOtherWindowAction = new QAction(tr("Goto other window"), this);
cmd = am->registerAction(m_d->m_gotoOtherWindowAction, Constants::GOTO_OTHER_WINDOW, editManagerContext);
m_d->m_gotoOtherSplitAction = new QAction(tr("Goto Other Split"), this);
cmd = am->registerAction(m_d->m_gotoOtherSplitAction, Constants::GOTO_OTHER_SPLIT, editManagerContext);
cmd->setDefaultKeySequence(QKeySequence(tr("Ctrl+E,o")));
mwindow->addAction(cmd, Constants::G_WINDOW_SPLIT);
connect(m_d->m_gotoOtherWindowAction, SIGNAL(triggered()), this, SLOT(gotoOtherWindow()));
connect(m_d->m_gotoOtherSplitAction, SIGNAL(triggered()), this, SLOT(gotoOtherSplit()));
ActionContainer *medit = am->actionContainer(Constants::M_EDIT);
......@@ -1344,8 +1351,9 @@ void EditorManager::updateActions()
m_d->m_goForwardAction->setEnabled(m_d->currentNavigationHistoryPosition < m_d->m_navigationHistory.size()-1);
bool hasSplitter = m_d->m_splitter->isSplitter();
m_d->m_unsplitAction->setEnabled(hasSplitter);
m_d->m_gotoOtherWindowAction->setEnabled(hasSplitter);
m_d->m_removeCurrentSplitAction->setEnabled(hasSplitter);
m_d->m_removeAllSplitsAction->setEnabled(hasSplitter);
m_d->m_gotoOtherSplitAction->setEnabled(hasSplitter);
m_d->m_openInExternalEditorAction->setEnabled(curEditor != 0);
}
......@@ -1788,7 +1796,7 @@ void EditorManager::splitSideBySide()
split(Qt::Horizontal);
}
void EditorManager::unsplit()
void EditorManager::removeCurrentSplit()
{
SplitterOrView *viewToClose = m_d->m_currentView;
if (!viewToClose && m_d->m_currentEditor)
......@@ -1801,7 +1809,18 @@ void EditorManager::unsplit()
updateActions();
}
void EditorManager::gotoOtherWindow()
void EditorManager::removeAllSplits()
{
IEditor *editor = m_d->m_currentEditor;
if (editor && m_d->m_editorModel->isDuplicate(editor))
editor = m_d->m_editorModel->originalForDuplicate(editor);
m_d->m_splitter->unsplitAll();
if (!editor)
editor = pickUnusedEditor();
activateEditor(editor);
}
void EditorManager::gotoOtherSplit()
{
if (m_d->m_splitter->isSplitter()) {
SplitterOrView *currentView = m_d->m_currentView;
......
......@@ -211,8 +211,9 @@ private slots:
void split(Qt::Orientation orientation);
void split();
void splitSideBySide();
void unsplit();
void gotoOtherWindow();
void removeCurrentSplit();
void removeAllSplits();
void gotoOtherSplit();
private:
QList<IFile *> filesForEditors(QList<IEditor *> editors) const;
......
......@@ -138,8 +138,9 @@ void EditorModel::addEntry(const Entry &entry)
}
int index;
QString displayName = entry.displayName();
for (index = 0; index < m_editors.count(); ++index) {
if (fileName < m_editors.at(index).fileName())
if (displayName < m_editors.at(index).displayName())
break;
}
......@@ -656,6 +657,18 @@ SplitterOrView::SplitterOrView(Core::IEditor *editor)
setFocusPolicy(Qt::ClickFocus);
}
SplitterOrView::~SplitterOrView()
{
delete m_layout;
m_layout = 0;
delete m_view;
m_view = 0;
delete m_splitter;
m_splitter = 0;
}
void SplitterOrView::focusInEvent(QFocusEvent *)
{
CoreImpl::instance()->editorManager()->setCurrentView(this);
......@@ -860,24 +873,24 @@ void SplitterOrView::split(Qt::Orientation orientation)
em->activateEditor(e);
}
void SplitterOrView::close()
void SplitterOrView::unsplitAll()
{
Q_ASSERT(!m_isRoot);
if (m_view) {
CoreImpl::instance()->editorManager()->emptyView(m_view);
delete m_view;
m_view = 0;
}
closeSplitterEditors();
m_splitter->hide();
m_layout->removeWidget(m_splitter); // workaround Qt bug
unsplitAll_helper();
delete m_splitter;
m_splitter = 0;
}
void SplitterOrView::closeSplitterEditors()
void SplitterOrView::unsplitAll_helper()
{
if (!m_splitter)
return;
for (int i = 0; i < m_splitter->count(); ++i) {
if (SplitterOrView *splitterOrView = qobject_cast<SplitterOrView*>(m_splitter->widget(i))) {
splitterOrView->close();
if (!m_isRoot && m_view)
CoreImpl::instance()->editorManager()->emptyView(m_view);
if (m_splitter) {
for (int i = 0; i < m_splitter->count(); ++i) {
if (SplitterOrView *splitterOrView = qobject_cast<SplitterOrView*>(m_splitter->widget(i))) {
splitterOrView->unsplitAll_helper();
}
}
}
}
......
......@@ -181,6 +181,7 @@ class SplitterOrView : public QWidget
public:
SplitterOrView(Internal::EditorModel *model = 0); // creates a splitter with an empty view
SplitterOrView(Core::IEditor *editor);
~SplitterOrView();
void split(Qt::Orientation orientation);
void unsplit();
......@@ -210,14 +211,15 @@ public:
QSize sizeHint() const { return minimumSizeHint(); }
QSize minimumSizeHint() const;
void unsplitAll();
protected:
void focusInEvent(QFocusEvent *);
void paintEvent(QPaintEvent *);
private:
void close();
void closeSplitterEditors();
void unsplitAll_helper();
SplitterOrView *findNextView_helper(SplitterOrView *view, bool *found);
bool m_isRoot;
QStackedLayout *m_layout;
......
......@@ -272,7 +272,7 @@ void NavigationWidget::restoreSettings(QSettings *settings)
} else {
QList<int> sizes;
sizes += 256;
for (int i = views.size()-1; i; --i)
for (int i = views.size()-1; i > 0; --i)
sizes.prepend(512);
setSizes(sizes);
}
......
......@@ -149,6 +149,9 @@ DebuggerSettings *theDebuggerSettings()
item = new SavedAction(instance);
instance->insertItem(AssignValue, item);
item = new SavedAction(instance);
instance->insertItem(AssignType, item);
item = new SavedAction(instance);
instance->insertItem(ExpandItem, item);
item->setText(QObject::tr("Expand item"));
......@@ -311,6 +314,10 @@ DebuggerSettings *theDebuggerSettings()
item->setDefaultValue(20);
instance->insertItem(MaximalStackDepth, item);
item = new SavedAction(instance);
item->setText(QObject::tr("Execute line"));
instance->insertItem(ExecuteCommand, item);
return instance;
}
......
......@@ -75,6 +75,7 @@ enum DebuggerActionCode
GdbLocation,
GdbEnvironment,
GdbScriptFile,
ExecuteCommand,
// Stack
MaximalStackDepth,
......@@ -86,6 +87,7 @@ enum DebuggerActionCode
WatchModelUpdate,
UseToolTips,
AssignValue,
AssignType,
ExpandItem,
CollapseItem,
......
......@@ -358,9 +358,6 @@ void DebuggerManager::init()
m_watchAction->setText(tr("Add to Watch Window"));
// For usuage hints oin focus{In,Out}
//connect(m_outputWindow, SIGNAL(statusMessageRequested(QString,int)),
// this, SLOT(showStatusMessage(QString,int)));
connect(m_continueAction, SIGNAL(triggered()),
this, SLOT(continueExec()));
......@@ -401,8 +398,8 @@ void DebuggerManager::init()
connect(m_statusTimer, SIGNAL(timeout()),
this, SLOT(clearStatusMessage()));
connect(m_outputWindow, SIGNAL(commandExecutionRequested(QString)),
this, SLOT(executeDebuggerCommand(QString)));
connect(theDebuggerAction(ExecuteCommand), SIGNAL(triggered()),
this, SLOT(executeDebuggerCommand()));
m_breakDock = createDockForWidget(m_breakWindow);
......@@ -971,6 +968,7 @@ void DebuggerManager::assignValueInDebugger()
assignValueInDebugger(str.left(i), str.mid(i + 1));
}
}
void DebuggerManager::assignValueInDebugger(const QString &expr, const QString &value)
{
QTC_ASSERT(m_engine, return);
......@@ -1036,6 +1034,12 @@ void DebuggerManager::nextIExec()
m_engine->nextIExec();
}
void DebuggerManager::executeDebuggerCommand()
{
if (QAction *action = qobject_cast<QAction *>(sender()))
executeDebuggerCommand(action->data().toString());
}
void DebuggerManager::executeDebuggerCommand(const QString &command)
{
if (Debugger::Constants::Internal::debug)
......
......@@ -238,6 +238,8 @@ public slots:
void assignValueInDebugger();
void assignValueInDebugger(const QString &expr, const QString &value);
void executeDebuggerCommand();
void executeDebuggerCommand(const QString &command);
void showStatusMessage(const QString &msg, int timeout = -1); // -1 forever
......
......@@ -84,6 +84,8 @@ public:
menu->addAction(m_clearContentsAction);
//menu->addAction(m_saveContentsAction);
addContextActions(menu);
theDebuggerAction(ExecuteCommand)->setData(textCursor().block().text());
menu->addAction(theDebuggerAction(ExecuteCommand));
menu->addSeparator();
menu->addAction(theDebuggerAction(SettingsDialog));
menu->exec(ev->globalPos());
......@@ -101,35 +103,20 @@ class InputPane : public DebuggerPane
{
Q_OBJECT
public:
InputPane(QWidget *parent) : DebuggerPane(parent)
{
m_commandExecutionAction = new QAction(this);
m_commandExecutionAction->setText("Execute line");
m_commandExecutionAction->setEnabled(true);
//m_commandExecutionAction->setShortcut
// (Qt::ControlModifier + Qt::Key_Return);
connect(m_commandExecutionAction, SIGNAL(triggered(bool)),
this, SLOT(executeCommand()));
}
InputPane(QWidget *parent)
: DebuggerPane(parent)
{}
signals:
void commandExecutionRequested(const QString &);
void clearContentsRequested();
void statusMessageRequested(const QString &, int);
void commandSelected(int);
private slots:
void executeCommand()
{
emit commandExecutionRequested(textCursor().block().text());
}
private:
void keyPressEvent(QKeyEvent *ev)
{
if (ev->modifiers() == Qt::ControlModifier && ev->key() == Qt::Key_Return)
emit commandExecutionRequested(textCursor().block().text());
theDebuggerAction(ExecuteCommand)->trigger(textCursor().block().text());
else if (ev->modifiers() == Qt::ControlModifier && ev->key() == Qt::Key_R)
emit clearContentsRequested();
else
......@@ -157,7 +144,7 @@ private:
void addContextActions(QMenu *menu)
{
menu->addAction(m_commandExecutionAction);
menu->addAction(theDebuggerAction(ExecuteCommand));
}
void focusInEvent(QFocusEvent *ev)
......@@ -171,8 +158,6 @@ private:
emit statusMessageRequested(QString(), -1);
QPlainTextEdit::focusOutEvent(ev);
}
QAction *m_commandExecutionAction;
};
......@@ -252,19 +237,12 @@ DebuggerOutputWindow::DebuggerOutputWindow(QWidget *parent)
aggregate->add(new BaseTextFind(m_inputText));
#endif
connect(m_inputText, SIGNAL(commandExecutionRequested(QString)),
this, SIGNAL(commandExecutionRequested(QString)));
connect(m_inputText, SIGNAL(statusMessageRequested(QString,int)),
this, SIGNAL(statusMessageRequested(QString,int)));
connect(m_inputText, SIGNAL(commandSelected(int)),
m_combinedText, SLOT(gotoResult(int)));
};
void DebuggerOutputWindow::onReturnPressed()
{
emit commandExecutionRequested(m_commandEdit->text());
}
void DebuggerOutputWindow::showOutput(const QString &prefix, const QString &output)
{
if (output.isEmpty())
......
......@@ -65,10 +65,6 @@ public slots:
signals:
void showPage();
void statusMessageRequested(const QString &msg, int);
void commandExecutionRequested(const QString &cmd);
private slots:
void onReturnPressed();
private:
QPlainTextEdit *m_combinedText; // combined input/output
......
......@@ -857,7 +857,6 @@ void GdbEngine::handleResult(const GdbResultRecord & record, int type,
void GdbEngine::executeDebuggerCommand(const QString &command)
{
//createGdbProcessIfNeeded();
if (m_gdbProc.state() == QProcess::NotRunning) {
debugMessage("NO GDB PROCESS RUNNING, PLAIN CMD IGNORED: " + command);
return;
......@@ -867,7 +866,6 @@ void GdbEngine::executeDebuggerCommand(const QString &command)
cmd.command = command;
cmd.type = -1;
emit gdbInputAvailable(QString(), cmd.command);
m_gdbProc.write(cmd.command.toLatin1() + "\r\n");
}
......
......@@ -520,9 +520,11 @@ Qt::ItemFlags WatchHandler::flags(const QModelIndex &idx) const
const WatchData &data = m_displaySet.at(node);
if (data.isWatcher() && idx.column() == 0)
return editable; // watcher names are
if (idx.column() == 1)
return editable; // values are editable
return editable; // watcher names are editable
if (data.isWatcher() && idx.column() == 2)
return editable; // watcher types are
if (idx.column() == 1)
return editable; // locals and watcher values are editable
return notEditable;
}
......
......@@ -87,6 +87,9 @@ public:
if (index.column() == 1) {
// the value column
theDebuggerAction(AssignValue)->trigger(exp + '=' + value);
} else if (index.column() == 2) {
// the type column
theDebuggerAction(AssignType)->trigger(exp + '=' + value);
} else if (index.column() == 0) {
// the watcher name column
theDebuggerAction(RemoveWatchExpression)->trigger(exp);
......@@ -139,11 +142,16 @@ void WatchWindow::collapseNode(const QModelIndex &idx)
void WatchWindow::keyPressEvent(QKeyEvent *ev)
{
if (ev->key() == Qt::Key_Delete) {
if (ev->key() == Qt::Key_Delete && m_type == WatchersType) {
QModelIndex idx = currentIndex();
QModelIndex idx1 = idx.sibling(idx.row(), 0);
QString exp = model()->data(idx1).toString();
theDebuggerAction(RemoveWatchExpression)->setValue(exp);
theDebuggerAction(RemoveWatchExpression)->trigger(exp);
} else if (ev->key() == Qt::Key_Return && m_type == LocalsType) {
QModelIndex idx = currentIndex();
QModelIndex idx1 = idx.sibling(idx.row(), 0);
QString exp = model()->data(idx1).toString();
theDebuggerAction(WatchExpression)->trigger(exp);
}
QTreeView::keyPressEvent(ev);
}
......
......@@ -125,15 +125,16 @@ enum Mode
enum SubMode
{
NoSubMode,
RegisterSubMode, // used for "
ChangeSubMode, // used for c
DeleteSubMode, // used for d
FilterSubMode, // used for !
IndentSubMode, // used for =
RegisterSubMode, // used for "
ReplaceSubMode, // used for R and r
YankSubMode, // used for y
ShiftLeftSubMode, // used for <
ShiftRightSubMode, // used for >
IndentSubMode, // used for =
WindowSubMode, // used for Ctrl-w
YankSubMode, // used for y
ZSubMode,
};
......@@ -260,13 +261,13 @@ public:
// helper functions for indenting
bool isElectricCharacter(QChar c) const
{ return c == '{' || c == '}' || c == '#'; }
int indentDist() const;
void indentRegion(QChar lastTyped = QChar());
void shiftRegionLeft(int repeat = 1);
void shiftRegionRight(int repeat = 1);
void moveToFirstNonBlankOnLine();
void moveToDesiredColumn();
void moveToTargetColumn();
void setTargetColumn() { m_targetColumn = leftDist(); }
void moveToNextWord(bool simple);
void moveToMatchingParanthesis();
void moveToWordBoundary(bool simple, bool forward);
......@@ -316,6 +317,7 @@ public:
int m_subsubdata;
QString m_input;
QTextCursor m_tc;
QTextCursor m_oldTc; // copy from last event to check for external changes
int m_anchor;
QHash<int, QString> m_registers;
int m_register;
......@@ -382,10 +384,17 @@ public:
// for restoring cursor position
int m_savedYankPosition;
int m_desiredColumn;
int m_targetColumn;
int m_cursorWidth;
// auto-indent
void insertAutomaticIndentation(bool goingDown);
bool removeAutomaticIndentation(); // true if something removed
// number of autoindented characters
int m_justAutoIndented;
void handleStartOfLine();
void recordJump();