Merge branch 'master' of git@scm.dev.nokia.troll.no:creator/mainline
Conflicts: src/plugins/perforce/perforceplugin.cpp
@@ -9,7 +9,11 @@ unix {
|
||||
QHP_FILE = $$OUT_PWD/doc/html/qtcreator.qhp
|
||||
QCH_FILE = $$OUT_PWD/doc/qtcreator.qch
|
||||
|
||||
html_docs.commands =$$QDOC $$PWD/qtcreator.qdocconf
|
||||
unix {
|
||||
html_docs.commands = $$QDOC $$PWD/qtcreator.qdocconf
|
||||
} else {
|
||||
html_docs.commands = \"$$QDOC $$PWD/qtcreator.qdocconf\"
|
||||
}
|
||||
html_docs.depends += $$PWD/qtcreator.qdoc $$PWD/qtcreator.qdocconf
|
||||
html_docs.files = $$QHP_FILE
|
||||
|
||||
|
||||
BIN
doc/qtcreator-session-manager.png
Normal file
|
After Width: | Height: | Size: 43 KiB |
BIN
doc/qtcreator-session-menu.png
Normal file
|
After Width: | Height: | Size: 47 KiB |
BIN
doc/qtcreator-vcs-annotate.png
Normal file
|
After Width: | Height: | Size: 257 KiB |
BIN
doc/qtcreator-vcs-commit.png
Normal file
|
After Width: | Height: | Size: 134 KiB |
BIN
doc/qtcreator-vcs-describe.png
Normal file
|
After Width: | Height: | Size: 196 KiB |
BIN
doc/qtcreator-vcs-diff.png
Normal file
|
After Width: | Height: | Size: 190 KiB |
BIN
doc/qtcreator-vcs-gitbranch.png
Normal file
|
After Width: | Height: | Size: 38 KiB |
BIN
doc/qtcreator-vcs-log.png
Normal file
|
After Width: | Height: | Size: 170 KiB |
BIN
doc/qtcreator-vcs-pane.png
Normal file
|
After Width: | Height: | Size: 25 KiB |
@@ -20,9 +20,9 @@
|
||||
|
||||
\table
|
||||
\row
|
||||
\o \inlineimage qtcreator-screenshots.png
|
||||
\o \inlineimage qtcreator-screenshots.png
|
||||
\row
|
||||
\o Qt Creator includes a wide range of useful features. Among them are:
|
||||
\o Qt Creator includes a wide range of useful features. Among them are:
|
||||
\list 1
|
||||
\o \bold{Smart Code Editor}: The code editor provides syntax
|
||||
highlighting as well as code completion.
|
||||
@@ -49,8 +49,11 @@
|
||||
\list
|
||||
\o \l{A Quick Tour of Qt Creator}
|
||||
\o \l{Creating a Project in Qt Creator}
|
||||
\o \l{The Code Editor}
|
||||
\o \l{Build Settings}
|
||||
\o \l{Qt Version Management}
|
||||
\o \l{Writing a Simple Program with Qt Creator}
|
||||
\o \l{Qt Creator and Version Control Systems}
|
||||
\o \l{Navigating Quickly Around Your Code with Locator}
|
||||
\o \l{Debugging with Qt Creator}
|
||||
\o \l{Tips and Tricks}
|
||||
@@ -154,21 +157,20 @@
|
||||
|
||||
\section1 Session Management in Qt Creator
|
||||
|
||||
### screenshot
|
||||
|
||||
In Qt Creator, a session is a collection of loaded projects, opened files,
|
||||
editor settings, and so on. When you run Qt Creator, you have a default
|
||||
session. You can create a new session using the \gui{Session Manager...},
|
||||
available in the \gui{File -> Session} menu.
|
||||
|
||||
|
||||
\image qtcreator-session-manager.png
|
||||
|
||||
|
||||
To switch between sessions, select \gui{File -> Session}. If you do not
|
||||
create and select any session, Qt Creator will always use the default
|
||||
session.
|
||||
|
||||
\omit
|
||||
session management can also store project dependencies, thorbjorn is
|
||||
currently working on it
|
||||
\endomit
|
||||
\image qtcreator-session-menu.png
|
||||
|
||||
|
||||
\section1 Qt Help Integration
|
||||
@@ -206,10 +208,74 @@
|
||||
are available to help speed up the process of developing your application.
|
||||
*/
|
||||
|
||||
/*! \contentspage index.html
|
||||
\previouspage creator-quick-tour.html
|
||||
\page creator-code-editor.html
|
||||
\nextpage creator-build-settings.html
|
||||
|
||||
\title The Code Editor
|
||||
|
||||
### SCREENSHOT of the editor in action
|
||||
|
||||
|
||||
\table
|
||||
\row
|
||||
\i Block navigation
|
||||
\i To navigate between blocks, e.g., from one \bold{\{} to another
|
||||
\bold{\}} , use \key{Ctrl+[} and \key{Ctrl+]}.
|
||||
\row
|
||||
\i Block selection
|
||||
\i To select a current block, use \key{Ctrl+U}. Pressing
|
||||
\key{Ctrl+U} again extends the selection to the parent block.
|
||||
To deselect, use \key{Ctrl+Shift+U}.
|
||||
\row
|
||||
\i Moving lines up and down
|
||||
\i
|
||||
|
||||
\row
|
||||
\i Completion
|
||||
\i
|
||||
|
||||
\row
|
||||
\i Indenting Blocks
|
||||
\i
|
||||
\row
|
||||
\i Commenting or Uncommenting Blocks
|
||||
\i
|
||||
|
||||
\row
|
||||
\i Switch between Header and Source
|
||||
\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
|
||||
|
||||
|
||||
More:
|
||||
|
||||
Collapse
|
||||
|
||||
Up/Down/Page Up/Page Down - hold ctrl to prevent the cursor from moving
|
||||
|
||||
|
||||
|
||||
To switch to an external editor, select \gui{Open in external editor} from
|
||||
the \gui{Edit -> Advanced} menu.
|
||||
|
||||
*/
|
||||
|
||||
|
||||
/*!
|
||||
\contentspage index.html
|
||||
\previouspage creator-quick-tour.html
|
||||
\previouspage creator-code-editor.html
|
||||
\page creator-build-settings.html
|
||||
\nextpage creator-creating-project.html
|
||||
|
||||
@@ -266,8 +332,23 @@
|
||||
remove the build step. You will still be able to debug applications, but the
|
||||
contents of Qt and STL data types will not be displayed properly.
|
||||
|
||||
\section1 Dependencies
|
||||
|
||||
\section1 Qt Version Management
|
||||
If you have multiple projects loaded in your session, you can configure
|
||||
dependencies between them. This will affect the build order of your
|
||||
projects. To do this, go the the \bold{Dependencies} tab after selecting
|
||||
the project for which you want to configure the dependencies, and then use
|
||||
the checkboxes to check which of the other projects is a dependency.
|
||||
|
||||
*/
|
||||
|
||||
/*!
|
||||
\contentspage index.html
|
||||
\previouspage creator-build-settings.html
|
||||
\page creator-version-management.html
|
||||
\nextpage creator-creating-project.html
|
||||
|
||||
\title Qt Version Management
|
||||
|
||||
Qt Creator allows you to use multiple versions of Qt installed on your hard
|
||||
disk and switch between them easily.
|
||||
@@ -692,6 +773,136 @@
|
||||
|
||||
*/
|
||||
|
||||
/*!
|
||||
\contentspage index.html
|
||||
\previouspage creator-navigation.html
|
||||
\page creator-version-control.html
|
||||
\nextpage creator-debugging.html
|
||||
|
||||
\title Qt Creator and Version Control Systems
|
||||
|
||||
\table
|
||||
\caption Version control systems supported by Qt Creator
|
||||
\row
|
||||
\i \bold{git}
|
||||
\i \l{http://git-scm.com/}
|
||||
\row
|
||||
\i \bold{Subversion}
|
||||
\i \l{http://subversion.tigris.org/}
|
||||
\row
|
||||
\i \bold{Perforce}
|
||||
\i \l{http://www.perforce.com}
|
||||
\endtable
|
||||
|
||||
|
||||
\section1 Setup
|
||||
|
||||
Qt Creator uses the version control system's command line clients to
|
||||
access your repositories. To set it up, you must ensure that these command
|
||||
line clients can be located via the \c{PATH} environment variable. You can
|
||||
specify the path to the command line client's executable in the settings
|
||||
pages that can be found under \gui{Options...} in the \gui{Tools} menu.
|
||||
|
||||
|
||||
\section1 Usage
|
||||
|
||||
You can find the version control menu entires in a sub-menu of the
|
||||
\gui{Tools} menu. The version control system displayed here is the system
|
||||
that manages the current project.
|
||||
|
||||
Each version control system adds a pane to the \gui{Application Output}
|
||||
panes within which it will log the commands it executes, prepended by a
|
||||
timestamp and the relevant output.
|
||||
|
||||
\image qtcreator-vcs-pane.png
|
||||
|
||||
|
||||
\section2 Addings Files
|
||||
|
||||
When you create a new file or a new project, the wizards will display page
|
||||
requesting whether the files should be added to a version control system.
|
||||
This depends on whether the parent directory or the project is already
|
||||
under version control and the system supports the concept of adding files,
|
||||
e.g., \bold{Perforce} and \bold{Subversion}. Alternatively, you can also
|
||||
add files later on using the version control tool menus.
|
||||
|
||||
With \bold{git}, there is no concept of adding files. Instead, all modified
|
||||
files must be \e{staged} for a commit.
|
||||
|
||||
|
||||
\section2 Viewing Diff Output
|
||||
|
||||
All version control systems provide menu options to \e{diff} the current
|
||||
file or project - comparing with the latest version stored in the
|
||||
repository and displaying the differences. In Qt Creator, a diff is
|
||||
displayed in a read-only editor. If the file is accessible, you can double
|
||||
-click on a selected diff chunk and Qt Creator will open an editor
|
||||
displaying the file, scrolled to the line in question.
|
||||
|
||||
\image qtcreator-vcs-diff.png
|
||||
|
||||
|
||||
\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
|
||||
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.
|
||||
|
||||
\image qtcreator-vcs-log.png
|
||||
\image qtcreator-vcs-describe.png
|
||||
|
||||
|
||||
\section2 Annotating Files
|
||||
|
||||
Annotation views are obtained by selecting \gui{Annotate} or \gui{Blame}.
|
||||
This will display the lines of the file prepended by the change identifier
|
||||
they originate from. Clicking on the change identifier shows a detailed
|
||||
description of the file.
|
||||
|
||||
|
||||
\section2 Committing Changes
|
||||
|
||||
Once you have finished making changes, you can submit them to the version
|
||||
control system by choosing \gui{Commit} or \gui{Submit}. Qt Creator will
|
||||
display a commit page containing a text editor, where you can enter your
|
||||
commit message, and a checkable list of modified files to be included.
|
||||
When you are done, click \gui{Commit} to start committing. In addition,
|
||||
there is a \gui{Diff selected} button that brings up a diff view of the
|
||||
files selected in the file list. Since the commit page is just another
|
||||
editor, you can go back to it by closing the diff view. Alternatively, you
|
||||
can view it from the editor combo box showing the \gui{Opened files}.
|
||||
|
||||
\image qtcreator-vcs-commit.png
|
||||
|
||||
|
||||
\section2 Menu Entries Specific to git
|
||||
|
||||
The git sub-menu contains additional entries:
|
||||
|
||||
\table
|
||||
\row
|
||||
\i \gui{Stash}
|
||||
\i Stash local changes prior to executing a \bold{pull}.
|
||||
\row
|
||||
\i \gui{Pull}
|
||||
\i Pull changes from the remote repository. If there are locally
|
||||
modified files, you will be prompted to stash those changes.
|
||||
\row
|
||||
\i \gui{Branches...}
|
||||
\i Displays the branch dialog showing the local branches at the
|
||||
top and remote branches at the bottom. To switch to the local
|
||||
branch, simply double-click on it. Double-clicking on a remote
|
||||
branch will first create a local branch with the same name that
|
||||
tracks the remote branch, and then switch to it.
|
||||
|
||||
\image qtcreator-vcs-gitbranch.png
|
||||
\endtable
|
||||
|
||||
*/
|
||||
|
||||
|
||||
/*!
|
||||
\contentspage index.html
|
||||
@@ -1017,8 +1228,8 @@
|
||||
|
||||
\bold{Keyboard Shortcuts}
|
||||
|
||||
Qt Creator provides a lot of useful keyboard shortcuts. A complete list can
|
||||
be found \l{Keyboard Shortcuts}{here}.
|
||||
Qt Creator provides a lot of useful keyboard shortcuts. Some useful
|
||||
shortcuts can be found \l{Keyboard Shortcuts}{here}.
|
||||
|
||||
\bold{Running Qt Creator from the Command Line}
|
||||
|
||||
@@ -1065,25 +1276,41 @@
|
||||
\o Meaning
|
||||
|
||||
\row
|
||||
\o System Qt \target glossary-system-qt
|
||||
\o
|
||||
\raw HTML
|
||||
System Qt
|
||||
\endraw
|
||||
\target glossary-system-qt
|
||||
\o The version of Qt installed on your system. This is the Qt
|
||||
version for the \c qmake command found in your \c PATH.
|
||||
|
||||
\row
|
||||
\o Default Qt \target glossary-default-qt
|
||||
\o
|
||||
\raw HTML
|
||||
Default Qt
|
||||
\endraw
|
||||
\target glossary-default-qt
|
||||
\o The version of Qt configured in \gui{Tools -> Options -> Qt 4
|
||||
-> Default Qt Version}. This is the Qt version used by your
|
||||
new projects. It defaults to System Qt.
|
||||
|
||||
\row
|
||||
\o Project Qt \target glossary-project-qt
|
||||
\o
|
||||
\raw HTML
|
||||
Project Qt
|
||||
\endraw
|
||||
\target glossary-project-qt
|
||||
\o The version of Qt configured in \gui{Build&Run -> Build
|
||||
Settings -> Build Configurations}. This is the Qt version that
|
||||
is actually used by a particular project. It defaults to
|
||||
Default Qt.
|
||||
|
||||
\row
|
||||
\o Shadow Build \target glossary-shadow-build
|
||||
\o
|
||||
\raw HTML
|
||||
Shadow Build
|
||||
\endraw
|
||||
\target glossary-shadow-build
|
||||
\o Shadow building means building a project in a separate
|
||||
directory, the \e{build directory}. The build directory is
|
||||
different from the source directory. One of the benefits of
|
||||
|
||||
@@ -1,8 +1,9 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
workdir=/home/berlin/dev/qt-4.4.3-temp
|
||||
destdir=/home/berlin/dev/qt-4.4.3-shipping
|
||||
dir=qt-x11-opensource-src-4.4.3
|
||||
version=4.4.3
|
||||
workdir=/home/berlin/dev/qt-${version}-temp
|
||||
destdir=/home/berlin/dev/qt-${version}-shipping
|
||||
dir=qt-x11-opensource-src-${version}
|
||||
file_tar="${dir}.tar"
|
||||
file_tar_gz="${file_tar}.gz"
|
||||
[ -z ${MAKE} ] && MAKE=make
|
||||
@@ -44,7 +45,7 @@ download() {
|
||||
mirror=http://wftp.tu-chemnitz.de/pub/Qt/qt/source
|
||||
;;
|
||||
esac
|
||||
wget "${mirror}/${file}" || die "Download failed"
|
||||
wget "${mirror}/${file_tar_gz}" || die "Download failed"
|
||||
}
|
||||
|
||||
unpack() {
|
||||
@@ -55,7 +56,7 @@ unpack() {
|
||||
|
||||
build() {
|
||||
(
|
||||
cd "${dir}"
|
||||
cd "${dir}" || die "cd failed"
|
||||
if [ ! -f config.status ] ; then
|
||||
env -i PATH=${envpath} ./configure \
|
||||
-prefix "${destdir}" \
|
||||
@@ -75,11 +76,44 @@ build() {
|
||||
ret=$?; [ ${ret} = 0 ] || exit ${ret}
|
||||
}
|
||||
|
||||
fix_rpath() {
|
||||
folder=$1
|
||||
pattern=$2
|
||||
rpath=$3
|
||||
(
|
||||
cd "${destdir}" || die "cd failed"
|
||||
while read file ; do
|
||||
echo "Fixing ${file}"
|
||||
chrpath -r "${rpath}" "${file}" 2>&1 | sed 's/^/\t/'
|
||||
done < <(find "${folder}" -type f -name "${pattern}")
|
||||
)
|
||||
ret=$?; [ ${ret} = 0 ] || exit ${ret}
|
||||
}
|
||||
|
||||
inst() {
|
||||
(
|
||||
cd "${dir}"
|
||||
mkdir -p "${destdir}"
|
||||
env -i "${MAKE}" install || die "make install failed"
|
||||
cd "${dir}" || die "cd failed"
|
||||
if [ ! -d "${destdir}" ]; then
|
||||
mkdir -p "${destdir}"
|
||||
env -i "${MAKE}" install || die "make install failed"
|
||||
fi
|
||||
|
||||
cd "${destdir}" || die "cd failed"
|
||||
|
||||
# Fix files bin/*
|
||||
fix_rpath bin '*' '$ORIGIN/../lib'
|
||||
|
||||
# Fix files lib/*.so
|
||||
fix_rpath lib '*.so.?.?.?' '$ORIGIN'
|
||||
fix_rpath lib '*.so.?.?.?.debug' '$ORIGIN'
|
||||
|
||||
# Fix files examples/tools/*/*/*.so
|
||||
fix_rpath examples/tools '*.so' '$ORIGIN/../../../lib'
|
||||
fix_rpath examples/tools '*.so.debug' '$ORIGIN/../../../lib'
|
||||
|
||||
# Fix files plugins/*/*.so
|
||||
fix_rpath plugins '*.so' '$ORIGIN/../../lib'
|
||||
fix_rpath plugins '*.so.debug' '$ORIGIN/../../lib'
|
||||
)
|
||||
ret=$?; [ ${ret} = 0 ] || exit ${ret}
|
||||
}
|
||||
|
||||
@@ -751,6 +751,9 @@ bool Parser::parseCvQualifiers(SpecifierAST *&node)
|
||||
spec->specifier_token = consumeToken();
|
||||
*ast = spec;
|
||||
ast = &(*ast)->next;
|
||||
} else if(LA() == T___ATTRIBUTE__) {
|
||||
parseAttributeSpecifier(*ast);
|
||||
ast = &(*ast)->next;
|
||||
} else {
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -34,7 +34,6 @@
|
||||
#ifndef INTERFACE_WRAP_HELPERS_H
|
||||
#define INTERFACE_WRAP_HELPERS_H
|
||||
|
||||
#include <extensionsystem/ExtensionSystemInterfaces>
|
||||
#include <QtScript/QScriptEngine>
|
||||
|
||||
namespace SharedTools {
|
||||
|
||||
@@ -963,7 +963,21 @@ void Preprocessor::processElif(TokenIterator firstToken, TokenIterator lastToken
|
||||
} else if (iflevel == 0 && !skipping()) {
|
||||
// std::cerr << "*** WARNING #else without #if" << std::endl;
|
||||
} else if (!_true_test[iflevel] && !_skipping[iflevel - 1]) {
|
||||
const Value result = evalExpression(tk.dot(), lastToken, _source);
|
||||
|
||||
const char *first = startOfToken(*tk);
|
||||
const char *last = startOfToken(*lastToken);
|
||||
|
||||
MacroExpander expandCondition (env);
|
||||
QByteArray condition;
|
||||
condition.reserve(256);
|
||||
expandCondition(first, last, &condition);
|
||||
|
||||
QVector<Token> tokens = tokenize(condition);
|
||||
|
||||
const Value result = evalExpression(tokens.constBegin(),
|
||||
tokens.constEnd() - 1,
|
||||
condition);
|
||||
|
||||
_true_test[iflevel] = ! result.is_zero ();
|
||||
_skipping[iflevel] = result.is_zero ();
|
||||
} else {
|
||||
|
||||
@@ -1,39 +0,0 @@
|
||||
/***************************************************************************
|
||||
**
|
||||
** This file is part of Qt Creator
|
||||
**
|
||||
** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
|
||||
**
|
||||
** Contact: Qt Software Information (qt-info@nokia.com)
|
||||
**
|
||||
**
|
||||
** Non-Open Source Usage
|
||||
**
|
||||
** Licensees may use this file in accordance with the Qt Beta Version
|
||||
** License Agreement, Agreement version 2.2 provided with the Software or,
|
||||
** alternatively, in accordance with the terms contained in a written
|
||||
** agreement between you and Nokia.
|
||||
**
|
||||
** GNU General Public License Usage
|
||||
**
|
||||
** Alternatively, this file may be used under the terms of the GNU General
|
||||
** Public License versions 2.0 or 3.0 as published by the Free Software
|
||||
** Foundation and appearing in the file LICENSE.GPL included in the packaging
|
||||
** of this file. Please review the following information to ensure GNU
|
||||
** General Public Licensing requirements will be met:
|
||||
**
|
||||
** http://www.fsf.org/licensing/licenses/info/GPLv2.html and
|
||||
** http://www.gnu.org/copyleft/gpl.html.
|
||||
**
|
||||
** In addition, as a special exception, Nokia gives you certain additional
|
||||
** rights. These rights are described in the Nokia Qt GPL Exception
|
||||
** version 1.3, included in the file GPL_EXCEPTION.txt in this package.
|
||||
**
|
||||
***************************************************************************/
|
||||
|
||||
#include "extensionsystem/pluginmanager.h"
|
||||
#include "extensionsystem/pluginspec.h"
|
||||
#include "extensionsystem/iplugin.h"
|
||||
#include "extensionsystem/pluginview.h"
|
||||
#include "extensionsystem/pluginerrorview.h"
|
||||
#include "extensionsystem/plugindetailsview.h"
|
||||
@@ -35,22 +35,23 @@
|
||||
#include "bineditor.h"
|
||||
#include "bineditorconstants.h"
|
||||
|
||||
#include <QtCore/QFile>
|
||||
#include <QtCore/QFileInfo>
|
||||
#include <QtGui/QMenu>
|
||||
#include <QtGui/QAction>
|
||||
#include <QtGui/QMainWindow>
|
||||
#include <QtGui/QHBoxLayout>
|
||||
#include <QtCore/QFile>
|
||||
|
||||
#include <coreplugin/icore.h>
|
||||
#include <coreplugin/actionmanager/actionmanager.h>
|
||||
#include <coreplugin/coreconstants.h>
|
||||
#include <coreplugin/editormanager/editormanager.h>
|
||||
#include <coreplugin/icore.h>
|
||||
#include <coreplugin/mimedatabase.h>
|
||||
#include <coreplugin/uniqueidmanager.h>
|
||||
#include <coreplugin/actionmanager/actionmanager.h>
|
||||
#include <coreplugin/editormanager/editormanager.h>
|
||||
#include <texteditor/texteditorsettings.h>
|
||||
#include <texteditor/fontsettings.h>
|
||||
#include <extensionsystem/pluginmanager.h>
|
||||
#include <find/ifindsupport.h>
|
||||
#include <texteditor/fontsettings.h>
|
||||
#include <texteditor/texteditorsettings.h>
|
||||
#include <utils/linecolumnlabel.h>
|
||||
#include <utils/reloadpromptutils.h>
|
||||
|
||||
@@ -204,7 +205,7 @@ public:
|
||||
break;
|
||||
}
|
||||
|
||||
switch (Core::Utils::reloadPrompt(fileName, BinEditorPlugin::core()->mainWindow())) {
|
||||
switch (Core::Utils::reloadPrompt(fileName, Core::ICore::instance()->mainWindow())) {
|
||||
case Core::Utils::ReloadCurrent:
|
||||
open(fileName);
|
||||
break;
|
||||
@@ -230,12 +231,15 @@ class BinEditorInterface : public Core::IEditor
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
BinEditorInterface(BinEditor *parent ) : Core::IEditor(parent) {
|
||||
BinEditorInterface(BinEditor *parent)
|
||||
: Core::IEditor(parent)
|
||||
{
|
||||
Core::ICore *core = Core::ICore::instance();
|
||||
m_editor = parent;
|
||||
m_file = new BinEditorFile(parent);
|
||||
m_context << BinEditorPlugin::core()->uniqueIDManager()->
|
||||
m_context << core->uniqueIDManager()->
|
||||
uniqueIdentifier(Core::Constants::K_DEFAULT_BINARY_EDITOR);
|
||||
m_context << BinEditorPlugin::core()->uniqueIDManager()->uniqueIdentifier(Constants::C_BINEDITOR);
|
||||
m_context << core->uniqueIDManager()->uniqueIdentifier(Constants::C_BINEDITOR);
|
||||
m_cursorPositionLabel = new Core::Utils::LineColumnLabel;
|
||||
|
||||
QHBoxLayout *l = new QHBoxLayout;
|
||||
@@ -316,7 +320,8 @@ QString BinEditorFactory::kind() const
|
||||
|
||||
Core::IFile *BinEditorFactory::open(const QString &fileName)
|
||||
{
|
||||
Core::IEditor *iface = m_owner->m_core->editorManager()->openEditor(fileName, kind());
|
||||
Core::ICore *core = Core::ICore::instance();
|
||||
Core::IEditor *iface = core->editorManager()->openEditor(fileName, kind());
|
||||
return iface ? iface->file() : 0;
|
||||
}
|
||||
|
||||
@@ -336,8 +341,7 @@ QStringList BinEditorFactory::mimeTypes() const
|
||||
|
||||
BinEditorPlugin *BinEditorPlugin::m_instance = 0;
|
||||
|
||||
BinEditorPlugin::BinEditorPlugin() :
|
||||
m_core(0)
|
||||
BinEditorPlugin::BinEditorPlugin()
|
||||
{
|
||||
m_undoAction = m_redoAction = m_copyAction = m_selectAllAction = 0;
|
||||
m_instance = this;
|
||||
@@ -353,16 +357,11 @@ BinEditorPlugin *BinEditorPlugin::instance()
|
||||
return m_instance;
|
||||
}
|
||||
|
||||
Core::ICore *BinEditorPlugin::core()
|
||||
{
|
||||
return m_instance->m_core;
|
||||
}
|
||||
|
||||
QAction *BinEditorPlugin::registerNewAction(const QString &id, const QString &title)
|
||||
{
|
||||
|
||||
QAction *result = new QAction(title, this);
|
||||
m_core->actionManager()->registerAction(result, id, m_context);
|
||||
Core::ICore::instance()->actionManager()->registerAction(result, id, m_context);
|
||||
return result;
|
||||
}
|
||||
|
||||
@@ -385,7 +384,8 @@ void BinEditorPlugin::initializeEditor(BinEditor *editor)
|
||||
QObject::connect(editor, SIGNAL(modificationChanged(bool)), editorInterface, SIGNAL(changed()));
|
||||
editor->setEditorInterface(editorInterface);
|
||||
|
||||
m_context << BinEditorPlugin::core()->uniqueIDManager()->uniqueIdentifier(Constants::C_BINEDITOR);
|
||||
Core::ICore *core = Core::ICore::instance();
|
||||
m_context << core->uniqueIDManager()->uniqueIdentifier(Constants::C_BINEDITOR);
|
||||
if (!m_undoAction) {
|
||||
m_undoAction = registerNewAction(QLatin1String(Core::Constants::UNDO),
|
||||
this, SLOT(undoAction()),
|
||||
@@ -415,13 +415,16 @@ void BinEditorPlugin::initializeEditor(BinEditor *editor)
|
||||
aggregate->add(editor);
|
||||
}
|
||||
|
||||
bool BinEditorPlugin::initialize(const QStringList & /*arguments*/, QString *errorMessage)
|
||||
bool BinEditorPlugin::initialize(const QStringList &arguments, QString *errorMessage)
|
||||
{
|
||||
m_core = ExtensionSystem::PluginManager::instance()->getObject<Core::ICore>();
|
||||
if (!m_core->mimeDatabase()->addMimeTypes(QLatin1String(":/bineditor/BinEditor.mimetypes.xml"), errorMessage))
|
||||
Q_UNUSED(arguments);
|
||||
Q_UNUSED(errorMessage);
|
||||
|
||||
Core::ICore *core = Core::ICore::instance();
|
||||
if (!core->mimeDatabase()->addMimeTypes(QLatin1String(":/bineditor/BinEditor.mimetypes.xml"), errorMessage))
|
||||
return false;
|
||||
|
||||
connect(m_core, SIGNAL(contextAboutToChange(Core::IContext *)),
|
||||
connect(core, SIGNAL(contextAboutToChange(Core::IContext *)),
|
||||
this, SLOT(updateCurrentEditor(Core::IContext *)));
|
||||
|
||||
addAutoReleasedObject(new BinEditorFactory(this));
|
||||
|
||||
@@ -62,7 +62,6 @@ public:
|
||||
~BinEditorPlugin();
|
||||
|
||||
static BinEditorPlugin *instance();
|
||||
static Core::ICore *core();
|
||||
|
||||
bool initialize(const QStringList &arguments, QString *error_message = 0);
|
||||
void extensionsInitialized();
|
||||
|
||||
@@ -37,10 +37,11 @@
|
||||
#include "bookmarksplugin.h"
|
||||
#include "bookmarks_global.h"
|
||||
|
||||
#include <projectexplorer/ProjectExplorerInterfaces>
|
||||
#include <coreplugin/icore.h>
|
||||
#include <coreplugin/editormanager/editormanager.h>
|
||||
#include <coreplugin/icore.h>
|
||||
#include <coreplugin/uniqueidmanager.h>
|
||||
#include <extensionsystem/pluginmanager.h>
|
||||
#include <projectexplorer/projectexplorer.h>
|
||||
#include <texteditor/basetexteditor.h>
|
||||
#include <utils/qtcassert.h>
|
||||
|
||||
@@ -49,6 +50,7 @@
|
||||
|
||||
#include <QtGui/QAction>
|
||||
#include <QtGui/QContextMenuEvent>
|
||||
#include <QtGui/QMenu>
|
||||
#include <QtGui/QPainter>
|
||||
|
||||
Q_DECLARE_METATYPE(Bookmarks::Internal::Bookmark*)
|
||||
@@ -56,6 +58,7 @@ Q_DECLARE_METATYPE(Bookmarks::Internal::Bookmark*)
|
||||
using namespace Bookmarks;
|
||||
using namespace Bookmarks::Internal;
|
||||
using namespace ProjectExplorer;
|
||||
using namespace Core;
|
||||
|
||||
BookmarkDelegate::BookmarkDelegate(QObject *parent)
|
||||
: QStyledItemDelegate(parent), m_normalPixmap(0), m_selectedPixmap(0)
|
||||
@@ -212,8 +215,7 @@ BookmarkView::BookmarkView(QWidget *parent)
|
||||
this, SLOT(gotoBookmark(const QModelIndex &)));
|
||||
|
||||
m_bookmarkContext = new BookmarkContext(this);
|
||||
Core::ICore *core = ExtensionSystem::PluginManager::instance()->getObject<Core::ICore>();
|
||||
core->addContextObject(m_bookmarkContext);
|
||||
ICore::instance()->addContextObject(m_bookmarkContext);
|
||||
|
||||
setItemDelegate(new BookmarkDelegate(this));
|
||||
setFrameStyle(QFrame::NoFrame);
|
||||
@@ -223,8 +225,7 @@ BookmarkView::BookmarkView(QWidget *parent)
|
||||
|
||||
BookmarkView::~BookmarkView()
|
||||
{
|
||||
Core::ICore *core = ExtensionSystem::PluginManager::instance()->getObject<Core::ICore>();
|
||||
core->removeContextObject(m_bookmarkContext);
|
||||
ICore::instance()->removeContextObject(m_bookmarkContext);
|
||||
}
|
||||
|
||||
void BookmarkView::contextMenuEvent(QContextMenuEvent *event)
|
||||
@@ -244,13 +245,11 @@ void BookmarkView::contextMenuEvent(QContextMenuEvent *event)
|
||||
connect(removeAll, SIGNAL(triggered()),
|
||||
this, SLOT(removeAll()));
|
||||
|
||||
|
||||
menu.exec(mapToGlobal(event->pos()));
|
||||
}
|
||||
|
||||
void BookmarkView::removeFromContextMenu()
|
||||
{
|
||||
|
||||
removeBookmark(m_contextMenuIndex);
|
||||
}
|
||||
|
||||
@@ -294,7 +293,7 @@ void BookmarkView::gotoBookmark(const QModelIndex &index)
|
||||
BookmarkContext::BookmarkContext(BookmarkView *widget)
|
||||
: m_bookmarkView(widget)
|
||||
{
|
||||
Core::ICore *core = ExtensionSystem::PluginManager::instance()->getObject<Core::ICore>();
|
||||
Core::ICore *core = ICore::instance();
|
||||
m_context << core->uniqueIDManager()->uniqueIdentifier(Constants::BOOKMARKS_CONTEXT);
|
||||
}
|
||||
|
||||
@@ -313,15 +312,14 @@ QWidget *BookmarkContext::widget()
|
||||
////
|
||||
|
||||
BookmarkManager::BookmarkManager() :
|
||||
m_core(BookmarksPlugin::core()),
|
||||
m_bookmarkIcon(QIcon(QLatin1String(":/bookmarks/images/bookmark.png")))
|
||||
{
|
||||
m_selectionModel = new QItemSelectionModel(this, this);
|
||||
|
||||
connect(m_core, SIGNAL(contextChanged(Core::IContext*)),
|
||||
connect(Core::ICore::instance(), SIGNAL(contextChanged(Core::IContext*)),
|
||||
this, SLOT(updateActionStatus()));
|
||||
|
||||
ExtensionSystem::PluginManager *pm = m_core->pluginManager();
|
||||
ExtensionSystem::PluginManager *pm = ExtensionSystem::PluginManager::instance();
|
||||
ProjectExplorerPlugin *projectExplorer = pm->getObject<ProjectExplorerPlugin>();
|
||||
|
||||
connect(projectExplorer->session(), SIGNAL(sessionLoaded()),
|
||||
@@ -511,7 +509,8 @@ void BookmarkManager::documentPrevNext(bool next)
|
||||
nextLine = markLine;
|
||||
}
|
||||
|
||||
m_core->editorManager()->addCurrentPositionToNavigationHistory(true);
|
||||
Core::EditorManager *em = Core::ICore::instance()->editorManager();
|
||||
em->addCurrentPositionToNavigationHistory(true);
|
||||
if (next) {
|
||||
if (nextLine == -1)
|
||||
editor->gotoLine(firstLine);
|
||||
@@ -523,7 +522,7 @@ void BookmarkManager::documentPrevNext(bool next)
|
||||
else
|
||||
editor->gotoLine(prevLine);
|
||||
}
|
||||
m_core->editorManager()->addCurrentPositionToNavigationHistory();
|
||||
em->addCurrentPositionToNavigationHistory();
|
||||
}
|
||||
|
||||
void BookmarkManager::next()
|
||||
@@ -555,16 +554,17 @@ void BookmarkManager::prev()
|
||||
|
||||
TextEditor::ITextEditor *BookmarkManager::currentTextEditor() const
|
||||
{
|
||||
Core::IEditor *currEditor = m_core->editorManager()->currentEditor();
|
||||
Core::EditorManager *em = Core::ICore::instance()->editorManager();
|
||||
Core::IEditor *currEditor = em->currentEditor();
|
||||
if (!currEditor)
|
||||
return 0;
|
||||
return qobject_cast<TextEditor::ITextEditor *>(currEditor);
|
||||
}
|
||||
|
||||
/* Returns the current session. */
|
||||
SessionManager* BookmarkManager::sessionManager() const
|
||||
SessionManager *BookmarkManager::sessionManager() const
|
||||
{
|
||||
ExtensionSystem::PluginManager *pm = m_core->pluginManager();
|
||||
ExtensionSystem::PluginManager *pm = ExtensionSystem::PluginManager::instance();
|
||||
ProjectExplorerPlugin *pe = pm->getObject<ProjectExplorerPlugin>();
|
||||
return pe->session();
|
||||
}
|
||||
|
||||
@@ -48,7 +48,6 @@ class SessionManager;
|
||||
}
|
||||
|
||||
namespace Core {
|
||||
class ICore;
|
||||
class IEditor;
|
||||
}
|
||||
|
||||
@@ -131,7 +130,6 @@ private:
|
||||
typedef QMap<QString, FileNameBookmarksMap *> DirectoryFileBookmarksMap;
|
||||
|
||||
DirectoryFileBookmarksMap m_bookmarksMap;
|
||||
Core::ICore *m_core;
|
||||
|
||||
QIcon m_bookmarkIcon;
|
||||
|
||||
|
||||
@@ -35,16 +35,17 @@
|
||||
#include "bookmarkmanager.h"
|
||||
#include "bookmarks_global.h"
|
||||
|
||||
#include <texteditor/texteditorconstants.h>
|
||||
#include <texteditor/itexteditor.h>
|
||||
#include <coreplugin/icore.h>
|
||||
#include <coreplugin/editormanager/ieditor.h>
|
||||
#include <coreplugin/editormanager/editormanager.h>
|
||||
#include <coreplugin/coreconstants.h>
|
||||
#include <coreplugin/uniqueidmanager.h>
|
||||
#include <coreplugin/actionmanager/actionmanager.h>
|
||||
#include <extensionsystem/pluginmanager.h>
|
||||
#include <texteditor/itexteditor.h>
|
||||
#include <texteditor/texteditorconstants.h>
|
||||
|
||||
#include <QtCore/qplugin.h>
|
||||
#include <QtCore/QtPlugin>
|
||||
#include <QtCore/QDebug>
|
||||
|
||||
#include <QtGui/QMenu>
|
||||
@@ -56,7 +57,7 @@ using namespace TextEditor;
|
||||
BookmarksPlugin *BookmarksPlugin::m_instance = 0;
|
||||
|
||||
BookmarksPlugin::BookmarksPlugin()
|
||||
: m_bookmarkManager(0), m_core(0)
|
||||
: m_bookmarkManager(0)
|
||||
{
|
||||
m_instance = this;
|
||||
}
|
||||
@@ -67,13 +68,13 @@ void BookmarksPlugin::extensionsInitialized()
|
||||
|
||||
bool BookmarksPlugin::initialize(const QStringList & /*arguments*/, QString *)
|
||||
{
|
||||
m_core = ExtensionSystem::PluginManager::instance()->getObject<Core::ICore>();
|
||||
Core::ActionManager *am = m_core->actionManager();
|
||||
Core::ICore *core = Core::ICore::instance();
|
||||
Core::ActionManager *am = core->actionManager();
|
||||
|
||||
QList<int> context = QList<int>() << m_core->uniqueIDManager()->
|
||||
QList<int> context = QList<int>() << core->uniqueIDManager()->
|
||||
uniqueIdentifier(Constants::BOOKMARKS_CONTEXT);
|
||||
QList<int> textcontext, globalcontext;
|
||||
textcontext << m_core->uniqueIDManager()->
|
||||
textcontext << core->uniqueIDManager()->
|
||||
uniqueIdentifier(TextEditor::Constants::C_TEXTEDITOR);
|
||||
globalcontext << Core::Constants::C_GLOBAL_ID;
|
||||
|
||||
@@ -171,7 +172,7 @@ bool BookmarksPlugin::initialize(const QStringList & /*arguments*/, QString *)
|
||||
this, SLOT(bookmarkMarginActionTriggered()));
|
||||
|
||||
// EditorManager
|
||||
QObject *editorManager = m_core->editorManager();
|
||||
QObject *editorManager = core->editorManager();
|
||||
connect(editorManager, SIGNAL(editorAboutToClose(Core::IEditor*)),
|
||||
this, SLOT(editorAboutToClose(Core::IEditor*)));
|
||||
connect(editorManager, SIGNAL(editorOpened(Core::IEditor*)),
|
||||
|
||||
@@ -45,7 +45,6 @@ class QMenu;
|
||||
QT_END_NAMESPACE
|
||||
|
||||
namespace Core {
|
||||
class ICore;
|
||||
class IEditor;
|
||||
}
|
||||
|
||||
@@ -67,7 +66,6 @@ public:
|
||||
~BookmarksPlugin();
|
||||
|
||||
static BookmarksPlugin *instance() { return m_instance; }
|
||||
static Core::ICore *core() { return m_instance->m_core; }
|
||||
|
||||
bool initialize(const QStringList &arguments, QString *error_message);
|
||||
void extensionsInitialized();
|
||||
@@ -85,7 +83,6 @@ private slots:
|
||||
private:
|
||||
static BookmarksPlugin *m_instance;
|
||||
BookmarkManager *m_bookmarkManager;
|
||||
Core::ICore *m_core;
|
||||
|
||||
QAction *m_toggleAction;
|
||||
QAction *m_prevAction;
|
||||
|
||||
@@ -80,13 +80,14 @@ 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;
|
||||
if (cbpparser.parseCbpFile(cbpFile)) {
|
||||
m_projectName = cbpparser.projectName();
|
||||
qDebug()<<"Building Tree";
|
||||
// TODO do a intelligent updating of the tree
|
||||
buildTree(m_rootNode, cbpparser.fileList());
|
||||
@@ -152,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();
|
||||
}
|
||||
@@ -200,8 +202,7 @@ ProjectExplorer::FolderNode *CMakeProject::findOrCreateFolder(CMakeProjectNode *
|
||||
|
||||
QString CMakeProject::name() const
|
||||
{
|
||||
// TODO
|
||||
return "";
|
||||
return m_projectName;
|
||||
}
|
||||
|
||||
Core::IFile *CMakeProject::file() const
|
||||
@@ -214,11 +215,6 @@ ProjectExplorer::IProjectManager *CMakeProject::projectManager() const
|
||||
return m_manager;
|
||||
}
|
||||
|
||||
QList<Core::IFile *> CMakeProject::dependencies()
|
||||
{
|
||||
return QList<Core::IFile *>();
|
||||
}
|
||||
|
||||
QList<ProjectExplorer::Project *> CMakeProject::dependsOn()
|
||||
{
|
||||
return QList<Project *>();
|
||||
@@ -240,7 +236,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;
|
||||
}
|
||||
|
||||
@@ -469,6 +465,8 @@ void CMakeCbpParser::parseProject()
|
||||
readNext();
|
||||
if (isEndElement()) {
|
||||
return;
|
||||
} else if (name() == "Option") {
|
||||
parseOption();
|
||||
} else if (name() == "Unit") {
|
||||
parseUnit();
|
||||
} else if (name() == "Build") {
|
||||
@@ -521,7 +519,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();
|
||||
@@ -537,6 +535,26 @@ void CMakeCbpParser::parseTargetOption()
|
||||
}
|
||||
}
|
||||
|
||||
QString CMakeCbpParser::projectName() const
|
||||
{
|
||||
return m_projectName;
|
||||
}
|
||||
|
||||
void CMakeCbpParser::parseOption()
|
||||
{
|
||||
if (attributes().hasAttribute("title"))
|
||||
m_projectName = attributes().value("title").toString();
|
||||
|
||||
while (!atEnd()) {
|
||||
readNext();
|
||||
if (isEndElement()) {
|
||||
return;
|
||||
} else if(isStartElement()) {
|
||||
parseUnknownElement();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void CMakeCbpParser::parseMakeCommand()
|
||||
{
|
||||
while (!atEnd()) {
|
||||
|
||||
@@ -73,7 +73,6 @@ public:
|
||||
virtual Core::IFile *file() const;
|
||||
virtual ProjectExplorer::IProjectManager *projectManager() const;
|
||||
|
||||
virtual QList<Core::IFile *> dependencies(); //NBS TODO remove
|
||||
virtual QList<ProjectExplorer::Project *> dependsOn(); //NBS TODO implement dependsOn
|
||||
|
||||
virtual bool isApplication() const;
|
||||
@@ -118,6 +117,7 @@ private:
|
||||
CMakeManager *m_manager;
|
||||
QString m_fileName;
|
||||
CMakeFile *m_file;
|
||||
QString m_projectName;
|
||||
|
||||
// TODO probably need a CMake specific node structure
|
||||
CMakeProjectNode* m_rootNode;
|
||||
@@ -137,10 +137,12 @@ public:
|
||||
QList<ProjectExplorer::FileNode *> fileList();
|
||||
QStringList includeFiles();
|
||||
QList<CMakeTarget> targets();
|
||||
QString projectName() const;
|
||||
private:
|
||||
void parseCodeBlocks_project_file();
|
||||
void parseProject();
|
||||
void parseBuild();
|
||||
void parseOption();
|
||||
void parseTarget();
|
||||
void parseTargetOption();
|
||||
void parseMakeCommand();
|
||||
@@ -157,6 +159,7 @@ private:
|
||||
CMakeTarget m_target;
|
||||
bool m_targetType;
|
||||
QList<CMakeTarget> m_targets;
|
||||
QString m_projectName;
|
||||
};
|
||||
|
||||
class CMakeFile : public Core::IFile
|
||||
|
||||
@@ -37,7 +37,6 @@
|
||||
#include "cmakeprojectconstants.h"
|
||||
|
||||
#include <coreplugin/icore.h>
|
||||
#include <extensionsystem/pluginmanager.h>
|
||||
#include <coreplugin/uniqueidmanager.h>
|
||||
#include <projectexplorer/projectexplorerconstants.h>
|
||||
|
||||
@@ -45,7 +44,7 @@ using namespace CMakeProjectManager::Internal;
|
||||
|
||||
CMakeManager::CMakeManager()
|
||||
{
|
||||
Core::ICore *core = ExtensionSystem::PluginManager::instance()->getObject<Core::ICore>();
|
||||
Core::ICore *core = Core::ICore::instance();
|
||||
m_projectContext = core->uniqueIDManager()->uniqueIdentifier(CMakeProjectManager::Constants::PROJECTCONTEXT);
|
||||
m_projectLanguage = core->uniqueIDManager()->uniqueIdentifier(ProjectExplorer::Constants::LANG_CXX);
|
||||
}
|
||||
|
||||
@@ -40,7 +40,7 @@
|
||||
#include <coreplugin/icore.h>
|
||||
#include <coreplugin/mimedatabase.h>
|
||||
|
||||
#include <QtCore/qplugin.h>
|
||||
#include <QtCore/QtPlugin>
|
||||
#include <QtCore/QDebug>
|
||||
|
||||
|
||||
@@ -56,7 +56,7 @@ CMakeProjectPlugin::~CMakeProjectPlugin()
|
||||
|
||||
bool CMakeProjectPlugin::initialize(const QStringList & /*arguments*/, QString *errorMessage)
|
||||
{
|
||||
Core::ICore *core = ExtensionSystem::PluginManager::instance()->getObject<Core::ICore>();
|
||||
Core::ICore *core = Core::ICore::instance();
|
||||
if (!core->mimeDatabase()->addMimeTypes(QLatin1String(":cmakeproject/CMakeProject.mimetypes.xml"), errorMessage))
|
||||
return false;
|
||||
addAutoReleasedObject(new CMakeManager());
|
||||
|
||||
@@ -61,7 +61,7 @@ namespace {
|
||||
You get the only implementation of this class from the core interface
|
||||
ICore::actionManager() method, e.g.
|
||||
\code
|
||||
ExtensionSystem::PluginManager::instance()->getObject<Core::ICore>()->actionManager()
|
||||
Core::ICore::instance()->actionManager()
|
||||
\endcode
|
||||
|
||||
The main reasons for the need of this class is to provide a central place where the user
|
||||
@@ -80,8 +80,7 @@ namespace {
|
||||
So to register a globally active action "My Action"
|
||||
put the following in your plugin's IPlugin::initialize method:
|
||||
\code
|
||||
Core::ActionManager *am = ExtensionSystem::PluginManager::instance()
|
||||
->getObject<Core::ICore>()->actionManager();
|
||||
Core::ActionManager *am = Core::ICore::instance()->actionManager();
|
||||
QAction *myAction = new QAction(tr("My Action"), this);
|
||||
Core::Command *cmd = am->registerAction(myAction,
|
||||
"myplugin.myaction",
|
||||
|
||||
@@ -38,6 +38,7 @@
|
||||
#include <coreplugin/icore.h>
|
||||
#include <coreplugin/coreconstants.h>
|
||||
#include <coreplugin/ifilewizardextension.h>
|
||||
#include <extensionsystem/pluginmanager.h>
|
||||
#include <utils/filewizarddialog.h>
|
||||
|
||||
#include <QtCore/QDir>
|
||||
@@ -345,28 +346,19 @@ void WizardEventLoop::rejected()
|
||||
// ---------------- BaseFileWizardPrivate
|
||||
struct BaseFileWizardPrivate
|
||||
{
|
||||
explicit BaseFileWizardPrivate(const Core::BaseFileWizardParameters ¶meters,
|
||||
Core::ICore *core);
|
||||
explicit BaseFileWizardPrivate(const Core::BaseFileWizardParameters ¶meters)
|
||||
: m_parameters(parameters), m_wizardDialog(0)
|
||||
{}
|
||||
|
||||
const Core::BaseFileWizardParameters m_parameters;
|
||||
QWizard *m_wizardDialog;
|
||||
Core::ICore *m_core;
|
||||
};
|
||||
|
||||
Core::BaseFileWizardPrivate::BaseFileWizardPrivate(const BaseFileWizardParameters ¶meters,
|
||||
Core::ICore *core) :
|
||||
m_parameters(parameters),
|
||||
m_wizardDialog(0),
|
||||
m_core(core)
|
||||
{
|
||||
}
|
||||
|
||||
// ---------------- Wizard
|
||||
BaseFileWizard::BaseFileWizard(const BaseFileWizardParameters ¶meters,
|
||||
Core::ICore *core,
|
||||
QObject *parent) :
|
||||
IWizard(parent),
|
||||
m_d(new BaseFileWizardPrivate(parameters, core))
|
||||
m_d(new BaseFileWizardPrivate(parameters))
|
||||
{
|
||||
}
|
||||
|
||||
@@ -517,13 +509,14 @@ bool BaseFileWizard::postGenerateFiles(const GeneratedFiles &l, QString *errorMe
|
||||
{
|
||||
// File mode: open the editors in file mode and ensure editor pane
|
||||
const Core::GeneratedFiles::const_iterator cend = l.constEnd();
|
||||
Core::EditorManager *em = Core::ICore::instance()->editorManager();
|
||||
for (Core::GeneratedFiles::const_iterator it = l.constBegin(); it != cend; ++it) {
|
||||
if (!m_d->m_core->editorManager()->openEditor(it->path(), it->editorKind())) {
|
||||
if (!em->openEditor(it->path(), it->editorKind())) {
|
||||
*errorMessage = tr("Failed to open an editor for %1").arg(it->path());
|
||||
return false;
|
||||
}
|
||||
}
|
||||
m_d->m_core->editorManager()->ensureEditorManagerVisible();
|
||||
em->ensureEditorManagerVisible();
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -534,7 +527,6 @@ BaseFileWizard::OverwriteResult BaseFileWizard::promptOverwrite(const QString &l
|
||||
if (debugWizard)
|
||||
qDebug() << Q_FUNC_INFO << location << files;
|
||||
|
||||
|
||||
bool existingFilesFound = false;
|
||||
bool oddStuffFound = false;
|
||||
|
||||
@@ -581,7 +573,7 @@ BaseFileWizard::OverwriteResult BaseFileWizard::promptOverwrite(const QString &l
|
||||
const QString messageFormat = tr("The following files already exist in the directory %1:\n"
|
||||
"%2.\nWould you like to overwrite them?");
|
||||
const QString message = messageFormat.arg(location).arg(fileNamesMsgPart);
|
||||
const bool yes = (QMessageBox::question(core()->mainWindow(),
|
||||
const bool yes = (QMessageBox::question(Core::ICore::instance()->mainWindow(),
|
||||
tr("Existing files"), message,
|
||||
QMessageBox::Yes | QMessageBox::No,
|
||||
QMessageBox::No)
|
||||
@@ -589,11 +581,6 @@ BaseFileWizard::OverwriteResult BaseFileWizard::promptOverwrite(const QString &l
|
||||
return yes ? OverwriteOk : OverwriteCanceled;
|
||||
}
|
||||
|
||||
Core::ICore *BaseFileWizard::core() const
|
||||
{
|
||||
return m_d->m_core;
|
||||
}
|
||||
|
||||
QList<IWizard*> BaseFileWizard::allWizards()
|
||||
{
|
||||
return ExtensionSystem::PluginManager::instance()->getObjects<IWizard>();
|
||||
@@ -636,19 +623,18 @@ QString BaseFileWizard::buildFileName(const QString &path,
|
||||
|
||||
QString BaseFileWizard::preferredSuffix(const QString &mimeType) const
|
||||
{
|
||||
const QString rc = m_d->m_core->mimeDatabase()->preferredSuffixByType(mimeType);
|
||||
const QString rc = Core::ICore::instance()->mimeDatabase()->preferredSuffixByType(mimeType);
|
||||
if (rc.isEmpty())
|
||||
qWarning("%s: WARNING: Unable to find a preferred suffix for %s.",
|
||||
Q_FUNC_INFO, mimeType.toUtf8().constData());
|
||||
return rc;
|
||||
}
|
||||
|
||||
// ------------- StandardFileWizard(
|
||||
// ------------- StandardFileWizard
|
||||
|
||||
StandardFileWizard::StandardFileWizard(const BaseFileWizardParameters ¶meters,
|
||||
Core::ICore *core,
|
||||
QObject *parent) :
|
||||
BaseFileWizard(parameters, core, parent)
|
||||
BaseFileWizard(parameters, parent)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
@@ -50,7 +50,6 @@ QT_END_NAMESPACE
|
||||
|
||||
namespace Core {
|
||||
|
||||
class ICore;
|
||||
class IEditor;
|
||||
class IFileWizardExtension;
|
||||
|
||||
@@ -69,7 +68,7 @@ public:
|
||||
GeneratedFile();
|
||||
explicit GeneratedFile(const QString &path);
|
||||
GeneratedFile(const GeneratedFile &);
|
||||
GeneratedFile &operator=(const GeneratedFile&);
|
||||
GeneratedFile &operator=(const GeneratedFile &);
|
||||
~GeneratedFile();
|
||||
|
||||
// Full path of the file should be created, or the suggested file name
|
||||
@@ -107,19 +106,19 @@ public:
|
||||
void setKind(IWizard::Kind k);
|
||||
|
||||
QIcon icon() const;
|
||||
void setIcon(const QIcon&);
|
||||
void setIcon(const QIcon &icon);
|
||||
|
||||
QString description() const;
|
||||
void setDescription(const QString &);
|
||||
void setDescription(const QString &description);
|
||||
|
||||
QString name() const;
|
||||
void setName(const QString &);
|
||||
void setName(const QString &name);
|
||||
|
||||
QString category() const;
|
||||
void setCategory(const QString &);
|
||||
void setCategory(const QString &category);
|
||||
|
||||
QString trCategory() const;
|
||||
void setTrCategory(const QString &);
|
||||
void setTrCategory(const QString &trCategory);
|
||||
|
||||
private:
|
||||
QSharedDataPointer<BaseFileWizardParameterData> m_d;
|
||||
@@ -172,7 +171,7 @@ public:
|
||||
protected:
|
||||
typedef QList<QWizardPage *> WizardPageList;
|
||||
|
||||
explicit BaseFileWizard(const BaseFileWizardParameters ¶meters, Core::ICore *core, QObject *parent = 0);
|
||||
explicit BaseFileWizard(const BaseFileWizardParameters ¶meters, QObject *parent = 0);
|
||||
|
||||
// Overwrite to create the wizard dialog on the parent, adding
|
||||
// the extension pages.
|
||||
@@ -197,8 +196,6 @@ protected:
|
||||
OverwriteResult promptOverwrite(const QString &location,
|
||||
const QStringList &files,
|
||||
QString *errorMessage) const;
|
||||
Core::ICore *core() const;
|
||||
|
||||
private:
|
||||
BaseFileWizardPrivate *m_d;
|
||||
};
|
||||
@@ -213,7 +210,7 @@ class CORE_EXPORT StandardFileWizard : public BaseFileWizard
|
||||
Q_OBJECT
|
||||
|
||||
protected:
|
||||
explicit StandardFileWizard(const BaseFileWizardParameters ¶meters, Core::ICore *core, QObject *parent = 0);
|
||||
explicit StandardFileWizard(const BaseFileWizardParameters ¶meters, QObject *parent = 0);
|
||||
|
||||
// Implemented to create a Core::Utils::FileWizardDialog
|
||||
virtual QWizard *createWizardDialog(QWidget *parent,
|
||||
|
||||
@@ -33,7 +33,7 @@
|
||||
|
||||
#include "baseview.h"
|
||||
|
||||
#include <extensionsystem/ExtensionSystemInterfaces>
|
||||
#include <QtGui/QWidget>
|
||||
|
||||
using namespace Core;
|
||||
|
||||
|
||||
@@ -34,8 +34,6 @@
|
||||
#ifndef CORECONSTANTS_H
|
||||
#define CORECONSTANTS_H
|
||||
|
||||
#include <extensionsystem/ExtensionSystemInterfaces>
|
||||
|
||||
namespace Core {
|
||||
namespace Constants {
|
||||
|
||||
@@ -122,6 +120,7 @@ const char * const EXIT = "QtCreator.Exit";
|
||||
|
||||
const char * const OPTIONS = "QtCreator.Options";
|
||||
const char * const TOGGLE_SIDEBAR = "QtCreator.ToggleSidebar";
|
||||
const char * const TOGGLE_FULLSCREEN = "QtCreator.ToggleFullScreen";
|
||||
|
||||
const char * const MINIMIZE_WINDOW = "QtCreator.MinimizeWindow";
|
||||
const char * const ZOOM_WINDOW = "QtCreator.ZoomWindow";
|
||||
@@ -146,7 +145,7 @@ const char * const ABOUT_WORKBENCH = "QtCreator.AboutWorkbench";
|
||||
const char * const ABOUT_PLUGINS = "QtCreator.AboutPlugins";
|
||||
const char * const ABOUT_QT = "QtCreator.AboutQt";
|
||||
const char * const S_RETURNTOEDITOR = "QtCreator.ReturnToEditor";
|
||||
const char * const OPEN_IN_EXTERNAL_EDITOR = "QtCreattor.OpenInExternalEditor";
|
||||
const char * const OPEN_IN_EXTERNAL_EDITOR = "QtCreator.OpenInExternalEditor";
|
||||
|
||||
// default groups
|
||||
const char * const G_DEFAULT_ONE = "QtCreator.Group.Default.One";
|
||||
@@ -174,11 +173,18 @@ const char * const G_FILE_OTHER = "QtCreator.Group.File.Other";
|
||||
const char * const G_EDIT_UNDOREDO = "QtCreator.Group.Edit.UndoRedo";
|
||||
const char * const G_EDIT_COPYPASTE = "QtCreator.Group.Edit.CopyPaste";
|
||||
const char * const G_EDIT_SELECTALL = "QtCreator.Group.Edit.SelectAll";
|
||||
const char * const G_EDIT_FORMAT = "QtCreator.Group.Edit.Format";
|
||||
const char * const G_EDIT_ADVANCED = "QtCreator.Group.Edit.Advanced";
|
||||
|
||||
const char * const G_EDIT_FIND = "QtCreator.Group.Edit.Find";
|
||||
const char * const G_EDIT_OTHER = "QtCreator.Group.Edit.Other";
|
||||
|
||||
// advanced edit menu groups
|
||||
|
||||
const char * const G_EDIT_FORMAT = "QtCreator.Group.Edit.Format";
|
||||
const char * const G_EDIT_COLLAPSING = "QtCreator.Group.Edit.Collapsing";
|
||||
const char * const G_EDIT_FONT = "QtCreator.Group.Edit.Font";
|
||||
const char * const G_EDIT_EDITOR = "QtCreator.Group.Edit.Editor";
|
||||
|
||||
// window menu groups
|
||||
const char * const G_WINDOW_SIZE = "QtCreator.Group.Window.Size";
|
||||
const char * const G_WINDOW_PANES = "QtCreator.Group.Window.Panes";
|
||||
@@ -188,6 +194,7 @@ const char * const G_WINDOW_NAVIGATE = "QtCreator.Group.Window.Navigate";
|
||||
const char * const G_WINDOW_NAVIGATE_GROUPS = "QtCreator.Group.Window.Navigate.Groups";
|
||||
const char * const G_WINDOW_OTHER = "QtCreator.Group.Window.Other";
|
||||
const char * const G_WINDOW_LIST = "QtCreator.Group.Window.List";
|
||||
const char * const G_WINDOW_FULLSCREEN = "QtCreator.Group.Window.Fullscreen";
|
||||
|
||||
// help groups (global)
|
||||
const char * const G_HELP_HELP = "QtCreator.Group.Help.Help";
|
||||
|
||||
@@ -36,12 +36,21 @@
|
||||
#include <QtCore/QDir>
|
||||
#include <QtCore/QCoreApplication>
|
||||
|
||||
namespace Core {
|
||||
namespace Internal {
|
||||
|
||||
// The Core Singleton
|
||||
static CoreImpl *m_instance = 0;
|
||||
|
||||
} // namespace Internal
|
||||
} // namespace Core
|
||||
|
||||
|
||||
using namespace Core;
|
||||
using namespace Core::Internal;
|
||||
|
||||
CoreImpl *CoreImpl::m_instance = 0;
|
||||
|
||||
CoreImpl *CoreImpl::instance()
|
||||
ICore* ICore::instance()
|
||||
{
|
||||
return m_instance;
|
||||
}
|
||||
@@ -190,3 +199,4 @@ void CoreImpl::openFiles(const QStringList &arguments)
|
||||
{
|
||||
m_mainwindow->openFiles(arguments);
|
||||
}
|
||||
|
||||
|
||||
@@ -45,8 +45,6 @@ class CoreImpl : public ICore
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
static CoreImpl *instance();
|
||||
|
||||
CoreImpl(MainWindow *mainwindow);
|
||||
~CoreImpl() {}
|
||||
|
||||
@@ -93,8 +91,6 @@ public:
|
||||
private:
|
||||
MainWindow *m_mainwindow;
|
||||
friend class MainWindow;
|
||||
|
||||
static CoreImpl *m_instance;
|
||||
};
|
||||
|
||||
} // namespace Internal
|
||||
|
||||
@@ -39,7 +39,9 @@
|
||||
#include "modemanager.h"
|
||||
#include "fileiconprovider.h"
|
||||
|
||||
#include <QtCore/qplugin.h>
|
||||
#include <extensionsystem/pluginmanager.h>
|
||||
|
||||
#include <QtCore/QtPlugin>
|
||||
#if !defined(QT_NO_WEBKIT)
|
||||
#include <QtGui/QApplication>
|
||||
#include <QtWebKit/QWebSettings>
|
||||
|
||||
@@ -34,6 +34,8 @@
|
||||
#include "settingsdialog.h"
|
||||
#include "coreimpl.h"
|
||||
|
||||
#include <extensionsystem/pluginmanager.h>
|
||||
|
||||
#include <QtGui/QHeaderView>
|
||||
#include <QtGui/QPushButton>
|
||||
|
||||
@@ -58,7 +60,7 @@ SettingsDialog::SettingsDialog(QWidget *parent, const QString &initialCategory,
|
||||
QMap<QString, QTreeWidgetItem *> categories;
|
||||
|
||||
QList<IOptionsPage*> pages =
|
||||
CoreImpl::instance()->pluginManager()->getObjects<IOptionsPage>();
|
||||
ExtensionSystem::PluginManager::instance()->getObjects<IOptionsPage>();
|
||||
|
||||
int index = 0;
|
||||
foreach (IOptionsPage *page, pages) {
|
||||
|
||||
@@ -53,6 +53,8 @@
|
||||
#include <coreplugin/baseview.h>
|
||||
#include <coreplugin/imode.h>
|
||||
|
||||
#include <extensionsystem/pluginmanager.h>
|
||||
|
||||
#include <utils/qtcassert.h>
|
||||
|
||||
#include <QtCore/QDebug>
|
||||
@@ -77,6 +79,11 @@ using namespace Core::Internal;
|
||||
|
||||
enum { debugEditorManager=0 };
|
||||
|
||||
static inline ExtensionSystem::PluginManager *pluginManager()
|
||||
{
|
||||
return ExtensionSystem::PluginManager::instance();
|
||||
}
|
||||
|
||||
//===================EditorManager=====================
|
||||
|
||||
EditorManagerPlaceHolder *EditorManagerPlaceHolder::m_current = 0;
|
||||
@@ -201,6 +208,16 @@ EditorManagerPrivate::~EditorManagerPrivate()
|
||||
|
||||
EditorManager *EditorManager::m_instance = 0;
|
||||
|
||||
static Command *createSeparator(ActionManager *am, QObject *parent,
|
||||
const QString &name,
|
||||
const QList<int> &context)
|
||||
{
|
||||
QAction *tmpaction = new QAction(parent);
|
||||
tmpaction->setSeparator(true);
|
||||
Command *cmd = am->registerAction(tmpaction, name, context);
|
||||
return cmd;
|
||||
}
|
||||
|
||||
EditorManager::EditorManager(ICore *core, QWidget *parent) :
|
||||
QWidget(parent),
|
||||
m_d(new EditorManagerPrivate(core, parent))
|
||||
@@ -338,12 +355,24 @@ EditorManager::EditorManager(ICore *core, QWidget *parent) :
|
||||
|
||||
ActionContainer *medit = am->actionContainer(Constants::M_EDIT);
|
||||
ActionContainer *advancedMenu = am->createMenu(Constants::M_EDIT_ADVANCED);
|
||||
medit->addMenu(advancedMenu, Constants::G_EDIT_FORMAT);
|
||||
medit->addMenu(advancedMenu, Constants::G_EDIT_ADVANCED);
|
||||
advancedMenu->menu()->setTitle(tr("&Advanced"));
|
||||
advancedMenu->appendGroup(Constants::G_EDIT_FORMAT);
|
||||
advancedMenu->appendGroup(Constants::G_EDIT_COLLAPSING);
|
||||
advancedMenu->appendGroup(Constants::G_EDIT_FONT);
|
||||
advancedMenu->appendGroup(Constants::G_EDIT_EDITOR);
|
||||
|
||||
// Advanced menu separators
|
||||
cmd = createSeparator(am, this, QLatin1String("QtCreator.Edit.Sep.Collapsing"), editManagerContext);
|
||||
advancedMenu->addAction(cmd, Constants::G_EDIT_COLLAPSING);
|
||||
cmd = createSeparator(am, this, QLatin1String("QtCreator.Edit.Sep.Font"), editManagerContext);
|
||||
advancedMenu->addAction(cmd, Constants::G_EDIT_FONT);
|
||||
cmd = createSeparator(am, this, QLatin1String("QtCreator.Edit.Sep.Editor"), editManagerContext);
|
||||
advancedMenu->addAction(cmd, Constants::G_EDIT_EDITOR);
|
||||
|
||||
cmd = am->registerAction(m_d->m_openInExternalEditorAction, Constants::OPEN_IN_EXTERNAL_EDITOR, editManagerContext);
|
||||
cmd->setDefaultKeySequence(QKeySequence(tr("Alt+V,Alt+I")));
|
||||
advancedMenu->addAction(cmd);
|
||||
advancedMenu->addAction(cmd, Constants::G_EDIT_EDITOR);
|
||||
connect(m_d->m_openInExternalEditorAction, SIGNAL(triggered()), this, SLOT(openInExternalEditor()));
|
||||
|
||||
|
||||
@@ -367,11 +396,12 @@ EditorManager::EditorManager(ICore *core, QWidget *parent) :
|
||||
EditorManager::~EditorManager()
|
||||
{
|
||||
if (m_d->m_core) {
|
||||
ExtensionSystem::PluginManager *pm = ExtensionSystem::PluginManager::instance();
|
||||
if (m_d->m_coreListener) {
|
||||
m_d->m_core->pluginManager()->removeObject(m_d->m_coreListener);
|
||||
pm->removeObject(m_d->m_coreListener);
|
||||
delete m_d->m_coreListener;
|
||||
}
|
||||
m_d->m_core->pluginManager()->removeObject(m_d->m_openEditorsFactory);
|
||||
pm->removeObject(m_d->m_openEditorsFactory);
|
||||
delete m_d->m_openEditorsFactory;
|
||||
}
|
||||
delete m_d;
|
||||
@@ -383,10 +413,11 @@ void EditorManager::init()
|
||||
context << m_d->m_core->uniqueIDManager()->uniqueIdentifier("QtCreator.OpenDocumentsView");
|
||||
|
||||
m_d->m_coreListener = new EditorClosingCoreListener(this);
|
||||
m_d->m_core->pluginManager()->addObject(m_d->m_coreListener);
|
||||
|
||||
pluginManager()->addObject(m_d->m_coreListener);
|
||||
|
||||
m_d->m_openEditorsFactory = new OpenEditorsViewFactory();
|
||||
m_d->m_core->pluginManager()->addObject(m_d->m_openEditorsFactory);
|
||||
pluginManager()->addObject(m_d->m_openEditorsFactory);
|
||||
}
|
||||
|
||||
QSize EditorManager::minimumSizeHint() const
|
||||
@@ -568,7 +599,7 @@ bool EditorManager::closeEditors(const QList<IEditor*> editorsToClose, bool askA
|
||||
QList<IEditor*> acceptedEditors;
|
||||
//ask all core listeners to check whether the editor can be closed
|
||||
const QList<ICoreListener *> listeners =
|
||||
m_d->m_core->pluginManager()->getObjects<ICoreListener>();
|
||||
pluginManager()->getObjects<ICoreListener>();
|
||||
foreach (IEditor *editor, editorsToClose) {
|
||||
bool editorAccepted = true;
|
||||
foreach (ICoreListener *listener, listeners) {
|
||||
@@ -680,7 +711,7 @@ EditorManager::EditorFactoryList
|
||||
EditorManager::editorFactories(const MimeType &mimeType, bool bestMatchOnly) const
|
||||
{
|
||||
EditorFactoryList rc;
|
||||
const EditorFactoryList allFactories = m_d->m_core->pluginManager()->getObjects<IEditorFactory>();
|
||||
const EditorFactoryList allFactories = pluginManager()->getObjects<IEditorFactory>();
|
||||
mimeTypeFactoryRecursion(m_d->m_core->mimeDatabase(), mimeType, allFactories, bestMatchOnly, &rc);
|
||||
if (debugEditorManager)
|
||||
qDebug() << Q_FUNC_INFO << mimeType.type() << " returns " << rc;
|
||||
@@ -707,7 +738,7 @@ IEditor *EditorManager::createEditor(const QString &editorKind,
|
||||
factories = editorFactories(mimeType, true);
|
||||
} else {
|
||||
// Find by editor kind
|
||||
const EditorFactoryList allFactories = m_d->m_core->pluginManager()->getObjects<IEditorFactory>();
|
||||
const EditorFactoryList allFactories = pluginManager()->getObjects<IEditorFactory>();
|
||||
const EditorFactoryList::const_iterator acend = allFactories.constEnd();
|
||||
for (EditorFactoryList::const_iterator ait = allFactories.constBegin(); ait != acend; ++ait) {
|
||||
if (editorKind == (*ait)->kind()) {
|
||||
|
||||
@@ -80,6 +80,7 @@ StackedEditorGroup::StackedEditorGroup(QWidget *parent) :
|
||||
tl->setMargin(0);
|
||||
{
|
||||
m_editorList->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed);
|
||||
m_editorList->setSizeAdjustPolicy(QComboBox::AdjustToContents);
|
||||
m_editorList->setMinimumContentsLength(20);
|
||||
m_proxyModel.setSourceModel(model());
|
||||
m_proxyModel.sort(0);
|
||||
@@ -297,9 +298,9 @@ void StackedEditorGroup::setCurrentEditor(IEditor *editor)
|
||||
|
||||
void StackedEditorGroup::checkEditorStatus()
|
||||
{
|
||||
IEditor *editor = qobject_cast<IEditor *>(sender());
|
||||
if (editor == currentEditor())
|
||||
updateEditorStatus(editor);
|
||||
IEditor *editor = qobject_cast<IEditor *>(sender());
|
||||
if (editor == currentEditor())
|
||||
updateEditorStatus(editor);
|
||||
}
|
||||
|
||||
void StackedEditorGroup::updateEditorStatus(IEditor *editor)
|
||||
|
||||
@@ -51,10 +51,7 @@
|
||||
|
||||
You should never create a subclass of this interface. The one and only
|
||||
instance is created by the Core plugin. You can access this instance
|
||||
from your plugin via the plugin manager, e.g.
|
||||
\code
|
||||
ExtensionSystem::PluginManager::instance()->getObject<Core::ICore>();
|
||||
\endcode
|
||||
from your plugin through \c{Core::instance()}.
|
||||
|
||||
\mainclass
|
||||
*/
|
||||
|
||||
@@ -35,36 +35,30 @@
|
||||
#define ICORE_H
|
||||
|
||||
#include "core_global.h"
|
||||
#include <extensionsystem/pluginmanager.h>
|
||||
#include <QtCore/QObject>
|
||||
#include <QtCore/QList>
|
||||
|
||||
QT_BEGIN_NAMESPACE
|
||||
class QSettings;
|
||||
class QStatusBar;
|
||||
class QFocusEvent;
|
||||
class QMainWindow;
|
||||
class QPrinter;
|
||||
class QSettings;
|
||||
template <class T> class QList;
|
||||
QT_END_NAMESPACE
|
||||
|
||||
namespace Core {
|
||||
|
||||
// forward declarations
|
||||
class ActionManager;
|
||||
class IFile;
|
||||
class FileManager;
|
||||
class MessageManager;
|
||||
class IEditor;
|
||||
class UniqueIDManager;
|
||||
class EditorManager;
|
||||
class FileManager;
|
||||
class IContext;
|
||||
class IWizard;
|
||||
class MessageManager;
|
||||
class MimeDatabase;
|
||||
class ModeManager;
|
||||
class ProgressManager;
|
||||
class ScriptManager;
|
||||
class UniqueIDManager;
|
||||
class VariableManager;
|
||||
class IContext;
|
||||
class VCSManager;
|
||||
class ModeManager;
|
||||
class IWizard;
|
||||
class MimeDatabase;
|
||||
|
||||
class CORE_EXPORT ICore : public QObject
|
||||
{
|
||||
@@ -74,6 +68,8 @@ public:
|
||||
ICore() {}
|
||||
virtual ~ICore() {}
|
||||
|
||||
static ICore *instance();
|
||||
|
||||
virtual QStringList showNewItemDialog(const QString &title,
|
||||
const QList<IWizard *> &wizards,
|
||||
const QString &defaultLocation = QString()) = 0;
|
||||
@@ -85,7 +81,6 @@ public:
|
||||
virtual FileManager *fileManager() const = 0;
|
||||
virtual UniqueIDManager *uniqueIDManager() const = 0;
|
||||
virtual MessageManager *messageManager() const = 0;
|
||||
virtual ExtensionSystem::PluginManager *pluginManager() const = 0;
|
||||
virtual EditorManager *editorManager() const = 0;
|
||||
virtual ProgressManager *progressManager() const = 0;
|
||||
virtual ScriptManager *scriptManager() const = 0;
|
||||
|
||||
@@ -70,22 +70,23 @@
|
||||
#include "basefilewizard.h"
|
||||
|
||||
#include <coreplugin/findplaceholder.h>
|
||||
#include <extensionsystem/pluginmanager.h>
|
||||
|
||||
#include <QtCore/qplugin.h>
|
||||
#include <QtCore/QDebug>
|
||||
#include <QtCore/QFileInfo>
|
||||
#include <QtCore/QSettings>
|
||||
#include <QtCore/QTimer>
|
||||
#include <QtCore/QFileInfo>
|
||||
#include <QtCore/QtPlugin>
|
||||
|
||||
#include <QtGui/QMenu>
|
||||
#include <QtGui/QToolBar>
|
||||
#include <QtGui/QApplication>
|
||||
#include <QtGui/QPixmap>
|
||||
#include <QtGui/QCloseEvent>
|
||||
#include <QtGui/QShortcut>
|
||||
#include <QtGui/QMenu>
|
||||
#include <QtGui/QPixmap>
|
||||
#include <QtGui/QPrinter>
|
||||
#include <QtGui/QWizard>
|
||||
#include <QtGui/QShortcut>
|
||||
#include <QtGui/QStatusBar>
|
||||
#include <QtGui/QToolBar>
|
||||
#include <QtGui/QWizard>
|
||||
|
||||
/*
|
||||
#ifdef Q_OS_UNIX
|
||||
@@ -142,6 +143,7 @@ MainWindow::MainWindow() :
|
||||
m_exitAction(0),
|
||||
m_optionsAction(0),
|
||||
m_toggleSideBarAction(0),
|
||||
m_toggleFullScreenAction(0),
|
||||
#ifdef Q_OS_MAC
|
||||
m_minimizeAction(0),
|
||||
m_zoomAction(0),
|
||||
@@ -186,6 +188,7 @@ MainWindow::MainWindow() :
|
||||
QCoreApplication::setOrganizationName(QLatin1String("Nokia"));
|
||||
QSettings::setDefaultFormat(QSettings::IniFormat);
|
||||
QString baseName = qApp->style()->objectName();
|
||||
#ifdef Q_WS_X11
|
||||
if (baseName == "windows") {
|
||||
// Sometimes we get the standard windows 95 style as a fallback
|
||||
// e.g. if we are running on a KDE4 desktop
|
||||
@@ -195,18 +198,19 @@ MainWindow::MainWindow() :
|
||||
else
|
||||
baseName = "cleanlooks";
|
||||
}
|
||||
#endif
|
||||
qApp->setStyle(new ManhattanStyle(baseName));
|
||||
statusBar()->setProperty("p_styled", true);
|
||||
}
|
||||
|
||||
void MainWindow::toggleNavigation()
|
||||
void MainWindow::setSidebarVisible(bool visible)
|
||||
{
|
||||
if (NavigationWidgetPlaceHolder::current()) {
|
||||
if (m_navigationWidget->isSuppressed()) {
|
||||
if (m_navigationWidget->isSuppressed() && visible) {
|
||||
m_navigationWidget->setShown(true);
|
||||
m_navigationWidget->setSuppressed(false);
|
||||
} else {
|
||||
m_navigationWidget->setShown(!m_navigationWidget->isShown());
|
||||
m_navigationWidget->setShown(visible);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -398,7 +402,7 @@ void MainWindow::registerDefaultContainers()
|
||||
medit->appendGroup(Constants::G_EDIT_UNDOREDO);
|
||||
medit->appendGroup(Constants::G_EDIT_COPYPASTE);
|
||||
medit->appendGroup(Constants::G_EDIT_SELECTALL);
|
||||
medit->appendGroup(Constants::G_EDIT_FORMAT);
|
||||
medit->appendGroup(Constants::G_EDIT_ADVANCED);
|
||||
medit->appendGroup(Constants::G_EDIT_FIND);
|
||||
medit->appendGroup(Constants::G_EDIT_OTHER);
|
||||
|
||||
@@ -428,9 +432,9 @@ void MainWindow::registerDefaultContainers()
|
||||
ac->appendGroup(Constants::G_HELP_ABOUT);
|
||||
}
|
||||
|
||||
static Command *createSeparator(ActionManagerPrivate *am, QObject *parent,
|
||||
const QString &name,
|
||||
const QList<int> &context)
|
||||
static Command *createSeparator(ActionManager *am, QObject *parent,
|
||||
const QString &name,
|
||||
const QList<int> &context)
|
||||
{
|
||||
QAction *tmpaction = new QAction(parent);
|
||||
tmpaction->setSeparator(true);
|
||||
@@ -445,7 +449,6 @@ void MainWindow::registerDefaultActions()
|
||||
ActionContainer *medit = am->actionContainer(Constants::M_EDIT);
|
||||
ActionContainer *mtools = am->actionContainer(Constants::M_TOOLS);
|
||||
ActionContainer *mwindow = am->actionContainer(Constants::M_WINDOW);
|
||||
Q_UNUSED(mwindow)
|
||||
ActionContainer *mhelp = am->actionContainer(Constants::M_HELP);
|
||||
|
||||
// File menu separators
|
||||
@@ -462,7 +465,7 @@ void MainWindow::registerDefaultActions()
|
||||
mfile->addAction(cmd, Constants::G_FILE_OTHER);
|
||||
|
||||
// Edit menu separators
|
||||
cmd = createSeparator(am, this, QLatin1String("QtCreator.Edit.Sep.CopyPaste"), m_globalContext);
|
||||
cmd = createSeparator(am, this, QLatin1String("QtCreator.Edit.Sep.CopyPaste"), m_globalContext);
|
||||
medit->addAction(cmd, Constants::G_EDIT_COPYPASTE);
|
||||
|
||||
cmd = createSeparator(am, this, QLatin1String("QtCreator.Edit.Sep.SelectAll"), m_globalContext);
|
||||
@@ -471,8 +474,8 @@ void MainWindow::registerDefaultActions()
|
||||
cmd = createSeparator(am, this, QLatin1String("QtCreator.Edit.Sep.Find"), m_globalContext);
|
||||
medit->addAction(cmd, Constants::G_EDIT_FIND);
|
||||
|
||||
cmd = createSeparator(am, this, QLatin1String("QtCreator.Edit.Sep.Format"), m_globalContext);
|
||||
medit->addAction(cmd, Constants::G_EDIT_FORMAT);
|
||||
cmd = createSeparator(am, this, QLatin1String("QtCreator.Edit.Sep.Advanced"), m_globalContext);
|
||||
medit->addAction(cmd, Constants::G_EDIT_ADVANCED);
|
||||
|
||||
//Tools menu separators
|
||||
cmd = createSeparator(am, this, QLatin1String("QtCreator.Tools.Sep.Options"), m_globalContext);
|
||||
@@ -625,7 +628,7 @@ void MainWindow::registerDefaultActions()
|
||||
|
||||
// Toggle Sidebar Action
|
||||
m_toggleSideBarAction = new QAction(QIcon(Constants::ICON_TOGGLE_SIDEBAR),
|
||||
tr("Toggle Sidebar"), this);
|
||||
tr("Show Sidebar"), this);
|
||||
m_toggleSideBarAction->setCheckable(true);
|
||||
cmd = am->registerAction(m_toggleSideBarAction, Constants::TOGGLE_SIDEBAR, m_globalContext);
|
||||
#ifdef Q_OS_MAC
|
||||
@@ -633,11 +636,24 @@ void MainWindow::registerDefaultActions()
|
||||
#else
|
||||
cmd->setDefaultKeySequence(QKeySequence("Alt+0"));
|
||||
#endif
|
||||
connect(m_toggleSideBarAction, SIGNAL(triggered()), this, SLOT(toggleNavigation()));
|
||||
connect(m_toggleSideBarAction, SIGNAL(triggered(bool)), this, SLOT(setSidebarVisible(bool)));
|
||||
m_toggleSideBarButton->setDefaultAction(cmd->action());
|
||||
mwindow->addAction(cmd, Constants::G_WINDOW_PANES);
|
||||
m_toggleSideBarAction->setEnabled(false);
|
||||
|
||||
#if !defined(Q_OS_MAC)
|
||||
// Toggle Full Screen
|
||||
m_toggleFullScreenAction = new QAction(tr("Toggle Fullscreen"), this);
|
||||
m_toggleFullScreenAction->setCheckable(true);
|
||||
m_toggleFullScreenAction->setChecked(false);
|
||||
cmd = am->registerAction(m_toggleFullScreenAction,
|
||||
Constants::TOGGLE_FULLSCREEN, m_globalContext);
|
||||
cmd->setDefaultKeySequence(QKeySequence("Ctrl+Shift+F11"));
|
||||
mwindow->addAction(cmd, Constants::G_WINDOW_SIZE);
|
||||
connect(m_toggleFullScreenAction, SIGNAL(triggered(bool)),
|
||||
this, SLOT(setFullScreen(bool)));
|
||||
#endif
|
||||
|
||||
//About IDE Action
|
||||
#ifdef Q_OS_MAC
|
||||
tmpaction = new QAction(tr("About &Qt Creator"), this); // it's convention not to add dots to the about menu
|
||||
@@ -682,8 +698,8 @@ void MainWindow::openFile()
|
||||
|
||||
static QList<IFileFactory*> getNonEditorFileFactories()
|
||||
{
|
||||
const ICore *core = CoreImpl::instance();
|
||||
const QList<IFileFactory*> allFileFactories = core->pluginManager()->getObjects<IFileFactory>();
|
||||
const QList<IFileFactory*> allFileFactories =
|
||||
ExtensionSystem::PluginManager::instance()->getObjects<IFileFactory>();
|
||||
QList<IFileFactory*> nonEditorFileFactories;
|
||||
foreach (IFileFactory *factory, allFileFactories) {
|
||||
if (!qobject_cast<IEditorFactory *>(factory))
|
||||
@@ -914,13 +930,18 @@ void MainWindow::changeEvent(QEvent *e)
|
||||
qDebug() << "main window activated";
|
||||
emit windowActivated();
|
||||
}
|
||||
#ifdef Q_OS_MAC
|
||||
} else if (e->type() == QEvent::WindowStateChange) {
|
||||
#ifdef Q_OS_MAC
|
||||
bool minimized = isMinimized();
|
||||
if (debugMainWindow)
|
||||
qDebug() << "main window state changed to minimized=" << minimized;
|
||||
m_minimizeAction->setEnabled(!minimized);
|
||||
m_zoomAction->setEnabled(!minimized);
|
||||
#else
|
||||
QWindowStateChangeEvent *ev =
|
||||
static_cast<QWindowStateChangeEvent *>(e);
|
||||
bool isFullScreen = (ev->oldState() & Qt::WindowFullScreen) != 0;
|
||||
m_toggleFullScreenAction->setChecked(!isFullScreen);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
@@ -1110,3 +1131,19 @@ QPrinter *MainWindow::printer() const
|
||||
m_printer = new QPrinter(QPrinter::HighResolution);
|
||||
return m_printer;
|
||||
}
|
||||
|
||||
void MainWindow::setFullScreen(bool on)
|
||||
{
|
||||
if (bool(windowState() & Qt::WindowFullScreen) == on)
|
||||
return;
|
||||
|
||||
if (on) {
|
||||
setWindowState(windowState() | Qt::WindowFullScreen);
|
||||
//statusBar()->hide();
|
||||
//menuBar()->hide();
|
||||
} else {
|
||||
setWindowState(windowState() & ~Qt::WindowFullScreen);
|
||||
//menuBar()->show();
|
||||
//statusBar()->show();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -137,6 +137,7 @@ public slots:
|
||||
void newFile();
|
||||
void openFileWith();
|
||||
void exit();
|
||||
void setFullScreen(bool on);
|
||||
|
||||
QStringList showNewItemDialog(const QString &title,
|
||||
const QList<IWizard *> &wizards,
|
||||
@@ -157,7 +158,7 @@ private slots:
|
||||
void aboutQtCreator();
|
||||
void aboutPlugins();
|
||||
void updateFocusWidget(QWidget *old, QWidget *now);
|
||||
void toggleNavigation();
|
||||
void setSidebarVisible(bool visible);
|
||||
void destroyVersionDialog();
|
||||
|
||||
private:
|
||||
@@ -213,6 +214,7 @@ private:
|
||||
QAction *m_exitAction;
|
||||
QAction *m_optionsAction;
|
||||
QAction *m_toggleSideBarAction;
|
||||
QAction *m_toggleFullScreenAction;
|
||||
#ifdef Q_OS_MAC
|
||||
QAction *m_minimizeAction;
|
||||
QAction *m_zoomAction;
|
||||
|
||||
@@ -46,6 +46,8 @@
|
||||
#include <coreplugin/imode.h>
|
||||
#include <coreplugin/uniqueidmanager.h>
|
||||
|
||||
#include <extensionsystem/pluginmanager.h>
|
||||
|
||||
#include <utils/qtcassert.h>
|
||||
|
||||
#include <QtCore/QObject>
|
||||
@@ -215,7 +217,7 @@ void ModeManager::currentTabChanged(int index)
|
||||
// FIXME: This hardcoded context update is required for the Debug and Edit modes, since
|
||||
// they use the editor widget, which is already a context widget so the main window won't
|
||||
// go further up the parent tree to find the mode context.
|
||||
CoreImpl *core = CoreImpl::instance();
|
||||
ICore *core = ICore::instance();
|
||||
foreach (const int context, m_addedContexts)
|
||||
core->removeAdditionalContext(context);
|
||||
|
||||
|
||||
@@ -39,15 +39,16 @@
|
||||
#include <coreplugin/modemanager.h>
|
||||
#include <coreplugin/uniqueidmanager.h>
|
||||
#include <coreplugin/actionmanager/actionmanager.h>
|
||||
#include <extensionsystem/ExtensionSystemInterfaces>
|
||||
#include <extensionsystem/pluginmanager.h>
|
||||
|
||||
#include <QtCore/QDebug>
|
||||
#include <QtCore/QSettings>
|
||||
|
||||
#include <QtGui/QAction>
|
||||
#include <QtGui/QHBoxLayout>
|
||||
#include <QtGui/QToolButton>
|
||||
#include <QtGui/QToolBar>
|
||||
#include <QtGui/QResizeEvent>
|
||||
#include <QtCore/QDebug>
|
||||
#include <QtCore/QSettings>
|
||||
#include <QtGui/QToolBar>
|
||||
#include <QtGui/QToolButton>
|
||||
|
||||
Q_DECLARE_METATYPE(Core::INavigationWidgetFactory *)
|
||||
|
||||
@@ -315,8 +316,8 @@ void NavigationWidget::objectAdded(QObject * obj)
|
||||
if (!factory)
|
||||
return;
|
||||
|
||||
Core::ICore *core = ExtensionSystem::PluginManager::instance()->getObject<Core::ICore>();
|
||||
Core::ActionManager *am = core->actionManager();
|
||||
ICore *core = ICore::instance();
|
||||
ActionManager *am = core->actionManager();
|
||||
QList<int> navicontext = QList<int>() << core->uniqueIDManager()->
|
||||
uniqueIdentifier(Core::Constants::C_NAVIGATION_PANE);
|
||||
|
||||
@@ -398,9 +399,8 @@ NavigationSubWidget::~NavigationSubWidget()
|
||||
void NavigationSubWidget::setCurrentIndex(int index)
|
||||
{
|
||||
// Remove toolbutton
|
||||
foreach (QWidget *w, m_additionalToolBarWidgets) {
|
||||
foreach (QWidget *w, m_additionalToolBarWidgets)
|
||||
delete w;
|
||||
}
|
||||
|
||||
// Remove old Widget
|
||||
delete m_navigationWidget;
|
||||
@@ -465,8 +465,7 @@ void NavigationSubWidget::setFactory(INavigationWidgetFactory *factory)
|
||||
|
||||
void NavigationSubWidget::setFactory(const QString &name)
|
||||
{
|
||||
for (int i = 0; i < m_navigationComboBox->count(); ++i)
|
||||
{
|
||||
for (int i = 0; i < m_navigationComboBox->count(); ++i) {
|
||||
INavigationWidgetFactory *factory =
|
||||
m_navigationComboBox->itemData(i).value<INavigationWidgetFactory *>();
|
||||
if (factory->displayName() == name)
|
||||
|
||||
@@ -42,12 +42,13 @@
|
||||
#include <coreplugin/editormanager/editormanager.h>
|
||||
#include <coreplugin/editormanager/editorgroup.h>
|
||||
|
||||
#include <extensionsystem/pluginmanager.h>
|
||||
|
||||
#include <QtGui/QAction>
|
||||
#include <QtGui/QApplication>
|
||||
#include <QtGui/QComboBox>
|
||||
#include <QtGui/QFocusEvent>
|
||||
#include <QtGui/QHBoxLayout>
|
||||
#include <QtGui/QLineEdit>
|
||||
#include <QtGui/QMenu>
|
||||
#include <QtGui/QPainter>
|
||||
#include <QtGui/QPushButton>
|
||||
@@ -393,8 +394,7 @@ void OutputPane::showPage(int idx, bool focus)
|
||||
if (!OutputPanePlaceHolder::m_current) {
|
||||
// In this mode we don't have a placeholder
|
||||
// switch to the output mode and switch the page
|
||||
ICore *core = m_pluginManager->getObject<ICore>();
|
||||
core->modeManager()->activateMode(Constants::MODE_OUTPUT);
|
||||
ICore::instance()->modeManager()->activateMode(Constants::MODE_OUTPUT);
|
||||
ensurePageVisible(idx);
|
||||
} else {
|
||||
// else we make that page visible
|
||||
@@ -409,14 +409,13 @@ void OutputPane::showPage(int idx, bool focus)
|
||||
void OutputPane::togglePage(bool focus)
|
||||
{
|
||||
int idx = findIndexForPage(qobject_cast<IOutputPane*>(sender()));
|
||||
if(OutputPanePlaceHolder::m_current
|
||||
if (OutputPanePlaceHolder::m_current
|
||||
&& OutputPanePlaceHolder::m_current->isVisible()
|
||||
&& m_widgetComboBox->itemData(m_widgetComboBox->currentIndex()).toInt() == idx) {
|
||||
slotHide();
|
||||
} else {
|
||||
showPage(idx, focus);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
void OutputPane::setCloseable(bool b)
|
||||
|
||||
@@ -35,7 +35,6 @@
|
||||
#include "qworkbench_wrapper.h"
|
||||
#include "metatypedeclarations.h"
|
||||
|
||||
#include <extensionsystem/ExtensionSystemInterfaces>
|
||||
#include <utils/qtcassert.h>
|
||||
#include <interface_wrap_helpers.h>
|
||||
#include <wrap_helpers.h>
|
||||
|
||||
@@ -40,21 +40,13 @@
|
||||
|
||||
#include <coreplugin/actionmanager/actionmanager.h>
|
||||
#include <coreplugin/actionmanager/command.h>
|
||||
#include <extensionsystem/ExtensionSystemInterfaces>
|
||||
#include <aggregation/aggregate.h>
|
||||
#include <extensionsystem/pluginmanager.h>
|
||||
|
||||
#include <QtCore/QSettings>
|
||||
#include <QtGui/QAction>
|
||||
#include <QtGui/QActionGroup>
|
||||
#include <QtGui/QComboBox>
|
||||
#include <QtGui/QDockWidget>
|
||||
#include <QtGui/QHBoxLayout>
|
||||
#include <QtGui/QLabel>
|
||||
#include <QtGui/QMenu>
|
||||
#include <QtGui/QStackedWidget>
|
||||
#include <QtGui/QStatusBar>
|
||||
#include <QtGui/QToolButton>
|
||||
#include <QtGui/QVBoxLayout>
|
||||
|
||||
using namespace Core;
|
||||
using namespace Core::Internal;
|
||||
|
||||
@@ -38,17 +38,18 @@
|
||||
#include "splitter.h"
|
||||
#include "view.h"
|
||||
|
||||
#include <coreplugin/icore.h>
|
||||
#include <coreplugin/coreconstants.h>
|
||||
#include <coreplugin/filemanager.h>
|
||||
#include <coreplugin/messagemanager.h>
|
||||
#include <coreplugin/uniqueidmanager.h>
|
||||
#include <coreplugin/actionmanager/actionmanager.h>
|
||||
#include <coreplugin/coreconstants.h>
|
||||
#include <coreplugin/editormanager/editormanager.h>
|
||||
#include <texteditor/itexteditor.h>
|
||||
#include <coreplugin/filemanager.h>
|
||||
#include <coreplugin/icore.h>
|
||||
#include <coreplugin/messagemanager.h>
|
||||
#include <coreplugin/messageoutputwindow.h>
|
||||
#include <coreplugin/uniqueidmanager.h>
|
||||
#include <extensionsystem/pluginmanager.h>
|
||||
#include <texteditor/itexteditor.h>
|
||||
|
||||
#include <QtCore/qplugin.h>
|
||||
#include <QtCore/QtPlugin>
|
||||
#include <QtCore/QDebug>
|
||||
#include <QtGui/QAction>
|
||||
#include <QtGui/QApplication>
|
||||
@@ -62,8 +63,6 @@ using namespace CodePaster;
|
||||
using namespace Core;
|
||||
using namespace TextEditor;
|
||||
|
||||
Core::ICore *gCoreInstance = NULL;
|
||||
|
||||
CodepasterPlugin::CodepasterPlugin()
|
||||
: m_settingsPage(0), m_fetcher(0), m_poster(0)
|
||||
{
|
||||
@@ -83,11 +82,9 @@ bool CodepasterPlugin::initialize(const QStringList &arguments, QString *error_m
|
||||
Q_UNUSED(arguments);
|
||||
Q_UNUSED(error_message);
|
||||
|
||||
gCoreInstance = ExtensionSystem::PluginManager::instance()->getObject<Core::ICore>();
|
||||
|
||||
// Create the globalcontext list to register actions accordingly
|
||||
QList<int> globalcontext;
|
||||
globalcontext << gCoreInstance->uniqueIDManager()->
|
||||
globalcontext << ICore::instance()->uniqueIDManager()->
|
||||
uniqueIdentifier(Core::Constants::C_GLOBAL);
|
||||
|
||||
// Create the settings Page
|
||||
@@ -95,7 +92,7 @@ bool CodepasterPlugin::initialize(const QStringList &arguments, QString *error_m
|
||||
addObject(m_settingsPage);
|
||||
|
||||
//register actions
|
||||
Core::ActionManager *actionManager = gCoreInstance->actionManager();
|
||||
Core::ActionManager *actionManager = ICore::instance()->actionManager();
|
||||
|
||||
Core::ActionContainer *toolsContainer =
|
||||
actionManager->actionContainer(Core::Constants::M_TOOLS);
|
||||
@@ -132,7 +129,7 @@ void CodepasterPlugin::post()
|
||||
{
|
||||
if (m_poster)
|
||||
delete m_poster;
|
||||
IEditor* editor = gCoreInstance->editorManager()->currentEditor();
|
||||
IEditor* editor = ICore::instance()->editorManager()->currentEditor();
|
||||
ITextEditor* textEditor = qobject_cast<ITextEditor*>(editor);
|
||||
if (!textEditor)
|
||||
return;
|
||||
@@ -243,7 +240,7 @@ void CustomFetcher::customRequestFinished(int, bool error)
|
||||
QByteArray data = body();
|
||||
if (!m_listWidget) {
|
||||
QString title = QString::fromLatin1("Code Paster: %1").arg(m_id);
|
||||
gCoreInstance->editorManager()->newFile(Core::Constants::K_DEFAULT_TEXT_EDITOR
|
||||
ICore::instance()->editorManager()->newFile(Core::Constants::K_DEFAULT_TEXT_EDITOR
|
||||
, &title, data);
|
||||
} else {
|
||||
m_listWidget->clear();
|
||||
@@ -283,7 +280,7 @@ void CustomPoster::customRequestFinished(int, bool error)
|
||||
if (!error) {
|
||||
if (m_copy)
|
||||
QApplication::clipboard()->setText(pastedUrl());
|
||||
gCoreInstance->messageManager()->printToOutputPane(pastedUrl(), m_output);
|
||||
ICore::instance()->messageManager()->printToOutputPane(pastedUrl(), m_output);
|
||||
} else
|
||||
QMessageBox::warning(0, "Code Paster Error", "Some error occured while posting", QMessageBox::Ok);
|
||||
#if 0 // Figure out how to access
|
||||
|
||||
@@ -40,8 +40,8 @@
|
||||
|
||||
#include <coreplugin/editormanager/ieditorfactory.h>
|
||||
#include <coreplugin/icorelistener.h>
|
||||
#include <projectexplorer/ProjectExplorerInterfaces>
|
||||
#include <extensionsystem/iplugin.h>
|
||||
#include <projectexplorer/projectexplorer.h>
|
||||
|
||||
#include <QtCore/QObject>
|
||||
|
||||
|
||||
@@ -34,7 +34,6 @@
|
||||
#include "settingspage.h"
|
||||
|
||||
#include <coreplugin/icore.h>
|
||||
#include <extensionsystem/pluginmanager.h>
|
||||
|
||||
#include <QtCore/QSettings>
|
||||
#include <QtGui/QLineEdit>
|
||||
@@ -46,10 +45,7 @@ using namespace CodePaster;
|
||||
|
||||
SettingsPage::SettingsPage()
|
||||
{
|
||||
Core::ICore *coreIFace = ExtensionSystem::PluginManager::instance()->getObject<Core::ICore>();
|
||||
if (coreIFace)
|
||||
m_settings = coreIFace->settings();
|
||||
|
||||
m_settings = Core::ICore::instance()->settings();
|
||||
if (m_settings) {
|
||||
m_settings->beginGroup("CodePaster");
|
||||
m_username = m_settings->value("UserName", qgetenv("USER")).toString();
|
||||
|
||||
@@ -42,9 +42,6 @@
|
||||
#include <QtCore/QDir>
|
||||
#include <QtCore/QTextStream>
|
||||
|
||||
#include <QtGui/QCheckBox>
|
||||
#include <QtGui/QComboBox>
|
||||
#include <QtGui/QLabel>
|
||||
#include <QtGui/QVBoxLayout>
|
||||
#include <QtGui/QWizard>
|
||||
|
||||
@@ -124,8 +121,8 @@ CppClassWizardParameters CppClassWizardDialog::parameters() const
|
||||
// ========= CppClassWizard =========
|
||||
|
||||
CppClassWizard::CppClassWizard(const Core::BaseFileWizardParameters ¶meters,
|
||||
Core::ICore *core, QObject *parent) :
|
||||
Core::BaseFileWizard(parameters, core, parent)
|
||||
QObject *parent)
|
||||
: Core::BaseFileWizard(parameters, parent)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
@@ -40,16 +40,13 @@
|
||||
#include <QtGui/QWizardPage>
|
||||
#include <QtGui/QWizard>
|
||||
|
||||
QT_BEGIN_NAMESPACE
|
||||
class QCheckBox;
|
||||
class QComboBox;
|
||||
QT_END_NAMESPACE
|
||||
|
||||
namespace Core {
|
||||
namespace Utils {
|
||||
class NewClassWidget;
|
||||
}
|
||||
}
|
||||
|
||||
class NewClassWidget;
|
||||
|
||||
} // namespace Utils
|
||||
} // namespace Core
|
||||
|
||||
namespace CppEditor {
|
||||
namespace Internal {
|
||||
@@ -75,7 +72,8 @@ private:
|
||||
};
|
||||
|
||||
|
||||
struct CppClassWizardParameters {
|
||||
struct CppClassWizardParameters
|
||||
{
|
||||
QString className;
|
||||
QString headerFile;
|
||||
QString sourceFile;
|
||||
@@ -83,9 +81,10 @@ struct CppClassWizardParameters {
|
||||
QString path;
|
||||
};
|
||||
|
||||
class CppClassWizardDialog : public QWizard {
|
||||
Q_DISABLE_COPY(CppClassWizardDialog)
|
||||
class CppClassWizardDialog : public QWizard
|
||||
{
|
||||
Q_OBJECT
|
||||
Q_DISABLE_COPY(CppClassWizardDialog)
|
||||
public:
|
||||
explicit CppClassWizardDialog(const QString &sourceSuffix,
|
||||
const QString &headerSuffix,
|
||||
@@ -104,7 +103,7 @@ class CppClassWizard : public Core::BaseFileWizard
|
||||
Q_OBJECT
|
||||
public:
|
||||
explicit CppClassWizard(const Core::BaseFileWizardParameters ¶meters,
|
||||
Core::ICore *core, QObject *parent = 0);
|
||||
QObject *parent = 0);
|
||||
|
||||
protected:
|
||||
virtual QWizard *createWizardDialog(QWidget *parent,
|
||||
|
||||
@@ -58,6 +58,7 @@
|
||||
#include <coreplugin/actionmanager/actionmanager.h>
|
||||
#include <coreplugin/editormanager/ieditor.h>
|
||||
#include <coreplugin/editormanager/editormanager.h>
|
||||
#include <extensionsystem/pluginmanager.h>
|
||||
#include <projectexplorer/projectexplorerconstants.h>
|
||||
#include <texteditor/basetextdocument.h>
|
||||
#include <texteditor/fontsettings.h>
|
||||
@@ -65,21 +66,17 @@
|
||||
#include <texteditor/textblockiterator.h>
|
||||
#include <indenter.h>
|
||||
|
||||
#include <QtCore/QFileInfo>
|
||||
#include <QtCore/QTextStream>
|
||||
#include <QtCore/QDebug>
|
||||
#include <QtCore/QTime>
|
||||
#include <QtCore/QTimer>
|
||||
#include <QtGui/QAction>
|
||||
#include <QtGui/QKeyEvent>
|
||||
#include <QtGui/QHeaderView>
|
||||
#include <QtGui/QLayout>
|
||||
#include <QtGui/QMenu>
|
||||
#include <QtGui/QShortcut>
|
||||
#include <QtGui/QTextEdit>
|
||||
#include <QtGui/QComboBox>
|
||||
#include <QtGui/QTreeView>
|
||||
#include <QtGui/QHeaderView>
|
||||
#include <QtGui/QStringListModel>
|
||||
|
||||
using namespace CPlusPlus;
|
||||
using namespace CppEditor::Internal;
|
||||
@@ -142,15 +139,14 @@ QualifiedNameId *qualifiedNameIdForSymbol(Symbol *s, const LookupContext &contex
|
||||
CPPEditorEditable::CPPEditorEditable(CPPEditor *editor)
|
||||
: BaseTextEditorEditable(editor)
|
||||
{
|
||||
Core::ICore *core = CppPlugin::core();
|
||||
Core::ICore *core = Core::ICore::instance();
|
||||
m_context << core->uniqueIDManager()->uniqueIdentifier(CppEditor::Constants::C_CPPEDITOR);
|
||||
m_context << core->uniqueIDManager()->uniqueIdentifier(ProjectExplorer::Constants::LANG_CXX);
|
||||
m_context << core->uniqueIDManager()->uniqueIdentifier(TextEditor::Constants::C_TEXTEDITOR);
|
||||
}
|
||||
|
||||
CPPEditor::CPPEditor(QWidget *parent) :
|
||||
TextEditor::BaseTextEditor(parent),
|
||||
m_core(CppPlugin::core())
|
||||
CPPEditor::CPPEditor(QWidget *parent)
|
||||
: TextEditor::BaseTextEditor(parent)
|
||||
{
|
||||
setParenthesesMatchingEnabled(true);
|
||||
setMarksVisible(true);
|
||||
@@ -172,7 +168,8 @@ CPPEditor::CPPEditor(QWidget *parent) :
|
||||
/*ambiguousMember=*/ 0, Qt::WidgetShortcut);
|
||||
#endif
|
||||
|
||||
m_modelManager = m_core->pluginManager()->getObject<CppTools::CppModelManagerInterface>();
|
||||
m_modelManager = ExtensionSystem::PluginManager::instance()
|
||||
->getObject<CppTools::CppModelManagerInterface>();
|
||||
|
||||
if (m_modelManager) {
|
||||
connect(m_modelManager, SIGNAL(documentUpdated(CPlusPlus::Document::Ptr)),
|
||||
|
||||
@@ -38,10 +38,9 @@
|
||||
|
||||
using namespace CppEditor::Internal;
|
||||
|
||||
CPPEditorActionHandler::CPPEditorActionHandler(Core::ICore *core,
|
||||
const QString &context,
|
||||
CPPEditorActionHandler::CPPEditorActionHandler(const QString &context,
|
||||
uint optionalActions)
|
||||
: TextEditor::TextEditorActionHandler(core, context, optionalActions)
|
||||
: TextEditor::TextEditorActionHandler(context, optionalActions)
|
||||
{ }
|
||||
|
||||
CPPEditorActionHandler::~CPPEditorActionHandler()
|
||||
|
||||
@@ -44,8 +44,7 @@ class CPPEditorActionHandler : public TextEditor::TextEditorActionHandler
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
CPPEditorActionHandler(Core::ICore *core,
|
||||
const QString &context,
|
||||
CPPEditorActionHandler(const QString &context,
|
||||
uint optionalActions = None);
|
||||
virtual ~CPPEditorActionHandler();
|
||||
|
||||
|
||||
@@ -46,9 +46,8 @@ enum { debugWizard = 0 };
|
||||
|
||||
CppFileWizard::CppFileWizard(const BaseFileWizardParameters ¶meters,
|
||||
FileType type,
|
||||
Core::ICore *core,
|
||||
QObject *parent) :
|
||||
Core::StandardFileWizard(parameters, core, parent),
|
||||
Core::StandardFileWizard(parameters, parent),
|
||||
m_type(type)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -48,9 +48,9 @@ class CppFileWizard : public Core::StandardFileWizard
|
||||
public:
|
||||
typedef Core::BaseFileWizardParameters BaseFileWizardParameters;
|
||||
|
||||
explicit CppFileWizard(const BaseFileWizardParameters ¶meters,
|
||||
FileType type,
|
||||
Core::ICore *core, QObject *parent = 0);
|
||||
CppFileWizard(const BaseFileWizardParameters ¶meters,
|
||||
FileType type,
|
||||
QObject *parent = 0);
|
||||
|
||||
protected:
|
||||
static QString toAlphaNum(const QString &s);
|
||||
|
||||
@@ -39,6 +39,7 @@
|
||||
#include <coreplugin/uniqueidmanager.h>
|
||||
#include <coreplugin/editormanager/editormanager.h>
|
||||
#include <cpptools/cppmodelmanagerinterface.h>
|
||||
#include <extensionsystem/pluginmanager.h>
|
||||
#include <texteditor/itexteditor.h>
|
||||
#include <texteditor/basetexteditor.h>
|
||||
#include <debugger/debuggerconstants.h>
|
||||
@@ -55,23 +56,27 @@
|
||||
#include <cplusplus/TypeOfExpression.h>
|
||||
#include <cplusplus/SimpleLexer.h>
|
||||
|
||||
#include <QtCore/QDebug>
|
||||
#include <QtCore/QDir>
|
||||
#include <QtCore/QFileInfo>
|
||||
#include <QtCore/QSettings>
|
||||
#include <QtGui/QToolTip>
|
||||
#include <QtGui/QTextCursor>
|
||||
#include <QtGui/QTextBlock>
|
||||
#include <QtHelp/QHelpEngineCore>
|
||||
#include <QtCore/QtCore>
|
||||
|
||||
using namespace CppEditor::Internal;
|
||||
using namespace CPlusPlus;
|
||||
using namespace Core;
|
||||
|
||||
CppHoverHandler::CppHoverHandler(QObject *parent)
|
||||
: QObject(parent)
|
||||
, m_core(CppPlugin::core())
|
||||
, m_helpEngineNeedsSetup(false)
|
||||
{
|
||||
m_modelManager = m_core->pluginManager()->getObject<CppTools::CppModelManagerInterface>();
|
||||
m_modelManager = ExtensionSystem::PluginManager::instance()->getObject<CppTools::CppModelManagerInterface>();
|
||||
|
||||
QFileInfo fi(ExtensionSystem::PluginManager::instance()->getObject<Core::ICore>()->settings()->fileName());
|
||||
ICore *core = ICore::instance();
|
||||
QFileInfo fi(core->settings()->fileName());
|
||||
// FIXME shouldn't the help engine create the directory if it doesn't exist?
|
||||
QDir directory(fi.absolutePath()+"/qtcreator");
|
||||
if (!directory.exists())
|
||||
@@ -86,7 +91,7 @@ CppHoverHandler::CppHoverHandler(QObject *parent)
|
||||
m_helpEngineNeedsSetup = m_helpEngine->registeredDocumentations().count() == 0;
|
||||
|
||||
// Listen for editor opened events in order to connect to tooltip/helpid requests
|
||||
connect(m_core->editorManager(), SIGNAL(editorOpened(Core::IEditor *)),
|
||||
connect(core->editorManager(), SIGNAL(editorOpened(Core::IEditor *)),
|
||||
this, SLOT(editorOpened(Core::IEditor *)));
|
||||
}
|
||||
|
||||
@@ -95,7 +100,7 @@ void CppHoverHandler::updateContextHelpId(TextEditor::ITextEditor *editor, int p
|
||||
updateHelpIdAndTooltip(editor, pos);
|
||||
}
|
||||
|
||||
void CppHoverHandler::editorOpened(Core::IEditor *editor)
|
||||
void CppHoverHandler::editorOpened(IEditor *editor)
|
||||
{
|
||||
CPPEditorEditable *cppEditor = qobject_cast<CPPEditorEditable *>(editor);
|
||||
if (!cppEditor)
|
||||
@@ -113,9 +118,10 @@ void CppHoverHandler::showToolTip(TextEditor::ITextEditor *editor, const QPoint
|
||||
if (!editor)
|
||||
return;
|
||||
|
||||
const int dbgcontext = m_core->uniqueIDManager()->uniqueIdentifier(Debugger::Constants::C_GDBDEBUGGER);
|
||||
ICore *core = ICore::instance();
|
||||
const int dbgcontext = core->uniqueIDManager()->uniqueIdentifier(Debugger::Constants::C_GDBDEBUGGER);
|
||||
|
||||
if (m_core->hasContext(dbgcontext))
|
||||
if (core->hasContext(dbgcontext))
|
||||
return;
|
||||
|
||||
updateHelpIdAndTooltip(editor, pos);
|
||||
|
||||
@@ -42,7 +42,6 @@ class QPoint;
|
||||
QT_END_NAMESPACE
|
||||
|
||||
namespace Core {
|
||||
class ICore;
|
||||
class IEditor;
|
||||
}
|
||||
|
||||
@@ -74,7 +73,6 @@ private slots:
|
||||
private:
|
||||
void updateHelpIdAndTooltip(TextEditor::ITextEditor *editor, int pos);
|
||||
|
||||
Core::ICore *m_core;
|
||||
CppTools::CppModelManagerInterface *m_modelManager;
|
||||
QHelpEngineCore *m_helpEngine;
|
||||
QString m_helpId;
|
||||
|
||||
@@ -40,6 +40,7 @@
|
||||
#include "cppfilewizard.h"
|
||||
#include "cpphoverhandler.h"
|
||||
|
||||
#include <coreplugin/icore.h>
|
||||
#include <coreplugin/coreconstants.h>
|
||||
#include <coreplugin/mimedatabase.h>
|
||||
#include <coreplugin/uniqueidmanager.h>
|
||||
@@ -63,7 +64,7 @@ static const char *sourceSuffixKeyC = "CppEditor/SourceSuffix";
|
||||
|
||||
using namespace CppEditor::Internal;
|
||||
|
||||
///////////////////////////////// CppPluginEditorFactory //////////////////////////////////
|
||||
//////////////////////////// CppPluginEditorFactory /////////////////////////////
|
||||
|
||||
CppPluginEditorFactory::CppPluginEditorFactory(CppPlugin *owner) :
|
||||
m_kind(QLatin1String(CppEditor::Constants::CPPEDITOR_KIND)),
|
||||
@@ -87,7 +88,7 @@ QString CppPluginEditorFactory::kind() const
|
||||
|
||||
Core::IFile *CppPluginEditorFactory::open(const QString &fileName)
|
||||
{
|
||||
Core::IEditor *iface = m_owner->m_core->editorManager()->openEditor(fileName, kind());
|
||||
Core::IEditor *iface = Core::ICore::instance()->editorManager()->openEditor(fileName, kind());
|
||||
return iface ? iface->file() : 0;
|
||||
}
|
||||
|
||||
@@ -110,7 +111,6 @@ QStringList CppPluginEditorFactory::mimeTypes() const
|
||||
CppPlugin *CppPlugin::m_instance = 0;
|
||||
|
||||
CppPlugin::CppPlugin() :
|
||||
m_core(0),
|
||||
m_actionHandler(0),
|
||||
m_factory(0)
|
||||
{
|
||||
@@ -130,11 +130,6 @@ CppPlugin *CppPlugin::instance()
|
||||
return m_instance;
|
||||
}
|
||||
|
||||
Core::ICore *CppPlugin::core()
|
||||
{
|
||||
return m_instance->m_core;
|
||||
}
|
||||
|
||||
void CppPlugin::initializeEditor(CPPEditor *editor)
|
||||
{
|
||||
// common actions
|
||||
@@ -159,14 +154,13 @@ void CppPlugin::initializeEditor(CPPEditor *editor)
|
||||
|
||||
// auto completion
|
||||
connect(editor, SIGNAL(requestAutoCompletion(ITextEditable*, bool)),
|
||||
TextEditor::Internal::CompletionSupport::instance(core()), SLOT(autoComplete(ITextEditable*, bool)));
|
||||
TextEditor::Internal::CompletionSupport::instance(), SLOT(autoComplete(ITextEditable*, bool)));
|
||||
}
|
||||
|
||||
bool CppPlugin::initialize(const QStringList & /*arguments*/, QString *errorMessage)
|
||||
{
|
||||
typedef TextEditor::TextEditorActionHandler TextEditorActionHandler;
|
||||
m_core = ExtensionSystem::PluginManager::instance()->getObject<Core::ICore>();
|
||||
if (!m_core->mimeDatabase()->addMimeTypes(QLatin1String(":/cppeditor/CppEditor.mimetypes.xml"), errorMessage))
|
||||
Core::ICore *core = Core::ICore::instance();
|
||||
if (!core->mimeDatabase()->addMimeTypes(QLatin1String(":/cppeditor/CppEditor.mimetypes.xml"), errorMessage))
|
||||
return false;
|
||||
|
||||
m_factory = new CppPluginEditorFactory(this);
|
||||
@@ -180,21 +174,21 @@ bool CppPlugin::initialize(const QStringList & /*arguments*/, QString *errorMess
|
||||
wizardParameters.setTrCategory(tr("C++"));
|
||||
wizardParameters.setDescription(tr("Creates a new C++ header file."));
|
||||
wizardParameters.setName(tr("C++ Header File"));
|
||||
addAutoReleasedObject(new CppFileWizard(wizardParameters, Header, m_core));
|
||||
addAutoReleasedObject(new CppFileWizard(wizardParameters, Header, core));
|
||||
|
||||
wizardParameters.setDescription(tr("Creates a new C++ source file."));
|
||||
wizardParameters.setName(tr("C++ Source File"));
|
||||
addAutoReleasedObject(new CppFileWizard(wizardParameters, Source, m_core));
|
||||
addAutoReleasedObject(new CppFileWizard(wizardParameters, Source, core));
|
||||
|
||||
wizardParameters.setKind(Core::IWizard::ClassWizard);
|
||||
wizardParameters.setName(tr("C++ Class"));
|
||||
wizardParameters.setDescription(tr("Creates a header and a source file for a new class."));
|
||||
addAutoReleasedObject(new CppClassWizard(wizardParameters, m_core));
|
||||
addAutoReleasedObject(new CppClassWizard(wizardParameters, core));
|
||||
|
||||
QList<int> context;
|
||||
context << m_core->uniqueIDManager()->uniqueIdentifier(CppEditor::Constants::C_CPPEDITOR);
|
||||
context << core->uniqueIDManager()->uniqueIdentifier(CppEditor::Constants::C_CPPEDITOR);
|
||||
|
||||
Core::ActionManager *am = m_core->actionManager();
|
||||
Core::ActionManager *am = core->actionManager();
|
||||
am->createMenu(CppEditor::Constants::M_CONTEXT);
|
||||
|
||||
Core::Command *cmd;
|
||||
@@ -217,22 +211,21 @@ bool CppPlugin::initialize(const QStringList & /*arguments*/, QString *errorMess
|
||||
am->actionContainer(CppEditor::Constants::M_CONTEXT)->addAction(cmd);
|
||||
am->actionContainer(CppTools::Constants::M_TOOLS_CPP)->addAction(cmd);
|
||||
|
||||
m_actionHandler = new CPPEditorActionHandler(m_core,
|
||||
CppEditor::Constants::C_CPPEDITOR,
|
||||
m_actionHandler = new CPPEditorActionHandler(CppEditor::Constants::C_CPPEDITOR,
|
||||
TextEditor::TextEditorActionHandler::Format
|
||||
| TextEditor::TextEditorActionHandler::UnCommentSelection
|
||||
| TextEditor::TextEditorActionHandler::UnCollapseAll);
|
||||
|
||||
// Check Suffixes
|
||||
if (const QSettings *settings = m_core->settings()) {
|
||||
if (const QSettings *settings = core->settings()) {
|
||||
const QString headerSuffixKey = QLatin1String(headerSuffixKeyC);
|
||||
if (settings->contains(headerSuffixKey)) {
|
||||
const QString headerSuffix = settings->value(headerSuffixKey, QString()).toString();
|
||||
if (!headerSuffix.isEmpty())
|
||||
m_core->mimeDatabase()->setPreferredSuffix(QLatin1String(Constants::CPP_HEADER_MIMETYPE), headerSuffix);
|
||||
core->mimeDatabase()->setPreferredSuffix(QLatin1String(Constants::CPP_HEADER_MIMETYPE), headerSuffix);
|
||||
const QString sourceSuffix = settings->value(QLatin1String(sourceSuffixKeyC), QString()).toString();
|
||||
if (!sourceSuffix.isEmpty())
|
||||
m_core->mimeDatabase()->setPreferredSuffix(QLatin1String(Constants::CPP_SOURCE_MIMETYPE), sourceSuffix);
|
||||
core->mimeDatabase()->setPreferredSuffix(QLatin1String(Constants::CPP_SOURCE_MIMETYPE), sourceSuffix);
|
||||
}
|
||||
}
|
||||
return true;
|
||||
@@ -245,7 +238,8 @@ void CppPlugin::extensionsInitialized()
|
||||
|
||||
void CppPlugin::switchDeclarationDefinition()
|
||||
{
|
||||
CPPEditor *editor = qobject_cast<CPPEditor*>(m_core->editorManager()->currentEditor()->widget());
|
||||
Core::ICore *core = Core::ICore::instance();
|
||||
CPPEditor *editor = qobject_cast<CPPEditor*>(core->editorManager()->currentEditor()->widget());
|
||||
if (editor) {
|
||||
editor->switchDeclarationDefinition();
|
||||
}
|
||||
@@ -253,7 +247,8 @@ void CppPlugin::switchDeclarationDefinition()
|
||||
|
||||
void CppPlugin::jumpToDefinition()
|
||||
{
|
||||
CPPEditor *editor = qobject_cast<CPPEditor*>(m_core->editorManager()->currentEditor()->widget());
|
||||
Core::ICore *core = Core::ICore::instance();
|
||||
CPPEditor *editor = qobject_cast<CPPEditor*>(core->editorManager()->currentEditor()->widget());
|
||||
if (editor) {
|
||||
editor->jumpToDefinition();
|
||||
}
|
||||
|
||||
@@ -65,7 +65,6 @@ public:
|
||||
~CppPlugin();
|
||||
|
||||
static CppPlugin *instance();
|
||||
static Core::ICore *core();
|
||||
|
||||
bool initialize(const QStringList &arguments, QString *error_message = 0);
|
||||
void extensionsInitialized();
|
||||
|
||||
@@ -51,6 +51,7 @@
|
||||
#include <coreplugin/editormanager/editormanager.h>
|
||||
#include <coreplugin/progressmanager/progressmanager.h>
|
||||
|
||||
#include <extensionsystem/pluginmanager.h>
|
||||
#include <utils/qtcassert.h>
|
||||
|
||||
#include <TranslationUnit.h>
|
||||
@@ -69,8 +70,6 @@
|
||||
#include <QtCore/QMutexLocker>
|
||||
#include <QtCore/QTime>
|
||||
|
||||
//#include <QtGui/QPlainTextEdit>
|
||||
|
||||
using namespace CppTools;
|
||||
using namespace CppTools::Internal;
|
||||
using namespace CPlusPlus;
|
||||
@@ -434,10 +433,10 @@ Document::Ptr CppPreprocessor::switchDocument(Document::Ptr doc)
|
||||
modified within Workbench.
|
||||
*/
|
||||
|
||||
CppModelManager::CppModelManager(QObject *parent) :
|
||||
CppModelManagerInterface(parent),
|
||||
m_core(ExtensionSystem::PluginManager::instance()->getObject<Core::ICore>())
|
||||
CppModelManager::CppModelManager(QObject *parent)
|
||||
: CppModelManagerInterface(parent)
|
||||
{
|
||||
m_core = Core::ICore::instance(); // FIXME
|
||||
m_dirty = true;
|
||||
|
||||
m_projectExplorer = ExtensionSystem::PluginManager::instance()
|
||||
|
||||
@@ -46,7 +46,7 @@ namespace ProjectExplorer {
|
||||
|
||||
namespace CppTools {
|
||||
|
||||
class CPPTOOLS_EXPORT CppModelManagerInterface: public QObject
|
||||
class CPPTOOLS_EXPORT CppModelManagerInterface : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
|
||||
@@ -48,8 +48,9 @@
|
||||
#include <coreplugin/actionmanager/actionmanager.h>
|
||||
#include <coreplugin/editormanager/editormanager.h>
|
||||
#include <cppeditor/cppeditorconstants.h>
|
||||
#include <extensionsystem/pluginmanager.h>
|
||||
|
||||
#include <QtCore/qplugin.h>
|
||||
#include <QtCore/QtPlugin>
|
||||
#include <QtCore/QFileInfo>
|
||||
#include <QtCore/QDir>
|
||||
#include <QtCore/QDebug>
|
||||
@@ -64,10 +65,8 @@ enum { debug = 0 };
|
||||
|
||||
CppToolsPlugin *CppToolsPlugin::m_instance = 0;
|
||||
|
||||
CppToolsPlugin::CppToolsPlugin() :
|
||||
m_core(0),
|
||||
m_context(-1),
|
||||
m_modelManager(0)
|
||||
CppToolsPlugin::CppToolsPlugin()
|
||||
: m_context(-1), m_modelManager(0)
|
||||
{
|
||||
m_instance = this;
|
||||
}
|
||||
@@ -78,21 +77,23 @@ CppToolsPlugin::~CppToolsPlugin()
|
||||
m_modelManager = 0; // deleted automatically
|
||||
}
|
||||
|
||||
bool CppToolsPlugin::initialize(const QStringList & /*arguments*/, QString *)
|
||||
bool CppToolsPlugin::initialize(const QStringList &arguments, QString *error)
|
||||
{
|
||||
m_core = ExtensionSystem::PluginManager::instance()->getObject<Core::ICore>();
|
||||
Core::ActionManager *am = m_core->actionManager();
|
||||
Q_UNUSED(arguments);
|
||||
Q_UNUSED(error);
|
||||
Core::ICore *core = Core::ICore::instance();
|
||||
Core::ActionManager *am = core->actionManager();
|
||||
|
||||
// Objects
|
||||
m_modelManager = new CppModelManager(this);
|
||||
addAutoReleasedObject(m_modelManager);
|
||||
m_completion = new CppCodeCompletion(m_modelManager, m_core);
|
||||
m_completion = new CppCodeCompletion(m_modelManager, core);
|
||||
addAutoReleasedObject(m_completion);
|
||||
CppQuickOpenFilter *quickOpenFilter = new CppQuickOpenFilter(m_modelManager,
|
||||
m_core->editorManager());
|
||||
core->editorManager());
|
||||
addAutoReleasedObject(quickOpenFilter);
|
||||
addAutoReleasedObject(new CppClassesFilter(m_modelManager, m_core->editorManager()));
|
||||
addAutoReleasedObject(new CppFunctionsFilter(m_modelManager, m_core->editorManager()));
|
||||
addAutoReleasedObject(new CppClassesFilter(m_modelManager, core->editorManager()));
|
||||
addAutoReleasedObject(new CppFunctionsFilter(m_modelManager, core->editorManager()));
|
||||
addAutoReleasedObject(new CompletionSettingsPage(m_completion));
|
||||
|
||||
// Menus
|
||||
@@ -104,7 +105,7 @@ bool CppToolsPlugin::initialize(const QStringList & /*arguments*/, QString *)
|
||||
mtools->addMenu(mcpptools);
|
||||
|
||||
// Actions
|
||||
m_context = m_core->uniqueIDManager()->uniqueIdentifier(CppEditor::Constants::C_CPPEDITOR);
|
||||
m_context = core->uniqueIDManager()->uniqueIdentifier(CppEditor::Constants::C_CPPEDITOR);
|
||||
QList<int> context = QList<int>() << m_context;
|
||||
|
||||
QAction *switchAction = new QAction(tr("Switch Header/Source"), this);
|
||||
@@ -114,7 +115,7 @@ bool CppToolsPlugin::initialize(const QStringList & /*arguments*/, QString *)
|
||||
connect(switchAction, SIGNAL(triggered()), this, SLOT(switchHeaderSource()));
|
||||
|
||||
// Restore settings
|
||||
QSettings *settings = m_core->settings();
|
||||
QSettings *settings = Core::ICore::instance()->settings();
|
||||
settings->beginGroup(QLatin1String("CppTools"));
|
||||
settings->beginGroup(QLatin1String("Completion"));
|
||||
const bool caseSensitive = settings->value(QLatin1String("CaseSensitive"), true).toBool();
|
||||
@@ -134,7 +135,7 @@ void CppToolsPlugin::extensionsInitialized()
|
||||
void CppToolsPlugin::shutdown()
|
||||
{
|
||||
// Save settings
|
||||
QSettings *settings = m_core->settings();
|
||||
QSettings *settings = Core::ICore::instance()->settings();
|
||||
settings->beginGroup(QLatin1String("CppTools"));
|
||||
settings->beginGroup(QLatin1String("Completion"));
|
||||
settings->setValue(QLatin1String("CaseSensitive"), m_completion->caseSensitivity() == Qt::CaseSensitive);
|
||||
@@ -146,14 +147,12 @@ void CppToolsPlugin::shutdown()
|
||||
|
||||
void CppToolsPlugin::switchHeaderSource()
|
||||
{
|
||||
if (!m_core)
|
||||
return;
|
||||
|
||||
Core::IEditor *editor = m_core->editorManager()->currentEditor();
|
||||
Core::EditorManager *editorManager = Core::ICore::instance()->editorManager();
|
||||
Core::IEditor *editor = editorManager->currentEditor();
|
||||
QString otherFile = correspondingHeaderOrSource(editor->file()->fileName());
|
||||
if (!otherFile.isEmpty()) {
|
||||
m_core->editorManager()->openEditor(otherFile);
|
||||
m_core->editorManager()->ensureEditorManagerVisible();
|
||||
editorManager->openEditor(otherFile);
|
||||
editorManager->ensureEditorManagerVisible();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -221,7 +220,7 @@ static QStringList matchingCandidateSuffixes(const Core::MimeDatabase *mimeDatas
|
||||
|
||||
QString CppToolsPlugin::correspondingHeaderOrSourceI(const QString &fileName) const
|
||||
{
|
||||
const Core::ICore *core = ExtensionSystem::PluginManager::instance()->getObject<Core::ICore>();
|
||||
const Core::ICore *core = Core::ICore::instance();
|
||||
const Core::MimeDatabase *mimeDatase = core->mimeDatabase();
|
||||
ProjectExplorer::ProjectExplorerPlugin *explorer =
|
||||
ExtensionSystem::PluginManager::instance()->getObject<ProjectExplorer::ProjectExplorerPlugin>();
|
||||
|
||||
@@ -35,17 +35,13 @@
|
||||
#define CPPTOOLS_H
|
||||
|
||||
#include <extensionsystem/iplugin.h>
|
||||
#include <projectexplorer/ProjectExplorerInterfaces>
|
||||
#include <projectexplorer/projectexplorer.h>
|
||||
|
||||
QT_BEGIN_NAMESPACE
|
||||
class QFileInfo;
|
||||
class QDir;
|
||||
QT_END_NAMESPACE
|
||||
|
||||
namespace Core {
|
||||
class ICore;
|
||||
}
|
||||
|
||||
namespace CppTools {
|
||||
namespace Internal {
|
||||
|
||||
@@ -75,7 +71,6 @@ private:
|
||||
QString correspondingHeaderOrSourceI(const QString &fileName) const;
|
||||
QFileInfo findFile(const QDir &dir, const QString &name, const ProjectExplorer::Project *project) const;
|
||||
|
||||
Core::ICore *m_core;
|
||||
int m_context;
|
||||
CppModelManager *m_modelManager;
|
||||
CppCodeCompletion *m_completion;
|
||||
|
||||
@@ -26,11 +26,11 @@ HEADERS += attachexternaldialog.h \
|
||||
disassemblerwindow.h \
|
||||
gdbengine.h \
|
||||
gdbmi.h \
|
||||
gdboptionpage.h \
|
||||
idebuggerengine.h \
|
||||
imports.h \
|
||||
moduleshandler.h \
|
||||
moduleswindow.h \
|
||||
outputcollector.h \
|
||||
procinterrupt.h \
|
||||
registerhandler.h \
|
||||
registerwindow.h \
|
||||
@@ -55,10 +55,9 @@ SOURCES += attachexternaldialog.cpp \
|
||||
disassemblerwindow.cpp \
|
||||
gdbengine.cpp \
|
||||
gdbmi.cpp \
|
||||
gdboptionpage.cpp \
|
||||
gdbengine.h \
|
||||
moduleshandler.cpp \
|
||||
moduleswindow.cpp \
|
||||
outputcollector.cpp \
|
||||
procinterrupt.cpp \
|
||||
registerhandler.cpp \
|
||||
registerwindow.cpp \
|
||||
|
||||
@@ -86,6 +86,18 @@ using namespace Debugger::Constants;
|
||||
|
||||
static const QString tooltipIName = "tooltip";
|
||||
|
||||
|
||||
DebuggerSettings::DebuggerSettings()
|
||||
{
|
||||
m_autoRun = false;
|
||||
m_autoQuit = false;
|
||||
m_skipKnownFrames = false;
|
||||
m_debugDumpers = false;
|
||||
m_useToolTips = false;
|
||||
m_useTerminal = false;
|
||||
m_useCustomDumpers = true;
|
||||
}
|
||||
|
||||
///////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// BreakByFunctionDialog
|
||||
@@ -322,56 +334,6 @@ void DebuggerManager::init()
|
||||
m_breakAtMainAction = new QAction(this);
|
||||
m_breakAtMainAction->setText(tr("Set Breakpoint at Function 'main'"));
|
||||
|
||||
m_debugDumpersAction = new QAction(this);
|
||||
m_debugDumpersAction->setText(tr("Debug Custom Dumpers"));
|
||||
m_debugDumpersAction->setToolTip(tr("This is an internal tool to "
|
||||
"make debugging the Custom Data Dumper code easier. "
|
||||
"Using this action is in general not needed unless you "
|
||||
"want do debug Qt Creator itself."));
|
||||
m_debugDumpersAction->setCheckable(true);
|
||||
|
||||
m_skipKnownFramesAction = new QAction(this);
|
||||
m_skipKnownFramesAction->setText(tr("Skip Known Frames When Stepping"));
|
||||
m_skipKnownFramesAction->setToolTip(tr("After checking this option"
|
||||
"'Step Into' combines in certain situations several steps, "
|
||||
"leading to 'less noisy' debugging. So will, e.g., the atomic "
|
||||
"reference counting code be skipped, and a single 'Step Into' "
|
||||
"for a signal emission will end up directly in the slot connected "
|
||||
"to it"));
|
||||
m_skipKnownFramesAction->setCheckable(true);
|
||||
|
||||
m_useCustomDumpersAction = new QAction(this);
|
||||
m_useCustomDumpersAction->setText(tr("Use Custom Display for Qt Objects"));
|
||||
m_useCustomDumpersAction->setToolTip(tr("Checking this will make the debugger "
|
||||
"try to use code to format certain data (QObject, QString, ...) nicely. "));
|
||||
m_useCustomDumpersAction->setCheckable(true);
|
||||
m_useCustomDumpersAction->setChecked(true);
|
||||
|
||||
m_useFastStartAction = new QAction(this);
|
||||
m_useFastStartAction->setText(tr("Fast Debugger Start"));
|
||||
m_useFastStartAction->setToolTip(tr("Checking this will make the debugger "
|
||||
"start fast by loading only very few debug symbols on start up. This "
|
||||
"might lead to situations where breakpoints can not be set properly. "
|
||||
"So uncheck this option if you experience breakpoint related problems."));
|
||||
m_useFastStartAction->setCheckable(true);
|
||||
m_useFastStartAction->setChecked(true);
|
||||
|
||||
m_useToolTipsAction = new QAction(this);
|
||||
m_useToolTipsAction->setText(tr("Use Tooltips While Debugging"));
|
||||
m_useToolTipsAction->setToolTip(tr("Checking this will make enable "
|
||||
"tooltips for variable values during debugging. Since this can slow "
|
||||
"down debugging and does not provide reliable information as it does "
|
||||
"not use scope information, it is switched off by default."));
|
||||
m_useToolTipsAction->setCheckable(true);
|
||||
m_useToolTipsAction->setChecked(false);
|
||||
|
||||
// FIXME
|
||||
m_useFastStartAction->setChecked(false);
|
||||
m_useFastStartAction->setEnabled(false);
|
||||
|
||||
m_dumpLogAction = new QAction(this);
|
||||
m_dumpLogAction->setText(tr("Dump Log File for Debugging Purposes"));
|
||||
|
||||
m_watchAction = new QAction(this);
|
||||
m_watchAction->setText(tr("Add to Watch Window"));
|
||||
|
||||
@@ -416,14 +378,6 @@ void DebuggerManager::init()
|
||||
connect(m_breakAtMainAction, SIGNAL(triggered()),
|
||||
this, SLOT(breakAtMain()));
|
||||
|
||||
connect(m_useFastStartAction, SIGNAL(triggered()),
|
||||
this, SLOT(saveSessionData()));
|
||||
connect(m_useCustomDumpersAction, SIGNAL(triggered()),
|
||||
this, SLOT(saveSessionData()));
|
||||
connect(m_skipKnownFramesAction, SIGNAL(triggered()),
|
||||
this, SLOT(saveSessionData()));
|
||||
connect(m_dumpLogAction, SIGNAL(triggered()),
|
||||
this, SLOT(dumpLog()));
|
||||
connect(m_statusTimer, SIGNAL(timeout()),
|
||||
this, SLOT(clearStatusMessage()));
|
||||
|
||||
@@ -636,9 +590,9 @@ void DebuggerManager::notifyInferiorPidChanged(int pid)
|
||||
emit inferiorPidChanged(pid);
|
||||
}
|
||||
|
||||
void DebuggerManager::showApplicationOutput(const QString &prefix, const QString &str)
|
||||
void DebuggerManager::showApplicationOutput(const QString &str)
|
||||
{
|
||||
emit applicationOutputAvailable(prefix, str);
|
||||
emit applicationOutputAvailable(str);
|
||||
}
|
||||
|
||||
void DebuggerManager::shutdown()
|
||||
@@ -947,16 +901,6 @@ void DebuggerManager::loadSessionData()
|
||||
{
|
||||
m_breakHandler->loadSessionData();
|
||||
m_watchHandler->loadSessionData();
|
||||
|
||||
QVariant value;
|
||||
querySessionValue(QLatin1String("UseFastStart"), &value);
|
||||
m_useFastStartAction->setChecked(value.toBool());
|
||||
querySessionValue(QLatin1String("UseToolTips"), &value);
|
||||
m_useToolTipsAction->setChecked(value.toBool());
|
||||
querySessionValue(QLatin1String("UseCustomDumpers"), &value);
|
||||
m_useCustomDumpersAction->setChecked(!value.isValid() || value.toBool());
|
||||
querySessionValue(QLatin1String("SkipKnownFrames"), &value);
|
||||
m_skipKnownFramesAction->setChecked(value.toBool());
|
||||
engine()->loadSessionData();
|
||||
}
|
||||
|
||||
@@ -964,15 +908,6 @@ void DebuggerManager::saveSessionData()
|
||||
{
|
||||
m_breakHandler->saveSessionData();
|
||||
m_watchHandler->saveSessionData();
|
||||
|
||||
setSessionValue(QLatin1String("UseFastStart"),
|
||||
m_useFastStartAction->isChecked());
|
||||
setSessionValue(QLatin1String("UseToolTips"),
|
||||
m_useToolTipsAction->isChecked());
|
||||
setSessionValue(QLatin1String("UseCustomDumpers"),
|
||||
m_useCustomDumpersAction->isChecked());
|
||||
setSessionValue(QLatin1String("SkipKnownFrames"),
|
||||
m_skipKnownFramesAction->isChecked());
|
||||
engine()->saveSessionData();
|
||||
}
|
||||
|
||||
@@ -1139,22 +1074,22 @@ void DebuggerManager::setBusyCursor(bool busy)
|
||||
|
||||
bool DebuggerManager::skipKnownFrames() const
|
||||
{
|
||||
return m_skipKnownFramesAction->isChecked();
|
||||
return m_settings.m_skipKnownFrames;
|
||||
}
|
||||
|
||||
bool DebuggerManager::debugDumpers() const
|
||||
{
|
||||
return m_debugDumpersAction->isChecked();
|
||||
return m_settings.m_debugDumpers;
|
||||
}
|
||||
|
||||
bool DebuggerManager::useCustomDumpers() const
|
||||
{
|
||||
return m_useCustomDumpersAction->isChecked();
|
||||
return m_settings.m_useCustomDumpers;
|
||||
}
|
||||
|
||||
bool DebuggerManager::useFastStart() const
|
||||
{
|
||||
return 0; // && m_useFastStartAction->isChecked();
|
||||
return 0; // && m_settings.m_useFastStart;
|
||||
}
|
||||
|
||||
void DebuggerManager::queryCurrentTextEditor(QString *fileName, int *lineNumber,
|
||||
|
||||
@@ -166,9 +166,9 @@ private:
|
||||
virtual ThreadsHandler *threadsHandler() = 0;
|
||||
virtual WatchHandler *watchHandler() = 0;
|
||||
|
||||
virtual void showApplicationOutput(const QString &prefix, const QString &data) = 0;
|
||||
virtual QAction *useCustomDumpersAction() const = 0;
|
||||
virtual QAction *debugDumpersAction() const = 0;
|
||||
virtual void showApplicationOutput(const QString &data) = 0;
|
||||
//virtual QAction *useCustomDumpersAction() const = 0;
|
||||
//virtual QAction *debugDumpersAction() const = 0;
|
||||
virtual bool skipKnownFrames() const = 0;
|
||||
virtual bool debugDumpers() const = 0;
|
||||
virtual bool useCustomDumpers() const = 0;
|
||||
@@ -180,6 +180,31 @@ private:
|
||||
};
|
||||
|
||||
|
||||
//
|
||||
// DebuggerSettings
|
||||
//
|
||||
|
||||
class DebuggerSettings
|
||||
{
|
||||
public:
|
||||
DebuggerSettings();
|
||||
|
||||
public:
|
||||
QString m_gdbCmd;
|
||||
QString m_gdbEnv;
|
||||
bool m_autoRun;
|
||||
bool m_autoQuit;
|
||||
|
||||
bool m_useCustomDumpers;
|
||||
bool m_skipKnownFrames;
|
||||
bool m_debugDumpers;
|
||||
bool m_useFastStart;
|
||||
bool m_useToolTips;
|
||||
bool m_useTerminal;
|
||||
|
||||
QString m_scriptFile;
|
||||
};
|
||||
|
||||
//
|
||||
// DebuggerManager
|
||||
//
|
||||
@@ -196,6 +221,7 @@ public:
|
||||
IDebuggerManagerAccessForEngines *engineInterface();
|
||||
QMainWindow *mainWindow() const { return m_mainWindow; }
|
||||
QLabel *statusLabel() const { return m_statusLabel; }
|
||||
DebuggerSettings *settings() { return &m_settings; }
|
||||
|
||||
enum StartMode { startInternal, startExternal, attachExternal };
|
||||
enum DebuggerType { GdbDebugger, ScriptDebugger, WinDebugger };
|
||||
@@ -260,7 +286,7 @@ public slots:
|
||||
private slots:
|
||||
void showDebuggerOutput(const QString &prefix, const QString &msg);
|
||||
void showDebuggerInput(const QString &prefix, const QString &msg);
|
||||
void showApplicationOutput(const QString &prefix, const QString &msg);
|
||||
void showApplicationOutput(const QString &data);
|
||||
|
||||
void reloadDisassembler();
|
||||
void disassemblerDockToggled(bool on);
|
||||
@@ -286,9 +312,9 @@ private:
|
||||
StackHandler *stackHandler() { return m_stackHandler; }
|
||||
ThreadsHandler *threadsHandler() { return m_threadsHandler; }
|
||||
WatchHandler *watchHandler() { return m_watchHandler; }
|
||||
QAction *useCustomDumpersAction() const { return m_useCustomDumpersAction; }
|
||||
QAction *useToolTipsAction() const { return m_useToolTipsAction; }
|
||||
QAction *debugDumpersAction() const { return m_debugDumpersAction; }
|
||||
//QAction *useCustomDumpersAction() const { return m_useCustomDumpersAction; }
|
||||
//QAction *useToolTipsAction() const { return m_useToolTipsAction; }
|
||||
//QAction *debugDumpersAction() const { return m_debugDumpersAction; }
|
||||
bool skipKnownFrames() const;
|
||||
bool debugDumpers() const;
|
||||
bool useCustomDumpers() const;
|
||||
@@ -340,8 +366,7 @@ signals:
|
||||
void setSessionValueRequested(const QString &name, const QVariant &value);
|
||||
void configValueRequested(const QString &name, QVariant *value);
|
||||
void setConfigValueRequested(const QString &name, const QVariant &value);
|
||||
void applicationOutputAvailable(const QString &prefix, const QString &msg);
|
||||
|
||||
void applicationOutputAvailable(const QString &output);
|
||||
|
||||
public:
|
||||
// FIXME: make private
|
||||
@@ -406,13 +431,6 @@ private:
|
||||
QAction *m_sepAction;
|
||||
QAction *m_stepIAction;
|
||||
QAction *m_nextIAction;
|
||||
QAction *m_skipKnownFramesAction;
|
||||
|
||||
QAction *m_debugDumpersAction;
|
||||
QAction *m_useCustomDumpersAction;
|
||||
QAction *m_useFastStartAction;
|
||||
QAction *m_useToolTipsAction;
|
||||
QAction *m_dumpLogAction;
|
||||
|
||||
QWidget *m_breakWindow;
|
||||
QWidget *m_disassemblerWindow;
|
||||
@@ -432,9 +450,9 @@ private:
|
||||
|
||||
IDebuggerEngine *engine();
|
||||
IDebuggerEngine *m_engine;
|
||||
DebuggerSettings m_settings;
|
||||
};
|
||||
|
||||
|
||||
} // namespace Internal
|
||||
} // namespace Debugger
|
||||
|
||||
|
||||
@@ -36,12 +36,14 @@
|
||||
#include "debuggerconstants.h"
|
||||
#include "debuggermanager.h"
|
||||
#include "debuggerrunner.h"
|
||||
#include "gdboptionpage.h"
|
||||
#include "gdbengine.h"
|
||||
|
||||
#include "ui_gdboptionpage.h"
|
||||
|
||||
#include <coreplugin/actionmanager/actionmanager.h>
|
||||
#include <coreplugin/basemode.h>
|
||||
#include <coreplugin/coreconstants.h>
|
||||
#include <coreplugin/dialogs/ioptionspage.h>
|
||||
#include <coreplugin/editormanager/editormanager.h>
|
||||
#include <coreplugin/findplaceholder.h>
|
||||
#include <coreplugin/icore.h>
|
||||
@@ -57,6 +59,8 @@
|
||||
|
||||
#include <cppeditor/cppeditorconstants.h>
|
||||
|
||||
#include <extensionsystem/pluginmanager.h>
|
||||
|
||||
#include <projectexplorer/projectexplorerconstants.h>
|
||||
#include <projectexplorer/session.h>
|
||||
|
||||
@@ -73,6 +77,7 @@
|
||||
#include <QtCore/QSettings>
|
||||
#include <QtCore/QtPlugin>
|
||||
|
||||
#include <QtGui/QLineEdit>
|
||||
#include <QtGui/QDockWidget>
|
||||
#include <QtGui/QMainWindow>
|
||||
#include <QtGui/QPlainTextEdit>
|
||||
@@ -80,6 +85,8 @@
|
||||
#include <QtGui/QTextCursor>
|
||||
|
||||
|
||||
namespace ExtensionSystem { class PluginManager; }
|
||||
|
||||
using namespace Core;
|
||||
using namespace Debugger::Constants;
|
||||
using namespace Debugger::Internal;
|
||||
@@ -99,13 +106,7 @@ const char * const JUMP_TO_LINE = "Debugger.JumpToLine";
|
||||
const char * const TOGGLE_BREAK = "Debugger.ToggleBreak";
|
||||
const char * const BREAK_BY_FUNCTION = "Debugger.BreakByFunction";
|
||||
const char * const BREAK_AT_MAIN = "Debugger.BreakAtMain";
|
||||
const char * const DEBUG_DUMPERS = "Debugger.DebugDumpers";
|
||||
const char * const ADD_TO_WATCH = "Debugger.AddToWatch";
|
||||
const char * const USE_CUSTOM_DUMPERS = "Debugger.UseCustomDumpers";
|
||||
const char * const USE_FAST_START = "Debugger.UseFastStart";
|
||||
const char * const USE_TOOL_TIPS = "Debugger.UseToolTips";
|
||||
const char * const SKIP_KNOWN_FRAMES = "Debugger.SkipKnownFrames";
|
||||
const char * const DUMP_LOG = "Debugger.DumpLog";
|
||||
|
||||
#ifdef Q_OS_MAC
|
||||
const char * const INTERRUPT_KEY = "Shift+F5";
|
||||
@@ -143,6 +144,12 @@ const char * const ADD_TO_WATCH_KEY = "Ctrl+Alt+Q";
|
||||
} // namespace Debugger
|
||||
|
||||
|
||||
///////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// DebugMode
|
||||
//
|
||||
///////////////////////////////////////////////////////////////////////
|
||||
|
||||
namespace Debugger {
|
||||
namespace Internal {
|
||||
|
||||
@@ -159,9 +166,6 @@ public:
|
||||
void shutdown() {}
|
||||
};
|
||||
|
||||
} // namespace Internal
|
||||
} // namespace Debugger
|
||||
|
||||
DebugMode::DebugMode(QObject *parent)
|
||||
: BaseMode(parent)
|
||||
{
|
||||
@@ -177,6 +181,9 @@ DebugMode::~DebugMode()
|
||||
EditorManager::instance()->setParent(0);
|
||||
}
|
||||
|
||||
} // namespace Internal
|
||||
} // namespace Debugger
|
||||
|
||||
|
||||
///////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
@@ -184,8 +191,10 @@ DebugMode::~DebugMode()
|
||||
//
|
||||
///////////////////////////////////////////////////////////////////////
|
||||
|
||||
class Debugger::Internal::LocationMark
|
||||
: public TextEditor::BaseTextMark
|
||||
namespace Debugger {
|
||||
namespace Internal {
|
||||
|
||||
class LocationMark : public TextEditor::BaseTextMark
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
@@ -212,6 +221,110 @@ QIcon LocationMark::icon() const
|
||||
return icon;
|
||||
}
|
||||
|
||||
} // namespace Internal
|
||||
} // namespace Debugger
|
||||
|
||||
|
||||
///////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// GdbOptionPage
|
||||
//
|
||||
///////////////////////////////////////////////////////////////////////
|
||||
|
||||
namespace Debugger {
|
||||
namespace Internal {
|
||||
|
||||
class GdbOptionPage : public Core::IOptionsPage
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
GdbOptionPage(DebuggerPlugin *plugin) : m_plugin(plugin) {}
|
||||
|
||||
// IOptionsPage
|
||||
QString name() const { return tr("Gdb"); }
|
||||
QString category() const { return "Debugger"; }
|
||||
QString trCategory() const { return tr("Debugger"); }
|
||||
|
||||
QWidget *createPage(QWidget *parent);
|
||||
void apply();
|
||||
void finish() {} // automatically calls "apply"
|
||||
|
||||
private:
|
||||
Ui::GdbOptionPage m_ui;
|
||||
|
||||
DebuggerSettings m_settings;
|
||||
DebuggerPlugin *m_plugin;
|
||||
};
|
||||
|
||||
QWidget *GdbOptionPage::createPage(QWidget *parent)
|
||||
{
|
||||
QWidget *w = new QWidget(parent);
|
||||
m_settings = *m_plugin->m_manager->settings();
|
||||
m_ui.setupUi(w);
|
||||
m_ui.gdbLocationChooser->setExpectedKind(Core::Utils::PathChooser::Command);
|
||||
m_ui.gdbLocationChooser->setPromptDialogTitle(tr("Choose Gdb Location"));
|
||||
m_ui.gdbLocationChooser->setPath(m_settings.m_gdbCmd);
|
||||
m_ui.scriptFileChooser->setExpectedKind(Core::Utils::PathChooser::File);
|
||||
m_ui.scriptFileChooser->setPromptDialogTitle(tr("Choose Location of Startup Script File"));
|
||||
m_ui.scriptFileChooser->setPath(m_settings.m_scriptFile);
|
||||
m_ui.environmentEdit->setText(m_settings.m_gdbEnv);
|
||||
m_ui.autoStartBox->setChecked(m_settings.m_autoRun);
|
||||
m_ui.autoQuitBox->setChecked(m_settings.m_autoQuit);
|
||||
|
||||
m_ui.checkBoxSkipKnownFrames->setChecked(m_settings.m_skipKnownFrames);
|
||||
m_ui.checkBoxDebugDumpers->setChecked(m_settings.m_debugDumpers);
|
||||
m_ui.checkBoxUseCustomDumpers->setChecked(m_settings.m_useCustomDumpers);
|
||||
m_ui.checkBoxFastStart->setChecked(m_settings.m_useFastStart);
|
||||
m_ui.checkBoxUseToolTips->setChecked(m_settings.m_useToolTips);
|
||||
m_ui.checkBoxUseTerminal->setChecked(m_settings.m_useTerminal);
|
||||
|
||||
#ifndef QT_DEBUG
|
||||
#if 0
|
||||
cmd = am->registerAction(m_manager->m_dumpLogAction,
|
||||
Constants::DUMP_LOG, globalcontext);
|
||||
//cmd->setDefaultKeySequence(QKeySequence(tr("Ctrl+D,Ctrl+L")));
|
||||
cmd->setDefaultKeySequence(QKeySequence(tr("Ctrl+Shift+F11")));
|
||||
mdebug->addAction(cmd);
|
||||
#endif
|
||||
#endif
|
||||
|
||||
// FIXME
|
||||
m_ui.autoStartBox->hide();
|
||||
m_ui.autoQuitBox->hide();
|
||||
m_ui.environmentEdit->hide();
|
||||
m_ui.labelEnvironment->hide();
|
||||
|
||||
m_ui.checkBoxFastStart->setChecked(false);
|
||||
m_ui.checkBoxFastStart->hide();
|
||||
|
||||
//m_dumpLogAction = new QAction(this);
|
||||
//m_dumpLogAction->setText(tr("Dump Log File for Debugging Purposes"));
|
||||
return w;
|
||||
}
|
||||
|
||||
void GdbOptionPage::apply()
|
||||
{
|
||||
m_settings.m_gdbCmd = m_ui.gdbLocationChooser->path();
|
||||
m_settings.m_gdbEnv = m_ui.environmentEdit->text();
|
||||
m_settings.m_autoRun = m_ui.autoStartBox->isChecked();
|
||||
m_settings.m_autoQuit = m_ui.autoQuitBox->isChecked();
|
||||
m_settings.m_scriptFile = m_ui.scriptFileChooser->path();
|
||||
|
||||
m_settings.m_skipKnownFrames = m_ui.checkBoxSkipKnownFrames->isChecked();
|
||||
m_settings.m_debugDumpers = m_ui.checkBoxDebugDumpers->isChecked();
|
||||
m_settings.m_useCustomDumpers = m_ui.checkBoxUseCustomDumpers->isChecked();
|
||||
m_settings.m_useFastStart = m_ui.checkBoxFastStart->isChecked();
|
||||
m_settings.m_useToolTips = m_ui.checkBoxUseToolTips->isChecked();
|
||||
m_settings.m_useTerminal = m_ui.checkBoxUseTerminal->isChecked();
|
||||
|
||||
*m_plugin->m_manager->settings() = m_settings;
|
||||
m_plugin->writeSettings();
|
||||
}
|
||||
|
||||
} // namespace Internal
|
||||
} // namespace Debugger
|
||||
|
||||
|
||||
///////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
@@ -233,7 +346,7 @@ DebuggerPlugin::~DebuggerPlugin()
|
||||
|
||||
static QSettings *settings()
|
||||
{
|
||||
return ExtensionSystem::PluginManager::instance()->getObject<ICore>()->settings();
|
||||
return ICore::instance()->settings();
|
||||
}
|
||||
|
||||
void DebuggerPlugin::shutdown()
|
||||
@@ -274,7 +387,7 @@ bool DebuggerPlugin::initialize(const QStringList &arguments, QString *error_mes
|
||||
|
||||
m_pm = ExtensionSystem::PluginManager::instance();
|
||||
|
||||
ICore *core = m_pm->getObject<Core::ICore>();
|
||||
ICore *core = ICore::instance();
|
||||
QTC_ASSERT(core, return false);
|
||||
|
||||
Core::ActionManager *am = core->actionManager();
|
||||
@@ -409,34 +522,6 @@ bool DebuggerPlugin::initialize(const QStringList &arguments, QString *error_mes
|
||||
cmd = am->registerAction(sep, QLatin1String("Debugger.Sep2"), globalcontext);
|
||||
mdebug->addAction(cmd);
|
||||
|
||||
cmd = am->registerAction(m_manager->m_skipKnownFramesAction,
|
||||
Constants::SKIP_KNOWN_FRAMES, globalcontext);
|
||||
mdebug->addAction(cmd);
|
||||
|
||||
cmd = am->registerAction(m_manager->m_useCustomDumpersAction,
|
||||
Constants::USE_CUSTOM_DUMPERS, globalcontext);
|
||||
mdebug->addAction(cmd);
|
||||
|
||||
cmd = am->registerAction(m_manager->m_useFastStartAction,
|
||||
Constants::USE_FAST_START, globalcontext);
|
||||
mdebug->addAction(cmd);
|
||||
|
||||
cmd = am->registerAction(m_manager->m_useToolTipsAction,
|
||||
Constants::USE_TOOL_TIPS, globalcontext);
|
||||
mdebug->addAction(cmd);
|
||||
|
||||
#ifdef QT_DEBUG
|
||||
cmd = am->registerAction(m_manager->m_dumpLogAction,
|
||||
Constants::DUMP_LOG, globalcontext);
|
||||
//cmd->setDefaultKeySequence(QKeySequence(tr("Ctrl+D,Ctrl+L")));
|
||||
cmd->setDefaultKeySequence(QKeySequence(tr("Ctrl+Shift+F11")));
|
||||
mdebug->addAction(cmd);
|
||||
|
||||
cmd = am->registerAction(m_manager->m_debugDumpersAction,
|
||||
Constants::DEBUG_DUMPERS, debuggercontext);
|
||||
mdebug->addAction(cmd);
|
||||
#endif
|
||||
|
||||
sep = new QAction(this);
|
||||
sep->setSeparator(true);
|
||||
cmd = am->registerAction(sep, QLatin1String("Debugger.Sep4"), globalcontext);
|
||||
@@ -479,7 +564,7 @@ bool DebuggerPlugin::initialize(const QStringList &arguments, QString *error_mes
|
||||
m_generalOptionPage = 0;
|
||||
|
||||
// FIXME:
|
||||
m_generalOptionPage = new GdbOptionPage(&theGdbSettings());
|
||||
m_generalOptionPage = new GdbOptionPage(this);
|
||||
addObject(m_generalOptionPage);
|
||||
|
||||
m_locationMark = 0;
|
||||
@@ -628,8 +713,7 @@ ProjectExplorer::ProjectExplorerPlugin *DebuggerPlugin::projectExplorer() const
|
||||
/*! Activates the previous mode when the current mode is the debug mode. */
|
||||
void DebuggerPlugin::activatePreviousMode()
|
||||
{
|
||||
ICore *core = m_pm->getObject<Core::ICore>();
|
||||
Core::ModeManager *const modeManager = core->modeManager();
|
||||
Core::ModeManager *const modeManager = ICore::instance()->modeManager();
|
||||
|
||||
if (modeManager->currentMode() == modeManager->mode(Constants::MODE_DEBUG)
|
||||
&& !m_previousMode.isEmpty()) {
|
||||
@@ -640,7 +724,7 @@ void DebuggerPlugin::activatePreviousMode()
|
||||
|
||||
void DebuggerPlugin::activateDebugMode()
|
||||
{
|
||||
ICore *core = m_pm->getObject<Core::ICore>();
|
||||
ICore *core = ICore::instance();
|
||||
Core::ModeManager *modeManager = core->modeManager();
|
||||
m_previousMode = QLatin1String(modeManager->currentMode()->uniqueModeName());
|
||||
modeManager->activateMode(QLatin1String(MODE_DEBUG));
|
||||
@@ -648,7 +732,7 @@ void DebuggerPlugin::activateDebugMode()
|
||||
|
||||
void DebuggerPlugin::queryCurrentTextEditor(QString *fileName, int *lineNumber, QObject **object)
|
||||
{
|
||||
ICore *core = m_pm->getObject<Core::ICore>();
|
||||
ICore *core = ICore::instance();
|
||||
if (!core || !core->editorManager())
|
||||
return;
|
||||
Core::IEditor *editor = core->editorManager()->currentEditor();
|
||||
@@ -711,7 +795,7 @@ void DebuggerPlugin::requestMark(TextEditor::ITextEditor *editor, int lineNumber
|
||||
void DebuggerPlugin::showToolTip(TextEditor::ITextEditor *editor,
|
||||
const QPoint &point, int pos)
|
||||
{
|
||||
if (!m_manager->useToolTipsAction()->isChecked())
|
||||
if (!m_manager->settings()->m_useToolTips)
|
||||
return;
|
||||
|
||||
QPlainTextEdit *plaintext = qobject_cast<QPlainTextEdit*>(editor->widget());
|
||||
@@ -787,7 +871,7 @@ void DebuggerPlugin::gotoLocation(const QString &fileName, int lineNumber,
|
||||
void DebuggerPlugin::changeStatus(int status)
|
||||
{
|
||||
bool startIsContinue = (status == DebuggerInferiorStopped);
|
||||
ICore *core = m_pm->getObject<Core::ICore>();
|
||||
ICore *core = ICore::instance();
|
||||
if (startIsContinue) {
|
||||
core->addAdditionalContext(m_gdbRunningContext);
|
||||
core->updateContext();
|
||||
@@ -799,22 +883,59 @@ void DebuggerPlugin::changeStatus(int status)
|
||||
|
||||
void DebuggerPlugin::writeSettings() const
|
||||
{
|
||||
QSettings *s = settings();
|
||||
QTC_ASSERT(m_manager, return);
|
||||
QTC_ASSERT(m_manager->mainWindow(), return);
|
||||
|
||||
QSettings *s = settings();
|
||||
DebuggerSettings *m = m_manager->settings();
|
||||
s->beginGroup(QLatin1String("DebugMode"));
|
||||
s->setValue(QLatin1String("State"), m_manager->mainWindow()->saveState());
|
||||
s->setValue(QLatin1String("Locked"), m_toggleLockedAction->isChecked());
|
||||
s->setValue("State", m_manager->mainWindow()->saveState());
|
||||
s->setValue("Locked", m_toggleLockedAction->isChecked());
|
||||
s->setValue("Location", m->m_gdbCmd);
|
||||
s->setValue("Environment", m->m_gdbEnv);
|
||||
s->setValue("ScriptFile", m->m_scriptFile);
|
||||
s->setValue("AutoRun", m->m_autoRun);
|
||||
s->setValue("AutoQuit", m->m_autoQuit);
|
||||
|
||||
s->setValue("UseFastStart", m->m_useFastStart);
|
||||
s->setValue("UseToolTips", m->m_useToolTips);
|
||||
s->setValue("UseTerminal", m->m_useTerminal);
|
||||
s->setValue("UseCustomDumpers", m->m_useCustomDumpers);
|
||||
s->setValue("SkipKnowFrames", m->m_skipKnownFrames);
|
||||
s->setValue("DebugDumpers", m->m_debugDumpers);
|
||||
s->endGroup();
|
||||
}
|
||||
|
||||
void DebuggerPlugin::readSettings()
|
||||
{
|
||||
QSettings *s = settings();
|
||||
DebuggerSettings *m = &m_manager->m_settings;
|
||||
|
||||
QString defaultCommand("gdb");
|
||||
#if defined(Q_OS_WIN32)
|
||||
defaultCommand.append(".exe");
|
||||
#endif
|
||||
QString defaultScript = ICore::instance()->resourcePath() +
|
||||
QLatin1String("/gdb/qt4macros");
|
||||
|
||||
s->beginGroup(QLatin1String("DebugMode"));
|
||||
m_manager->mainWindow()->restoreState(s->value(QLatin1String("State"), QByteArray()).toByteArray());
|
||||
m_toggleLockedAction->setChecked(s->value(QLatin1String("Locked"), true).toBool());
|
||||
QByteArray ba = s->value("State", QByteArray()).toByteArray();
|
||||
m_toggleLockedAction->setChecked(s->value("Locked", true).toBool());
|
||||
m->m_gdbCmd = s->value("Location", defaultCommand).toString();
|
||||
m->m_scriptFile = s->value("ScriptFile", defaultScript).toString();
|
||||
m->m_gdbEnv = s->value("Environment", "").toString();
|
||||
m->m_autoRun = s->value("AutoRun", true).toBool();
|
||||
m->m_autoQuit = s->value("AutoQuit", true).toBool();
|
||||
|
||||
m->m_skipKnownFrames = s->value("SkipKnownFrames", false).toBool();
|
||||
m->m_debugDumpers = s->value("DebugDumpers", false).toBool();
|
||||
m->m_useCustomDumpers = s->value("UseCustomDupers", false).toBool();
|
||||
m->m_useFastStart = s->value("UseFastStart", false).toBool();
|
||||
m->m_useToolTips = s->value("UseToolTips", false).toBool();
|
||||
m->m_useTerminal = s->value("UseTerminal", false).toBool();
|
||||
s->endGroup();
|
||||
|
||||
m_manager->mainWindow()->restoreState(ba);
|
||||
}
|
||||
|
||||
void DebuggerPlugin::focusCurrentEditor(IMode *mode)
|
||||
|
||||
@@ -78,7 +78,6 @@ private slots:
|
||||
void changeStatus(int status);
|
||||
void requestMark(TextEditor::ITextEditor *editor, int lineNumber);
|
||||
void showToolTip(TextEditor::ITextEditor *editor, const QPoint &pnt, int pos);
|
||||
|
||||
void querySessionValue(const QString &name, QVariant *value);
|
||||
void setSessionValue(const QString &name, const QVariant &value);
|
||||
void queryConfigValue(const QString &name, QVariant *value);
|
||||
@@ -97,6 +96,7 @@ private:
|
||||
void writeSettings() const;
|
||||
|
||||
friend class DebuggerManager;
|
||||
friend class GdbOptionPage;
|
||||
friend class DebugMode; // FIXME: Just a hack now so that it can access the views
|
||||
|
||||
ProjectExplorer::ProjectExplorerPlugin *projectExplorer() const;
|
||||
|
||||
@@ -108,8 +108,8 @@ DebuggerRunControl::DebuggerRunControl(DebuggerManager *manager,
|
||||
{
|
||||
connect(m_manager, SIGNAL(debuggingFinished()),
|
||||
this, SLOT(debuggingFinished()));
|
||||
connect(m_manager, SIGNAL(applicationOutputAvailable(QString, QString)),
|
||||
this, SLOT(slotAddToOutputWindow(QString, QString)));
|
||||
connect(m_manager, SIGNAL(applicationOutputAvailable(QString)),
|
||||
this, SLOT(slotAddToOutputWindowInline(QString)));
|
||||
connect(m_manager, SIGNAL(inferiorPidChanged(qint64)),
|
||||
this, SLOT(bringApplicationToForeground(qint64)));
|
||||
}
|
||||
@@ -138,12 +138,9 @@ void DebuggerRunControl::start()
|
||||
debuggingFinished();
|
||||
}
|
||||
|
||||
void DebuggerRunControl::slotAddToOutputWindow(const QString &prefix, const QString &line)
|
||||
void DebuggerRunControl::slotAddToOutputWindowInline(const QString &data)
|
||||
{
|
||||
Q_UNUSED(prefix);
|
||||
foreach (const QString &l, line.split('\n'))
|
||||
emit addToOutputWindow(this, prefix + Qt::escape(l));
|
||||
//emit addToOutputWindow(this, prefix + Qt::escape(line));
|
||||
emit addToOutputWindowInline(this, data);
|
||||
}
|
||||
|
||||
void DebuggerRunControl::stop()
|
||||
|
||||
@@ -84,7 +84,7 @@ public:
|
||||
|
||||
private slots:
|
||||
void debuggingFinished();
|
||||
void slotAddToOutputWindow(const QString &prefix, const QString &line);
|
||||
void slotAddToOutputWindowInline(const QString &output);
|
||||
|
||||
private:
|
||||
DebuggerManager *m_manager;
|
||||
|
||||
@@ -84,19 +84,6 @@ Q_DECLARE_METATYPE(Debugger::Internal::GdbMi);
|
||||
|
||||
static const QString tooltipIName = "tooltip";
|
||||
|
||||
///////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// GdbSettings
|
||||
//
|
||||
///////////////////////////////////////////////////////////////////////
|
||||
|
||||
GdbSettings &Debugger::Internal::theGdbSettings()
|
||||
{
|
||||
static GdbSettings settings;
|
||||
return settings;
|
||||
}
|
||||
|
||||
|
||||
///////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// GdbCommandType
|
||||
@@ -265,7 +252,7 @@ void GdbEngine::init()
|
||||
m_pendingRequests = 0;
|
||||
m_gdbVersion = 100;
|
||||
m_shared = 0;
|
||||
qq->debugDumpersAction()->setChecked(false);
|
||||
m_outputCodec = QTextCodec::codecForLocale();
|
||||
|
||||
m_oldestAcceptableToken = -1;
|
||||
|
||||
@@ -279,12 +266,9 @@ void GdbEngine::init()
|
||||
connect(&m_gdbProc, SIGNAL(finished(int, QProcess::ExitStatus)), q,
|
||||
SLOT(exitDebugger()));
|
||||
|
||||
connect(qq->debugDumpersAction(), SIGNAL(toggled(bool)),
|
||||
this, SLOT(setDebugDumpers(bool)));
|
||||
connect(qq->useCustomDumpersAction(), SIGNAL(toggled(bool)),
|
||||
this, SLOT(setCustomDumpersWanted(bool)));
|
||||
|
||||
// Output
|
||||
connect(&m_outputCollector, SIGNAL(byteDelivery(QByteArray)),
|
||||
SLOT(readDebugeeOutput(QByteArray)));
|
||||
connect(this, SIGNAL(gdbResponseAvailable()),
|
||||
this, SLOT(handleResponse()), Qt::QueuedConnection);
|
||||
|
||||
@@ -294,8 +278,8 @@ void GdbEngine::init()
|
||||
connect(this, SIGNAL(gdbInputAvailable(QString,QString)),
|
||||
q, SLOT(showDebuggerInput(QString,QString)),
|
||||
Qt::QueuedConnection);
|
||||
connect(this, SIGNAL(applicationOutputAvailable(QString,QString)),
|
||||
q, SLOT(showApplicationOutput(QString,QString)),
|
||||
connect(this, SIGNAL(applicationOutputAvailable(QString)),
|
||||
q, SLOT(showApplicationOutput(QString)),
|
||||
Qt::QueuedConnection);
|
||||
}
|
||||
|
||||
@@ -306,7 +290,7 @@ void GdbEngine::gdbProcError(QProcess::ProcessError error)
|
||||
case QProcess::FailedToStart:
|
||||
msg = QString(tr("The Gdb process failed to start. Either the "
|
||||
"invoked program '%1' is missing, or you may have insufficient "
|
||||
"permissions to invoke the program.")).arg(theGdbSettings().m_gdbCmd);
|
||||
"permissions to invoke the program.")).arg(q->settings()->m_gdbCmd);
|
||||
break;
|
||||
case QProcess::Crashed:
|
||||
msg = tr("The Gdb process crashed some time after starting "
|
||||
@@ -374,6 +358,12 @@ static void skipTerminator(const char *&from, const char *to)
|
||||
skipSpaces(from, to);
|
||||
}
|
||||
|
||||
void GdbEngine::readDebugeeOutput(const QByteArray &data)
|
||||
{
|
||||
emit applicationOutputAvailable(m_outputCodec->toUnicode(
|
||||
data.constData(), data.length(), &m_outputCodecState));
|
||||
}
|
||||
|
||||
// called asyncronously as response to Gdb stdout output in
|
||||
// gdbResponseAvailable()
|
||||
void GdbEngine::handleResponse()
|
||||
@@ -426,22 +416,6 @@ void GdbEngine::handleResponse()
|
||||
break;
|
||||
}
|
||||
|
||||
if (token == -1 && *from != '&' && *from != '~' && *from != '*') {
|
||||
// FIXME: On Linux the application's std::out is merged in here.
|
||||
// High risk of falsely interpreting this as MI output.
|
||||
// We assume that we _always_ use tokens, so not finding a token
|
||||
// is a positive indication for the presence of application output.
|
||||
QString s;
|
||||
while (from != to && *from != '\n')
|
||||
s += *from++;
|
||||
//qDebug() << "UNREQUESTED DATA " << s << " TAKEN AS APPLICATION OUTPUT";
|
||||
//s += '\n';
|
||||
|
||||
m_inbuffer = QByteArray(from, to - from);
|
||||
emit applicationOutputAvailable("app-stdout: ", s);
|
||||
continue;
|
||||
}
|
||||
|
||||
// next char decides kind of record
|
||||
const char c = *from++;
|
||||
//qDebug() << "CODE:" << c;
|
||||
@@ -609,8 +583,7 @@ static void fixMac(QByteArray &out)
|
||||
|
||||
void GdbEngine::readGdbStandardError()
|
||||
{
|
||||
QByteArray err = m_gdbProc.readAllStandardError();
|
||||
emit applicationOutputAvailable("app-stderr:", err);
|
||||
qWarning() << "Unexpected gdb stderr:" << m_gdbProc.readAllStandardError();
|
||||
}
|
||||
|
||||
void GdbEngine::readGdbStandardOutput()
|
||||
@@ -723,7 +696,7 @@ void GdbEngine::sendCommand(const QString &command, int type,
|
||||
|
||||
//qDebug() << "";
|
||||
if (!command.isEmpty()) {
|
||||
//qDebug() << qPrintable(currentTime()) << "RUNNING << cmd.command;
|
||||
//qDebug() << qPrintable(currentTime()) << "RUNNING" << cmd.command;
|
||||
m_gdbProc.write(cmd.command.toLatin1() + "\r\n");
|
||||
//emit gdbInputAvailable(QString(), " " + currentTime());
|
||||
emit gdbInputAvailable(QString(), "[" + currentTime() + "] " + cmd.command);
|
||||
@@ -1097,7 +1070,7 @@ void GdbEngine::handleStreamOutput(const QString &data, char code)
|
||||
// On Windows, the contents seem to depend on the debugger
|
||||
// version and/or OS version used.
|
||||
if (data.startsWith("warning:"))
|
||||
qq->showApplicationOutput(QString(), data);
|
||||
qq->showApplicationOutput(data);
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -1503,7 +1476,8 @@ void GdbEngine::exitDebugger()
|
||||
m_varToType.clear();
|
||||
m_dataDumperState = DataDumperUninitialized;
|
||||
m_shared = 0;
|
||||
qq->debugDumpersAction()->setChecked(false);
|
||||
m_outputCollector.shutdown();
|
||||
//q->settings()->m_debugDumpers = false;
|
||||
}
|
||||
|
||||
|
||||
@@ -1525,6 +1499,15 @@ bool GdbEngine::startDebugger()
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!m_outputCollector.listen()) {
|
||||
QMessageBox::critical(q->mainWindow(), tr("Debugger Startup Failure"),
|
||||
tr("Cannot set up communication with child process: %1")
|
||||
.arg(m_outputCollector.errorString()));
|
||||
return false;
|
||||
}
|
||||
|
||||
gdbArgs.prepend(QLatin1String("--tty=") + m_outputCollector.serverName());
|
||||
|
||||
//gdbArgs.prepend(QLatin1String("--quiet"));
|
||||
gdbArgs.prepend(QLatin1String("mi"));
|
||||
gdbArgs.prepend(QLatin1String("-i"));
|
||||
@@ -1535,8 +1518,9 @@ bool GdbEngine::startDebugger()
|
||||
m_gdbProc.setEnvironment(q->m_environment);
|
||||
|
||||
#if 0
|
||||
qDebug() << "Command: " << theGdbSettings().m_gdbCmd;
|
||||
qDebug() << "Command: " << q->settings()->m_gdbCmd;
|
||||
qDebug() << "WorkingDirectory: " << m_gdbProc.workingDirectory();
|
||||
qDebug() << "ScriptFile: " << q->settings()->m_scriptFile;
|
||||
qDebug() << "Environment: " << m_gdbProc.environment();
|
||||
qDebug() << "Arguments: " << gdbArgs;
|
||||
qDebug() << "BuildDir: " << q->m_buildDir;
|
||||
@@ -1544,13 +1528,17 @@ bool GdbEngine::startDebugger()
|
||||
#endif
|
||||
|
||||
q->showStatusMessage(tr("Starting Debugger"));
|
||||
emit gdbInputAvailable(QString(), theGdbSettings().m_gdbCmd + ' ' + gdbArgs.join(" "));
|
||||
emit gdbInputAvailable(QString(), q->settings()->m_gdbCmd + ' ' + gdbArgs.join(" "));
|
||||
|
||||
m_gdbProc.start(theGdbSettings().m_gdbCmd, gdbArgs);
|
||||
m_gdbProc.start(q->settings()->m_gdbCmd, gdbArgs);
|
||||
m_gdbProc.waitForStarted();
|
||||
|
||||
if (m_gdbProc.state() != QProcess::Running)
|
||||
if (m_gdbProc.state() != QProcess::Running) {
|
||||
QMessageBox::critical(q->mainWindow(), tr("Debugger Startup Failure"),
|
||||
tr("Cannot start debugger: %1").arg(m_gdbProc.errorString()));
|
||||
m_outputCollector.shutdown();
|
||||
return false;
|
||||
}
|
||||
|
||||
q->showStatusMessage(tr("Gdb Running"));
|
||||
|
||||
@@ -1612,6 +1600,22 @@ bool GdbEngine::startDebugger()
|
||||
"dyld \".*libobjc.*\" all "
|
||||
"dyld \".*CarbonDataFormatters.*\" all");
|
||||
#endif
|
||||
|
||||
QString scriptFileName = q->settings()->m_scriptFile;
|
||||
if (!scriptFileName.isEmpty()) {
|
||||
QFile scriptFile(scriptFileName);
|
||||
if (scriptFile.open(QIODevice::ReadOnly)) {
|
||||
sendCommand("source " + scriptFileName);
|
||||
} else {
|
||||
QMessageBox::warning(q->mainWindow(),
|
||||
tr("Cannot find debugger initialization script"),
|
||||
tr("The debugger settings point to a script file at '%1' "
|
||||
"which is not accessible. If a script file is not needed, "
|
||||
"consider clearing that entry to avoid this warning. "
|
||||
).arg(scriptFileName));
|
||||
}
|
||||
}
|
||||
|
||||
if (q->startMode() == q->attachExternal) {
|
||||
sendCommand("attach " + QString::number(q->m_attachedPID));
|
||||
}
|
||||
@@ -2589,7 +2593,7 @@ void GdbEngine::setToolTipExpression(const QPoint &pos, const QString &exp0)
|
||||
return;
|
||||
}
|
||||
|
||||
if (qq->debugDumpersAction()->isChecked()) {
|
||||
if (q->settings()->m_debugDumpers) {
|
||||
// minimize interference
|
||||
return;
|
||||
}
|
||||
@@ -2909,10 +2913,10 @@ void GdbEngine::setCustomDumpersWanted(bool on)
|
||||
|
||||
bool GdbEngine::isCustomValueDumperAvailable(const QString &type) const
|
||||
{
|
||||
if (!qq->useCustomDumpers())
|
||||
DebuggerSettings *s = q->settings();
|
||||
if (!s->m_useCustomDumpers)
|
||||
return false;
|
||||
if (qq->debugDumpersAction()->isChecked()
|
||||
&& qq->stackHandler()->isDebuggingDumpers())
|
||||
if (s->m_debugDumpers && qq->stackHandler()->isDebuggingDumpers())
|
||||
return false;
|
||||
if (m_dataDumperState != DataDumperAvailable)
|
||||
return false;
|
||||
@@ -3001,6 +3005,12 @@ void GdbEngine::runCustomDumper(const WatchData & data0, bool dumpChildren)
|
||||
//extraArgs[extraArgCount++] = sizeofTypeExpression(data.type);
|
||||
//extraArgs[extraArgCount++] = "(size_t)&(('" + data.type + "'*)0)->value";
|
||||
}
|
||||
} else if (outertype == "std::deque") {
|
||||
// remove 'std::allocator<...>':
|
||||
extraArgs[1] = "0";
|
||||
} else if (outertype == "std::stack") {
|
||||
// remove 'std::allocator<...>':
|
||||
extraArgs[1] = "0";
|
||||
} else if (outertype == "std::map") {
|
||||
// We don't want the comparator and the allocator confuse gdb.
|
||||
// But we need the offset of the second item in the value pair.
|
||||
@@ -3470,7 +3480,7 @@ void GdbEngine::handleDumpCustomValue1(const GdbResultRecord &record,
|
||||
//qDebug() << "CUSTOM DUMPER ERROR MESSAGE: " << msg;
|
||||
#ifdef QT_DEBUG
|
||||
// Make debugging of dumers easier
|
||||
if (qq->debugDumpersAction()->isChecked()
|
||||
if (q->settings()->m_debugDumpers
|
||||
&& msg.startsWith("The program being debugged stopped while")
|
||||
&& msg.contains("qDumpObjectData440")) {
|
||||
// Fake full stop
|
||||
|
||||
@@ -36,6 +36,7 @@
|
||||
|
||||
#include "idebuggerengine.h"
|
||||
#include "gdbmi.h"
|
||||
#include "outputcollector.h"
|
||||
|
||||
#include <QtCore/QByteArray>
|
||||
#include <QtCore/QHash>
|
||||
@@ -43,6 +44,7 @@
|
||||
#include <QtCore/QObject>
|
||||
#include <QtCore/QProcess>
|
||||
#include <QtCore/QPoint>
|
||||
#include <QtCore/QTextCodec>
|
||||
#include <QtCore/QVariant>
|
||||
|
||||
QT_BEGIN_NAMESPACE
|
||||
@@ -81,23 +83,6 @@ enum DataDumperState
|
||||
};
|
||||
|
||||
|
||||
class GdbSettings
|
||||
{
|
||||
public:
|
||||
GdbSettings() { m_autoRun = m_autoQuit = false; }
|
||||
|
||||
public:
|
||||
QString m_gdbCmd;
|
||||
QString m_gdbEnv;
|
||||
bool m_autoRun;
|
||||
bool m_autoQuit;
|
||||
|
||||
QString m_scriptFile;
|
||||
QMap<QString, QVariant> m_typeMacros;
|
||||
};
|
||||
|
||||
GdbSettings &theGdbSettings();
|
||||
|
||||
class GdbEngine : public IDebuggerEngine
|
||||
{
|
||||
Q_OBJECT
|
||||
@@ -110,7 +95,7 @@ signals:
|
||||
void gdbResponseAvailable();
|
||||
void gdbInputAvailable(const QString &prefix, const QString &msg);
|
||||
void gdbOutputAvailable(const QString &prefix, const QString &msg);
|
||||
void applicationOutputAvailable(const QString &prefix, const QString &msg);
|
||||
void applicationOutputAvailable(const QString &output);
|
||||
|
||||
private:
|
||||
//
|
||||
@@ -190,6 +175,7 @@ private slots:
|
||||
void gdbProcError(QProcess::ProcessError error);
|
||||
void readGdbStandardOutput();
|
||||
void readGdbStandardError();
|
||||
void readDebugeeOutput(const QByteArray &data);
|
||||
|
||||
private:
|
||||
int terminationIndex(const QByteArray &buffer, int &length);
|
||||
@@ -207,6 +193,10 @@ private:
|
||||
void handleQueryPwd(const GdbResultRecord &response);
|
||||
void handleQuerySources(const GdbResultRecord &response);
|
||||
|
||||
OutputCollector m_outputCollector;
|
||||
QTextCodec *m_outputCodec;
|
||||
QTextCodec::ConverterState m_outputCodecState;
|
||||
|
||||
QByteArray m_inbuffer;
|
||||
|
||||
QProcess m_gdbProc;
|
||||
|
||||
@@ -1,145 +0,0 @@
|
||||
/***************************************************************************
|
||||
**
|
||||
** This file is part of Qt Creator
|
||||
**
|
||||
** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
|
||||
**
|
||||
** Contact: Qt Software Information (qt-info@nokia.com)
|
||||
**
|
||||
**
|
||||
** Non-Open Source Usage
|
||||
**
|
||||
** Licensees may use this file in accordance with the Qt Beta Version
|
||||
** License Agreement, Agreement version 2.2 provided with the Software or,
|
||||
** alternatively, in accordance with the terms contained in a written
|
||||
** agreement between you and Nokia.
|
||||
**
|
||||
** GNU General Public License Usage
|
||||
**
|
||||
** Alternatively, this file may be used under the terms of the GNU General
|
||||
** Public License versions 2.0 or 3.0 as published by the Free Software
|
||||
** Foundation and appearing in the file LICENSE.GPL included in the packaging
|
||||
** of this file. Please review the following information to ensure GNU
|
||||
** General Public Licensing requirements will be met:
|
||||
**
|
||||
** http://www.fsf.org/licensing/licenses/info/GPLv2.html and
|
||||
** http://www.gnu.org/copyleft/gpl.html.
|
||||
**
|
||||
** In addition, as a special exception, Nokia gives you certain additional
|
||||
** rights. These rights are described in the Nokia Qt GPL Exception
|
||||
** version 1.3, included in the file GPL_EXCEPTION.txt in this package.
|
||||
**
|
||||
***************************************************************************/
|
||||
|
||||
#include "gdboptionpage.h"
|
||||
|
||||
#include "gdbengine.h"
|
||||
|
||||
#include <extensionsystem/pluginmanager.h>
|
||||
#include <coreplugin/icore.h>
|
||||
|
||||
#include <QtCore/QSettings>
|
||||
#include <QtGui/QLineEdit>
|
||||
#include <QtGui/QFileDialog>
|
||||
|
||||
using namespace Debugger::Internal;
|
||||
|
||||
GdbOptionPage::GdbOptionPage(GdbSettings *settings)
|
||||
{
|
||||
m_pm = ExtensionSystem::PluginManager::instance();
|
||||
m_settings = settings;
|
||||
|
||||
Core::ICore *coreIFace = m_pm->getObject<Core::ICore>();
|
||||
if (!coreIFace || !coreIFace->settings())
|
||||
return;
|
||||
QSettings *s = coreIFace->settings();
|
||||
s->beginGroup("GdbOptions");
|
||||
QString defaultCommand("gdb");
|
||||
#if defined(Q_OS_WIN32)
|
||||
defaultCommand.append(".exe");
|
||||
#endif
|
||||
QString defaultScript = coreIFace->resourcePath() +
|
||||
QLatin1String("/gdb/qt4macros");
|
||||
|
||||
m_settings->m_gdbCmd = s->value("Location", defaultCommand).toString();
|
||||
m_settings->m_scriptFile= s->value("ScriptFile", defaultScript).toString();
|
||||
m_settings->m_gdbEnv = s->value("Environment", "").toString();
|
||||
m_settings->m_autoRun = s->value("AutoRun", true).toBool();
|
||||
m_settings->m_autoQuit = s->value("AutoQuit", true).toBool();
|
||||
s->endGroup();
|
||||
}
|
||||
|
||||
QString GdbOptionPage::name() const
|
||||
{
|
||||
return tr("Gdb");
|
||||
}
|
||||
|
||||
QString GdbOptionPage::category() const
|
||||
{
|
||||
return "Debugger";
|
||||
}
|
||||
|
||||
QString GdbOptionPage::trCategory() const
|
||||
{
|
||||
return tr("Debugger");
|
||||
}
|
||||
|
||||
QWidget *GdbOptionPage::createPage(QWidget *parent)
|
||||
{
|
||||
QWidget *w = new QWidget(parent);
|
||||
m_ui.setupUi(w);
|
||||
m_ui.gdbLocationChooser->setExpectedKind(Core::Utils::PathChooser::Command);
|
||||
m_ui.gdbLocationChooser->setPromptDialogTitle(tr("Choose Gdb Location"));
|
||||
m_ui.gdbLocationChooser->setPath(m_settings->m_gdbCmd);
|
||||
m_ui.scriptFileChooser->setExpectedKind(Core::Utils::PathChooser::File);
|
||||
m_ui.scriptFileChooser->setPromptDialogTitle(tr("Choose Location of Startup Script File"));
|
||||
m_ui.scriptFileChooser->setPath(m_settings->m_scriptFile);
|
||||
m_ui.environmentEdit->setText(m_settings->m_gdbEnv);
|
||||
m_ui.autoStartBox->setChecked(m_settings->m_autoRun);
|
||||
m_ui.autoQuitBox->setChecked(m_settings->m_autoQuit);
|
||||
|
||||
// FIXME
|
||||
m_ui.autoStartBox->hide();
|
||||
m_ui.autoQuitBox->hide();
|
||||
m_ui.environmentEdit->hide();
|
||||
m_ui.labelEnvironment->hide();
|
||||
|
||||
connect(m_ui.gdbLocationChooser, SIGNAL(changed()),
|
||||
this, SLOT(onGdbLocationChanged()));
|
||||
connect(m_ui.scriptFileChooser, SIGNAL(changed()),
|
||||
this, SLOT(onScriptFileChanged()));
|
||||
|
||||
return w;
|
||||
}
|
||||
|
||||
void GdbOptionPage::onGdbLocationChanged()
|
||||
{
|
||||
m_settings->m_gdbCmd = m_ui.gdbLocationChooser->path();
|
||||
}
|
||||
|
||||
void GdbOptionPage::onScriptFileChanged()
|
||||
{
|
||||
m_settings->m_scriptFile = m_ui.scriptFileChooser->path();
|
||||
}
|
||||
|
||||
void GdbOptionPage::apply()
|
||||
{
|
||||
m_settings->m_gdbCmd = m_ui.gdbLocationChooser->path();
|
||||
m_settings->m_gdbEnv = m_ui.environmentEdit->text();
|
||||
m_settings->m_autoRun = m_ui.autoStartBox->isChecked();
|
||||
m_settings->m_autoQuit = m_ui.autoQuitBox->isChecked();
|
||||
m_settings->m_scriptFile = m_ui.scriptFileChooser->path();
|
||||
|
||||
Core::ICore *coreIFace = m_pm->getObject<Core::ICore>();
|
||||
if (!coreIFace || !coreIFace->settings())
|
||||
return;
|
||||
|
||||
QSettings *s = coreIFace->settings();
|
||||
|
||||
s->beginGroup("GdbOptions");
|
||||
s->setValue("Location", m_settings->m_gdbCmd);
|
||||
s->setValue("Environment", m_settings->m_gdbEnv);
|
||||
s->setValue("AutoRun", m_settings->m_autoRun);
|
||||
s->setValue("AutoQuit", m_settings->m_autoQuit);
|
||||
s->endGroup();
|
||||
}
|
||||
@@ -6,8 +6,8 @@
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>433</width>
|
||||
<height>233</height>
|
||||
<width>465</width>
|
||||
<height>372</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
@@ -36,7 +36,7 @@
|
||||
<widget class="QLineEdit" name="environmentEdit"/>
|
||||
</item>
|
||||
<item row="0" column="0">
|
||||
<widget class="QLabel" name="labelGdbLocaltion">
|
||||
<widget class="QLabel" name="labelGdbLocation">
|
||||
<property name="toolTip">
|
||||
<string>This is either a full abolute path leading to the gdb binary you intend to use or the name of a gdb binary that wiull be searched in your PATH.</string>
|
||||
</property>
|
||||
@@ -74,6 +74,68 @@
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QCheckBox" name="checkBoxUseCustomDumpers">
|
||||
<property name="toolTip">
|
||||
<string>Checking this will make the debugger try to use code to format certain data (QObject, QString, std::string etc.) nicely.</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Use custom display for Qt and Standard Library objects</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QCheckBox" name="checkBoxUseTerminal">
|
||||
<property name="toolTip">
|
||||
<string>Start debugged process in a separte terminal.</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Start in terminal</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QCheckBox" name="checkBoxFastStart">
|
||||
<property name="toolTip">
|
||||
<string>Checking this will make the debugger start fast by loading only very few debug symbols on start up. This might lead to situations where breakpoints can not be set properly. So uncheck this option if you experience breakpoint related problems.</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Fast debugger start</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QCheckBox" name="checkBoxSkipKnownFrames">
|
||||
<property name="toolTip">
|
||||
<string>fter checking this option 'Step Into' combines in certain situations several steps, leading to 'less noisy' debugging. So will, e.g., the atomic
|
||||
reference counting code be skipped, and a single 'Step Into' for a signal emission will end up directly in the slot connected to it.
|
||||
</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Skip known frames when stepping</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QCheckBox" name="checkBoxUseToolTips">
|
||||
<property name="toolTip">
|
||||
<string>Checking this will make enable tooltips for variable values during debugging. Since this can slow down debugging and does not provide reliable information as it does not use scope information, it is switched off by default.</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Use tooltips while debugging</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QCheckBox" name="checkBoxDebugDumpers">
|
||||
<property name="toolTip">
|
||||
<string notr="true">This is an internal tool to make debugging the Custom Data Dumper code easier. Using this action is in general not needed unless you want do debug Qt Creator itself.</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Debug Custom Dumpers</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QCheckBox" name="autoStartBox">
|
||||
<property name="text">
|
||||
|
||||
@@ -35,7 +35,6 @@
|
||||
#include "gdbengine.h"
|
||||
#include "imports.h"
|
||||
|
||||
#include <extensionsystem/pluginmanager.h>
|
||||
#include <coreplugin/icore.h>
|
||||
|
||||
#include <QtCore/QSettings>
|
||||
@@ -49,9 +48,7 @@ TypeMacroPage::TypeMacroPage(GdbSettings *settings)
|
||||
m_pm = ExtensionSystem::PluginManager::instance();
|
||||
m_settings = settings;
|
||||
|
||||
Core::ICore *coreIFace = m_pm->getObject<Core::ICore>();
|
||||
if (!coreIFace || !coreIFace->settings())
|
||||
return;
|
||||
Core::ICore *coreIFace = ICore::instance();
|
||||
|
||||
QSettings *s = coreIFace->settings();
|
||||
s->beginGroup("GdbOptions");
|
||||
@@ -164,14 +161,11 @@ void TypeMacroPage::finished(bool accepted)
|
||||
m_settings->m_typeMacros.insert(item->text(0), data);
|
||||
}
|
||||
|
||||
Core::ICore *coreIFace = m_pm->getObject<Core::ICore>();
|
||||
if (coreIFace && coreIFace->settings()) {
|
||||
QSettings *s = coreIFace->settings();
|
||||
s->beginGroup("GdbOptions");
|
||||
s->setValue("ScriptFile", m_settings->m_scriptFile);
|
||||
s->setValue("TypeMacros", m_settings->m_typeMacros);
|
||||
s->endGroup();
|
||||
}
|
||||
QSettings *s = ICore::instance()->settings();
|
||||
s->beginGroup("GdbOptions");
|
||||
s->setValue("ScriptFile", m_settings->m_scriptFile);
|
||||
s->setValue("TypeMacros", m_settings->m_typeMacros);
|
||||
s->endGroup();
|
||||
}
|
||||
|
||||
void TypeMacroPage::onAddButton()
|
||||
|
||||
180
src/plugins/debugger/outputcollector.cpp
Normal file
@@ -0,0 +1,180 @@
|
||||
/***************************************************************************
|
||||
**
|
||||
** This file is part of Qt Creator
|
||||
**
|
||||
** Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
|
||||
**
|
||||
** Contact: Qt Software Information (qt-info@nokia.com)
|
||||
**
|
||||
**
|
||||
** Non-Open Source Usage
|
||||
**
|
||||
** Licensees may use this file in accordance with the Qt Beta Version
|
||||
** License Agreement, Agreement version 2.2 provided with the Software or,
|
||||
** alternatively, in accordance with the terms contained in a written
|
||||
** agreement between you and Nokia.
|
||||
**
|
||||
** GNU General Public License Usage
|
||||
**
|
||||
** Alternatively, this file may be used under the terms of the GNU General
|
||||
** Public License versions 2.0 or 3.0 as published by the Free Software
|
||||
** Foundation and appearing in the file LICENSE.GPL included in the packaging
|
||||
** of this file. Please review the following information to ensure GNU
|
||||
** General Public Licensing requirements will be met:
|
||||
**
|
||||
** http://www.fsf.org/licensing/licenses/info/GPLv2.html and
|
||||
** http://www.gnu.org/copyleft/gpl.html.
|
||||
**
|
||||
** In addition, as a special exception, Nokia gives you certain additional
|
||||
** rights. These rights are described in the Nokia Qt GPL Exception
|
||||
** version 1.3, included in the file GPL_EXCEPTION.txt in this package.
|
||||
**
|
||||
***************************************************************************/
|
||||
|
||||
#include "outputcollector.h"
|
||||
|
||||
#ifdef Q_OS_WIN
|
||||
|
||||
#include <QtNetwork/QLocalServer>
|
||||
#include <QtNetwork/QLocalSocket>
|
||||
#include <QtCore/QCoreApplication>
|
||||
|
||||
#else
|
||||
|
||||
#include <QtCore/QFile>
|
||||
#include <QtCore/QSocketNotifier>
|
||||
#include <QtCore/QTemporaryFile>
|
||||
#include <QtCore/QVarLengthArray>
|
||||
|
||||
#include <sys/ioctl.h>
|
||||
#include <sys/types.h>
|
||||
#include <sys/stat.h>
|
||||
#include <errno.h>
|
||||
#include <fcntl.h>
|
||||
#include <string.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#endif
|
||||
|
||||
namespace Debugger {
|
||||
namespace Internal {
|
||||
|
||||
OutputCollector::OutputCollector(QObject *parent)
|
||||
: QObject(parent)
|
||||
{
|
||||
#ifdef Q_OS_WIN
|
||||
m_server = 0;
|
||||
m_socket = 0;
|
||||
#endif
|
||||
}
|
||||
|
||||
OutputCollector::~OutputCollector()
|
||||
{
|
||||
shutdown();
|
||||
}
|
||||
|
||||
bool OutputCollector::listen()
|
||||
{
|
||||
#ifdef Q_OS_WIN
|
||||
if (m_server)
|
||||
return m_server->isListening();
|
||||
m_server = new QLocalServer(this);
|
||||
connect(m_server, SIGNAL(newConnection()), SLOT(newConnectionAvailable()));
|
||||
return m_server->listen(QLatin1String("creator-") + QCoreApplication::applicationPid()); // XXX how to make that secure?
|
||||
#else
|
||||
if (!m_serverPath.isEmpty())
|
||||
return true;
|
||||
QByteArray codedServerPath;
|
||||
forever {
|
||||
{
|
||||
QTemporaryFile tf;
|
||||
if (!tf.open()) {
|
||||
m_errorString = tr("Cannot create temporary file: %2").arg(tf.errorString());
|
||||
m_serverPath.clear();
|
||||
return false;
|
||||
}
|
||||
m_serverPath = tf.fileName();
|
||||
}
|
||||
// By now the temp file was deleted again
|
||||
codedServerPath = QFile::encodeName(m_serverPath);
|
||||
if (!::mkfifo(codedServerPath.constData(), 0600))
|
||||
break;
|
||||
if (errno != EEXIST) {
|
||||
m_errorString = tr("Cannot create FiFo %1: %2").arg(m_serverPath, strerror(errno));
|
||||
m_serverPath.clear();
|
||||
return false;
|
||||
}
|
||||
}
|
||||
if ((m_serverFd = ::open(codedServerPath.constData(), O_RDONLY|O_NONBLOCK)) < 0) {
|
||||
m_errorString = tr("Cannot open FiFo %1: %2").arg(m_serverPath, strerror(errno));
|
||||
m_serverPath.clear();
|
||||
return false;
|
||||
}
|
||||
m_serverNotifier = new QSocketNotifier(m_serverFd, QSocketNotifier::Read, this);
|
||||
connect(m_serverNotifier, SIGNAL(activated(int)), SLOT(bytesAvailable()));
|
||||
return true;
|
||||
#endif
|
||||
}
|
||||
|
||||
void OutputCollector::shutdown()
|
||||
{
|
||||
#ifdef Q_OS_WIN
|
||||
delete m_server; // Deletes socket as well (QObject parent)
|
||||
m_server = 0;
|
||||
m_socket = 0;
|
||||
#else
|
||||
if (!m_serverPath.isEmpty()) {
|
||||
::close(m_serverFd);
|
||||
::unlink(QFile::encodeName(m_serverPath).constData());
|
||||
delete m_serverNotifier;
|
||||
m_serverPath.clear();
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
QString OutputCollector::errorString() const
|
||||
{
|
||||
#ifdef Q_OS_WIN
|
||||
return m_socket ? m_socket->errorString() : m_server->errorString();
|
||||
#else
|
||||
return m_errorString;
|
||||
#endif
|
||||
}
|
||||
|
||||
QString OutputCollector::serverName() const
|
||||
{
|
||||
#ifdef Q_OS_WIN
|
||||
return m_server->fullServerName();
|
||||
#else
|
||||
return m_serverPath;
|
||||
#endif
|
||||
}
|
||||
|
||||
#ifdef Q_OS_WIN
|
||||
void OutputCollector::newConnectionAvailable()
|
||||
{
|
||||
if (m_socket)
|
||||
return;
|
||||
m_socket = m_server->nextPendingConnection();
|
||||
connect(m_socket, SIGNAL(bytesAvailable()), SLOT(bytesAvailable()));
|
||||
}
|
||||
#endif
|
||||
|
||||
void OutputCollector::bytesAvailable()
|
||||
{
|
||||
#ifdef Q_OS_WIN
|
||||
emit byteDelivery(m_socket->readAll());
|
||||
#else
|
||||
size_t nbytes = 0;
|
||||
if (::ioctl(m_serverFd, FIONREAD, (char *) &nbytes) < 0)
|
||||
return;
|
||||
QVarLengthArray<char, 8192> buff(nbytes);
|
||||
if (::read(m_serverFd, buff.data(), nbytes) != (int)nbytes)
|
||||
return;
|
||||
if (nbytes) // Skip EOF notifications
|
||||
emit byteDelivery(QByteArray::fromRawData(buff.data(), nbytes));
|
||||
#endif
|
||||
}
|
||||
|
||||
} // namespace Internal
|
||||
} // namespace Debugger
|
||||
@@ -2,7 +2,7 @@
|
||||
**
|
||||
** This file is part of Qt Creator
|
||||
**
|
||||
** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
|
||||
** Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
|
||||
**
|
||||
** Contact: Qt Software Information (qt-info@nokia.com)
|
||||
**
|
||||
@@ -31,79 +31,61 @@
|
||||
**
|
||||
***************************************************************************/
|
||||
|
||||
#ifndef GDBOPTIONPAGE_H
|
||||
#define GDBOPTIONPAGE_H
|
||||
#ifndef OUTPUT_COLLECTOR_H
|
||||
#define OUTPUT_COLLECTOR_H
|
||||
|
||||
#include "ui_gdboptionpage.h"
|
||||
#include <QtCore/QByteArray>
|
||||
#include <QtCore/QObject>
|
||||
|
||||
#include <coreplugin/dialogs/ioptionspage.h>
|
||||
|
||||
#include <QtGui/QWidget>
|
||||
|
||||
namespace ExtensionSystem { class PluginManager; }
|
||||
QT_BEGIN_NAMESPACE
|
||||
class QLocalServer;
|
||||
class QLocalSocket;
|
||||
class QSocketNotifier;
|
||||
QT_END_NAMESPACE
|
||||
|
||||
namespace Debugger {
|
||||
namespace Internal {
|
||||
|
||||
class GdbSettings;
|
||||
///////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// OutputCollector
|
||||
//
|
||||
///////////////////////////////////////////////////////////////////////
|
||||
|
||||
class GdbOptionPage : public Core::IOptionsPage
|
||||
class OutputCollector : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
GdbOptionPage(GdbSettings *settings);
|
||||
OutputCollector(QObject *parent = 0);
|
||||
~OutputCollector();
|
||||
bool listen();
|
||||
void shutdown();
|
||||
QString serverName() const;
|
||||
QString errorString() const;
|
||||
|
||||
QString name() const;
|
||||
QString category() const;
|
||||
QString trCategory() const;
|
||||
|
||||
QWidget *createPage(QWidget *parent);
|
||||
void apply();
|
||||
void finish() { }
|
||||
|
||||
public slots:
|
||||
void onGdbLocationChanged();
|
||||
void onScriptFileChanged();
|
||||
|
||||
private:
|
||||
ExtensionSystem::PluginManager *m_pm;
|
||||
Ui::GdbOptionPage m_ui;
|
||||
|
||||
GdbSettings *m_settings;
|
||||
};
|
||||
|
||||
#if 0
|
||||
class TypeMacroPage : public Core::IOptionsPage
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
TypeMacroPage(GdbSettings *settings);
|
||||
|
||||
QString name() const;
|
||||
QString category() const;
|
||||
QString trCategory() const;
|
||||
|
||||
QWidget *createPage(QWidget *parent);
|
||||
void finished(bool accepted);
|
||||
signals:
|
||||
void byteDelivery(const QByteArray &data);
|
||||
|
||||
private slots:
|
||||
void onAddButton();
|
||||
void onDelButton();
|
||||
void currentItemChanged(QTreeWidgetItem *item);
|
||||
void updateButtonState();
|
||||
void bytesAvailable();
|
||||
#ifdef Q_OS_WIN
|
||||
void newConnectionAvailable();
|
||||
#endif
|
||||
|
||||
private:
|
||||
ExtensionSystem::PluginManager *m_pm;
|
||||
Ui::TypeMacroPage m_ui;
|
||||
|
||||
GdbSettings *m_settings;
|
||||
QWidget *m_widget;
|
||||
};
|
||||
#ifdef Q_OS_WIN
|
||||
QLocalServer *m_server;
|
||||
QLocalSocket *m_socket;
|
||||
#else
|
||||
QString m_serverPath;
|
||||
int m_serverFd;
|
||||
QSocketNotifier *m_serverNotifier;
|
||||
QString m_errorString;
|
||||
#endif
|
||||
};
|
||||
|
||||
} // namespace Internal
|
||||
} // namespace Debugger
|
||||
|
||||
#endif // GDBOPTIONPAGE_H
|
||||
#endif // OUTPUT_COLLECTOR_H
|
||||
@@ -48,8 +48,8 @@ enum { debugFormClassWizard = 0 };
|
||||
using namespace Designer;
|
||||
using namespace Designer::Internal;
|
||||
|
||||
FormClassWizard::FormClassWizard(const BaseFileWizardParameters ¶meters, Core::ICore *core, QObject *parent) :
|
||||
Core::BaseFileWizard(parameters, core, parent)
|
||||
FormClassWizard::FormClassWizard(const BaseFileWizardParameters ¶meters, QObject *parent)
|
||||
: Core::BaseFileWizard(parameters, parent)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
@@ -38,10 +38,6 @@
|
||||
|
||||
#include <coreplugin/basefilewizard.h>
|
||||
|
||||
QT_BEGIN_NAMESPACE
|
||||
class QWizard;
|
||||
QT_END_NAMESPACE
|
||||
|
||||
namespace Designer {
|
||||
namespace Internal {
|
||||
|
||||
@@ -55,7 +51,7 @@ class FormClassWizard : public Core::BaseFileWizard
|
||||
public:
|
||||
typedef Core::BaseFileWizardParameters BaseFileWizardParameters;
|
||||
|
||||
FormClassWizard(const BaseFileWizardParameters ¶meters, Core::ICore *core, QObject *parent);
|
||||
FormClassWizard(const BaseFileWizardParameters ¶meters, QObject *parent);
|
||||
|
||||
QString headerSuffix() const;
|
||||
QString sourceSuffix() const;
|
||||
|
||||
@@ -42,8 +42,8 @@
|
||||
#include <QtCore/QDir>
|
||||
#include <QtCore/QSettings>
|
||||
|
||||
#include <QtGui/QMessageBox>
|
||||
#include <QtGui/QAbstractButton>
|
||||
#include <QtGui/QMessageBox>
|
||||
|
||||
static const char *formClassWizardPageGroupC = "FormClassWizardPage";
|
||||
static const char *translationKeyC = "RetranslationSupport";
|
||||
@@ -175,7 +175,7 @@ bool FormClassWizardPage::validatePage()
|
||||
|
||||
void FormClassWizardPage::saveSettings()
|
||||
{
|
||||
Core::ICore *core = ExtensionSystem::PluginManager::instance()->getObject<Core::ICore>();
|
||||
Core::ICore *core = Core::ICore::instance();
|
||||
if (QSettings *settings = core->settings()) {
|
||||
settings->beginGroup(QLatin1String(formClassWizardPageGroupC));
|
||||
settings->setValue(QLatin1String(translationKeyC), hasRetranslationSupport());
|
||||
@@ -189,7 +189,7 @@ void FormClassWizardPage::restoreSettings()
|
||||
bool retranslationSupport = true;
|
||||
int embedding = PointerAggregatedUiClass;
|
||||
|
||||
Core::ICore *core = ExtensionSystem::PluginManager::instance()->getObject<Core::ICore>();
|
||||
Core::ICore *core = Core::ICore::instance();
|
||||
if (QSettings *settings = core->settings()) {
|
||||
|
||||
QString key = QLatin1String(formClassWizardPageGroupC);
|
||||
|
||||
@@ -34,7 +34,6 @@
|
||||
#ifndef FORMEDITORFACTORY_H
|
||||
#define FORMEDITORFACTORY_H
|
||||
|
||||
#include <extensionsystem/ExtensionSystemInterfaces>
|
||||
#include <coreplugin/editormanager/ieditorfactory.h>
|
||||
|
||||
#include <QtCore/QStringList>
|
||||
|
||||
@@ -51,7 +51,7 @@
|
||||
#include <coreplugin/coreconstants.h>
|
||||
#include <coreplugin/uniqueidmanager.h>
|
||||
|
||||
#include <QtCore/qplugin.h>
|
||||
#include <QtCore/QtPlugin>
|
||||
#include <QtCore/QDebug>
|
||||
|
||||
#ifdef CPP_ENABLED
|
||||
@@ -89,13 +89,16 @@ FormEditorPlugin::~FormEditorPlugin()
|
||||
// INHERITED FROM ExtensionSystem::Plugin
|
||||
//
|
||||
////////////////////////////////////////////////////
|
||||
bool FormEditorPlugin::initialize(const QStringList & /*arguments*/, QString *error_message/* = 0*/) // =0;
|
||||
bool FormEditorPlugin::initialize(const QStringList &arguments, QString *error)
|
||||
{
|
||||
Core::ICore *core = ExtensionSystem::PluginManager::instance()->getObject<Core::ICore>();
|
||||
if (!core->mimeDatabase()->addMimeTypes(QLatin1String(":/formeditor/Designer.mimetypes.xml"), error_message))
|
||||
Q_UNUSED(arguments);
|
||||
Q_UNUSED(error);
|
||||
|
||||
Core::ICore *core = Core::ICore::instance();
|
||||
if (!core->mimeDatabase()->addMimeTypes(QLatin1String(":/formeditor/Designer.mimetypes.xml"), error))
|
||||
return false;
|
||||
|
||||
if (!initializeTemplates(error_message))
|
||||
if (!initializeTemplates(error))
|
||||
return false;
|
||||
|
||||
const int uid = core->uniqueIDManager()->uniqueIdentifier(QLatin1String(C_FORMEDITOR));
|
||||
@@ -107,7 +110,7 @@ bool FormEditorPlugin::initialize(const QStringList & /*arguments*/, QString *er
|
||||
// Make sure settings pages and action shortcuts are registered
|
||||
FormEditorW::ensureInitStage(FormEditorW::RegisterPlugins);
|
||||
|
||||
error_message->clear();
|
||||
error->clear();
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -121,24 +124,23 @@ void FormEditorPlugin::extensionsInitialized()
|
||||
//
|
||||
////////////////////////////////////////////////////
|
||||
|
||||
bool FormEditorPlugin::initializeTemplates(QString * /* error_message */)
|
||||
bool FormEditorPlugin::initializeTemplates(QString *error)
|
||||
{
|
||||
|
||||
Core::ICore *core = ExtensionSystem::PluginManager::instance()->getObject<Core::ICore>();
|
||||
Q_UNUSED(error);
|
||||
FormWizard::BaseFileWizardParameters wizardParameters(Core::IWizard::FileWizard);
|
||||
wizardParameters.setCategory(QLatin1String("Qt"));
|
||||
wizardParameters.setTrCategory(tr("Qt"));
|
||||
const QString formFileType = QLatin1String(Constants::FORM_FILE_TYPE);
|
||||
wizardParameters.setName(tr("Qt Designer Form"));
|
||||
wizardParameters.setDescription(tr("This creates a new Qt Designer form file."));
|
||||
m_formWizard = new FormWizard(wizardParameters, core, this);
|
||||
m_formWizard = new FormWizard(wizardParameters, this);
|
||||
addObject(m_formWizard);
|
||||
|
||||
#ifdef CPP_ENABLED
|
||||
wizardParameters.setKind(Core::IWizard::ClassWizard);
|
||||
wizardParameters.setName(tr("Qt Designer Form Class"));
|
||||
wizardParameters.setDescription(tr("This creates a new Qt Designer form class."));
|
||||
m_formClassWizard = new FormClassWizard(wizardParameters, core, this);
|
||||
m_formClassWizard = new FormClassWizard(wizardParameters, this);
|
||||
addObject(m_formClassWizard);
|
||||
#endif
|
||||
return true;
|
||||
|
||||
@@ -43,6 +43,7 @@
|
||||
#include <coreplugin/uniqueidmanager.h>
|
||||
#include <coreplugin/actionmanager/actionmanager.h>
|
||||
#include <coreplugin/editormanager/editormanager.h>
|
||||
#include <extensionsystem/pluginmanager.h>
|
||||
#include <utils/qtcassert.h>
|
||||
|
||||
#include <QtDesigner/QDesignerFormEditorPluginInterface>
|
||||
@@ -162,7 +163,7 @@ FormEditorW::FormEditorW() :
|
||||
m_formeditor(QDesignerComponents::createFormEditor(0)),
|
||||
m_integration(0),
|
||||
m_fwm(0),
|
||||
m_core(ExtensionSystem::PluginManager::instance()->getObject<Core::ICore>()),
|
||||
m_core(Core::ICore::instance()),
|
||||
m_initStage(RegisterPlugins),
|
||||
m_actionGroupEditMode(0),
|
||||
m_actionPrint(0),
|
||||
|
||||
@@ -34,12 +34,12 @@
|
||||
#ifndef FORMEDITORW_H
|
||||
#define FORMEDITORW_H
|
||||
|
||||
#include <extensionsystem/ExtensionSystemInterfaces>
|
||||
#include <QtDesigner/QDesignerFormEditorInterface>
|
||||
|
||||
#include <QtCore/QObject>
|
||||
#include <QtCore/QList>
|
||||
#include <QtCore/QObject>
|
||||
#include <QtCore/QPointer>
|
||||
#include <QtCore/QStringList>
|
||||
|
||||
#include "designerconstants.h"
|
||||
|
||||
|
||||
@@ -36,8 +36,6 @@
|
||||
#include "formwindoweditor.h"
|
||||
#include "designerconstants.h"
|
||||
|
||||
#include <coreplugin/icore.h>
|
||||
|
||||
#include <QtCore/QFile>
|
||||
#include <QtCore/QDebug>
|
||||
|
||||
@@ -46,8 +44,8 @@ enum { debugFormWizard = 0 };
|
||||
using namespace Designer;
|
||||
using namespace Designer::Internal;
|
||||
|
||||
FormWizard::FormWizard(const BaseFileWizardParameters ¶meters, Core::ICore *core, QObject *parent) :
|
||||
Core::BaseFileWizard(parameters, core, parent)
|
||||
FormWizard::FormWizard(const BaseFileWizardParameters ¶meters, QObject *parent)
|
||||
: Core::BaseFileWizard(parameters, parent)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -55,7 +53,7 @@ QWizard *FormWizard::createWizardDialog(QWidget *parent,
|
||||
const QString &defaultPath,
|
||||
const WizardPageList &extensionPages) const
|
||||
{
|
||||
FormFileWizardDialog *wizardDialog = new FormFileWizardDialog(core(), extensionPages, parent);
|
||||
FormFileWizardDialog *wizardDialog = new FormFileWizardDialog(extensionPages, parent);
|
||||
wizardDialog->setPath(defaultPath);
|
||||
return wizardDialog;
|
||||
}
|
||||
|
||||
@@ -36,15 +36,9 @@
|
||||
|
||||
#include <coreplugin/basefilewizard.h>
|
||||
|
||||
QT_BEGIN_NAMESPACE
|
||||
class QWizard;
|
||||
QT_END_NAMESPACE
|
||||
|
||||
namespace Designer {
|
||||
namespace Internal {
|
||||
|
||||
class FormFileWizardDialog;
|
||||
|
||||
class FormWizard : public Core::BaseFileWizard
|
||||
{
|
||||
Q_DISABLE_COPY(FormWizard)
|
||||
@@ -53,7 +47,7 @@ class FormWizard : public Core::BaseFileWizard
|
||||
public:
|
||||
typedef Core::BaseFileWizardParameters BaseFileWizardParameters;
|
||||
|
||||
explicit FormWizard(const BaseFileWizardParameters ¶meters, Core::ICore *core, QObject *parent);
|
||||
FormWizard(const BaseFileWizardParameters ¶meters, QObject *parent);
|
||||
|
||||
protected:
|
||||
virtual QWizard *createWizardDialog(QWidget *parent,
|
||||
|
||||
@@ -50,12 +50,10 @@ namespace Designer {
|
||||
namespace Internal {
|
||||
|
||||
// ----------------- FormWizardDialog
|
||||
FormWizardDialog::FormWizardDialog(Core::ICore *core,
|
||||
const WizardPageList &extensionPages,
|
||||
QWidget *parent) :
|
||||
QWizard(parent),
|
||||
m_formPage(new FormTemplateWizardPagePage),
|
||||
m_core(core)
|
||||
FormWizardDialog::FormWizardDialog(const WizardPageList &extensionPages,
|
||||
QWidget *parent)
|
||||
: QWizard(parent),
|
||||
m_formPage(new FormTemplateWizardPagePage)
|
||||
{
|
||||
init(extensionPages);
|
||||
}
|
||||
@@ -82,10 +80,9 @@ QString FormWizardDialog::templateContents() const
|
||||
}
|
||||
|
||||
// ----------------- FormFileWizardDialog
|
||||
FormFileWizardDialog::FormFileWizardDialog(Core::ICore *core,
|
||||
const WizardPageList &extensionPages,
|
||||
QWidget *parent) :
|
||||
FormWizardDialog(core, extensionPages, parent),
|
||||
FormFileWizardDialog::FormFileWizardDialog(const WizardPageList &extensionPages,
|
||||
QWidget *parent)
|
||||
: FormWizardDialog(extensionPages, parent),
|
||||
m_filePage(new Core::Utils::FileWizardPage)
|
||||
{
|
||||
setPage(FilePageId, m_filePage);
|
||||
|
||||
@@ -37,10 +37,9 @@
|
||||
#include <QtGui/QWizard>
|
||||
|
||||
namespace Core {
|
||||
class ICore;
|
||||
namespace Utils {
|
||||
class FileWizardPage;
|
||||
}
|
||||
namespace Utils {
|
||||
class FileWizardPage;
|
||||
}
|
||||
}
|
||||
|
||||
namespace Designer {
|
||||
@@ -58,8 +57,7 @@ class FormWizardDialog : public QWizard
|
||||
|
||||
public:
|
||||
typedef QList<QWizardPage *> WizardPageList;
|
||||
explicit FormWizardDialog(Core::ICore *core,
|
||||
const WizardPageList &extensionPages,
|
||||
explicit FormWizardDialog(const WizardPageList &extensionPages,
|
||||
QWidget *parent = 0);
|
||||
|
||||
QString templateContents() const;
|
||||
@@ -68,7 +66,6 @@ private:
|
||||
void init(const WizardPageList &extensionPages);
|
||||
|
||||
FormTemplateWizardPagePage *m_formPage;
|
||||
Core::ICore *m_core;
|
||||
mutable QString m_templateContents;
|
||||
};
|
||||
|
||||
@@ -82,8 +79,7 @@ class FormFileWizardDialog : public FormWizardDialog
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit FormFileWizardDialog(Core::ICore *core,
|
||||
const WizardPageList &extensionPages,
|
||||
explicit FormFileWizardDialog(const WizardPageList &extensionPages,
|
||||
QWidget *parent = 0);
|
||||
|
||||
QString path() const;
|
||||
|
||||
@@ -48,6 +48,7 @@
|
||||
#include <cplusplus/LookupContext.h>
|
||||
#include <coreplugin/icore.h>
|
||||
#include <coreplugin/editormanager/editormanager.h>
|
||||
#include <extensionsystem/pluginmanager.h>
|
||||
#include <texteditor/basetexteditor.h>
|
||||
#include <texteditor/itexteditable.h>
|
||||
|
||||
@@ -78,8 +79,8 @@ static QString msgClassNotFound(const QString &uiClassName, const QList<Document
|
||||
|
||||
static inline CppTools::CppModelManagerInterface *cppModelManagerInstance()
|
||||
{
|
||||
Core::ICore *core = ExtensionSystem::PluginManager::instance()->getObject<Core::ICore>();
|
||||
return core->pluginManager()->getObject<CppTools::CppModelManagerInterface>();
|
||||
return ExtensionSystem::PluginManager::instance()
|
||||
->getObject<CppTools::CppModelManagerInterface>();
|
||||
}
|
||||
|
||||
WorkbenchIntegration::WorkbenchIntegration(QDesignerFormEditorInterface *core, FormEditorW *parent) :
|
||||
|
||||
@@ -58,6 +58,7 @@ public slots:
|
||||
// FIXME: good idea?
|
||||
void addWidget(QWidget *widget);
|
||||
void removeWidget(QWidget *widget);
|
||||
void setCurrentFileName(const QString &fileName);
|
||||
|
||||
// This executes an "ex" style command taking context
|
||||
// information from \p widget;
|
||||
@@ -68,10 +69,11 @@ public slots:
|
||||
signals:
|
||||
void commandBufferChanged(const QString &msg);
|
||||
void statusDataChanged(const QString &msg);
|
||||
void extraInformationChanged(const QString &msg);
|
||||
void quitRequested(QWidget *);
|
||||
void extraInformationChanged(QWidget *widget, const QString &msg);
|
||||
void quitRequested(QWidget *widget);
|
||||
void selectionChanged(QWidget *widget,
|
||||
const QList<QTextEdit::ExtraSelection> &selection);
|
||||
void writeFile(const QString &fileName, const QString &contents);
|
||||
|
||||
private:
|
||||
bool eventFilter(QObject *ob, QEvent *ev);
|
||||
|
||||
@@ -39,7 +39,9 @@
|
||||
#include <coreplugin/actionmanager/actionmanager.h>
|
||||
#include <coreplugin/coreconstants.h>
|
||||
#include <coreplugin/editormanager/editormanager.h>
|
||||
#include <coreplugin/filemanager.h>
|
||||
#include <coreplugin/icore.h>
|
||||
#include <coreplugin/ifile.h>
|
||||
#include <coreplugin/messagemanager.h>
|
||||
#include <coreplugin/modemanager.h>
|
||||
#include <coreplugin/uniqueidmanager.h>
|
||||
@@ -112,17 +114,19 @@ private slots:
|
||||
void installHandler(QWidget *widget);
|
||||
void removeHandler(QWidget *widget);
|
||||
void showCommandBuffer(const QString &contents);
|
||||
void showExtraInformation(const QString &msg);
|
||||
void showExtraInformation(QWidget *, const QString &msg);
|
||||
void editorOpened(Core::IEditor *);
|
||||
void editorAboutToClose(Core::IEditor *);
|
||||
void changeSelection(QWidget *widget,
|
||||
const QList<QTextEdit::ExtraSelection> &selections);
|
||||
void writeFile(const QString &fileName, const QString &contents);
|
||||
|
||||
private:
|
||||
FakeVimPlugin *q;
|
||||
FakeVimHandler *m_handler;
|
||||
QAction *m_installHandlerAction;
|
||||
Core::ICore *m_core;
|
||||
Core::IFile *m_currentFile;
|
||||
};
|
||||
|
||||
} // namespace Internal
|
||||
@@ -134,6 +138,7 @@ FakeVimPluginPrivate::FakeVimPluginPrivate(FakeVimPlugin *plugin)
|
||||
m_handler = 0;
|
||||
m_installHandlerAction = 0;
|
||||
m_core = 0;
|
||||
m_currentFile = 0;
|
||||
}
|
||||
|
||||
FakeVimPluginPrivate::~FakeVimPluginPrivate()
|
||||
@@ -153,7 +158,7 @@ bool FakeVimPluginPrivate::initialize(const QStringList &arguments, QString *err
|
||||
|
||||
m_handler = new FakeVimHandler;
|
||||
|
||||
m_core = ExtensionSystem::PluginManager::instance()->getObject<Core::ICore>();
|
||||
m_core = Core::ICore::instance();
|
||||
QTC_ASSERT(m_core, return false);
|
||||
|
||||
Core::ActionManager *actionManager = m_core->actionManager();
|
||||
@@ -172,7 +177,7 @@ bool FakeVimPluginPrivate::initialize(const QStringList &arguments, QString *err
|
||||
|
||||
ActionContainer *advancedMenu =
|
||||
actionManager->actionContainer(Core::Constants::M_EDIT_ADVANCED);
|
||||
advancedMenu->addAction(cmd);
|
||||
advancedMenu->addAction(cmd, Core::Constants::G_EDIT_EDITOR);
|
||||
|
||||
connect(m_installHandlerAction, SIGNAL(triggered()),
|
||||
this, SLOT(installHandler()));
|
||||
@@ -195,8 +200,8 @@ void FakeVimPluginPrivate::installHandler()
|
||||
|
||||
void FakeVimPluginPrivate::installHandler(QWidget *widget)
|
||||
{
|
||||
connect(m_handler, SIGNAL(extraInformationChanged(QString)),
|
||||
this, SLOT(showExtraInformation(QString)));
|
||||
connect(m_handler, SIGNAL(extraInformationChanged(QWidget *, QString)),
|
||||
this, SLOT(showExtraInformation(QWidget *, QString)));
|
||||
connect(m_handler, SIGNAL(commandBufferChanged(QString)),
|
||||
this, SLOT(showCommandBuffer(QString)));
|
||||
connect(m_handler, SIGNAL(quitRequested(QWidget *)),
|
||||
@@ -206,6 +211,12 @@ void FakeVimPluginPrivate::installHandler(QWidget *widget)
|
||||
this, SLOT(changeSelection(QWidget*,QList<QTextEdit::ExtraSelection>)));
|
||||
|
||||
m_handler->addWidget(widget);
|
||||
TextEditor::BaseTextEditor* editor =
|
||||
qobject_cast<TextEditor::BaseTextEditor*>(widget);
|
||||
if (editor) {
|
||||
m_currentFile = editor->file();
|
||||
m_handler->setCurrentFileName(editor->file()->fileName());
|
||||
}
|
||||
|
||||
BaseTextEditor *bt = qobject_cast<BaseTextEditor *>(widget);
|
||||
if (bt) {
|
||||
@@ -225,12 +236,29 @@ void FakeVimPluginPrivate::installHandler(QWidget *widget)
|
||||
}
|
||||
}
|
||||
|
||||
void FakeVimPluginPrivate::writeFile(const QString &fileName,
|
||||
const QString &contents)
|
||||
{
|
||||
if (m_currentFile && fileName == m_currentFile->fileName()) {
|
||||
// Handle that as a special case for nicer interaction with core
|
||||
m_core->fileManager()->blockFileChange(m_currentFile);
|
||||
m_currentFile->save(fileName);
|
||||
m_core->fileManager()->unblockFileChange(m_currentFile);
|
||||
} else {
|
||||
QFile file(fileName);
|
||||
file.open(QIODevice::ReadWrite);
|
||||
{ QTextStream ts(&file); ts << contents; }
|
||||
file.close();
|
||||
}
|
||||
}
|
||||
|
||||
void FakeVimPluginPrivate::removeHandler(QWidget *widget)
|
||||
{
|
||||
Q_UNUSED(widget);
|
||||
m_handler->removeWidget(widget);
|
||||
Core::EditorManager::instance()->hideEditorInfoBar(
|
||||
QLatin1String(Constants::MINI_BUFFER));
|
||||
m_currentFile = 0;
|
||||
}
|
||||
|
||||
void FakeVimPluginPrivate::editorOpened(Core::IEditor *editor)
|
||||
@@ -253,9 +281,9 @@ void FakeVimPluginPrivate::showCommandBuffer(const QString &contents)
|
||||
tr("Quit FakeVim"), m_handler, SLOT(quit()));
|
||||
}
|
||||
|
||||
void FakeVimPluginPrivate::showExtraInformation(const QString &text)
|
||||
void FakeVimPluginPrivate::showExtraInformation(QWidget *widget, const QString &text)
|
||||
{
|
||||
QMessageBox::information(0, tr("FakeVim Information"), text);
|
||||
QMessageBox::information(widget, tr("FakeVim Information"), text);
|
||||
}
|
||||
|
||||
void FakeVimPluginPrivate::changeSelection(QWidget *widget,
|
||||
|
||||
@@ -43,9 +43,11 @@
|
||||
#include <coreplugin/actionmanager/command.h>
|
||||
#include <coreplugin/coreconstants.h>
|
||||
|
||||
#include <extensionsystem/pluginmanager.h>
|
||||
|
||||
#include <utils/qtcassert.h>
|
||||
|
||||
#include <QtCore/qplugin.h>
|
||||
#include <QtCore/QtPlugin>
|
||||
#include <QtCore/QSettings>
|
||||
|
||||
Q_DECLARE_METATYPE(Find::IFindFilter*)
|
||||
@@ -58,8 +60,7 @@ using namespace Find;
|
||||
using namespace Find::Internal;
|
||||
|
||||
FindPlugin::FindPlugin()
|
||||
: m_core(0),
|
||||
m_currentDocumentFind(0),
|
||||
: m_currentDocumentFind(0),
|
||||
m_findToolBar(0),
|
||||
m_findDialog(0),
|
||||
m_findCompletionModel(new QStringListModel(this)),
|
||||
@@ -76,14 +77,14 @@ FindPlugin::~FindPlugin()
|
||||
|
||||
bool FindPlugin::initialize(const QStringList &, QString *)
|
||||
{
|
||||
m_core = ExtensionSystem::PluginManager::instance()->getObject<Core::ICore>();
|
||||
Core::ICore *core = Core::ICore::instance();
|
||||
setupMenu();
|
||||
|
||||
m_currentDocumentFind = new CurrentDocumentFind(m_core);
|
||||
m_currentDocumentFind = new CurrentDocumentFind(core);
|
||||
|
||||
m_findToolBar = new FindToolBar(this, m_currentDocumentFind);
|
||||
m_findDialog = new FindToolWindow(this);
|
||||
SearchResultWindow *searchResultWindow = new SearchResultWindow(m_core);
|
||||
SearchResultWindow *searchResultWindow = new SearchResultWindow(core);
|
||||
addAutoReleasedObject(searchResultWindow);
|
||||
return true;
|
||||
}
|
||||
@@ -123,10 +124,10 @@ void FindPlugin::openFindFilter()
|
||||
m_findDialog->open(filter);
|
||||
}
|
||||
|
||||
|
||||
void FindPlugin::setupMenu()
|
||||
{
|
||||
Core::ActionManager *am = m_core->actionManager();
|
||||
Core::ICore *core = Core::ICore::instance();
|
||||
Core::ActionManager *am = core->actionManager();
|
||||
Core::ActionContainer *medit = am->actionContainer(Core::Constants::M_EDIT);
|
||||
Core::ActionContainer *mfind = am->createMenu(Constants::M_FIND);
|
||||
medit->addMenu(mfind, Core::Constants::G_EDIT_FIND);
|
||||
@@ -149,7 +150,8 @@ void FindPlugin::setupMenu()
|
||||
|
||||
void FindPlugin::setupFilterMenuItems()
|
||||
{
|
||||
Core::ActionManager *am = m_core->actionManager();
|
||||
Core::ICore *core = Core::ICore::instance();
|
||||
Core::ActionManager *am = core->actionManager();
|
||||
QList<IFindFilter*> findInterfaces =
|
||||
ExtensionSystem::PluginManager::instance()->getObjects<IFindFilter>();
|
||||
Core::Command *cmd;
|
||||
@@ -171,11 +173,6 @@ void FindPlugin::setupFilterMenuItems()
|
||||
m_findDialog->setFindFilters(findInterfaces);
|
||||
}
|
||||
|
||||
Core::ICore *FindPlugin::core()
|
||||
{
|
||||
return m_core;
|
||||
}
|
||||
|
||||
QTextDocument::FindFlags FindPlugin::findFlags() const
|
||||
{
|
||||
return m_findFlags;
|
||||
@@ -216,7 +213,7 @@ bool FindPlugin::hasFindFlag(QTextDocument::FindFlag flag)
|
||||
|
||||
void FindPlugin::writeSettings()
|
||||
{
|
||||
QSettings *settings = ExtensionSystem::PluginManager::instance()->getObject<Core::ICore>()->settings();
|
||||
QSettings *settings = Core::ICore::instance()->settings();
|
||||
settings->beginGroup("Find");
|
||||
settings->setValue("Backward", QVariant((m_findFlags & QTextDocument::FindBackward) != 0));
|
||||
settings->setValue("CaseSensitively", QVariant((m_findFlags & QTextDocument::FindCaseSensitively) != 0));
|
||||
@@ -229,7 +226,7 @@ void FindPlugin::writeSettings()
|
||||
|
||||
void FindPlugin::readSettings()
|
||||
{
|
||||
QSettings *settings = ExtensionSystem::PluginManager::instance()->getObject<Core::ICore>()->settings();
|
||||
QSettings *settings = Core::ICore::instance()->settings();
|
||||
settings->beginGroup("Find");
|
||||
bool block = blockSignals(true);
|
||||
setBackward(settings->value("Backward", false).toBool());
|
||||
|
||||
@@ -64,7 +64,6 @@ public:
|
||||
void extensionsInitialized();
|
||||
void shutdown();
|
||||
|
||||
Core::ICore *core();
|
||||
QTextDocument::FindFlags findFlags() const;
|
||||
void updateFindCompletion(const QString &text);
|
||||
void updateReplaceCompletion(const QString &text);
|
||||
@@ -93,7 +92,6 @@ private:
|
||||
void readSettings();
|
||||
|
||||
//variables
|
||||
Core::ICore *m_core;
|
||||
QHash<IFindFilter *, QAction *> m_filterActions;
|
||||
|
||||
CurrentDocumentFind *m_currentDocumentFind;
|
||||
|
||||
@@ -41,16 +41,19 @@
|
||||
#include <coreplugin/actionmanager/actioncontainer.h>
|
||||
#include <coreplugin/actionmanager/command.h>
|
||||
|
||||
#include <extensionsystem/pluginmanager.h>
|
||||
|
||||
#include <QtCore/QDebug>
|
||||
#include <QtCore/QSettings>
|
||||
#include <QtGui/QPushButton>
|
||||
#include <QtGui/QMenu>
|
||||
#include <QtGui/QToolButton>
|
||||
#include <QtGui/QLineEdit>
|
||||
#include <QtGui/QKeyEvent>
|
||||
|
||||
#include <QtGui/QClipboard>
|
||||
#include <QtGui/QPainter>
|
||||
#include <QtGui/QCompleter>
|
||||
#include <QDebug>
|
||||
#include <QtGui/QKeyEvent>
|
||||
#include <QtGui/QLineEdit>
|
||||
#include <QtGui/QMenu>
|
||||
#include <QtGui/QPainter>
|
||||
#include <QtGui/QPushButton>
|
||||
#include <QtGui/QToolButton>
|
||||
|
||||
Q_DECLARE_METATYPE(QStringList)
|
||||
Q_DECLARE_METATYPE(Find::IFindFilter*)
|
||||
@@ -138,7 +141,7 @@ FindToolBar::FindToolBar(FindPlugin *plugin, CurrentDocumentFind *currentDocumen
|
||||
QList<int> globalcontext;
|
||||
globalcontext << Core::Constants::C_GLOBAL_ID;
|
||||
|
||||
Core::ActionManager *am = ExtensionSystem::PluginManager::instance()->getObject<Core::ICore>()->actionManager();
|
||||
Core::ActionManager *am = Core::ICore::instance()->actionManager();
|
||||
Core::ActionContainer *mfind = am->actionContainer(Constants::M_FIND);
|
||||
Core::Command *cmd;
|
||||
|
||||
|
||||
@@ -42,7 +42,7 @@ using namespace Find;
|
||||
using namespace Find::Internal;
|
||||
|
||||
FindToolWindow::FindToolWindow(FindPlugin *plugin)
|
||||
: QDialog(plugin->core()->mainWindow()),
|
||||
: QDialog(Core::ICore::instance()->mainWindow()),
|
||||
m_plugin(plugin),
|
||||
m_findCompleter(new QCompleter(this))
|
||||
{
|
||||
@@ -124,7 +124,7 @@ void FindToolWindow::search()
|
||||
|
||||
void FindToolWindow::writeSettings()
|
||||
{
|
||||
QSettings *settings = m_plugin->core()->settings();
|
||||
QSettings *settings = Core::ICore::instance()->settings();
|
||||
settings->beginGroup("Find");
|
||||
foreach (IFindFilter *filter, m_filters)
|
||||
filter->writeSettings(settings);
|
||||
@@ -133,7 +133,7 @@ void FindToolWindow::writeSettings()
|
||||
|
||||
void FindToolWindow::readSettings()
|
||||
{
|
||||
QSettings *settings = m_plugin->core()->settings();
|
||||
QSettings *settings = Core::ICore::instance()->settings();
|
||||
settings->beginGroup("Find");
|
||||
foreach (IFindFilter *filter, m_filters)
|
||||
filter->readSettings(settings);
|
||||
|
||||
@@ -97,10 +97,10 @@ static QString formatCommand(const QString &binary, const QStringList &args)
|
||||
}
|
||||
|
||||
// ---------------- GitClient
|
||||
GitClient::GitClient(GitPlugin* plugin, Core::ICore *core) :
|
||||
m_msgWait(tr("Waiting for data...")),
|
||||
GitClient::GitClient(GitPlugin* plugin)
|
||||
: m_msgWait(tr("Waiting for data...")),
|
||||
m_plugin(plugin),
|
||||
m_core(core)
|
||||
m_core(Core::ICore::instance())
|
||||
{
|
||||
if (QSettings *s = m_core->settings())
|
||||
m_settings.fromSettings(s);
|
||||
@@ -178,7 +178,7 @@ VCSBase::VCSBaseEditor
|
||||
QTC_ASSERT(rc, return 0);
|
||||
rc->setSource(source);
|
||||
if (setSourceCodec)
|
||||
rc->setCodec(VCSBase::VCSBaseEditor::getCodec(m_core, source));
|
||||
rc->setCodec(VCSBase::VCSBaseEditor::getCodec(source));
|
||||
}
|
||||
return rc;
|
||||
}
|
||||
|
||||
@@ -68,7 +68,7 @@ class GitClient : public QObject
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit GitClient(GitPlugin *plugin, Core::ICore *core);
|
||||
explicit GitClient(GitPlugin *plugin);
|
||||
~GitClient();
|
||||
|
||||
bool managesDirectory(const QString &) const { return false; }
|
||||
|
||||
@@ -36,6 +36,7 @@
|
||||
|
||||
#include <coreplugin/icore.h>
|
||||
#include <coreplugin/progressmanager/progressmanager.h>
|
||||
#include <extensionsystem/pluginmanager.h>
|
||||
|
||||
#include <QtCore/QDebug>
|
||||
#include <QtCore/QProcess>
|
||||
@@ -83,8 +84,7 @@ void GitCommand::execute()
|
||||
QFuture<void> task = QtConcurrent::run(this, &GitCommand::run);
|
||||
const QString taskName = QLatin1String("Git ") + m_jobs.front().arguments.at(0);
|
||||
|
||||
Core::ICore *core = ExtensionSystem::PluginManager::instance()->getObject<Core::ICore>();
|
||||
core->progressManager()->addTask(task, taskName,
|
||||
Core::ICore::instance()->progressManager()->addTask(task, taskName,
|
||||
QLatin1String("Git.action"),
|
||||
Core::ProgressManager::CloseOnSuccess);
|
||||
}
|
||||
|
||||