forked from qt-creator/qt-creator
Merge branch 'master' of git@scm.dev.nokia.troll.no:creator/mainline
Conflicts: src/plugins/perforce/perforceplugin.cpp
This commit is contained in:
@@ -7,7 +7,7 @@ unix {
|
|||||||
}
|
}
|
||||||
|
|
||||||
QHP_FILE = $$OUT_PWD/doc/html/qtcreator.qhp
|
QHP_FILE = $$OUT_PWD/doc/html/qtcreator.qhp
|
||||||
QCH_FILE = $$OUT_PWD/doc/qtcreator.qch
|
QCH_FILE = $$OUT_PWD/share/doc/qtcreator/qtcreator.qch
|
||||||
|
|
||||||
unix {
|
unix {
|
||||||
html_docs.commands = $$QDOC $$PWD/qtcreator.qdocconf
|
html_docs.commands = $$QDOC $$PWD/qtcreator.qdocconf
|
||||||
@@ -21,6 +21,11 @@ qch_docs.commands = $$HELPGENERATOR -o $$QCH_FILE $$QHP_FILE
|
|||||||
qch_docs.depends += html_docs
|
qch_docs.depends += html_docs
|
||||||
qch_docs.files = $$QCH_FILE
|
qch_docs.files = $$QCH_FILE
|
||||||
|
|
||||||
|
linux-* {
|
||||||
|
qch_docs.path = /share/doc/qtcreator
|
||||||
|
INSTALLS += qch_docs
|
||||||
|
}
|
||||||
|
|
||||||
macx {
|
macx {
|
||||||
cp_docs.commands = $${QMAKE_COPY_DIR} $${OUT_PWD}/doc $${OUT_PWD}/bin/QtCreator.app/Contents/Resources
|
cp_docs.commands = $${QMAKE_COPY_DIR} $${OUT_PWD}/doc $${OUT_PWD}/bin/QtCreator.app/Contents/Resources
|
||||||
cp_docs.depends += qch_docs
|
cp_docs.depends += qch_docs
|
||||||
|
|||||||
@@ -5,10 +5,10 @@ count(TOO_OLD_LIST, 1) {
|
|||||||
error("Use at least Qt 4.5.")
|
error("Use at least Qt 4.5.")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
include(doc/doc.pri)
|
||||||
|
include(share/share.pri)
|
||||||
|
|
||||||
TEMPLATE = subdirs
|
TEMPLATE = subdirs
|
||||||
CONFIG += ordered
|
CONFIG += ordered
|
||||||
|
|
||||||
SUBDIRS = src
|
SUBDIRS = src
|
||||||
|
|
||||||
include(doc/doc.pri)
|
|
||||||
|
|||||||
@@ -76,20 +76,6 @@ build() {
|
|||||||
ret=$?; [ ${ret} = 0 ] || exit ${ret}
|
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() {
|
inst() {
|
||||||
(
|
(
|
||||||
cd "${dir}" || die "cd failed"
|
cd "${dir}" || die "cd failed"
|
||||||
@@ -98,22 +84,13 @@ inst() {
|
|||||||
env -i "${MAKE}" install || die "make install failed"
|
env -i "${MAKE}" install || die "make install failed"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# Fix rpath's
|
||||||
cd "${destdir}" || die "cd failed"
|
cd "${destdir}" || die "cd failed"
|
||||||
|
find bin -mindepth 1 -maxdepth 1 -type f -perm -100 | xargs -n 1 chrpath -r '$ORIGIN/../lib'
|
||||||
# Fix files bin/*
|
find lib -mindepth 1 -maxdepth 1 -type f -perm -100 | xargs -n 1 chrpath -r '$ORIGIN'
|
||||||
fix_rpath bin '*' '$ORIGIN/../lib'
|
find . -mindepth 3 -maxdepth 3 -type f -perm -100 | xargs -n 1 chrpath -r '$ORIGIN/../../lib'
|
||||||
|
find . -mindepth 4 -maxdepth 4 -type f -perm -100 | xargs -n 1 chrpath -r '$ORIGIN/../../../lib'
|
||||||
# Fix files lib/*.so
|
find . -mindepth 5 -maxdepth 5 -type f -perm -100 | xargs -n 1 chrpath -r '$ORIGIN/../../../../lib'
|
||||||
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}
|
ret=$?; [ ${ret} = 0 ] || exit ${ret}
|
||||||
}
|
}
|
||||||
|
|||||||
81
share/share.pri
Normal file
81
share/share.pri
Normal file
@@ -0,0 +1,81 @@
|
|||||||
|
macx {
|
||||||
|
SNIPPETS.path = Contents/Resources
|
||||||
|
SNIPPETS.files = $$PWD/qtcreator/snippets
|
||||||
|
TEMPLATES.path = Contents/Resources
|
||||||
|
TEMPLATES.files = $$PWD/qtcreator/templates
|
||||||
|
DESIGNER.path = Contents/Resources
|
||||||
|
DESIGNER.files = $$PWD/qtcreator/designer
|
||||||
|
SCHEMES.path = Contents/Resources
|
||||||
|
SCHEMES.files = $$PWD/qtcreator/schemes
|
||||||
|
GDBDEBUGGER.path = Contents/Resources
|
||||||
|
GDBDEBUGGER.files = $$PWD/qtcreator/gdbmacros
|
||||||
|
LICENSE.path = Contents/Resources
|
||||||
|
LICENSE.files = $$PWD/qtcreator/license.txt
|
||||||
|
RUNINTERMINAL.path = Contents/Resources
|
||||||
|
RUNINTERMINAL.files = $$PWD/qtcreator/runInTerminal.command
|
||||||
|
QMAKE_BUNDLE_DATA += SNIPPETS TEMPLATES DESIGNER SCHEMES GDBDEBUGGER LICENSE RUNINTERMINAL
|
||||||
|
QMAKE_INFO_PLIST = $$PWD/qtcreator/info.plist
|
||||||
|
}
|
||||||
|
|
||||||
|
win32 {
|
||||||
|
# make sure the resources are in place
|
||||||
|
!exists($$OUT_PWD/app.pro) {
|
||||||
|
unix:SEPARATOR = ;
|
||||||
|
win32:SEPARATOR = &
|
||||||
|
# we are shadow build
|
||||||
|
COPYSRC = snippets \
|
||||||
|
templates \
|
||||||
|
designer \
|
||||||
|
schemes \
|
||||||
|
gdbmacros
|
||||||
|
COPYDEST = $${OUT_PWD}/../../bin
|
||||||
|
win32:COPYDEST ~= s|/+|\|
|
||||||
|
for(tmp,COPYSRC) {
|
||||||
|
REALSRC = $$PWD/$$tmp
|
||||||
|
REALDEST = $$COPYDEST/$$tmp
|
||||||
|
win32:tmp ~= s|/+|\|
|
||||||
|
win32:REALSRC ~= s|/+|\|
|
||||||
|
win32:REALDEST ~= s|/+|\|
|
||||||
|
QMAKE_POST_LINK += $${QMAKE_COPY_DIR} $${REALSRC} $${REALDEST} $$SEPARATOR
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
linux-* {
|
||||||
|
licenses.files += $$PWD/qtcreator/license.txt
|
||||||
|
licenses.path = /share/qtcreator
|
||||||
|
|
||||||
|
keymaps.files += $$PWD/qtcreator/schemes/MS_Visual_C++.kms
|
||||||
|
keymaps.files += $$PWD/qtcreator/schemes/Xcode.kms
|
||||||
|
keymaps.path = /share/qtcreator/schemes
|
||||||
|
|
||||||
|
gdbsupport.files += $$PWD/qtcreator/gdbmacros/GPL_EXCEPTION.TXT
|
||||||
|
gdbsupport.files += $$PWD/qtcreator/gdbmacros/gdbmacros.cpp
|
||||||
|
gdbsupport.files += $$PWD/qtcreator/gdbmacros/gdbmacros.pro
|
||||||
|
gdbsupport.path = /share/qtcreator/gdbmacros
|
||||||
|
|
||||||
|
designertemplates.files += $$PWD/qtcreator/designer/templates.xml
|
||||||
|
designertemplates.files += $$PWD/qtcreator/designer/templates/*
|
||||||
|
designertemplates.path = /share/qtcreator/designer/templates
|
||||||
|
|
||||||
|
snippets.files += $$PWD/qtcreator/snippets/*.snp
|
||||||
|
snippets.path = /share/qtcreator/snippets
|
||||||
|
|
||||||
|
projecttemplates.files += $$PWD/qtcreator/templates/qt4project/mywidget_form.h
|
||||||
|
projecttemplates.files += $$PWD/qtcreator/templates/qt4project/main.cpp
|
||||||
|
projecttemplates.files += $$PWD/qtcreator/templates/qt4project/mywidget.cpp
|
||||||
|
projecttemplates.files += $$PWD/qtcreator/templates/qt4project/mywidget.h
|
||||||
|
projecttemplates.files += $$PWD/qtcreator/templates/qt4project/widget.ui
|
||||||
|
projecttemplates.files += $$PWD/qtcreator/templates/qt4project/mywidget_form.cpp
|
||||||
|
projecttemplates.path = /share/qtcreator/templates/qt4project
|
||||||
|
|
||||||
|
INSTALLS += \
|
||||||
|
licenses \
|
||||||
|
keymaps \
|
||||||
|
gdbsupport \
|
||||||
|
designertemplates \
|
||||||
|
snippets \
|
||||||
|
projecttemplates
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
@@ -60,12 +60,13 @@ QT_BEGIN_NAMESPACE
|
|||||||
class HelpNetworkReply : public QNetworkReply
|
class HelpNetworkReply : public QNetworkReply
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
HelpNetworkReply(const QNetworkRequest &request, const QByteArray &fileData);
|
HelpNetworkReply(const QNetworkRequest &request, const QByteArray &fileData,
|
||||||
|
const QString &mimeType);
|
||||||
|
|
||||||
virtual void abort();
|
virtual void abort();
|
||||||
|
|
||||||
virtual qint64 bytesAvailable() const
|
virtual qint64 bytesAvailable() const
|
||||||
{ return data.length() + QNetworkReply::bytesAvailable(); }
|
{ return data.length() + QNetworkReply::bytesAvailable(); }
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
virtual qint64 readData(char *data, qint64 maxlen);
|
virtual qint64 readData(char *data, qint64 maxlen);
|
||||||
@@ -76,13 +77,13 @@ private:
|
|||||||
};
|
};
|
||||||
|
|
||||||
HelpNetworkReply::HelpNetworkReply(const QNetworkRequest &request,
|
HelpNetworkReply::HelpNetworkReply(const QNetworkRequest &request,
|
||||||
const QByteArray &fileData)
|
const QByteArray &fileData, const QString &mimeType)
|
||||||
: data(fileData), origLen(fileData.length())
|
: data(fileData), origLen(fileData.length())
|
||||||
{
|
{
|
||||||
setRequest(request);
|
setRequest(request);
|
||||||
setOpenMode(QIODevice::ReadOnly);
|
setOpenMode(QIODevice::ReadOnly);
|
||||||
|
|
||||||
setHeader(QNetworkRequest::ContentTypeHeader, QLatin1String("text/html"));
|
setHeader(QNetworkRequest::ContentTypeHeader, mimeType);
|
||||||
setHeader(QNetworkRequest::ContentLengthHeader, QByteArray::number(origLen));
|
setHeader(QNetworkRequest::ContentLengthHeader, QByteArray::number(origLen));
|
||||||
QTimer::singleShot(0, this, SIGNAL(metaDataChanged()));
|
QTimer::singleShot(0, this, SIGNAL(metaDataChanged()));
|
||||||
QTimer::singleShot(0, this, SIGNAL(readyRead()));
|
QTimer::singleShot(0, this, SIGNAL(readyRead()));
|
||||||
@@ -127,9 +128,23 @@ HelpNetworkAccessManager::HelpNetworkAccessManager(QHelpEngine *engine,
|
|||||||
QNetworkReply *HelpNetworkAccessManager::createRequest(Operation op,
|
QNetworkReply *HelpNetworkAccessManager::createRequest(Operation op,
|
||||||
const QNetworkRequest &request, QIODevice *outgoingData)
|
const QNetworkRequest &request, QIODevice *outgoingData)
|
||||||
{
|
{
|
||||||
const QString scheme = request.url().scheme();
|
const QString& scheme = request.url().scheme();
|
||||||
if (scheme == QLatin1String("qthelp") || scheme == QLatin1String("about")) {
|
if (scheme == QLatin1String("qthelp") || scheme == QLatin1String("about")) {
|
||||||
return new HelpNetworkReply(request, helpEngine->fileData(request.url()));
|
const QUrl& url = request.url();
|
||||||
|
QString mimeType = url.toString();
|
||||||
|
if (mimeType.endsWith(QLatin1String(".svg"))
|
||||||
|
|| mimeType.endsWith(QLatin1String(".svgz"))) {
|
||||||
|
mimeType = QLatin1String("image/svg+xml");
|
||||||
|
}
|
||||||
|
else if (mimeType.endsWith(QLatin1String(".css"))) {
|
||||||
|
mimeType = QLatin1String("text/css");
|
||||||
|
}
|
||||||
|
else if (mimeType.endsWith(QLatin1String(".js"))) {
|
||||||
|
mimeType = QLatin1String("text/javascript");
|
||||||
|
} else {
|
||||||
|
mimeType = QLatin1String("text/html");
|
||||||
|
}
|
||||||
|
return new HelpNetworkReply(request, helpEngine->fileData(url), mimeType);
|
||||||
}
|
}
|
||||||
return QNetworkAccessManager::createRequest(op, request, outgoingData);
|
return QNetworkAccessManager::createRequest(op, request, outgoingData);
|
||||||
}
|
}
|
||||||
@@ -312,7 +327,7 @@ void HelpViewer::setSource(const QUrl &url)
|
|||||||
if (url.isValid() && !help) {
|
if (url.isValid() && !help) {
|
||||||
if (launchedWithExternalApp(url))
|
if (launchedWithExternalApp(url))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
QUrl u = helpEngine->findFile(url);
|
QUrl u = helpEngine->findFile(url);
|
||||||
if (u.isValid()) {
|
if (u.isValid()) {
|
||||||
if (!homeUrl.isValid())
|
if (!homeUrl.isValid())
|
||||||
|
|||||||
@@ -16,6 +16,9 @@ linux-* {
|
|||||||
ISGCC33=$$(GCC33)
|
ISGCC33=$$(GCC33)
|
||||||
!equals(ISGCC33, 1):QT += svg dbus
|
!equals(ISGCC33, 1):QT += svg dbus
|
||||||
|
|
||||||
|
target.path = /bin
|
||||||
|
INSTALLS += target
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
TEMPLATE = app
|
TEMPLATE = app
|
||||||
@@ -25,55 +28,7 @@ DESTDIR = ../../bin
|
|||||||
|
|
||||||
SOURCES += main.cpp
|
SOURCES += main.cpp
|
||||||
|
|
||||||
macx {
|
include(../rpath.pri)
|
||||||
SNIPPETS.path = Contents/Resources
|
|
||||||
SNIPPETS.files = $$IDE_SOURCE_TREE/bin/snippets
|
|
||||||
TEMPLATES.path = Contents/Resources
|
|
||||||
TEMPLATES.files = $$IDE_SOURCE_TREE/bin/templates
|
|
||||||
DESIGNER.path = Contents/Resources
|
|
||||||
DESIGNER.files = $$IDE_SOURCE_TREE/bin/designer
|
|
||||||
SCHEMES.path = Contents/Resources
|
|
||||||
SCHEMES.files = $$IDE_SOURCE_TREE/bin/schemes
|
|
||||||
GDBDEBUGGER.path = Contents/Resources
|
|
||||||
GDBDEBUGGER.files = $$IDE_SOURCE_TREE/bin/gdbmacros
|
|
||||||
LICENSE.path = Contents/Resources
|
|
||||||
LICENSE.files = $$IDE_SOURCE_TREE/bin/license.txt
|
|
||||||
RUNINTERMINAL.path = Contents/Resources
|
|
||||||
RUNINTERMINAL.files = $$IDE_SOURCE_TREE/bin/runInTerminal.command
|
|
||||||
QMAKE_BUNDLE_DATA += SNIPPETS TEMPLATES DESIGNER SCHEMES GDBDEBUGGER LICENSE RUNINTERMINAL
|
|
||||||
QMAKE_INFO_PLIST = $$PWD/Info.plist
|
|
||||||
}
|
|
||||||
!macx {
|
|
||||||
# make sure the resources are in place
|
|
||||||
!exists($$OUT_PWD/app.pro) {
|
|
||||||
unix:SEPARATOR = ;
|
|
||||||
win32:SEPARATOR = &
|
|
||||||
# we are shadow build
|
|
||||||
COPYSRC = snippets \
|
|
||||||
templates \
|
|
||||||
designer \
|
|
||||||
schemes \
|
|
||||||
gdbmacros
|
|
||||||
COPYDEST = $${OUT_PWD}/../../bin
|
|
||||||
win32:COPYDEST ~= s|/+|\|
|
|
||||||
for(tmp,COPYSRC) {
|
|
||||||
REALSRC = $$IDE_SOURCE_TREE/bin/$$tmp
|
|
||||||
REALDEST = $$COPYDEST/$$tmp
|
|
||||||
win32:tmp ~= s|/+|\|
|
|
||||||
win32:REALSRC ~= s|/+|\|
|
|
||||||
win32:REALDEST ~= s|/+|\|
|
|
||||||
QMAKE_POST_LINK += $${QMAKE_COPY_DIR} $${REALSRC} $${REALDEST} $$SEPARATOR
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
linux-* {
|
|
||||||
#do the rpath by hand since it's not possible to use ORIGIN in QMAKE_RPATHDIR
|
|
||||||
QMAKE_RPATHDIR += \$\$ORIGIN/../lib
|
|
||||||
IDE_PLUGIN_RPATH = $$join(QMAKE_RPATHDIR, ":")
|
|
||||||
QMAKE_LFLAGS += -Wl,-z,origin \'-Wl,-rpath,$${IDE_PLUGIN_RPATH}\'
|
|
||||||
QMAKE_RPATHDIR =
|
|
||||||
}
|
|
||||||
|
|
||||||
win32 {
|
win32 {
|
||||||
RC_FILE = qtcreator.rc
|
RC_FILE = qtcreator.rc
|
||||||
@@ -82,3 +37,4 @@ win32 {
|
|||||||
macx {
|
macx {
|
||||||
ICON = qtcreator.icns
|
ICON = qtcreator.icns
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -180,12 +180,16 @@ static inline QStringList getPluginPaths()
|
|||||||
QDir rootDir = QApplication::applicationDirPath();
|
QDir rootDir = QApplication::applicationDirPath();
|
||||||
rootDir.cdUp();
|
rootDir.cdUp();
|
||||||
const QString rootDirPath = rootDir.canonicalPath();
|
const QString rootDirPath = rootDir.canonicalPath();
|
||||||
// 1) "lib" dir
|
// 1) "plugins" (Win/Linux)
|
||||||
QString pluginPath = rootDirPath;
|
QString pluginPath = rootDirPath;
|
||||||
pluginPath += QDir::separator();
|
pluginPath += QDir::separator();
|
||||||
pluginPath += QLatin1String("lib");
|
pluginPath += QLatin1String("lib");
|
||||||
|
pluginPath += QDir::separator();
|
||||||
|
pluginPath += QLatin1String("qtcreator");
|
||||||
|
pluginPath += QDir::separator();
|
||||||
|
pluginPath += QLatin1String("plugins");
|
||||||
rc.push_back(pluginPath);
|
rc.push_back(pluginPath);
|
||||||
// 2) "PlugIns"
|
// 2) "PlugIns" (OS X)
|
||||||
pluginPath = rootDirPath;
|
pluginPath = rootDirPath;
|
||||||
pluginPath += QDir::separator();
|
pluginPath += QDir::separator();
|
||||||
pluginPath += QLatin1String("PlugIns");
|
pluginPath += QLatin1String("PlugIns");
|
||||||
|
|||||||
@@ -234,12 +234,11 @@ public:
|
|||||||
BinEditorInterface(BinEditor *parent)
|
BinEditorInterface(BinEditor *parent)
|
||||||
: Core::IEditor(parent)
|
: Core::IEditor(parent)
|
||||||
{
|
{
|
||||||
Core::ICore *core = Core::ICore::instance();
|
Core::UniqueIDManager *uidm = Core::UniqueIDManager::instance();
|
||||||
m_editor = parent;
|
m_editor = parent;
|
||||||
m_file = new BinEditorFile(parent);
|
m_file = new BinEditorFile(parent);
|
||||||
m_context << core->uniqueIDManager()->
|
m_context << uidm->uniqueIdentifier(Core::Constants::K_DEFAULT_BINARY_EDITOR);
|
||||||
uniqueIdentifier(Core::Constants::K_DEFAULT_BINARY_EDITOR);
|
m_context << uidm->uniqueIdentifier(Constants::C_BINEDITOR);
|
||||||
m_context << core->uniqueIDManager()->uniqueIdentifier(Constants::C_BINEDITOR);
|
|
||||||
m_cursorPositionLabel = new Core::Utils::LineColumnLabel;
|
m_cursorPositionLabel = new Core::Utils::LineColumnLabel;
|
||||||
|
|
||||||
QHBoxLayout *l = new QHBoxLayout;
|
QHBoxLayout *l = new QHBoxLayout;
|
||||||
@@ -320,8 +319,8 @@ QString BinEditorFactory::kind() const
|
|||||||
|
|
||||||
Core::IFile *BinEditorFactory::open(const QString &fileName)
|
Core::IFile *BinEditorFactory::open(const QString &fileName)
|
||||||
{
|
{
|
||||||
Core::ICore *core = Core::ICore::instance();
|
Core::EditorManager *em = Core::EditorManager::instance();
|
||||||
Core::IEditor *iface = core->editorManager()->openEditor(fileName, kind());
|
Core::IEditor *iface = em->openEditor(fileName, kind());
|
||||||
return iface ? iface->file() : 0;
|
return iface ? iface->file() : 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -339,27 +338,17 @@ QStringList BinEditorFactory::mimeTypes() const
|
|||||||
|
|
||||||
///////////////////////////////// BinEditorPlugin //////////////////////////////////
|
///////////////////////////////// BinEditorPlugin //////////////////////////////////
|
||||||
|
|
||||||
BinEditorPlugin *BinEditorPlugin::m_instance = 0;
|
|
||||||
|
|
||||||
BinEditorPlugin::BinEditorPlugin()
|
BinEditorPlugin::BinEditorPlugin()
|
||||||
{
|
{
|
||||||
m_undoAction = m_redoAction = m_copyAction = m_selectAllAction = 0;
|
m_undoAction = m_redoAction = m_copyAction = m_selectAllAction = 0;
|
||||||
m_instance = this;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
BinEditorPlugin::~BinEditorPlugin()
|
BinEditorPlugin::~BinEditorPlugin()
|
||||||
{
|
{
|
||||||
m_instance = 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
BinEditorPlugin *BinEditorPlugin::instance()
|
|
||||||
{
|
|
||||||
return m_instance;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
QAction *BinEditorPlugin::registerNewAction(const QString &id, const QString &title)
|
QAction *BinEditorPlugin::registerNewAction(const QString &id, const QString &title)
|
||||||
{
|
{
|
||||||
|
|
||||||
QAction *result = new QAction(title, this);
|
QAction *result = new QAction(title, this);
|
||||||
Core::ICore::instance()->actionManager()->registerAction(result, id, m_context);
|
Core::ICore::instance()->actionManager()->registerAction(result, id, m_context);
|
||||||
return result;
|
return result;
|
||||||
@@ -384,8 +373,8 @@ void BinEditorPlugin::initializeEditor(BinEditor *editor)
|
|||||||
QObject::connect(editor, SIGNAL(modificationChanged(bool)), editorInterface, SIGNAL(changed()));
|
QObject::connect(editor, SIGNAL(modificationChanged(bool)), editorInterface, SIGNAL(changed()));
|
||||||
editor->setEditorInterface(editorInterface);
|
editor->setEditorInterface(editorInterface);
|
||||||
|
|
||||||
Core::ICore *core = Core::ICore::instance();
|
Core::UniqueIDManager *uidm = Core::UniqueIDManager::instance();
|
||||||
m_context << core->uniqueIDManager()->uniqueIdentifier(Constants::C_BINEDITOR);
|
m_context << uidm->uniqueIdentifier(Constants::C_BINEDITOR);
|
||||||
if (!m_undoAction) {
|
if (!m_undoAction) {
|
||||||
m_undoAction = registerNewAction(QLatin1String(Core::Constants::UNDO),
|
m_undoAction = registerNewAction(QLatin1String(Core::Constants::UNDO),
|
||||||
this, SLOT(undoAction()),
|
this, SLOT(undoAction()),
|
||||||
|
|||||||
@@ -43,7 +43,6 @@
|
|||||||
#include <QtGui/QAction>
|
#include <QtGui/QAction>
|
||||||
|
|
||||||
namespace Core {
|
namespace Core {
|
||||||
class ICore;
|
|
||||||
class IWizard;
|
class IWizard;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -61,8 +60,6 @@ public:
|
|||||||
BinEditorPlugin();
|
BinEditorPlugin();
|
||||||
~BinEditorPlugin();
|
~BinEditorPlugin();
|
||||||
|
|
||||||
static BinEditorPlugin *instance();
|
|
||||||
|
|
||||||
bool initialize(const QStringList &arguments, QString *error_message = 0);
|
bool initialize(const QStringList &arguments, QString *error_message = 0);
|
||||||
void extensionsInitialized();
|
void extensionsInitialized();
|
||||||
|
|
||||||
@@ -77,6 +74,7 @@ private slots:
|
|||||||
void updateActions();
|
void updateActions();
|
||||||
|
|
||||||
void updateCurrentEditor(Core::IContext *object);
|
void updateCurrentEditor(Core::IContext *object);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
QList<int> m_context;
|
QList<int> m_context;
|
||||||
QAction *registerNewAction(const QString &id, const QString &title = QString());
|
QAction *registerNewAction(const QString &id, const QString &title = QString());
|
||||||
@@ -90,9 +88,6 @@ private:
|
|||||||
friend class BinEditorFactory;
|
friend class BinEditorFactory;
|
||||||
Core::IEditor *createEditor(QWidget *parent);
|
Core::IEditor *createEditor(QWidget *parent);
|
||||||
|
|
||||||
static BinEditorPlugin *m_instance;
|
|
||||||
|
|
||||||
Core::ICore *m_core;
|
|
||||||
typedef QList<Core::IWizard *> WizardList;
|
typedef QList<Core::IWizard *> WizardList;
|
||||||
WizardList m_wizards;
|
WizardList m_wizards;
|
||||||
BinEditorFactory *m_factory;
|
BinEditorFactory *m_factory;
|
||||||
|
|||||||
@@ -293,8 +293,7 @@ void BookmarkView::gotoBookmark(const QModelIndex &index)
|
|||||||
BookmarkContext::BookmarkContext(BookmarkView *widget)
|
BookmarkContext::BookmarkContext(BookmarkView *widget)
|
||||||
: m_bookmarkView(widget)
|
: m_bookmarkView(widget)
|
||||||
{
|
{
|
||||||
Core::ICore *core = ICore::instance();
|
m_context << UniqueIDManager::instance()->uniqueIdentifier(Constants::BOOKMARKS_CONTEXT);
|
||||||
m_context << core->uniqueIDManager()->uniqueIdentifier(Constants::BOOKMARKS_CONTEXT);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
QList<int> BookmarkContext::context() const
|
QList<int> BookmarkContext::context() const
|
||||||
@@ -509,7 +508,7 @@ void BookmarkManager::documentPrevNext(bool next)
|
|||||||
nextLine = markLine;
|
nextLine = markLine;
|
||||||
}
|
}
|
||||||
|
|
||||||
Core::EditorManager *em = Core::ICore::instance()->editorManager();
|
Core::EditorManager *em = Core::EditorManager::instance();
|
||||||
em->addCurrentPositionToNavigationHistory(true);
|
em->addCurrentPositionToNavigationHistory(true);
|
||||||
if (next) {
|
if (next) {
|
||||||
if (nextLine == -1)
|
if (nextLine == -1)
|
||||||
@@ -554,7 +553,7 @@ void BookmarkManager::prev()
|
|||||||
|
|
||||||
TextEditor::ITextEditor *BookmarkManager::currentTextEditor() const
|
TextEditor::ITextEditor *BookmarkManager::currentTextEditor() const
|
||||||
{
|
{
|
||||||
Core::EditorManager *em = Core::ICore::instance()->editorManager();
|
Core::EditorManager *em = Core::EditorManager::instance();
|
||||||
Core::IEditor *currEditor = em->currentEditor();
|
Core::IEditor *currEditor = em->currentEditor();
|
||||||
if (!currEditor)
|
if (!currEditor)
|
||||||
return 0;
|
return 0;
|
||||||
|
|||||||
@@ -36,7 +36,6 @@
|
|||||||
#include "cmakeproject.h"
|
#include "cmakeproject.h"
|
||||||
#include "cmakeprojectconstants.h"
|
#include "cmakeprojectconstants.h"
|
||||||
|
|
||||||
#include <coreplugin/icore.h>
|
|
||||||
#include <coreplugin/uniqueidmanager.h>
|
#include <coreplugin/uniqueidmanager.h>
|
||||||
#include <projectexplorer/projectexplorerconstants.h>
|
#include <projectexplorer/projectexplorerconstants.h>
|
||||||
|
|
||||||
@@ -44,9 +43,9 @@ using namespace CMakeProjectManager::Internal;
|
|||||||
|
|
||||||
CMakeManager::CMakeManager()
|
CMakeManager::CMakeManager()
|
||||||
{
|
{
|
||||||
Core::ICore *core = Core::ICore::instance();
|
Core::UniqueIDManager *uidm = Core::UniqueIDManager::instance();
|
||||||
m_projectContext = core->uniqueIDManager()->uniqueIdentifier(CMakeProjectManager::Constants::PROJECTCONTEXT);
|
m_projectContext = uidm->uniqueIdentifier(CMakeProjectManager::Constants::PROJECTCONTEXT);
|
||||||
m_projectLanguage = core->uniqueIDManager()->uniqueIdentifier(ProjectExplorer::Constants::LANG_CXX);
|
m_projectLanguage = uidm->uniqueIdentifier(ProjectExplorer::Constants::LANG_CXX);
|
||||||
}
|
}
|
||||||
|
|
||||||
int CMakeManager::projectContext() const
|
int CMakeManager::projectContext() const
|
||||||
|
|||||||
@@ -109,8 +109,7 @@ bool CommandsFile::exportCommands(const QList<ShortcutItem *> &items)
|
|||||||
QDomElement root = doc.createElement("mapping");
|
QDomElement root = doc.createElement("mapping");
|
||||||
doc.appendChild(root);
|
doc.appendChild(root);
|
||||||
|
|
||||||
for (int i = 0; i < items.count(); ++i) {
|
foreach (const ShortcutItem *item, items) {
|
||||||
ShortcutItem *item = items.at(i);
|
|
||||||
QDomElement ctag = doc.createElement("shortcut");
|
QDomElement ctag = doc.createElement("shortcut");
|
||||||
ctag.setAttribute(QLatin1String("id"), idmanager->stringForUniqueIdentifier(item->m_cmd->id()));
|
ctag.setAttribute(QLatin1String("id"), idmanager->stringForUniqueIdentifier(item->m_cmd->id()));
|
||||||
root.appendChild(ctag);
|
root.appendChild(ctag);
|
||||||
|
|||||||
@@ -32,12 +32,13 @@
|
|||||||
***************************************************************************/
|
***************************************************************************/
|
||||||
|
|
||||||
#include "basefilewizard.h"
|
#include "basefilewizard.h"
|
||||||
#include "mimedatabase.h"
|
|
||||||
|
|
||||||
#include <coreplugin/editormanager/editormanager.h>
|
#include "coreconstants.h"
|
||||||
#include <coreplugin/icore.h>
|
#include "icore.h"
|
||||||
#include <coreplugin/coreconstants.h>
|
#include "ifilewizardextension.h"
|
||||||
#include <coreplugin/ifilewizardextension.h>
|
#include "mimedatabase.h"
|
||||||
|
#include "editormanager/editormanager.h"
|
||||||
|
|
||||||
#include <extensionsystem/pluginmanager.h>
|
#include <extensionsystem/pluginmanager.h>
|
||||||
#include <utils/filewizarddialog.h>
|
#include <utils/filewizarddialog.h>
|
||||||
|
|
||||||
@@ -509,7 +510,7 @@ bool BaseFileWizard::postGenerateFiles(const GeneratedFiles &l, QString *errorMe
|
|||||||
{
|
{
|
||||||
// File mode: open the editors in file mode and ensure editor pane
|
// File mode: open the editors in file mode and ensure editor pane
|
||||||
const Core::GeneratedFiles::const_iterator cend = l.constEnd();
|
const Core::GeneratedFiles::const_iterator cend = l.constEnd();
|
||||||
Core::EditorManager *em = Core::ICore::instance()->editorManager();
|
Core::EditorManager *em = Core::EditorManager::instance();
|
||||||
for (Core::GeneratedFiles::const_iterator it = l.constBegin(); it != cend; ++it) {
|
for (Core::GeneratedFiles::const_iterator it = l.constBegin(); it != cend; ++it) {
|
||||||
if (!em->openEditor(it->path(), it->editorKind())) {
|
if (!em->openEditor(it->path(), it->editorKind())) {
|
||||||
*errorMessage = tr("Failed to open an editor for %1").arg(it->path());
|
*errorMessage = tr("Failed to open an editor for %1").arg(it->path());
|
||||||
|
|||||||
@@ -148,7 +148,7 @@ QString CoreImpl::resourcePath() const
|
|||||||
#if defined(Q_OS_MAC)
|
#if defined(Q_OS_MAC)
|
||||||
return QDir::cleanPath(QCoreApplication::applicationDirPath()+QLatin1String("/../Resources"));
|
return QDir::cleanPath(QCoreApplication::applicationDirPath()+QLatin1String("/../Resources"));
|
||||||
#else
|
#else
|
||||||
return QDir::cleanPath(QCoreApplication::applicationDirPath());
|
return QDir::cleanPath(QCoreApplication::applicationDirPath())+"/../share/qtcreator";
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -85,7 +85,7 @@ bool CorePlugin::initialize(const QStringList & /*arguments*/, QString *error_me
|
|||||||
m_welcomeMode = new WelcomeMode;
|
m_welcomeMode = new WelcomeMode;
|
||||||
addObject(m_welcomeMode);
|
addObject(m_welcomeMode);
|
||||||
|
|
||||||
EditorManager *editorManager = qobject_cast<EditorManager*>(m_mainWindow->editorManager());
|
EditorManager *editorManager = m_mainWindow->editorManager();
|
||||||
m_editMode = new EditMode(editorManager);
|
m_editMode = new EditMode(editorManager);
|
||||||
addObject(m_editMode);
|
addObject(m_editMode);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -163,3 +163,10 @@ RESOURCES += core.qrc \
|
|||||||
contains(QT_CONFIG, webkit) {
|
contains(QT_CONFIG, webkit) {
|
||||||
QT += webkit
|
QT += webkit
|
||||||
}
|
}
|
||||||
|
|
||||||
|
linux-* {
|
||||||
|
images.files = images/qtcreator_logo_*.png
|
||||||
|
images.path = /share/pixmaps
|
||||||
|
|
||||||
|
INSTALLS += images
|
||||||
|
}
|
||||||
|
|||||||
@@ -599,8 +599,7 @@ QList<IEditor*>
|
|||||||
return found.toList();
|
return found.toList();
|
||||||
}
|
}
|
||||||
|
|
||||||
QList<IFile *>
|
QList<IFile *> EditorManager::filesForEditors(QList<IEditor *> editors) const
|
||||||
EditorManager::filesForEditors(QList<IEditor *> editors) const
|
|
||||||
{
|
{
|
||||||
QSet<IEditor *> handledEditors;
|
QSet<IEditor *> handledEditors;
|
||||||
QList<IFile *> files;
|
QList<IFile *> files;
|
||||||
@@ -941,9 +940,8 @@ QStringList EditorManager::getOpenFileNames() const
|
|||||||
|
|
||||||
void EditorManager::ensureEditorManagerVisible()
|
void EditorManager::ensureEditorManagerVisible()
|
||||||
{
|
{
|
||||||
if (!isVisible()) {
|
if (!isVisible())
|
||||||
m_d->m_core->modeManager()->activateMode(Constants::MODE_EDIT);
|
m_d->m_core->modeManager()->activateMode(Constants::MODE_EDIT);
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
IEditor *EditorManager::newFile(const QString &editorKind,
|
IEditor *EditorManager::newFile(const QString &editorKind,
|
||||||
|
|||||||
@@ -33,15 +33,14 @@
|
|||||||
|
|
||||||
#include "editorsplitter.h"
|
#include "editorsplitter.h"
|
||||||
|
|
||||||
|
#include "coreconstants.h"
|
||||||
#include "editormanager.h"
|
#include "editormanager.h"
|
||||||
|
#include "icore.h"
|
||||||
#include "minisplitter.h"
|
#include "minisplitter.h"
|
||||||
#include "openeditorswindow.h"
|
#include "openeditorswindow.h"
|
||||||
#include "stackededitorgroup.h"
|
#include "stackededitorgroup.h"
|
||||||
|
#include "uniqueidmanager.h"
|
||||||
#include <coreplugin/icore.h>
|
#include "actionmanager/actionmanager.h"
|
||||||
#include <coreplugin/coreconstants.h>
|
|
||||||
#include <coreplugin/uniqueidmanager.h>
|
|
||||||
#include <coreplugin/actionmanager/actionmanager.h>
|
|
||||||
|
|
||||||
#include <utils/qtcassert.h>
|
#include <utils/qtcassert.h>
|
||||||
|
|
||||||
|
|||||||
@@ -120,8 +120,7 @@ void OpenEditorsWidget::closeEditors()
|
|||||||
core->fileManager()->saveModifiedFiles(selectedFiles, &cancelled);
|
core->fileManager()->saveModifiedFiles(selectedFiles, &cancelled);
|
||||||
if (cancelled)
|
if (cancelled)
|
||||||
return;
|
return;
|
||||||
core->editorManager()->
|
core->editorManager()->closeEditors(selectedEditors);
|
||||||
closeEditors(selectedEditors);
|
|
||||||
updateEditorList();
|
updateEditorList();
|
||||||
*/
|
*/
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -33,13 +33,14 @@
|
|||||||
|
|
||||||
#include "filemanager.h"
|
#include "filemanager.h"
|
||||||
|
|
||||||
|
#include "editormanager.h"
|
||||||
|
#include "icore.h"
|
||||||
#include "ifile.h"
|
#include "ifile.h"
|
||||||
|
#include "iversioncontrol.h"
|
||||||
#include "mainwindow.h"
|
#include "mainwindow.h"
|
||||||
|
#include "mimedatabase.h"
|
||||||
#include "saveitemsdialog.h"
|
#include "saveitemsdialog.h"
|
||||||
#include "vcsmanager.h"
|
#include "vcsmanager.h"
|
||||||
#include "editormanager.h"
|
|
||||||
#include "mimedatabase.h"
|
|
||||||
#include "iversioncontrol.h"
|
|
||||||
|
|
||||||
#include <utils/qtcassert.h>
|
#include <utils/qtcassert.h>
|
||||||
|
|
||||||
@@ -509,7 +510,7 @@ void FileManager::syncWithEditor(Core::IContext *context)
|
|||||||
if (!context)
|
if (!context)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
Core::IEditor *editor = Core::ICore::instance()->editorManager()->currentEditor();
|
Core::IEditor *editor = Core::EditorManager::instance()->currentEditor();
|
||||||
if (editor && (editor->widget() == context->widget()))
|
if (editor && (editor->widget() == context->widget()))
|
||||||
setCurrentFile(editor->file()->fileName());
|
setCurrentFile(editor->file()->fileName());
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -380,7 +380,7 @@ void MainWindow::registerDefaultContainers()
|
|||||||
menubar->appendGroup(Constants::G_WINDOW);
|
menubar->appendGroup(Constants::G_WINDOW);
|
||||||
menubar->appendGroup(Constants::G_HELP);
|
menubar->appendGroup(Constants::G_HELP);
|
||||||
|
|
||||||
//File Menu
|
// File Menu
|
||||||
ActionContainer *filemenu = am->createMenu(Constants::M_FILE);
|
ActionContainer *filemenu = am->createMenu(Constants::M_FILE);
|
||||||
menubar->addMenu(filemenu, Constants::G_FILE);
|
menubar->addMenu(filemenu, Constants::G_FILE);
|
||||||
filemenu->menu()->setTitle(tr("&File"));
|
filemenu->menu()->setTitle(tr("&File"));
|
||||||
@@ -394,7 +394,7 @@ void MainWindow::registerDefaultContainers()
|
|||||||
connect(filemenu->menu(), SIGNAL(aboutToShow()), this, SLOT(aboutToShowRecentFiles()));
|
connect(filemenu->menu(), SIGNAL(aboutToShow()), this, SLOT(aboutToShowRecentFiles()));
|
||||||
|
|
||||||
|
|
||||||
//Edit Menu
|
// Edit Menu
|
||||||
ActionContainer *medit = am->createMenu(Constants::M_EDIT);
|
ActionContainer *medit = am->createMenu(Constants::M_EDIT);
|
||||||
menubar->addMenu(medit, Constants::G_EDIT);
|
menubar->addMenu(medit, Constants::G_EDIT);
|
||||||
medit->menu()->setTitle(tr("&Edit"));
|
medit->menu()->setTitle(tr("&Edit"));
|
||||||
@@ -405,12 +405,12 @@ void MainWindow::registerDefaultContainers()
|
|||||||
medit->appendGroup(Constants::G_EDIT_FIND);
|
medit->appendGroup(Constants::G_EDIT_FIND);
|
||||||
medit->appendGroup(Constants::G_EDIT_OTHER);
|
medit->appendGroup(Constants::G_EDIT_OTHER);
|
||||||
|
|
||||||
//Tools Menu
|
// Tools Menu
|
||||||
ActionContainer *ac = am->createMenu(Constants::M_TOOLS);
|
ActionContainer *ac = am->createMenu(Constants::M_TOOLS);
|
||||||
menubar->addMenu(ac, Constants::G_TOOLS);
|
menubar->addMenu(ac, Constants::G_TOOLS);
|
||||||
ac->menu()->setTitle(tr("&Tools"));
|
ac->menu()->setTitle(tr("&Tools"));
|
||||||
|
|
||||||
//Window Menu
|
// Window Menu
|
||||||
ActionContainer *mwindow = am->createMenu(Constants::M_WINDOW);
|
ActionContainer *mwindow = am->createMenu(Constants::M_WINDOW);
|
||||||
menubar->addMenu(mwindow, Constants::G_WINDOW);
|
menubar->addMenu(mwindow, Constants::G_WINDOW);
|
||||||
mwindow->menu()->setTitle(tr("&Window"));
|
mwindow->menu()->setTitle(tr("&Window"));
|
||||||
@@ -423,7 +423,7 @@ void MainWindow::registerDefaultContainers()
|
|||||||
mwindow->appendGroup(Constants::G_WINDOW_OTHER);
|
mwindow->appendGroup(Constants::G_WINDOW_OTHER);
|
||||||
mwindow->appendGroup(Constants::G_WINDOW_LIST);
|
mwindow->appendGroup(Constants::G_WINDOW_LIST);
|
||||||
|
|
||||||
//Help Menu
|
// Help Menu
|
||||||
ac = am->createMenu(Constants::M_HELP);
|
ac = am->createMenu(Constants::M_HELP);
|
||||||
menubar->addMenu(ac, Constants::G_HELP);
|
menubar->addMenu(ac, Constants::G_HELP);
|
||||||
ac->menu()->setTitle(tr("&Help"));
|
ac->menu()->setTitle(tr("&Help"));
|
||||||
@@ -476,43 +476,43 @@ void MainWindow::registerDefaultActions()
|
|||||||
cmd = createSeparator(am, this, QLatin1String("QtCreator.Edit.Sep.Advanced"), m_globalContext);
|
cmd = createSeparator(am, this, QLatin1String("QtCreator.Edit.Sep.Advanced"), m_globalContext);
|
||||||
medit->addAction(cmd, Constants::G_EDIT_ADVANCED);
|
medit->addAction(cmd, Constants::G_EDIT_ADVANCED);
|
||||||
|
|
||||||
//Tools menu separators
|
// Tools menu separators
|
||||||
cmd = createSeparator(am, this, QLatin1String("QtCreator.Tools.Sep.Options"), m_globalContext);
|
cmd = createSeparator(am, this, QLatin1String("QtCreator.Tools.Sep.Options"), m_globalContext);
|
||||||
mtools->addAction(cmd, Constants::G_DEFAULT_THREE);
|
mtools->addAction(cmd, Constants::G_DEFAULT_THREE);
|
||||||
|
|
||||||
//Return to editor shortcut: Note this requires Qt to fix up
|
// Return to editor shortcut: Note this requires Qt to fix up
|
||||||
// handling of shortcut overrides in menus, item views, combos....
|
// handling of shortcut overrides in menus, item views, combos....
|
||||||
m_focusToEditor = new QShortcut(this);
|
m_focusToEditor = new QShortcut(this);
|
||||||
cmd = am->registerShortcut(m_focusToEditor, Constants::S_RETURNTOEDITOR, m_globalContext);
|
cmd = am->registerShortcut(m_focusToEditor, Constants::S_RETURNTOEDITOR, m_globalContext);
|
||||||
cmd->setDefaultKeySequence(QKeySequence(Qt::Key_Escape));
|
cmd->setDefaultKeySequence(QKeySequence(Qt::Key_Escape));
|
||||||
connect(m_focusToEditor, SIGNAL(activated()), this, SLOT(setFocusToEditor()));
|
connect(m_focusToEditor, SIGNAL(activated()), this, SLOT(setFocusToEditor()));
|
||||||
|
|
||||||
//New File Action
|
// New File Action
|
||||||
m_newAction = new QAction(QIcon(Constants::ICON_NEWFILE), tr("&New..."), this);
|
m_newAction = new QAction(QIcon(Constants::ICON_NEWFILE), tr("&New..."), this);
|
||||||
cmd = am->registerAction(m_newAction, Constants::NEW, m_globalContext);
|
cmd = am->registerAction(m_newAction, Constants::NEW, m_globalContext);
|
||||||
cmd->setDefaultKeySequence(QKeySequence::New);
|
cmd->setDefaultKeySequence(QKeySequence::New);
|
||||||
mfile->addAction(cmd, Constants::G_FILE_NEW);
|
mfile->addAction(cmd, Constants::G_FILE_NEW);
|
||||||
connect(m_newAction, SIGNAL(triggered()), this, SLOT(newFile()));
|
connect(m_newAction, SIGNAL(triggered()), this, SLOT(newFile()));
|
||||||
|
|
||||||
//Open Action
|
// Open Action
|
||||||
m_openAction = new QAction(QIcon(Constants::ICON_OPENFILE), tr("&Open..."), this);
|
m_openAction = new QAction(QIcon(Constants::ICON_OPENFILE), tr("&Open..."), this);
|
||||||
cmd = am->registerAction(m_openAction, Constants::OPEN, m_globalContext);
|
cmd = am->registerAction(m_openAction, Constants::OPEN, m_globalContext);
|
||||||
cmd->setDefaultKeySequence(QKeySequence::Open);
|
cmd->setDefaultKeySequence(QKeySequence::Open);
|
||||||
mfile->addAction(cmd, Constants::G_FILE_OPEN);
|
mfile->addAction(cmd, Constants::G_FILE_OPEN);
|
||||||
connect(m_openAction, SIGNAL(triggered()), this, SLOT(openFile()));
|
connect(m_openAction, SIGNAL(triggered()), this, SLOT(openFile()));
|
||||||
|
|
||||||
//Open With Action
|
// Open With Action
|
||||||
m_openWithAction = new QAction(tr("&Open With..."), this);
|
m_openWithAction = new QAction(tr("&Open With..."), this);
|
||||||
cmd = am->registerAction(m_openWithAction, Constants::OPEN_WITH, m_globalContext);
|
cmd = am->registerAction(m_openWithAction, Constants::OPEN_WITH, m_globalContext);
|
||||||
mfile->addAction(cmd, Constants::G_FILE_OPEN);
|
mfile->addAction(cmd, Constants::G_FILE_OPEN);
|
||||||
connect(m_openWithAction, SIGNAL(triggered()), this, SLOT(openFileWith()));
|
connect(m_openWithAction, SIGNAL(triggered()), this, SLOT(openFileWith()));
|
||||||
|
|
||||||
//File->Recent Files Menu
|
// File->Recent Files Menu
|
||||||
ActionContainer *ac = am->createMenu(Constants::M_FILE_RECENTFILES);
|
ActionContainer *ac = am->createMenu(Constants::M_FILE_RECENTFILES);
|
||||||
mfile->addMenu(ac, Constants::G_FILE_OPEN);
|
mfile->addMenu(ac, Constants::G_FILE_OPEN);
|
||||||
ac->menu()->setTitle(tr("Recent Files"));
|
ac->menu()->setTitle(tr("Recent Files"));
|
||||||
|
|
||||||
//Save Action
|
// Save Action
|
||||||
QAction *tmpaction = new QAction(QIcon(Constants::ICON_SAVEFILE), tr("&Save"), this);
|
QAction *tmpaction = new QAction(QIcon(Constants::ICON_SAVEFILE), tr("&Save"), this);
|
||||||
cmd = am->registerAction(tmpaction, Constants::SAVE, m_globalContext);
|
cmd = am->registerAction(tmpaction, Constants::SAVE, m_globalContext);
|
||||||
cmd->setDefaultKeySequence(QKeySequence::Save);
|
cmd->setDefaultKeySequence(QKeySequence::Save);
|
||||||
@@ -520,7 +520,7 @@ void MainWindow::registerDefaultActions()
|
|||||||
cmd->setDefaultText(tr("&Save"));
|
cmd->setDefaultText(tr("&Save"));
|
||||||
mfile->addAction(cmd, Constants::G_FILE_SAVE);
|
mfile->addAction(cmd, Constants::G_FILE_SAVE);
|
||||||
|
|
||||||
//Save As Action
|
// Save As Action
|
||||||
tmpaction = new QAction(tr("Save &As..."), this);
|
tmpaction = new QAction(tr("Save &As..."), this);
|
||||||
cmd = am->registerAction(tmpaction, Constants::SAVEAS, m_globalContext);
|
cmd = am->registerAction(tmpaction, Constants::SAVEAS, m_globalContext);
|
||||||
#ifdef Q_OS_MAC
|
#ifdef Q_OS_MAC
|
||||||
@@ -530,7 +530,7 @@ void MainWindow::registerDefaultActions()
|
|||||||
cmd->setDefaultText(tr("Save &As..."));
|
cmd->setDefaultText(tr("Save &As..."));
|
||||||
mfile->addAction(cmd, Constants::G_FILE_SAVE);
|
mfile->addAction(cmd, Constants::G_FILE_SAVE);
|
||||||
|
|
||||||
//SaveAll Action
|
// SaveAll Action
|
||||||
m_saveAllAction = new QAction(tr("Save A&ll"), this);
|
m_saveAllAction = new QAction(tr("Save A&ll"), this);
|
||||||
cmd = am->registerAction(m_saveAllAction, Constants::SAVEALL, m_globalContext);
|
cmd = am->registerAction(m_saveAllAction, Constants::SAVEALL, m_globalContext);
|
||||||
#ifndef Q_OS_MAC
|
#ifndef Q_OS_MAC
|
||||||
@@ -539,19 +539,19 @@ void MainWindow::registerDefaultActions()
|
|||||||
mfile->addAction(cmd, Constants::G_FILE_SAVE);
|
mfile->addAction(cmd, Constants::G_FILE_SAVE);
|
||||||
connect(m_saveAllAction, SIGNAL(triggered()), this, SLOT(saveAll()));
|
connect(m_saveAllAction, SIGNAL(triggered()), this, SLOT(saveAll()));
|
||||||
|
|
||||||
//Print Action
|
// Print Action
|
||||||
tmpaction = new QAction(tr("&Print..."), this);
|
tmpaction = new QAction(tr("&Print..."), this);
|
||||||
cmd = am->registerAction(tmpaction, Constants::PRINT, m_globalContext);
|
cmd = am->registerAction(tmpaction, Constants::PRINT, m_globalContext);
|
||||||
mfile->addAction(cmd, Constants::G_FILE_PRINT);
|
mfile->addAction(cmd, Constants::G_FILE_PRINT);
|
||||||
|
|
||||||
//Exit Action
|
// Exit Action
|
||||||
m_exitAction = new QAction(tr("E&xit"), this);
|
m_exitAction = new QAction(tr("E&xit"), this);
|
||||||
cmd = am->registerAction(m_exitAction, Constants::EXIT, m_globalContext);
|
cmd = am->registerAction(m_exitAction, Constants::EXIT, m_globalContext);
|
||||||
cmd->setDefaultKeySequence(QKeySequence(tr("Ctrl+Q")));
|
cmd->setDefaultKeySequence(QKeySequence(tr("Ctrl+Q")));
|
||||||
mfile->addAction(cmd, Constants::G_FILE_OTHER);
|
mfile->addAction(cmd, Constants::G_FILE_OTHER);
|
||||||
connect(m_exitAction, SIGNAL(triggered()), this, SLOT(exit()));
|
connect(m_exitAction, SIGNAL(triggered()), this, SLOT(exit()));
|
||||||
|
|
||||||
//Undo Action
|
// Undo Action
|
||||||
tmpaction = new QAction(QIcon(Constants::ICON_UNDO), tr("&Undo"), this);
|
tmpaction = new QAction(QIcon(Constants::ICON_UNDO), tr("&Undo"), this);
|
||||||
cmd = am->registerAction(tmpaction, Constants::UNDO, m_globalContext);
|
cmd = am->registerAction(tmpaction, Constants::UNDO, m_globalContext);
|
||||||
cmd->setDefaultKeySequence(QKeySequence::Undo);
|
cmd->setDefaultKeySequence(QKeySequence::Undo);
|
||||||
@@ -559,7 +559,7 @@ void MainWindow::registerDefaultActions()
|
|||||||
cmd->setDefaultText(tr("&Undo"));
|
cmd->setDefaultText(tr("&Undo"));
|
||||||
medit->addAction(cmd, Constants::G_EDIT_UNDOREDO);
|
medit->addAction(cmd, Constants::G_EDIT_UNDOREDO);
|
||||||
|
|
||||||
//Redo Action
|
// Redo Action
|
||||||
tmpaction = new QAction(QIcon(Constants::ICON_REDO), tr("&Redo"), this);
|
tmpaction = new QAction(QIcon(Constants::ICON_REDO), tr("&Redo"), this);
|
||||||
cmd = am->registerAction(tmpaction, Constants::REDO, m_globalContext);
|
cmd = am->registerAction(tmpaction, Constants::REDO, m_globalContext);
|
||||||
cmd->setDefaultKeySequence(QKeySequence::Redo);
|
cmd->setDefaultKeySequence(QKeySequence::Redo);
|
||||||
@@ -567,37 +567,37 @@ void MainWindow::registerDefaultActions()
|
|||||||
cmd->setDefaultText(tr("&Redo"));
|
cmd->setDefaultText(tr("&Redo"));
|
||||||
medit->addAction(cmd, Constants::G_EDIT_UNDOREDO);
|
medit->addAction(cmd, Constants::G_EDIT_UNDOREDO);
|
||||||
|
|
||||||
//Cut Action
|
// Cut Action
|
||||||
tmpaction = new QAction(QIcon(Constants::ICON_CUT), tr("Cu&t"), this);
|
tmpaction = new QAction(QIcon(Constants::ICON_CUT), tr("Cu&t"), this);
|
||||||
cmd = am->registerAction(tmpaction, Constants::CUT, m_globalContext);
|
cmd = am->registerAction(tmpaction, Constants::CUT, m_globalContext);
|
||||||
cmd->setDefaultKeySequence(QKeySequence::Cut);
|
cmd->setDefaultKeySequence(QKeySequence::Cut);
|
||||||
medit->addAction(cmd, Constants::G_EDIT_COPYPASTE);
|
medit->addAction(cmd, Constants::G_EDIT_COPYPASTE);
|
||||||
|
|
||||||
//Copy Action
|
// Copy Action
|
||||||
tmpaction = new QAction(QIcon(Constants::ICON_COPY), tr("&Copy"), this);
|
tmpaction = new QAction(QIcon(Constants::ICON_COPY), tr("&Copy"), this);
|
||||||
cmd = am->registerAction(tmpaction, Constants::COPY, m_globalContext);
|
cmd = am->registerAction(tmpaction, Constants::COPY, m_globalContext);
|
||||||
cmd->setDefaultKeySequence(QKeySequence::Copy);
|
cmd->setDefaultKeySequence(QKeySequence::Copy);
|
||||||
medit->addAction(cmd, Constants::G_EDIT_COPYPASTE);
|
medit->addAction(cmd, Constants::G_EDIT_COPYPASTE);
|
||||||
|
|
||||||
//Paste Action
|
// Paste Action
|
||||||
tmpaction = new QAction(QIcon(Constants::ICON_PASTE), tr("&Paste"), this);
|
tmpaction = new QAction(QIcon(Constants::ICON_PASTE), tr("&Paste"), this);
|
||||||
cmd = am->registerAction(tmpaction, Constants::PASTE, m_globalContext);
|
cmd = am->registerAction(tmpaction, Constants::PASTE, m_globalContext);
|
||||||
cmd->setDefaultKeySequence(QKeySequence::Paste);
|
cmd->setDefaultKeySequence(QKeySequence::Paste);
|
||||||
medit->addAction(cmd, Constants::G_EDIT_COPYPASTE);
|
medit->addAction(cmd, Constants::G_EDIT_COPYPASTE);
|
||||||
|
|
||||||
//Select All
|
// Select All
|
||||||
tmpaction = new QAction(tr("&Select All"), this);
|
tmpaction = new QAction(tr("&Select All"), this);
|
||||||
cmd = am->registerAction(tmpaction, Constants::SELECTALL, m_globalContext);
|
cmd = am->registerAction(tmpaction, Constants::SELECTALL, m_globalContext);
|
||||||
cmd->setDefaultKeySequence(QKeySequence::SelectAll);
|
cmd->setDefaultKeySequence(QKeySequence::SelectAll);
|
||||||
medit->addAction(cmd, Constants::G_EDIT_SELECTALL);
|
medit->addAction(cmd, Constants::G_EDIT_SELECTALL);
|
||||||
|
|
||||||
//Goto Action
|
// Goto Action
|
||||||
tmpaction = new QAction(tr("&Go To Line..."), this);
|
tmpaction = new QAction(tr("&Go To Line..."), this);
|
||||||
cmd = am->registerAction(tmpaction, Constants::GOTO, m_globalContext);
|
cmd = am->registerAction(tmpaction, Constants::GOTO, m_globalContext);
|
||||||
cmd->setDefaultKeySequence(QKeySequence(tr("Ctrl+L")));
|
cmd->setDefaultKeySequence(QKeySequence(tr("Ctrl+L")));
|
||||||
medit->addAction(cmd, Constants::G_EDIT_OTHER);
|
medit->addAction(cmd, Constants::G_EDIT_OTHER);
|
||||||
|
|
||||||
//Options Action
|
// Options Action
|
||||||
m_optionsAction = new QAction(tr("&Options..."), this);
|
m_optionsAction = new QAction(tr("&Options..."), this);
|
||||||
cmd = am->registerAction(m_optionsAction, Constants::OPTIONS, m_globalContext);
|
cmd = am->registerAction(m_optionsAction, Constants::OPTIONS, m_globalContext);
|
||||||
#ifdef Q_OS_MAC
|
#ifdef Q_OS_MAC
|
||||||
@@ -607,25 +607,25 @@ void MainWindow::registerDefaultActions()
|
|||||||
connect(m_optionsAction, SIGNAL(triggered()), this, SLOT(showOptionsDialog()));
|
connect(m_optionsAction, SIGNAL(triggered()), this, SLOT(showOptionsDialog()));
|
||||||
|
|
||||||
#ifdef Q_OS_MAC
|
#ifdef Q_OS_MAC
|
||||||
//Minimize Action
|
// Minimize Action
|
||||||
m_minimizeAction = new QAction(tr("Minimize"), this);
|
m_minimizeAction = new QAction(tr("Minimize"), this);
|
||||||
cmd = am->registerAction(m_minimizeAction, Constants::MINIMIZE_WINDOW, m_globalContext);
|
cmd = am->registerAction(m_minimizeAction, Constants::MINIMIZE_WINDOW, m_globalContext);
|
||||||
cmd->setDefaultKeySequence(QKeySequence("Ctrl+M"));
|
cmd->setDefaultKeySequence(QKeySequence("Ctrl+M"));
|
||||||
mwindow->addAction(cmd, Constants::G_WINDOW_SIZE);
|
mwindow->addAction(cmd, Constants::G_WINDOW_SIZE);
|
||||||
connect(m_minimizeAction, SIGNAL(triggered()), this, SLOT(showMinimized()));
|
connect(m_minimizeAction, SIGNAL(triggered()), this, SLOT(showMinimized()));
|
||||||
|
|
||||||
//Zoom Action
|
// Zoom Action
|
||||||
m_zoomAction = new QAction(tr("Zoom"), this);
|
m_zoomAction = new QAction(tr("Zoom"), this);
|
||||||
cmd = am->registerAction(m_zoomAction, Constants::ZOOM_WINDOW, m_globalContext);
|
cmd = am->registerAction(m_zoomAction, Constants::ZOOM_WINDOW, m_globalContext);
|
||||||
mwindow->addAction(cmd, Constants::G_WINDOW_SIZE);
|
mwindow->addAction(cmd, Constants::G_WINDOW_SIZE);
|
||||||
connect(m_zoomAction, SIGNAL(triggered()), this, SLOT(showMaximized()));
|
connect(m_zoomAction, SIGNAL(triggered()), this, SLOT(showMaximized()));
|
||||||
|
|
||||||
//Window separator
|
// Window separator
|
||||||
cmd = createSeparator(am, this, QLatin1String("QtCreator.Window.Sep.Size"), m_globalContext);
|
cmd = createSeparator(am, this, QLatin1String("QtCreator.Window.Sep.Size"), m_globalContext);
|
||||||
mwindow->addAction(cmd, Constants::G_WINDOW_SIZE);
|
mwindow->addAction(cmd, Constants::G_WINDOW_SIZE);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// Toggle Sidebar Action
|
// Show Sidebar Action
|
||||||
m_toggleSideBarAction = new QAction(QIcon(Constants::ICON_TOGGLE_SIDEBAR),
|
m_toggleSideBarAction = new QAction(QIcon(Constants::ICON_TOGGLE_SIDEBAR),
|
||||||
tr("Show Sidebar"), this);
|
tr("Show Sidebar"), this);
|
||||||
m_toggleSideBarAction->setCheckable(true);
|
m_toggleSideBarAction->setCheckable(true);
|
||||||
@@ -641,19 +641,16 @@ void MainWindow::registerDefaultActions()
|
|||||||
m_toggleSideBarAction->setEnabled(false);
|
m_toggleSideBarAction->setEnabled(false);
|
||||||
|
|
||||||
#if !defined(Q_OS_MAC)
|
#if !defined(Q_OS_MAC)
|
||||||
// Toggle Full Screen
|
// Full Screen Action
|
||||||
m_toggleFullScreenAction = new QAction(tr("Toggle Fullscreen"), this);
|
m_toggleFullScreenAction = new QAction(tr("Full Screen"), this);
|
||||||
m_toggleFullScreenAction->setCheckable(true);
|
m_toggleFullScreenAction->setCheckable(true);
|
||||||
m_toggleFullScreenAction->setChecked(false);
|
cmd = am->registerAction(m_toggleFullScreenAction, Constants::TOGGLE_FULLSCREEN, m_globalContext);
|
||||||
cmd = am->registerAction(m_toggleFullScreenAction,
|
|
||||||
Constants::TOGGLE_FULLSCREEN, m_globalContext);
|
|
||||||
cmd->setDefaultKeySequence(QKeySequence("Ctrl+Shift+F11"));
|
cmd->setDefaultKeySequence(QKeySequence("Ctrl+Shift+F11"));
|
||||||
mwindow->addAction(cmd, Constants::G_WINDOW_SIZE);
|
mwindow->addAction(cmd, Constants::G_WINDOW_SIZE);
|
||||||
connect(m_toggleFullScreenAction, SIGNAL(triggered(bool)),
|
connect(m_toggleFullScreenAction, SIGNAL(triggered(bool)), this, SLOT(setFullScreen(bool)));
|
||||||
this, SLOT(setFullScreen(bool)));
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
//About IDE Action
|
// About IDE Action
|
||||||
#ifdef Q_OS_MAC
|
#ifdef Q_OS_MAC
|
||||||
tmpaction = new QAction(tr("About &Qt Creator"), this); // it's convention not to add dots to the about menu
|
tmpaction = new QAction(tr("About &Qt Creator"), this); // it's convention not to add dots to the about menu
|
||||||
#else
|
#else
|
||||||
@@ -672,7 +669,7 @@ void MainWindow::registerDefaultActions()
|
|||||||
cmd->action()->setMenuRole(QAction::ApplicationSpecificRole);
|
cmd->action()->setMenuRole(QAction::ApplicationSpecificRole);
|
||||||
#endif
|
#endif
|
||||||
connect(tmpaction, SIGNAL(triggered()), this, SLOT(aboutPlugins()));
|
connect(tmpaction, SIGNAL(triggered()), this, SLOT(aboutPlugins()));
|
||||||
//About Qt Action
|
// About Qt Action
|
||||||
// tmpaction = new QAction(tr("About &Qt..."), this);
|
// tmpaction = new QAction(tr("About &Qt..."), this);
|
||||||
// cmd = am->registerAction(tmpaction, Constants:: ABOUT_QT, m_globalContext);
|
// cmd = am->registerAction(tmpaction, Constants:: ABOUT_QT, m_globalContext);
|
||||||
// mhelp->addAction(cmd, Constants::G_HELP_ABOUT);
|
// mhelp->addAction(cmd, Constants::G_HELP_ABOUT);
|
||||||
@@ -937,10 +934,8 @@ void MainWindow::changeEvent(QEvent *e)
|
|||||||
m_minimizeAction->setEnabled(!minimized);
|
m_minimizeAction->setEnabled(!minimized);
|
||||||
m_zoomAction->setEnabled(!minimized);
|
m_zoomAction->setEnabled(!minimized);
|
||||||
#else
|
#else
|
||||||
QWindowStateChangeEvent *ev =
|
bool isFullScreen = (windowState() & Qt::WindowFullScreen) != 0;
|
||||||
static_cast<QWindowStateChangeEvent *>(e);
|
m_toggleFullScreenAction->setChecked(isFullScreen);
|
||||||
bool isFullScreen = (ev->oldState() & Qt::WindowFullScreen) != 0;
|
|
||||||
m_toggleFullScreenAction->setChecked(!isFullScreen);
|
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -34,7 +34,7 @@
|
|||||||
#ifndef MAINWINDOW_H
|
#ifndef MAINWINDOW_H
|
||||||
#define MAINWINDOW_H
|
#define MAINWINDOW_H
|
||||||
|
|
||||||
#include "icore.h"
|
#include "core_global.h"
|
||||||
|
|
||||||
#include <QtGui/QMainWindow>
|
#include <QtGui/QMainWindow>
|
||||||
#include <QtCore/QMap>
|
#include <QtCore/QMap>
|
||||||
@@ -61,6 +61,7 @@ class BaseView;
|
|||||||
class EditorManager;
|
class EditorManager;
|
||||||
class FileManager;
|
class FileManager;
|
||||||
class IContext;
|
class IContext;
|
||||||
|
class IWizard;
|
||||||
class MessageManager;
|
class MessageManager;
|
||||||
class MimeDatabase;
|
class MimeDatabase;
|
||||||
class ModeManager;
|
class ModeManager;
|
||||||
@@ -103,7 +104,6 @@ public:
|
|||||||
|
|
||||||
void openFiles(const QStringList &fileNames);
|
void openFiles(const QStringList &fileNames);
|
||||||
|
|
||||||
//ICore
|
|
||||||
inline ExtensionSystem::PluginManager *pluginManager() { return m_pluginManager; }
|
inline ExtensionSystem::PluginManager *pluginManager() { return m_pluginManager; }
|
||||||
Core::ActionManager *actionManager() const;
|
Core::ActionManager *actionManager() const;
|
||||||
Core::FileManager *fileManager() const;
|
Core::FileManager *fileManager() const;
|
||||||
|
|||||||
@@ -35,6 +35,7 @@
|
|||||||
|
|
||||||
#include "fancytabwidget.h"
|
#include "fancytabwidget.h"
|
||||||
#include "fancyactionbar.h"
|
#include "fancyactionbar.h"
|
||||||
|
#include "icore.h"
|
||||||
#include "mainwindow.h"
|
#include "mainwindow.h"
|
||||||
|
|
||||||
#include <aggregation/aggregate.h>
|
#include <aggregation/aggregate.h>
|
||||||
|
|||||||
@@ -33,12 +33,13 @@
|
|||||||
|
|
||||||
#include "navigationwidget.h"
|
#include "navigationwidget.h"
|
||||||
|
|
||||||
#include <coreplugin/icore.h>
|
#include "icore.h"
|
||||||
#include <coreplugin/coreconstants.h>
|
#include "coreconstants.h"
|
||||||
#include <coreplugin/inavigationwidgetfactory.h>
|
#include "inavigationwidgetfactory.h"
|
||||||
#include <coreplugin/modemanager.h>
|
#include "modemanager.h"
|
||||||
#include <coreplugin/uniqueidmanager.h>
|
#include "uniqueidmanager.h"
|
||||||
#include <coreplugin/actionmanager/actionmanager.h>
|
#include "actionmanager/actionmanager.h"
|
||||||
|
|
||||||
#include <extensionsystem/pluginmanager.h>
|
#include <extensionsystem/pluginmanager.h>
|
||||||
|
|
||||||
#include <QtCore/QDebug>
|
#include <QtCore/QDebug>
|
||||||
|
|||||||
@@ -33,6 +33,7 @@
|
|||||||
|
|
||||||
#include "outputpane.h"
|
#include "outputpane.h"
|
||||||
#include "coreconstants.h"
|
#include "coreconstants.h"
|
||||||
|
#include "icore.h"
|
||||||
#include "ioutputpane.h"
|
#include "ioutputpane.h"
|
||||||
#include "mainwindow.h"
|
#include "mainwindow.h"
|
||||||
#include "modemanager.h"
|
#include "modemanager.h"
|
||||||
@@ -55,7 +56,6 @@
|
|||||||
#include <QtGui/QToolBar>
|
#include <QtGui/QToolBar>
|
||||||
#include <QtGui/QToolButton>
|
#include <QtGui/QToolButton>
|
||||||
#include <QtGui/QStackedWidget>
|
#include <QtGui/QStackedWidget>
|
||||||
#include <QDebug>
|
|
||||||
|
|
||||||
using namespace Core;
|
using namespace Core;
|
||||||
using namespace Core::Internal;
|
using namespace Core::Internal;
|
||||||
|
|||||||
@@ -35,13 +35,15 @@
|
|||||||
#define SCRIPTMANAGER_P_H
|
#define SCRIPTMANAGER_P_H
|
||||||
|
|
||||||
#include <coreplugin/scriptmanager/scriptmanager.h>
|
#include <coreplugin/scriptmanager/scriptmanager.h>
|
||||||
#include <coreplugin/icore.h>
|
|
||||||
|
|
||||||
#include <QtCore/QObject>
|
#include <QtCore/QObject>
|
||||||
#include <QtCore/QList>
|
#include <QtCore/QList>
|
||||||
#include <QtScript/QScriptEngine>
|
#include <QtScript/QScriptEngine>
|
||||||
|
|
||||||
namespace Core {
|
namespace Core {
|
||||||
|
|
||||||
|
class ICore;
|
||||||
|
|
||||||
namespace Internal {
|
namespace Internal {
|
||||||
|
|
||||||
class ScriptManagerPrivate : public Core::ScriptManager
|
class ScriptManagerPrivate : public Core::ScriptManager
|
||||||
|
|||||||
@@ -84,8 +84,7 @@ bool CodepasterPlugin::initialize(const QStringList &arguments, QString *error_m
|
|||||||
|
|
||||||
// Create the globalcontext list to register actions accordingly
|
// Create the globalcontext list to register actions accordingly
|
||||||
QList<int> globalcontext;
|
QList<int> globalcontext;
|
||||||
globalcontext << ICore::instance()->uniqueIDManager()->
|
globalcontext << UniqueIDManager::instance()->uniqueIdentifier(Core::Constants::C_GLOBAL);
|
||||||
uniqueIdentifier(Core::Constants::C_GLOBAL);
|
|
||||||
|
|
||||||
// Create the settings Page
|
// Create the settings Page
|
||||||
m_settingsPage = new SettingsPage();
|
m_settingsPage = new SettingsPage();
|
||||||
@@ -129,7 +128,7 @@ void CodepasterPlugin::post()
|
|||||||
{
|
{
|
||||||
if (m_poster)
|
if (m_poster)
|
||||||
delete m_poster;
|
delete m_poster;
|
||||||
IEditor* editor = ICore::instance()->editorManager()->currentEditor();
|
IEditor* editor = EditorManager::instance()->currentEditor();
|
||||||
ITextEditor* textEditor = qobject_cast<ITextEditor*>(editor);
|
ITextEditor* textEditor = qobject_cast<ITextEditor*>(editor);
|
||||||
if (!textEditor)
|
if (!textEditor)
|
||||||
return;
|
return;
|
||||||
@@ -240,8 +239,7 @@ void CustomFetcher::customRequestFinished(int, bool error)
|
|||||||
QByteArray data = body();
|
QByteArray data = body();
|
||||||
if (!m_listWidget) {
|
if (!m_listWidget) {
|
||||||
QString title = QString::fromLatin1("Code Paster: %1").arg(m_id);
|
QString title = QString::fromLatin1("Code Paster: %1").arg(m_id);
|
||||||
ICore::instance()->editorManager()->newFile(Core::Constants::K_DEFAULT_TEXT_EDITOR
|
EditorManager::instance()->newFile(Core::Constants::K_DEFAULT_TEXT_EDITOR, &title, data);
|
||||||
, &title, data);
|
|
||||||
} else {
|
} else {
|
||||||
m_listWidget->clear();
|
m_listWidget->clear();
|
||||||
QStringList lines = QString(data).split(QLatin1Char('\n'));
|
QStringList lines = QString(data).split(QLatin1Char('\n'));
|
||||||
|
|||||||
@@ -139,10 +139,10 @@ QualifiedNameId *qualifiedNameIdForSymbol(Symbol *s, const LookupContext &contex
|
|||||||
CPPEditorEditable::CPPEditorEditable(CPPEditor *editor)
|
CPPEditorEditable::CPPEditorEditable(CPPEditor *editor)
|
||||||
: BaseTextEditorEditable(editor)
|
: BaseTextEditorEditable(editor)
|
||||||
{
|
{
|
||||||
Core::ICore *core = Core::ICore::instance();
|
Core::UniqueIDManager *uidm = Core::UniqueIDManager::instance();
|
||||||
m_context << core->uniqueIDManager()->uniqueIdentifier(CppEditor::Constants::C_CPPEDITOR);
|
m_context << uidm->uniqueIdentifier(CppEditor::Constants::C_CPPEDITOR);
|
||||||
m_context << core->uniqueIDManager()->uniqueIdentifier(ProjectExplorer::Constants::LANG_CXX);
|
m_context << uidm->uniqueIdentifier(ProjectExplorer::Constants::LANG_CXX);
|
||||||
m_context << core->uniqueIDManager()->uniqueIdentifier(TextEditor::Constants::C_TEXTEDITOR);
|
m_context << uidm->uniqueIdentifier(TextEditor::Constants::C_TEXTEDITOR);
|
||||||
}
|
}
|
||||||
|
|
||||||
CPPEditor::CPPEditor(QWidget *parent)
|
CPPEditor::CPPEditor(QWidget *parent)
|
||||||
@@ -334,10 +334,10 @@ void CPPEditor::jumpToMethod(int)
|
|||||||
if (! symbol)
|
if (! symbol)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
Core::ICore::instance()->editorManager()->addCurrentPositionToNavigationHistory(true);
|
Core::EditorManager::instance()->addCurrentPositionToNavigationHistory(true);
|
||||||
int line = symbol->line();
|
int line = symbol->line();
|
||||||
gotoLine(line);
|
gotoLine(line);
|
||||||
Core::ICore::instance()->editorManager()->addCurrentPositionToNavigationHistory();
|
Core::EditorManager::instance()->addCurrentPositionToNavigationHistory();
|
||||||
setFocus();
|
setFocus();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -440,9 +440,9 @@ void CPPEditor::switchDeclarationDefinition()
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
Function *f = lastSymbol->asFunction();
|
Function *f = lastSymbol->asFunction();
|
||||||
if (! f) {
|
if (!f) {
|
||||||
Scope *fs = lastSymbol->scope();
|
Scope *fs = lastSymbol->scope();
|
||||||
if (! fs->isFunctionScope())
|
if (!fs->isFunctionScope())
|
||||||
fs = fs->enclosingFunctionScope();
|
fs = fs->enclosingFunctionScope();
|
||||||
if (fs)
|
if (fs)
|
||||||
f = fs->owner()->asFunction();
|
f = fs->owner()->asFunction();
|
||||||
|
|||||||
@@ -88,7 +88,7 @@ QString CppPluginEditorFactory::kind() const
|
|||||||
|
|
||||||
Core::IFile *CppPluginEditorFactory::open(const QString &fileName)
|
Core::IFile *CppPluginEditorFactory::open(const QString &fileName)
|
||||||
{
|
{
|
||||||
Core::IEditor *iface = Core::ICore::instance()->editorManager()->openEditor(fileName, kind());
|
Core::IEditor *iface = Core::EditorManager::instance()->openEditor(fileName, kind());
|
||||||
return iface ? iface->file() : 0;
|
return iface ? iface->file() : 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -238,20 +238,18 @@ void CppPlugin::extensionsInitialized()
|
|||||||
|
|
||||||
void CppPlugin::switchDeclarationDefinition()
|
void CppPlugin::switchDeclarationDefinition()
|
||||||
{
|
{
|
||||||
Core::ICore *core = Core::ICore::instance();
|
Core::EditorManager *em = Core::EditorManager::instance();
|
||||||
CPPEditor *editor = qobject_cast<CPPEditor*>(core->editorManager()->currentEditor()->widget());
|
CPPEditor *editor = qobject_cast<CPPEditor*>(em->currentEditor()->widget());
|
||||||
if (editor) {
|
if (editor)
|
||||||
editor->switchDeclarationDefinition();
|
editor->switchDeclarationDefinition();
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void CppPlugin::jumpToDefinition()
|
void CppPlugin::jumpToDefinition()
|
||||||
{
|
{
|
||||||
Core::ICore *core = Core::ICore::instance();
|
Core::EditorManager *em = Core::EditorManager::instance();
|
||||||
CPPEditor *editor = qobject_cast<CPPEditor*>(core->editorManager()->currentEditor()->widget());
|
CPPEditor *editor = qobject_cast<CPPEditor*>(em->currentEditor()->widget());
|
||||||
if (editor) {
|
if (editor)
|
||||||
editor->jumpToDefinition();
|
editor->jumpToDefinition();
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Q_EXPORT_PLUGIN(CppPlugin)
|
Q_EXPORT_PLUGIN(CppPlugin)
|
||||||
|
|||||||
@@ -147,7 +147,7 @@ void CppToolsPlugin::shutdown()
|
|||||||
|
|
||||||
void CppToolsPlugin::switchHeaderSource()
|
void CppToolsPlugin::switchHeaderSource()
|
||||||
{
|
{
|
||||||
Core::EditorManager *editorManager = Core::ICore::instance()->editorManager();
|
Core::EditorManager *editorManager = Core::EditorManager::instance();
|
||||||
Core::IEditor *editor = editorManager->currentEditor();
|
Core::IEditor *editor = editorManager->currentEditor();
|
||||||
QString otherFile = correspondingHeaderOrSource(editor->file()->fileName());
|
QString otherFile = correspondingHeaderOrSource(editor->file()->fileName());
|
||||||
if (!otherFile.isEmpty()) {
|
if (!otherFile.isEmpty()) {
|
||||||
|
|||||||
@@ -723,18 +723,17 @@ void DebuggerPlugin::activatePreviousMode()
|
|||||||
|
|
||||||
void DebuggerPlugin::activateDebugMode()
|
void DebuggerPlugin::activateDebugMode()
|
||||||
{
|
{
|
||||||
ICore *core = ICore::instance();
|
ModeManager *modeManager = ModeManager::instance();
|
||||||
Core::ModeManager *modeManager = core->modeManager();
|
|
||||||
m_previousMode = QLatin1String(modeManager->currentMode()->uniqueModeName());
|
m_previousMode = QLatin1String(modeManager->currentMode()->uniqueModeName());
|
||||||
modeManager->activateMode(QLatin1String(MODE_DEBUG));
|
modeManager->activateMode(QLatin1String(MODE_DEBUG));
|
||||||
}
|
}
|
||||||
|
|
||||||
void DebuggerPlugin::queryCurrentTextEditor(QString *fileName, int *lineNumber, QObject **object)
|
void DebuggerPlugin::queryCurrentTextEditor(QString *fileName, int *lineNumber, QObject **object)
|
||||||
{
|
{
|
||||||
ICore *core = ICore::instance();
|
EditorManager *editorManager = EditorManager::instance();
|
||||||
if (!core || !core->editorManager())
|
if (!editorManager)
|
||||||
return;
|
return;
|
||||||
Core::IEditor *editor = core->editorManager()->currentEditor();
|
Core::IEditor *editor = editorManager->currentEditor();
|
||||||
ITextEditor *textEditor = qobject_cast<ITextEditor*>(editor);
|
ITextEditor *textEditor = qobject_cast<ITextEditor*>(editor);
|
||||||
if (!textEditor)
|
if (!textEditor)
|
||||||
return;
|
return;
|
||||||
|
|||||||
@@ -50,7 +50,7 @@ namespace Internal {
|
|||||||
FormClassWizardDialog::FormClassWizardDialog(const WizardPageList &extensionPages,
|
FormClassWizardDialog::FormClassWizardDialog(const WizardPageList &extensionPages,
|
||||||
QWidget *parent) :
|
QWidget *parent) :
|
||||||
QWizard(parent),
|
QWizard(parent),
|
||||||
m_formPage(new FormTemplateWizardPagePage),
|
m_formPage(new FormTemplateWizardPage),
|
||||||
m_classPage(new FormClassWizardPage)
|
m_classPage(new FormClassWizardPage)
|
||||||
{
|
{
|
||||||
setWindowTitle(tr("Qt Designer Form Class"));
|
setWindowTitle(tr("Qt Designer Form Class"));
|
||||||
@@ -97,8 +97,8 @@ void FormClassWizardDialog::slotCurrentIdChanged(int id)
|
|||||||
m_rawFormTemplate = m_formPage->templateContents();
|
m_rawFormTemplate = m_formPage->templateContents();
|
||||||
// Strip namespaces from the ui class and suggest it as a new class
|
// Strip namespaces from the ui class and suggest it as a new class
|
||||||
// name
|
// name
|
||||||
if (FormTemplateWizardPagePage::getUIXmlData(m_rawFormTemplate, &formBaseClass, &uiClassName))
|
if (FormTemplateWizardPage::getUIXmlData(m_rawFormTemplate, &formBaseClass, &uiClassName))
|
||||||
m_classPage->setClassName(FormTemplateWizardPagePage::stripNamespaces(uiClassName));
|
m_classPage->setClassName(FormTemplateWizardPage::stripNamespaces(uiClassName));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -107,7 +107,7 @@ FormClassWizardParameters FormClassWizardDialog::parameters() const
|
|||||||
FormClassWizardParameters rc;
|
FormClassWizardParameters rc;
|
||||||
m_classPage->getParameters(&rc);
|
m_classPage->getParameters(&rc);
|
||||||
// Name the ui class in the Ui namespace after the class specified
|
// Name the ui class in the Ui namespace after the class specified
|
||||||
rc.uiTemplate = FormTemplateWizardPagePage::changeUiClassName(m_rawFormTemplate, rc.className);
|
rc.uiTemplate = FormTemplateWizardPage::changeUiClassName(m_rawFormTemplate, rc.className);
|
||||||
return rc;
|
return rc;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -45,7 +45,7 @@ namespace Internal {
|
|||||||
|
|
||||||
struct FormClassWizardParameters;
|
struct FormClassWizardParameters;
|
||||||
class FormClassWizardPage;
|
class FormClassWizardPage;
|
||||||
class FormTemplateWizardPagePage;
|
class FormTemplateWizardPage;
|
||||||
|
|
||||||
class FormClassWizardDialog : public QWizard
|
class FormClassWizardDialog : public QWizard
|
||||||
{
|
{
|
||||||
@@ -73,7 +73,7 @@ private slots:
|
|||||||
void slotCurrentIdChanged(int id);
|
void slotCurrentIdChanged(int id);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
FormTemplateWizardPagePage *m_formPage;
|
FormTemplateWizardPage *m_formPage;
|
||||||
FormClassWizardPage *m_classPage;
|
FormClassWizardPage *m_classPage;
|
||||||
QString m_rawFormTemplate;
|
QString m_rawFormTemplate;
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -57,7 +57,7 @@ bool FormClassWizardParameters::generateCpp(QString *header, QString *source, in
|
|||||||
const QString indent = QString(indentation, QLatin1Char(' '));
|
const QString indent = QString(indentation, QLatin1Char(' '));
|
||||||
QString formBaseClass;
|
QString formBaseClass;
|
||||||
QString uiClassName;
|
QString uiClassName;
|
||||||
if (!FormTemplateWizardPagePage::getUIXmlData(uiTemplate, &formBaseClass, &uiClassName)) {
|
if (!FormTemplateWizardPage::getUIXmlData(uiTemplate, &formBaseClass, &uiClassName)) {
|
||||||
qWarning("Unable to determine the form base class from %s.", uiTemplate.toUtf8().constData());
|
qWarning("Unable to determine the form base class from %s.", uiTemplate.toUtf8().constData());
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@@ -107,7 +107,7 @@ bool FormClassWizardParameters::generateCpp(QString *header, QString *source, in
|
|||||||
if (embedding == PointerAggregatedUiClass) {
|
if (embedding == PointerAggregatedUiClass) {
|
||||||
headerStr << '\n'
|
headerStr << '\n'
|
||||||
<< namespaceIndent << "namespace " << uiNamespaceC << " {\n"
|
<< namespaceIndent << "namespace " << uiNamespaceC << " {\n"
|
||||||
<< namespaceIndent << indent << "class " << FormTemplateWizardPagePage::stripNamespaces(uiClassName) << ";\n"
|
<< namespaceIndent << indent << "class " << FormTemplateWizardPage::stripNamespaces(uiClassName) << ";\n"
|
||||||
<< namespaceIndent << "}\n";
|
<< namespaceIndent << "}\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -63,7 +63,7 @@ QString FormEditorFactory::kind() const
|
|||||||
|
|
||||||
Core::IFile *FormEditorFactory::open(const QString &fileName)
|
Core::IFile *FormEditorFactory::open(const QString &fileName)
|
||||||
{
|
{
|
||||||
Core::IEditor *iface = Core::ICore::instance()->editorManager()->openEditor(fileName, kind());
|
Core::IEditor *iface = Core::EditorManager::instance()->openEditor(fileName, kind());
|
||||||
return iface ? iface->file() : 0;
|
return iface ? iface->file() : 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -40,6 +40,7 @@
|
|||||||
#include "workbenchintegration.h"
|
#include "workbenchintegration.h"
|
||||||
|
|
||||||
#include <coreplugin/coreconstants.h>
|
#include <coreplugin/coreconstants.h>
|
||||||
|
#include <coreplugin/icore.h>
|
||||||
#include <coreplugin/uniqueidmanager.h>
|
#include <coreplugin/uniqueidmanager.h>
|
||||||
#include <coreplugin/actionmanager/actionmanager.h>
|
#include <coreplugin/actionmanager/actionmanager.h>
|
||||||
#include <coreplugin/editormanager/editormanager.h>
|
#include <coreplugin/editormanager/editormanager.h>
|
||||||
|
|||||||
@@ -55,9 +55,9 @@
|
|||||||
namespace Designer {
|
namespace Designer {
|
||||||
namespace Internal {
|
namespace Internal {
|
||||||
|
|
||||||
// ----------------- FormTemplateWizardPagePage
|
// ----------------- FormTemplateWizardPage
|
||||||
|
|
||||||
FormTemplateWizardPagePage::FormTemplateWizardPagePage(QWidget * parent) :
|
FormTemplateWizardPage::FormTemplateWizardPage(QWidget * parent) :
|
||||||
QWizardPage(parent),
|
QWizardPage(parent),
|
||||||
m_newFormWidget(QDesignerNewFormWidgetInterface::createNewFormWidget(FormEditorW::instance()->designerEditor())),
|
m_newFormWidget(QDesignerNewFormWidgetInterface::createNewFormWidget(FormEditorW::instance()->designerEditor())),
|
||||||
m_templateSelected(m_newFormWidget->hasCurrentTemplate())
|
m_templateSelected(m_newFormWidget->hasCurrentTemplate())
|
||||||
@@ -74,12 +74,12 @@ FormTemplateWizardPagePage::FormTemplateWizardPagePage(QWidget * parent) :
|
|||||||
setLayout(layout);
|
setLayout(layout);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool FormTemplateWizardPagePage::isComplete() const
|
bool FormTemplateWizardPage::isComplete() const
|
||||||
{
|
{
|
||||||
return m_templateSelected;
|
return m_templateSelected;
|
||||||
}
|
}
|
||||||
|
|
||||||
void FormTemplateWizardPagePage::slotCurrentTemplateChanged(bool templateSelected)
|
void FormTemplateWizardPage::slotCurrentTemplateChanged(bool templateSelected)
|
||||||
{
|
{
|
||||||
if (m_templateSelected == templateSelected)
|
if (m_templateSelected == templateSelected)
|
||||||
return;
|
return;
|
||||||
@@ -87,7 +87,7 @@ void FormTemplateWizardPagePage::slotCurrentTemplateChanged(bool templateSelecte
|
|||||||
emit completeChanged();
|
emit completeChanged();
|
||||||
}
|
}
|
||||||
|
|
||||||
bool FormTemplateWizardPagePage::validatePage()
|
bool FormTemplateWizardPage::validatePage()
|
||||||
{
|
{
|
||||||
QString errorMessage;
|
QString errorMessage;
|
||||||
m_templateContents = m_newFormWidget->currentTemplate(&errorMessage);
|
m_templateContents = m_newFormWidget->currentTemplate(&errorMessage);
|
||||||
@@ -98,7 +98,7 @@ bool FormTemplateWizardPagePage::validatePage()
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
QString FormTemplateWizardPagePage::stripNamespaces(const QString &className)
|
QString FormTemplateWizardPage::stripNamespaces(const QString &className)
|
||||||
{
|
{
|
||||||
QString rc = className;
|
QString rc = className;
|
||||||
const int namespaceIndex = rc.lastIndexOf(QLatin1String("::"));
|
const int namespaceIndex = rc.lastIndexOf(QLatin1String("::"));
|
||||||
@@ -107,7 +107,7 @@ QString FormTemplateWizardPagePage::stripNamespaces(const QString &className)
|
|||||||
return rc;
|
return rc;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool FormTemplateWizardPagePage::getUIXmlData(const QString &uiXml,
|
bool FormTemplateWizardPage::getUIXmlData(const QString &uiXml,
|
||||||
QString *formBaseClass,
|
QString *formBaseClass,
|
||||||
QString *uiClassName)
|
QString *uiClassName)
|
||||||
{
|
{
|
||||||
@@ -179,7 +179,7 @@ static const char *classNameChangingSheetFormatC =
|
|||||||
"</xsl:template>\n"
|
"</xsl:template>\n"
|
||||||
"</xsl:stylesheet>\n";
|
"</xsl:stylesheet>\n";
|
||||||
|
|
||||||
QString FormTemplateWizardPagePage::changeUiClassName(const QString &uiXml, const QString &newUiClassName)
|
QString FormTemplateWizardPage::changeUiClassName(const QString &uiXml, const QString &newUiClassName)
|
||||||
{
|
{
|
||||||
// Prepare I/O: Sheet
|
// Prepare I/O: Sheet
|
||||||
const QString xsltSheet = QString::fromLatin1(classNameChangingSheetFormatC).arg(newUiClassName);
|
const QString xsltSheet = QString::fromLatin1(classNameChangingSheetFormatC).arg(newUiClassName);
|
||||||
@@ -280,7 +280,7 @@ namespace {
|
|||||||
// of the <class> element, as name of the first <widget> element, and possibly
|
// of the <class> element, as name of the first <widget> element, and possibly
|
||||||
// in the signal/slot connections
|
// in the signal/slot connections
|
||||||
|
|
||||||
QString FormTemplateWizardPagePage::changeUiClassName(const QString &uiXml, const QString &newUiClassName)
|
QString FormTemplateWizardPage::changeUiClassName(const QString &uiXml, const QString &newUiClassName)
|
||||||
{
|
{
|
||||||
QDomDocument domUi;
|
QDomDocument domUi;
|
||||||
if (!domUi.setContent(uiXml)) {
|
if (!domUi.setContent(uiXml)) {
|
||||||
|
|||||||
@@ -46,12 +46,12 @@ namespace Internal {
|
|||||||
// A wizard page embedding Qt Designer's QDesignerNewFormWidgetInterface
|
// A wizard page embedding Qt Designer's QDesignerNewFormWidgetInterface
|
||||||
// widget.
|
// widget.
|
||||||
|
|
||||||
class FormTemplateWizardPagePage : public QWizardPage
|
class FormTemplateWizardPage : public QWizardPage
|
||||||
{
|
{
|
||||||
Q_DISABLE_COPY(FormTemplateWizardPagePage)
|
Q_DISABLE_COPY(FormTemplateWizardPage)
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
public:
|
public:
|
||||||
explicit FormTemplateWizardPagePage(QWidget * parent = 0);
|
explicit FormTemplateWizardPage(QWidget * parent = 0);
|
||||||
|
|
||||||
virtual bool isComplete () const;
|
virtual bool isComplete () const;
|
||||||
virtual bool validatePage();
|
virtual bool validatePage();
|
||||||
|
|||||||
@@ -53,7 +53,7 @@ namespace Internal {
|
|||||||
FormWizardDialog::FormWizardDialog(const WizardPageList &extensionPages,
|
FormWizardDialog::FormWizardDialog(const WizardPageList &extensionPages,
|
||||||
QWidget *parent)
|
QWidget *parent)
|
||||||
: QWizard(parent),
|
: QWizard(parent),
|
||||||
m_formPage(new FormTemplateWizardPagePage)
|
m_formPage(new FormTemplateWizardPage)
|
||||||
{
|
{
|
||||||
init(extensionPages);
|
init(extensionPages);
|
||||||
}
|
}
|
||||||
@@ -114,8 +114,8 @@ void FormFileWizardDialog::slotCurrentIdChanged(int id)
|
|||||||
// the ui class
|
// the ui class
|
||||||
QString formBaseClass;
|
QString formBaseClass;
|
||||||
QString uiClassName;
|
QString uiClassName;
|
||||||
if (FormTemplateWizardPagePage::getUIXmlData(templateContents(), &formBaseClass, &uiClassName)) {
|
if (FormTemplateWizardPage::getUIXmlData(templateContents(), &formBaseClass, &uiClassName)) {
|
||||||
QString fileName = FormTemplateWizardPagePage::stripNamespaces(uiClassName).toLower();
|
QString fileName = FormTemplateWizardPage::stripNamespaces(uiClassName).toLower();
|
||||||
fileName += QLatin1String(".ui");
|
fileName += QLatin1String(".ui");
|
||||||
m_filePage->setName(fileName);
|
m_filePage->setName(fileName);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -45,7 +45,7 @@ namespace Utils {
|
|||||||
namespace Designer {
|
namespace Designer {
|
||||||
namespace Internal {
|
namespace Internal {
|
||||||
|
|
||||||
class FormTemplateWizardPagePage;
|
class FormTemplateWizardPage;
|
||||||
|
|
||||||
// Single-Page Wizard for new forms offering all types known to Qt Designer.
|
// Single-Page Wizard for new forms offering all types known to Qt Designer.
|
||||||
// To be used for Mode "CreateNewEditor" [not currently used]
|
// To be used for Mode "CreateNewEditor" [not currently used]
|
||||||
@@ -65,7 +65,7 @@ public:
|
|||||||
private:
|
private:
|
||||||
void init(const WizardPageList &extensionPages);
|
void init(const WizardPageList &extensionPages);
|
||||||
|
|
||||||
FormTemplateWizardPagePage *m_formPage;
|
FormTemplateWizardPage *m_formPage;
|
||||||
mutable QString m_templateContents;
|
mutable QString m_templateContents;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -34,7 +34,6 @@
|
|||||||
#ifndef DESIGNER_SETTINGSPAGE_H
|
#ifndef DESIGNER_SETTINGSPAGE_H
|
||||||
#define DESIGNER_SETTINGSPAGE_H
|
#define DESIGNER_SETTINGSPAGE_H
|
||||||
|
|
||||||
#include <coreplugin/icore.h>
|
|
||||||
#include <coreplugin/dialogs/ioptionspage.h>
|
#include <coreplugin/dialogs/ioptionspage.h>
|
||||||
|
|
||||||
QT_BEGIN_NAMESPACE
|
QT_BEGIN_NAMESPACE
|
||||||
|
|||||||
@@ -105,7 +105,7 @@ enum SubMode
|
|||||||
ChangeSubMode,
|
ChangeSubMode,
|
||||||
DeleteSubMode,
|
DeleteSubMode,
|
||||||
FilterSubMode,
|
FilterSubMode,
|
||||||
ReplaceSubMode,
|
ReplaceSubMode, // used for R and r
|
||||||
YankSubMode,
|
YankSubMode,
|
||||||
IndentSubMode,
|
IndentSubMode,
|
||||||
ZSubMode,
|
ZSubMode,
|
||||||
@@ -113,11 +113,13 @@ enum SubMode
|
|||||||
|
|
||||||
enum SubSubMode
|
enum SubSubMode
|
||||||
{
|
{
|
||||||
|
// typically used for things that require one more data item
|
||||||
|
// and are 'nested' behind a mode
|
||||||
NoSubSubMode,
|
NoSubSubMode,
|
||||||
FtSubSubMode, // used for f, F, t, T
|
FtSubSubMode, // used for f, F, t, T
|
||||||
MarkSubSubMode, // used for m
|
MarkSubSubMode, // used for m
|
||||||
BackTickSubSubMode, // used for `
|
BackTickSubSubMode, // used for `
|
||||||
TickSubSubMode // used for '
|
TickSubSubMode, // used for '
|
||||||
};
|
};
|
||||||
|
|
||||||
enum VisualMode
|
enum VisualMode
|
||||||
@@ -137,20 +139,20 @@ enum MoveType
|
|||||||
|
|
||||||
struct EditOperation
|
struct EditOperation
|
||||||
{
|
{
|
||||||
EditOperation() : m_position(-1), m_itemCount(0) {}
|
EditOperation() : position(-1), itemCount(0) {}
|
||||||
int m_position;
|
int position;
|
||||||
int m_itemCount; // used to combine several operations
|
int itemCount; // used to combine several operations
|
||||||
QString m_from;
|
QString from;
|
||||||
QString m_to;
|
QString to;
|
||||||
};
|
};
|
||||||
|
|
||||||
QDebug &operator<<(QDebug &ts, const EditOperation &op)
|
QDebug &operator<<(QDebug &ts, const EditOperation &op)
|
||||||
{
|
{
|
||||||
if (op.m_itemCount > 0) {
|
if (op.itemCount > 0) {
|
||||||
ts << "\n EDIT BLOCK WITH " << op.m_itemCount << " ITEMS";
|
ts << "\n EDIT BLOCK WITH " << op.itemCount << " ITEMS";
|
||||||
} else {
|
} else {
|
||||||
ts << "\n EDIT AT " << op.m_position
|
ts << "\n EDIT AT " << op.position
|
||||||
<< "\n FROM " << op.m_from << "\n TO " << op.m_to;
|
<< "\n FROM " << op.from << "\n TO " << op.to;
|
||||||
}
|
}
|
||||||
return ts;
|
return ts;
|
||||||
}
|
}
|
||||||
@@ -188,7 +190,7 @@ private:
|
|||||||
int count() const { return mvCount() * opCount(); }
|
int count() const { return mvCount() * opCount(); }
|
||||||
int leftDist() const { return m_tc.position() - m_tc.block().position(); }
|
int leftDist() const { return m_tc.position() - m_tc.block().position(); }
|
||||||
int rightDist() const { return m_tc.block().length() - leftDist() - 1; }
|
int rightDist() const { return m_tc.block().length() - leftDist() - 1; }
|
||||||
bool atEol() const { return m_tc.atBlockEnd() && m_tc.block().length()>1; }
|
bool atEndOfLine() const { return m_tc.atBlockEnd() && m_tc.block().length()>1; }
|
||||||
|
|
||||||
int lastPositionInDocument() const;
|
int lastPositionInDocument() const;
|
||||||
int positionForLine(int line) const; // 1 based line, 0 based pos
|
int positionForLine(int line) const; // 1 based line, 0 based pos
|
||||||
@@ -284,11 +286,11 @@ public:
|
|||||||
void recordInsert(int position, const QString &data);
|
void recordInsert(int position, const QString &data);
|
||||||
void recordRemove(int position, const QString &data);
|
void recordRemove(int position, const QString &data);
|
||||||
void recordRemove(int position, int length);
|
void recordRemove(int position, int length);
|
||||||
void recordMove(int position, int nestedCount);
|
|
||||||
|
|
||||||
void recordRemoveNextChar();
|
void recordRemoveNextChar();
|
||||||
void recordInsertText(const QString &data);
|
void recordInsertText(const QString &data);
|
||||||
QString recordRemoveSelectedText();
|
QString recordRemoveSelectedText();
|
||||||
|
void recordMove();
|
||||||
void recordBeginGroup();
|
void recordBeginGroup();
|
||||||
void recordEndGroup();
|
void recordEndGroup();
|
||||||
int anchor() const { return m_anchor; }
|
int anchor() const { return m_anchor; }
|
||||||
@@ -301,7 +303,6 @@ public:
|
|||||||
QStack<int> m_undoGroupStack;
|
QStack<int> m_undoGroupStack;
|
||||||
|
|
||||||
// extra data for '.'
|
// extra data for '.'
|
||||||
QString m_dotCount;
|
|
||||||
QString m_dotCommand;
|
QString m_dotCommand;
|
||||||
|
|
||||||
// history for '/'
|
// history for '/'
|
||||||
@@ -367,6 +368,7 @@ bool FakeVimHandler::Private::handleEvent(QKeyEvent *ev)
|
|||||||
quit();
|
quit();
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
m_mode = CommandMode;
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -391,7 +393,7 @@ bool FakeVimHandler::Private::handleEvent(QKeyEvent *ev)
|
|||||||
bool handled = handleKey(key, um, ev->text());
|
bool handled = handleKey(key, um, ev->text());
|
||||||
|
|
||||||
// We fake vi-style end-of-line behaviour
|
// We fake vi-style end-of-line behaviour
|
||||||
m_fakeEnd = (atEol() && m_mode == CommandMode);
|
m_fakeEnd = (atEndOfLine() && m_mode == CommandMode);
|
||||||
|
|
||||||
if (m_fakeEnd)
|
if (m_fakeEnd)
|
||||||
moveLeft();
|
moveLeft();
|
||||||
@@ -446,7 +448,7 @@ void FakeVimHandler::Private::finishMovement(const QString &dotCommand)
|
|||||||
m_registers[m_register] = recordRemoveSelectedText();
|
m_registers[m_register] = recordRemoveSelectedText();
|
||||||
recordEndGroup();
|
recordEndGroup();
|
||||||
m_submode = NoSubMode;
|
m_submode = NoSubMode;
|
||||||
if (atEol())
|
if (atEndOfLine())
|
||||||
moveLeft();
|
moveLeft();
|
||||||
} else if (m_submode == YankSubMode) {
|
} else if (m_submode == YankSubMode) {
|
||||||
m_registers[m_register] = selectedText();
|
m_registers[m_register] = selectedText();
|
||||||
@@ -467,6 +469,7 @@ void FakeVimHandler::Private::finishMovement(const QString &dotCommand)
|
|||||||
m_submode = NoSubMode;
|
m_submode = NoSubMode;
|
||||||
} else if (m_moveType == MoveExclusive) {
|
} else if (m_moveType == MoveExclusive) {
|
||||||
moveLeft(); // correct
|
moveLeft(); // correct
|
||||||
|
m_moveType = MoveInclusive;
|
||||||
}
|
}
|
||||||
m_mvcount.clear();
|
m_mvcount.clear();
|
||||||
m_opcount.clear();
|
m_opcount.clear();
|
||||||
@@ -631,12 +634,6 @@ bool FakeVimHandler::Private::handleCommandMode(int key, int unmodified,
|
|||||||
moveDown(count());
|
moveDown(count());
|
||||||
m_moveType = MoveLineWise;
|
m_moveType = MoveLineWise;
|
||||||
finishMovement("y");
|
finishMovement("y");
|
||||||
} else if (m_submode == ReplaceSubMode) {
|
|
||||||
if (atEol())
|
|
||||||
moveLeft(KeepAnchor);
|
|
||||||
else
|
|
||||||
m_tc.deleteChar();
|
|
||||||
recordInsertText(text);
|
|
||||||
} else if (m_submode == IndentSubMode && key == '=') {
|
} else if (m_submode == IndentSubMode && key == '=') {
|
||||||
indentRegion(m_tc.block(), m_tc.block().next());
|
indentRegion(m_tc.block(), m_tc.block().next());
|
||||||
finishMovement();
|
finishMovement();
|
||||||
@@ -654,6 +651,22 @@ bool FakeVimHandler::Private::handleCommandMode(int key, int unmodified,
|
|||||||
handleFfTt(key);
|
handleFfTt(key);
|
||||||
m_subsubmode = NoSubSubMode;
|
m_subsubmode = NoSubSubMode;
|
||||||
finishMovement(QString(QChar(m_subsubdata)) + QChar(key));
|
finishMovement(QString(QChar(m_subsubdata)) + QChar(key));
|
||||||
|
} else if (m_submode == ReplaceSubMode) {
|
||||||
|
if (count() < rightDist() && text.size() == 1
|
||||||
|
&& (text.at(0).isPrint() || text.at(0).isSpace())) {
|
||||||
|
recordBeginGroup();
|
||||||
|
setAnchor();
|
||||||
|
moveRight(count());
|
||||||
|
recordRemoveSelectedText();
|
||||||
|
recordInsertText(QString(count(), text.at(0)));
|
||||||
|
recordEndGroup();
|
||||||
|
m_moveType = MoveExclusive;
|
||||||
|
m_submode = NoSubMode;
|
||||||
|
m_dotCommand = QString("%1r%2").arg(count()).arg(text);
|
||||||
|
finishMovement();
|
||||||
|
} else {
|
||||||
|
m_submode = NoSubMode;
|
||||||
|
}
|
||||||
} else if (m_subsubmode == MarkSubSubMode) {
|
} else if (m_subsubmode == MarkSubSubMode) {
|
||||||
m_marks[key] = m_tc.position();
|
m_marks[key] = m_tc.position();
|
||||||
m_subsubmode = NoSubSubMode;
|
m_subsubmode = NoSubSubMode;
|
||||||
@@ -748,7 +761,8 @@ bool FakeVimHandler::Private::handleCommandMode(int key, int unmodified,
|
|||||||
m_mode = InsertMode;
|
m_mode = InsertMode;
|
||||||
recordBeginGroup();
|
recordBeginGroup();
|
||||||
m_lastInsertion.clear();
|
m_lastInsertion.clear();
|
||||||
moveRight();
|
if (!atEndOfLine())
|
||||||
|
moveRight();
|
||||||
updateMiniBuffer();
|
updateMiniBuffer();
|
||||||
} else if (key == 'A') {
|
} else if (key == 'A') {
|
||||||
m_mode = InsertMode;
|
m_mode = InsertMode;
|
||||||
@@ -773,7 +787,7 @@ bool FakeVimHandler::Private::handleCommandMode(int key, int unmodified,
|
|||||||
m_mode = InsertMode;
|
m_mode = InsertMode;
|
||||||
finishMovement();
|
finishMovement();
|
||||||
} else if (key == 'd' && m_visualMode == NoVisualMode) {
|
} else if (key == 'd' && m_visualMode == NoVisualMode) {
|
||||||
if (atEol())
|
if (atEndOfLine())
|
||||||
moveLeft();
|
moveLeft();
|
||||||
setAnchor();
|
setAnchor();
|
||||||
recordBeginGroup();
|
recordBeginGroup();
|
||||||
@@ -827,7 +841,7 @@ bool FakeVimHandler::Private::handleCommandMode(int key, int unmodified,
|
|||||||
} else if (key == 'i') {
|
} else if (key == 'i') {
|
||||||
enterInsertMode();
|
enterInsertMode();
|
||||||
updateMiniBuffer();
|
updateMiniBuffer();
|
||||||
if (atEol())
|
if (atEndOfLine())
|
||||||
moveLeft();
|
moveLeft();
|
||||||
} else if (key == 'I') {
|
} else if (key == 'I') {
|
||||||
setAnchor();
|
setAnchor();
|
||||||
@@ -915,25 +929,35 @@ bool FakeVimHandler::Private::handleCommandMode(int key, int unmodified,
|
|||||||
//qDebug() << "REGISTERS: " << m_registers << "MOVE: " << m_moveType;
|
//qDebug() << "REGISTERS: " << m_registers << "MOVE: " << m_moveType;
|
||||||
//qDebug() << "LINES: " << n << text << m_register;
|
//qDebug() << "LINES: " << n << text << m_register;
|
||||||
if (n > 0) {
|
if (n > 0) {
|
||||||
|
recordMove();
|
||||||
moveToStartOfLine();
|
moveToStartOfLine();
|
||||||
if (key == 'p')
|
m_desiredColumn = 0;
|
||||||
moveDown();
|
for (int i = count(); --i >= 0; ) {
|
||||||
recordInsertText(text);
|
if (key == 'p')
|
||||||
moveUp(n);
|
moveDown();
|
||||||
|
recordInsertText(text);
|
||||||
|
moveUp(n);
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
if (key == 'p')
|
m_desiredColumn = 0;
|
||||||
moveRight();
|
for (int i = count(); --i >= 0; ) {
|
||||||
recordInsertText(text);
|
if (key == 'p')
|
||||||
moveLeft();
|
moveRight();
|
||||||
|
recordInsertText(text);
|
||||||
|
moveLeft();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
recordEndGroup();
|
recordEndGroup();
|
||||||
m_dotCommand = "p";
|
m_dotCommand = QString("%1p").arg(count());
|
||||||
|
finishMovement();
|
||||||
} else if (key == 'r') {
|
} else if (key == 'r') {
|
||||||
recordBeginGroup();
|
|
||||||
m_submode = ReplaceSubMode;
|
m_submode = ReplaceSubMode;
|
||||||
m_dotCommand = "r";
|
m_dotCommand = "r";
|
||||||
} else if (key == 'R') {
|
} else if (key == 'R') {
|
||||||
|
// FIXME: right now we repeat the insertion count() times,
|
||||||
|
// but not the deletion
|
||||||
recordBeginGroup();
|
recordBeginGroup();
|
||||||
|
m_lastInsertion.clear();
|
||||||
m_mode = InsertMode;
|
m_mode = InsertMode;
|
||||||
m_submode = ReplaceSubMode;
|
m_submode = ReplaceSubMode;
|
||||||
m_dotCommand = "R";
|
m_dotCommand = "R";
|
||||||
@@ -971,9 +995,10 @@ bool FakeVimHandler::Private::handleCommandMode(int key, int unmodified,
|
|||||||
moveToNextWord(true);
|
moveToNextWord(true);
|
||||||
finishMovement("W");
|
finishMovement("W");
|
||||||
} else if (key == 'x') { // = "dl"
|
} else if (key == 'x') { // = "dl"
|
||||||
if (atEol())
|
if (atEndOfLine())
|
||||||
moveLeft();
|
moveLeft();
|
||||||
recordBeginGroup();
|
recordBeginGroup();
|
||||||
|
setAnchor();
|
||||||
m_submode = DeleteSubMode;
|
m_submode = DeleteSubMode;
|
||||||
moveRight(qMin(count(), rightDist()));
|
moveRight(qMin(count(), rightDist()));
|
||||||
finishMovement("l");
|
finishMovement("l");
|
||||||
@@ -986,7 +1011,7 @@ bool FakeVimHandler::Private::handleCommandMode(int key, int unmodified,
|
|||||||
finishMovement();
|
finishMovement();
|
||||||
} else if (key == 'y') {
|
} else if (key == 'y') {
|
||||||
m_savedYankPosition = m_tc.position();
|
m_savedYankPosition = m_tc.position();
|
||||||
if (atEol())
|
if (atEndOfLine())
|
||||||
moveLeft();
|
moveLeft();
|
||||||
recordBeginGroup();
|
recordBeginGroup();
|
||||||
setAnchor();
|
setAnchor();
|
||||||
@@ -1000,7 +1025,7 @@ bool FakeVimHandler::Private::handleCommandMode(int key, int unmodified,
|
|||||||
} else if (key == 'z') {
|
} else if (key == 'z') {
|
||||||
recordBeginGroup();
|
recordBeginGroup();
|
||||||
m_submode = ZSubMode;
|
m_submode = ZSubMode;
|
||||||
} else if (key == '~' && !atEol()) {
|
} else if (key == '~' && !atEndOfLine()) {
|
||||||
recordBeginGroup();
|
recordBeginGroup();
|
||||||
setAnchor();
|
setAnchor();
|
||||||
moveRight(qMin(count(), rightDist()));
|
moveRight(qMin(count(), rightDist()));
|
||||||
@@ -1018,7 +1043,9 @@ bool FakeVimHandler::Private::handleCommandMode(int key, int unmodified,
|
|||||||
moveUp(count() * (linesOnScreen() - 2));
|
moveUp(count() * (linesOnScreen() - 2));
|
||||||
finishMovement();
|
finishMovement();
|
||||||
} else if (key == Key_Delete) {
|
} else if (key == Key_Delete) {
|
||||||
m_tc.deleteChar();
|
setAnchor();
|
||||||
|
moveRight(qMin(1, rightDist()));
|
||||||
|
recordRemoveSelectedText();
|
||||||
} else if (key == Key_Escape) {
|
} else if (key == Key_Escape) {
|
||||||
if (m_visualMode != NoVisualMode)
|
if (m_visualMode != NoVisualMode)
|
||||||
leaveVisualMode();
|
leaveVisualMode();
|
||||||
@@ -1084,7 +1111,7 @@ bool FakeVimHandler::Private::handleInsertMode(int key, int, const QString &text
|
|||||||
} else if (!text.isEmpty()) {
|
} else if (!text.isEmpty()) {
|
||||||
m_lastInsertion.append(text);
|
m_lastInsertion.append(text);
|
||||||
if (m_submode == ReplaceSubMode) {
|
if (m_submode == ReplaceSubMode) {
|
||||||
if (atEol())
|
if (atEndOfLine())
|
||||||
m_submode = NoSubMode;
|
m_submode = NoSubMode;
|
||||||
else
|
else
|
||||||
m_tc.deleteChar();
|
m_tc.deleteChar();
|
||||||
@@ -1356,9 +1383,9 @@ void FakeVimHandler::Private::handleExCommand(const QString &cmd0)
|
|||||||
m_tc.setPosition(positionForLine(beginLine));
|
m_tc.setPosition(positionForLine(beginLine));
|
||||||
EditOperation op;
|
EditOperation op;
|
||||||
// FIXME: broken for "upward selection"
|
// FIXME: broken for "upward selection"
|
||||||
op.m_position = m_tc.position();
|
op.position = m_tc.position();
|
||||||
op.m_from = text;
|
op.from = text;
|
||||||
op.m_to = result;
|
op.to = result;
|
||||||
recordOperation(op);
|
recordOperation(op);
|
||||||
|
|
||||||
enterCommandMode();
|
enterCommandMode();
|
||||||
@@ -1619,7 +1646,7 @@ void FakeVimHandler::Private::moveToMatchingParanthesis()
|
|||||||
#if 0
|
#if 0
|
||||||
// FIXME: remove TextEditor dependency
|
// FIXME: remove TextEditor dependency
|
||||||
bool undoFakeEOL = false;
|
bool undoFakeEOL = false;
|
||||||
if (atEol()) {
|
if (atEndOfLine()) {
|
||||||
m_tc.movePosition(Left, KeepAnchor, 1);
|
m_tc.movePosition(Left, KeepAnchor, 1);
|
||||||
undoFakeEOL = true;
|
undoFakeEOL = true;
|
||||||
}
|
}
|
||||||
@@ -1748,60 +1775,52 @@ QWidget *FakeVimHandler::Private::editor() const
|
|||||||
|
|
||||||
void FakeVimHandler::Private::undo()
|
void FakeVimHandler::Private::undo()
|
||||||
{
|
{
|
||||||
#if 0
|
|
||||||
EDITOR(undo());
|
|
||||||
#else
|
|
||||||
if (m_undoStack.isEmpty()) {
|
if (m_undoStack.isEmpty()) {
|
||||||
showBlackMessage(tr("Already at oldest change"));
|
showBlackMessage(tr("Already at oldest change"));
|
||||||
} else {
|
} else {
|
||||||
EditOperation op = m_undoStack.pop();
|
EditOperation op = m_undoStack.pop();
|
||||||
//qDebug() << "UNDO " << op;
|
//qDebug() << "UNDO " << op;
|
||||||
if (op.m_itemCount > 0) {
|
if (op.itemCount > 0) {
|
||||||
for (int i = op.m_itemCount; --i >= 0; )
|
for (int i = op.itemCount; --i >= 0; )
|
||||||
undo();
|
undo();
|
||||||
} else {
|
} else {
|
||||||
m_tc.setPosition(op.m_position, MoveAnchor);
|
m_tc.setPosition(op.position, MoveAnchor);
|
||||||
if (!op.m_to.isEmpty()) {
|
if (!op.to.isEmpty()) {
|
||||||
m_tc.setPosition(op.m_position + op.m_to.size(), KeepAnchor);
|
m_tc.setPosition(op.position + op.to.size(), KeepAnchor);
|
||||||
m_tc.deleteChar();
|
m_tc.removeSelectedText();
|
||||||
}
|
}
|
||||||
if (!op.m_from.isEmpty())
|
if (!op.from.isEmpty())
|
||||||
m_tc.insertText(op.m_from);
|
m_tc.insertText(op.from);
|
||||||
m_tc.setPosition(op.m_position, MoveAnchor);
|
m_tc.setPosition(op.position, MoveAnchor);
|
||||||
}
|
}
|
||||||
m_redoStack.push(op);
|
m_redoStack.push(op);
|
||||||
showBlackMessage(QString());
|
showBlackMessage(QString());
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void FakeVimHandler::Private::redo()
|
void FakeVimHandler::Private::redo()
|
||||||
{
|
{
|
||||||
#if 0
|
|
||||||
EDITOR(redo());
|
|
||||||
#else
|
|
||||||
if (m_redoStack.isEmpty()) {
|
if (m_redoStack.isEmpty()) {
|
||||||
showBlackMessage(tr("Already at newest change"));
|
showBlackMessage(tr("Already at newest change"));
|
||||||
} else {
|
} else {
|
||||||
EditOperation op = m_redoStack.pop();
|
EditOperation op = m_redoStack.pop();
|
||||||
//qDebug() << "REDO " << op;
|
//qDebug() << "REDO " << op;
|
||||||
if (op.m_itemCount > 0) {
|
if (op.itemCount > 0) {
|
||||||
for (int i = op.m_itemCount; --i >= 0; )
|
for (int i = op.itemCount; --i >= 0; )
|
||||||
redo();
|
redo();
|
||||||
} else {
|
} else {
|
||||||
m_tc.setPosition(op.m_position, MoveAnchor);
|
m_tc.setPosition(op.position, MoveAnchor);
|
||||||
if (!op.m_from.isEmpty()) {
|
if (!op.from.isEmpty()) {
|
||||||
m_tc.setPosition(op.m_position + op.m_from.size(), KeepAnchor);
|
m_tc.setPosition(op.position + op.from.size(), KeepAnchor);
|
||||||
m_tc.deleteChar();
|
m_tc.removeSelectedText();
|
||||||
}
|
}
|
||||||
if (!op.m_to.isEmpty())
|
if (!op.to.isEmpty())
|
||||||
m_tc.insertText(op.m_to);
|
m_tc.insertText(op.to);
|
||||||
m_tc.setPosition(op.m_position, MoveAnchor);
|
m_tc.setPosition(op.position, MoveAnchor);
|
||||||
}
|
}
|
||||||
m_undoStack.push(op);
|
m_undoStack.push(op);
|
||||||
showBlackMessage(QString());
|
showBlackMessage(QString());
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void FakeVimHandler::Private::recordBeginGroup()
|
void FakeVimHandler::Private::recordBeginGroup()
|
||||||
@@ -1809,29 +1828,37 @@ void FakeVimHandler::Private::recordBeginGroup()
|
|||||||
//qDebug() << "PUSH";
|
//qDebug() << "PUSH";
|
||||||
m_undoGroupStack.push(m_undoStack.size());
|
m_undoGroupStack.push(m_undoStack.size());
|
||||||
EditOperation op;
|
EditOperation op;
|
||||||
op.m_position = m_tc.position();
|
op.position = m_tc.position();
|
||||||
recordOperation(op);
|
recordOperation(op);
|
||||||
}
|
}
|
||||||
|
|
||||||
void FakeVimHandler::Private::recordEndGroup()
|
void FakeVimHandler::Private::recordEndGroup()
|
||||||
{
|
{
|
||||||
|
if (m_undoGroupStack.isEmpty()) {
|
||||||
|
qWarning("fakevim: undo groups not balanced.\n");
|
||||||
|
return;
|
||||||
|
}
|
||||||
EditOperation op;
|
EditOperation op;
|
||||||
op.m_itemCount = m_undoStack.size() - m_undoGroupStack.pop();
|
op.itemCount = m_undoStack.size() - m_undoGroupStack.pop();
|
||||||
//qDebug() << "POP " << op.m_itemCount;
|
//qDebug() << "POP " << op.itemCount << m_undoStack;
|
||||||
recordOperation(op);
|
recordOperation(op);
|
||||||
}
|
}
|
||||||
|
|
||||||
QString FakeVimHandler::Private::recordRemoveSelectedText()
|
QString FakeVimHandler::Private::recordRemoveSelectedText()
|
||||||
{
|
{
|
||||||
EditOperation op;
|
EditOperation op;
|
||||||
//qDebug() << "1 POS: " << position() << " ANCHOR: " << anchor() << m_tc.anchor();
|
//qDebug() << "POS: " << position() << " ANCHOR: " << anchor() << m_tc.anchor();
|
||||||
m_tc.setPosition(anchor(), KeepAnchor);
|
int pos = m_tc.position();
|
||||||
op.m_position = qMin(position(), anchor());
|
if (pos == anchor())
|
||||||
//qDebug() << "2 POS: " << position() << " ANCHOR: " << anchor() << m_tc.anchor();
|
return QString();
|
||||||
op.m_from = m_tc.selection().toPlainText();
|
m_tc.setPosition(anchor(), MoveAnchor);
|
||||||
|
m_tc.setPosition(pos, KeepAnchor);
|
||||||
|
op.position = qMin(pos, anchor());
|
||||||
|
op.from = m_tc.selection().toPlainText();
|
||||||
|
//qDebug() << "OP: " << op;
|
||||||
recordOperation(op);
|
recordOperation(op);
|
||||||
m_tc.deleteChar();
|
m_tc.removeSelectedText();
|
||||||
return op.m_from;
|
return op.from;
|
||||||
}
|
}
|
||||||
|
|
||||||
void FakeVimHandler::Private::recordRemoveNextChar()
|
void FakeVimHandler::Private::recordRemoveNextChar()
|
||||||
@@ -1844,32 +1871,41 @@ void FakeVimHandler::Private::recordRemoveNextChar()
|
|||||||
void FakeVimHandler::Private::recordInsertText(const QString &data)
|
void FakeVimHandler::Private::recordInsertText(const QString &data)
|
||||||
{
|
{
|
||||||
EditOperation op;
|
EditOperation op;
|
||||||
op.m_position = m_tc.position();
|
op.position = m_tc.position();
|
||||||
op.m_to = data;
|
op.to = data;
|
||||||
recordOperation(op);
|
recordOperation(op);
|
||||||
m_tc.insertText(data);
|
m_tc.insertText(data);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void FakeVimHandler::Private::recordMove()
|
||||||
|
{
|
||||||
|
EditOperation op;
|
||||||
|
op.position = m_tc.position();
|
||||||
|
m_undoStack.push(op);
|
||||||
|
m_redoStack.clear();
|
||||||
|
//qDebug() << "MOVE: " << op;
|
||||||
|
//qDebug() << "\nSTACK: " << m_undoStack;
|
||||||
|
}
|
||||||
|
|
||||||
void FakeVimHandler::Private::recordOperation(const EditOperation &op)
|
void FakeVimHandler::Private::recordOperation(const EditOperation &op)
|
||||||
{
|
{
|
||||||
//qDebug() << "OP: " << op;
|
//qDebug() << "OP: " << op;
|
||||||
|
// No need to record operations that actually do not change anything.
|
||||||
|
if (op.from.isEmpty() && op.to.isEmpty() && op.itemCount == 0)
|
||||||
|
return;
|
||||||
|
// No need to create groups with only one member.
|
||||||
|
if (op.itemCount == 1)
|
||||||
|
return;
|
||||||
m_undoStack.push(op);
|
m_undoStack.push(op);
|
||||||
m_redoStack.clear();
|
m_redoStack.clear();
|
||||||
}
|
//qDebug() << "\nSTACK: " << m_undoStack;
|
||||||
|
|
||||||
void FakeVimHandler::Private::recordMove(int position, int nestedCount)
|
|
||||||
{
|
|
||||||
EditOperation op;
|
|
||||||
op.m_position = position;
|
|
||||||
op.m_itemCount = nestedCount;
|
|
||||||
recordOperation(op);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void FakeVimHandler::Private::recordInsert(int position, const QString &data)
|
void FakeVimHandler::Private::recordInsert(int position, const QString &data)
|
||||||
{
|
{
|
||||||
EditOperation op;
|
EditOperation op;
|
||||||
op.m_position = position;
|
op.position = position;
|
||||||
op.m_to = data;
|
op.to = data;
|
||||||
recordOperation(op);
|
recordOperation(op);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1884,8 +1920,8 @@ void FakeVimHandler::Private::recordRemove(int position, int length)
|
|||||||
void FakeVimHandler::Private::recordRemove(int position, const QString &data)
|
void FakeVimHandler::Private::recordRemove(int position, const QString &data)
|
||||||
{
|
{
|
||||||
EditOperation op;
|
EditOperation op;
|
||||||
op.m_position = position;
|
op.position = position;
|
||||||
op.m_from = data;
|
op.from = data;
|
||||||
recordOperation(op);
|
recordOperation(op);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1894,6 +1930,7 @@ void FakeVimHandler::Private::enterInsertMode()
|
|||||||
EDITOR(setOverwriteMode(false));
|
EDITOR(setOverwriteMode(false));
|
||||||
m_mode = InsertMode;
|
m_mode = InsertMode;
|
||||||
m_lastInsertion.clear();
|
m_lastInsertion.clear();
|
||||||
|
recordBeginGroup();
|
||||||
}
|
}
|
||||||
|
|
||||||
void FakeVimHandler::Private::enterCommandMode()
|
void FakeVimHandler::Private::enterCommandMode()
|
||||||
|
|||||||
@@ -45,8 +45,8 @@ using namespace Core;
|
|||||||
using namespace Find;
|
using namespace Find;
|
||||||
using namespace Find::Internal;
|
using namespace Find::Internal;
|
||||||
|
|
||||||
CurrentDocumentFind::CurrentDocumentFind(ICore *core)
|
CurrentDocumentFind::CurrentDocumentFind()
|
||||||
: m_core(core), m_currentFind(0)
|
: m_currentFind(0)
|
||||||
{
|
{
|
||||||
connect(qApp, SIGNAL(focusChanged(QWidget*, QWidget*)),
|
connect(qApp, SIGNAL(focusChanged(QWidget*, QWidget*)),
|
||||||
this, SLOT(updateCurrentFindFilter(QWidget*,QWidget*)));
|
this, SLOT(updateCurrentFindFilter(QWidget*,QWidget*)));
|
||||||
|
|||||||
@@ -36,8 +36,6 @@
|
|||||||
|
|
||||||
#include "ifindfilter.h"
|
#include "ifindfilter.h"
|
||||||
|
|
||||||
#include <coreplugin/icore.h>
|
|
||||||
|
|
||||||
#include <QtCore/QPointer>
|
#include <QtCore/QPointer>
|
||||||
#include <QtGui/QWidget>
|
#include <QtGui/QWidget>
|
||||||
|
|
||||||
@@ -49,7 +47,7 @@ class CurrentDocumentFind : public QObject
|
|||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
CurrentDocumentFind(Core::ICore *core);
|
CurrentDocumentFind();
|
||||||
|
|
||||||
void resetIncrementalSearch();
|
void resetIncrementalSearch();
|
||||||
void clearResults();
|
void clearResults();
|
||||||
@@ -83,7 +81,6 @@ private slots:
|
|||||||
private:
|
private:
|
||||||
void removeFindSupportConnections();
|
void removeFindSupportConnections();
|
||||||
|
|
||||||
Core::ICore *m_core;
|
|
||||||
QPointer<IFindSupport> m_currentFind;
|
QPointer<IFindSupport> m_currentFind;
|
||||||
QPointer<QWidget> m_currentWidget;
|
QPointer<QWidget> m_currentWidget;
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -42,6 +42,7 @@
|
|||||||
#include <coreplugin/actionmanager/actioncontainer.h>
|
#include <coreplugin/actionmanager/actioncontainer.h>
|
||||||
#include <coreplugin/actionmanager/command.h>
|
#include <coreplugin/actionmanager/command.h>
|
||||||
#include <coreplugin/coreconstants.h>
|
#include <coreplugin/coreconstants.h>
|
||||||
|
#include <coreplugin/icore.h>
|
||||||
|
|
||||||
#include <extensionsystem/pluginmanager.h>
|
#include <extensionsystem/pluginmanager.h>
|
||||||
|
|
||||||
@@ -77,14 +78,13 @@ FindPlugin::~FindPlugin()
|
|||||||
|
|
||||||
bool FindPlugin::initialize(const QStringList &, QString *)
|
bool FindPlugin::initialize(const QStringList &, QString *)
|
||||||
{
|
{
|
||||||
Core::ICore *core = Core::ICore::instance();
|
|
||||||
setupMenu();
|
setupMenu();
|
||||||
|
|
||||||
m_currentDocumentFind = new CurrentDocumentFind(core);
|
m_currentDocumentFind = new CurrentDocumentFind;
|
||||||
|
|
||||||
m_findToolBar = new FindToolBar(this, m_currentDocumentFind);
|
m_findToolBar = new FindToolBar(this, m_currentDocumentFind);
|
||||||
m_findDialog = new FindToolWindow(this);
|
m_findDialog = new FindToolWindow(this);
|
||||||
SearchResultWindow *searchResultWindow = new SearchResultWindow(core);
|
SearchResultWindow *searchResultWindow = new SearchResultWindow;
|
||||||
addAutoReleasedObject(searchResultWindow);
|
addAutoReleasedObject(searchResultWindow);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@@ -126,8 +126,7 @@ void FindPlugin::openFindFilter()
|
|||||||
|
|
||||||
void FindPlugin::setupMenu()
|
void FindPlugin::setupMenu()
|
||||||
{
|
{
|
||||||
Core::ICore *core = Core::ICore::instance();
|
Core::ActionManager *am = Core::ICore::instance()->actionManager();
|
||||||
Core::ActionManager *am = core->actionManager();
|
|
||||||
Core::ActionContainer *medit = am->actionContainer(Core::Constants::M_EDIT);
|
Core::ActionContainer *medit = am->actionContainer(Core::Constants::M_EDIT);
|
||||||
Core::ActionContainer *mfind = am->createMenu(Constants::M_FIND);
|
Core::ActionContainer *mfind = am->createMenu(Constants::M_FIND);
|
||||||
medit->addMenu(mfind, Core::Constants::G_EDIT_FIND);
|
medit->addMenu(mfind, Core::Constants::G_EDIT_FIND);
|
||||||
@@ -150,8 +149,7 @@ void FindPlugin::setupMenu()
|
|||||||
|
|
||||||
void FindPlugin::setupFilterMenuItems()
|
void FindPlugin::setupFilterMenuItems()
|
||||||
{
|
{
|
||||||
Core::ICore *core = Core::ICore::instance();
|
Core::ActionManager *am = Core::ICore::instance()->actionManager();
|
||||||
Core::ActionManager *am = core->actionManager();
|
|
||||||
QList<IFindFilter*> findInterfaces =
|
QList<IFindFilter*> findInterfaces =
|
||||||
ExtensionSystem::PluginManager::instance()->getObjects<IFindFilter>();
|
ExtensionSystem::PluginManager::instance()->getObjects<IFindFilter>();
|
||||||
Core::Command *cmd;
|
Core::Command *cmd;
|
||||||
|
|||||||
@@ -38,7 +38,6 @@
|
|||||||
#include "ifindfilter.h"
|
#include "ifindfilter.h"
|
||||||
#include "findtoolbar.h"
|
#include "findtoolbar.h"
|
||||||
|
|
||||||
#include <coreplugin/icore.h>
|
|
||||||
#include <extensionsystem/iplugin.h>
|
#include <extensionsystem/iplugin.h>
|
||||||
|
|
||||||
#include <QtCore/QHash>
|
#include <QtCore/QHash>
|
||||||
|
|||||||
@@ -37,6 +37,7 @@
|
|||||||
|
|
||||||
#include <coreplugin/coreconstants.h>
|
#include <coreplugin/coreconstants.h>
|
||||||
#include <coreplugin/findplaceholder.h>
|
#include <coreplugin/findplaceholder.h>
|
||||||
|
#include <coreplugin/icore.h>
|
||||||
#include <coreplugin/actionmanager/actionmanager.h>
|
#include <coreplugin/actionmanager/actionmanager.h>
|
||||||
#include <coreplugin/actionmanager/actioncontainer.h>
|
#include <coreplugin/actionmanager/actioncontainer.h>
|
||||||
#include <coreplugin/actionmanager/command.h>
|
#include <coreplugin/actionmanager/command.h>
|
||||||
|
|||||||
@@ -34,6 +34,8 @@
|
|||||||
#include "searchresultwindow.h"
|
#include "searchresultwindow.h"
|
||||||
#include "searchresulttreemodel.h"
|
#include "searchresulttreemodel.h"
|
||||||
|
|
||||||
|
#include <coreplugin/icore.h>
|
||||||
|
|
||||||
#include <QtCore/QFile>
|
#include <QtCore/QFile>
|
||||||
#include <QtCore/QTextStream>
|
#include <QtCore/QTextStream>
|
||||||
#include <QtCore/QSettings>
|
#include <QtCore/QSettings>
|
||||||
@@ -46,10 +48,9 @@ using namespace Find::Internal;
|
|||||||
static const QString SETTINGSKEYSECTIONNAME("SearchResults");
|
static const QString SETTINGSKEYSECTIONNAME("SearchResults");
|
||||||
static const QString SETTINGSKEYEXPANDRESULTS("ExpandResults");
|
static const QString SETTINGSKEYEXPANDRESULTS("ExpandResults");
|
||||||
|
|
||||||
SearchResultWindow::SearchResultWindow(Core::ICore *core) :
|
SearchResultWindow::SearchResultWindow()
|
||||||
m_core(core),
|
|
||||||
m_widget(new QStackedWidget())
|
|
||||||
{
|
{
|
||||||
|
m_widget = new QStackedWidget;
|
||||||
m_widget->setWindowTitle(name());
|
m_widget->setWindowTitle(name());
|
||||||
|
|
||||||
m_searchResultTreeView = new SearchResultTreeView(m_widget);
|
m_searchResultTreeView = new SearchResultTreeView(m_widget);
|
||||||
@@ -173,8 +174,8 @@ void SearchResultWindow::handleExpandCollapseToolButton(bool checked)
|
|||||||
|
|
||||||
void SearchResultWindow::readSettings(void)
|
void SearchResultWindow::readSettings(void)
|
||||||
{
|
{
|
||||||
if (m_core && m_core->settings()) {
|
QSettings *s = Core::ICore::instance()->settings();
|
||||||
QSettings *s = m_core->settings();
|
if (s) {
|
||||||
s->beginGroup(SETTINGSKEYSECTIONNAME);
|
s->beginGroup(SETTINGSKEYSECTIONNAME);
|
||||||
m_expandCollapseToolButton->setChecked(s->value(SETTINGSKEYEXPANDRESULTS, m_initiallyExpand).toBool());
|
m_expandCollapseToolButton->setChecked(s->value(SETTINGSKEYEXPANDRESULTS, m_initiallyExpand).toBool());
|
||||||
s->endGroup();
|
s->endGroup();
|
||||||
@@ -183,8 +184,8 @@ void SearchResultWindow::readSettings(void)
|
|||||||
|
|
||||||
void SearchResultWindow::writeSettings(void)
|
void SearchResultWindow::writeSettings(void)
|
||||||
{
|
{
|
||||||
if (m_core && m_core->settings()) {
|
QSettings *s = Core::ICore::instance()->settings();
|
||||||
QSettings *s = m_core->settings();
|
if (s) {
|
||||||
s->beginGroup(SETTINGSKEYSECTIONNAME);
|
s->beginGroup(SETTINGSKEYSECTIONNAME);
|
||||||
s->setValue(SETTINGSKEYEXPANDRESULTS, m_expandCollapseToolButton->isChecked());
|
s->setValue(SETTINGSKEYEXPANDRESULTS, m_expandCollapseToolButton->isChecked());
|
||||||
s->endGroup();
|
s->endGroup();
|
||||||
|
|||||||
@@ -38,7 +38,6 @@
|
|||||||
#include "searchresulttreeview.h"
|
#include "searchresulttreeview.h"
|
||||||
|
|
||||||
#include <coreplugin/ioutputpane.h>
|
#include <coreplugin/ioutputpane.h>
|
||||||
#include <coreplugin/icore.h>
|
|
||||||
|
|
||||||
#include <QtCore/QThread>
|
#include <QtCore/QThread>
|
||||||
#include <QtCore/QStringList>
|
#include <QtCore/QStringList>
|
||||||
@@ -65,7 +64,7 @@ class FIND_EXPORT SearchResultWindow : public Core::IOutputPane
|
|||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
SearchResultWindow(Core::ICore *core);
|
SearchResultWindow();
|
||||||
~SearchResultWindow();
|
~SearchResultWindow();
|
||||||
|
|
||||||
QWidget *outputWidget(QWidget *);
|
QWidget *outputWidget(QWidget *);
|
||||||
@@ -97,7 +96,6 @@ private:
|
|||||||
|
|
||||||
Internal::SearchResultTreeView *m_searchResultTreeView;
|
Internal::SearchResultTreeView *m_searchResultTreeView;
|
||||||
QListWidget *m_noMatchesFoundDisplay;
|
QListWidget *m_noMatchesFoundDisplay;
|
||||||
Core::ICore *m_core;
|
|
||||||
QToolButton *m_expandCollapseToolButton;
|
QToolButton *m_expandCollapseToolButton;
|
||||||
static const bool m_initiallyExpand = false;
|
static const bool m_initiallyExpand = false;
|
||||||
QStackedWidget *m_widget;
|
QStackedWidget *m_widget;
|
||||||
|
|||||||
@@ -236,8 +236,7 @@ bool GitPlugin::initialize(const QStringList &arguments, QString *error_message)
|
|||||||
m_gitClient = new GitClient(this);
|
m_gitClient = new GitClient(this);
|
||||||
// Create the globalcontext list to register actions accordingly
|
// Create the globalcontext list to register actions accordingly
|
||||||
QList<int> globalcontext;
|
QList<int> globalcontext;
|
||||||
globalcontext << m_core->uniqueIDManager()->
|
globalcontext << m_core->uniqueIDManager()->uniqueIdentifier(Core::Constants::C_GLOBAL);
|
||||||
uniqueIdentifier(Core::Constants::C_GLOBAL);
|
|
||||||
|
|
||||||
// Create the output Window
|
// Create the output Window
|
||||||
m_outputWindow = new GitOutputWindow();
|
m_outputWindow = new GitOutputWindow();
|
||||||
|
|||||||
@@ -446,7 +446,7 @@ void HelpPlugin::extensionsInitialized()
|
|||||||
#if defined(Q_OS_MAC)
|
#if defined(Q_OS_MAC)
|
||||||
+ QLatin1String("/../Resources/doc/qtcreator.qch"));
|
+ QLatin1String("/../Resources/doc/qtcreator.qch"));
|
||||||
#else
|
#else
|
||||||
+ QLatin1String("/../doc/qtcreator.qch"));
|
+ QLatin1String("../../share/doc/qtcreator/qtcreator.qch"));
|
||||||
#endif
|
#endif
|
||||||
QHelpEngineCore hc(fi.absoluteFilePath());
|
QHelpEngineCore hc(fi.absoluteFilePath());
|
||||||
hc.setupData();
|
hc.setupData();
|
||||||
|
|||||||
@@ -241,8 +241,8 @@ bool PerforcePlugin::initialize(const QStringList &arguments, QString *errorMess
|
|||||||
globalcontext << Core::Constants::C_GLOBAL_ID;
|
globalcontext << Core::Constants::C_GLOBAL_ID;
|
||||||
|
|
||||||
QList<int> perforcesubmitcontext;
|
QList<int> perforcesubmitcontext;
|
||||||
perforcesubmitcontext <<
|
perforcesubmitcontext << Core::UniqueIDManager::instance()->
|
||||||
Core::ICore::instance()->uniqueIDManager()->uniqueIdentifier(Constants::C_PERFORCESUBMITEDITOR);
|
uniqueIdentifier(Constants::C_PERFORCESUBMITEDITOR);
|
||||||
|
|
||||||
Core::Command *command;
|
Core::Command *command;
|
||||||
QAction *tmpaction;
|
QAction *tmpaction;
|
||||||
@@ -467,7 +467,7 @@ void PerforcePlugin::diffAllOpened()
|
|||||||
|
|
||||||
void PerforcePlugin::printOpenedFileList()
|
void PerforcePlugin::printOpenedFileList()
|
||||||
{
|
{
|
||||||
Core::IEditor *e = Core::ICore::instance()->editorManager()->currentEditor();
|
Core::IEditor *e = Core::EditorManager::instance()->currentEditor();
|
||||||
if (e)
|
if (e)
|
||||||
e->widget()->setFocus();
|
e->widget()->setFocus();
|
||||||
PerforceResponse result = runP4Cmd(QStringList() << QLatin1String("opened"), QStringList(), CommandToWindow|StdOutToWindow|StdErrToWindow|ErrorToWindow);
|
PerforceResponse result = runP4Cmd(QStringList() << QLatin1String("opened"), QStringList(), CommandToWindow|StdOutToWindow|StdErrToWindow|ErrorToWindow);
|
||||||
@@ -542,9 +542,9 @@ void PerforcePlugin::submit()
|
|||||||
|
|
||||||
Core::IEditor *PerforcePlugin::openPerforceSubmitEditor(const QString &fileName, const QStringList &depotFileNames)
|
Core::IEditor *PerforcePlugin::openPerforceSubmitEditor(const QString &fileName, const QStringList &depotFileNames)
|
||||||
{
|
{
|
||||||
Core::IEditor *editor =
|
Core::EditorManager *editorManager = Core::EditorManager::instance();
|
||||||
Core::ICore::instance()->editorManager()->openEditor(fileName, Constants::PERFORCESUBMITEDITOR_KIND);
|
Core::IEditor *editor = editorManager->openEditor(fileName, Constants::PERFORCESUBMITEDITOR_KIND);
|
||||||
Core::ICore::instance()->editorManager()->ensureEditorManagerVisible();
|
editorManager->ensureEditorManagerVisible();
|
||||||
PerforceSubmitEditor *submitEditor = dynamic_cast<PerforceSubmitEditor*>(editor);
|
PerforceSubmitEditor *submitEditor = dynamic_cast<PerforceSubmitEditor*>(editor);
|
||||||
QTC_ASSERT(submitEditor, return 0);
|
QTC_ASSERT(submitEditor, return 0);
|
||||||
submitEditor->restrictToProjectFiles(depotFileNames);
|
submitEditor->restrictToProjectFiles(depotFileNames);
|
||||||
@@ -841,9 +841,9 @@ Core::IEditor * PerforcePlugin::showOutputInEditor(const QString& title, const Q
|
|||||||
if (Perforce::Constants::debug)
|
if (Perforce::Constants::debug)
|
||||||
qDebug() << "PerforcePlugin::showOutputInEditor" << title << kind << "Size= " << output.size() << " Type=" << editorType << debugCodec(codec);
|
qDebug() << "PerforcePlugin::showOutputInEditor" << title << kind << "Size= " << output.size() << " Type=" << editorType << debugCodec(codec);
|
||||||
QString s = title;
|
QString s = title;
|
||||||
Core::IEditor *ediface = Core::ICore::instance()->editorManager()->
|
Core::IEditor *editor = Core::EditorManager::instance()->
|
||||||
newFile(kind, &s, output.toLocal8Bit());
|
newFile(kind, &s, output.toLocal8Bit());
|
||||||
PerforceEditor *e = qobject_cast<PerforceEditor*>(ediface->widget());
|
PerforceEditor *e = qobject_cast<PerforceEditor*>(editor->widget());
|
||||||
if (!e)
|
if (!e)
|
||||||
return 0;
|
return 0;
|
||||||
s.replace(QLatin1Char(' '), QLatin1Char('_'));
|
s.replace(QLatin1Char(' '), QLatin1Char('_'));
|
||||||
@@ -857,7 +857,7 @@ QStringList PerforcePlugin::environment() const
|
|||||||
{
|
{
|
||||||
QStringList newEnv = QProcess::systemEnvironment();
|
QStringList newEnv = QProcess::systemEnvironment();
|
||||||
const QString name = "P4DIFF";
|
const QString name = "P4DIFF";
|
||||||
for (int i=0; i<newEnv.count(); ++i) {
|
for (int i = 0; i < newEnv.count(); ++i) {
|
||||||
if (newEnv.at(i).startsWith(name)) {
|
if (newEnv.at(i).startsWith(name)) {
|
||||||
newEnv.removeAt(i);
|
newEnv.removeAt(i);
|
||||||
return newEnv;
|
return newEnv;
|
||||||
@@ -889,7 +889,7 @@ void PerforcePlugin::p4Diff(const QStringList &files, QString diffname)
|
|||||||
diffname = fi.fileName();
|
diffname = fi.fileName();
|
||||||
}
|
}
|
||||||
|
|
||||||
foreach (Core::IEditor *ed, Core::ICore::instance()->editorManager()->openedEditors()) {
|
foreach (Core::IEditor *ed, Core::EditorManager::instance()->openedEditors()) {
|
||||||
if (ed->file()->property("originalFileName").toString() == fileName) {
|
if (ed->file()->property("originalFileName").toString() == fileName) {
|
||||||
existingEditor = ed;
|
existingEditor = ed;
|
||||||
displayInEditor = false;
|
displayInEditor = false;
|
||||||
@@ -912,7 +912,7 @@ void PerforcePlugin::p4Diff(const QStringList &files, QString diffname)
|
|||||||
} else if (!displayInEditor && existingEditor) {
|
} else if (!displayInEditor && existingEditor) {
|
||||||
if (existingEditor) {
|
if (existingEditor) {
|
||||||
existingEditor->createNew(result.stdOut);
|
existingEditor->createNew(result.stdOut);
|
||||||
Core::ICore::instance()->editorManager()->setCurrentEditor(existingEditor);
|
Core::EditorManager::instance()->setCurrentEditor(existingEditor);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -930,7 +930,7 @@ void PerforcePlugin::describe(const QString & source, const QString &n)
|
|||||||
|
|
||||||
void PerforcePlugin::submitCurrentLog()
|
void PerforcePlugin::submitCurrentLog()
|
||||||
{
|
{
|
||||||
Core::EditorManager *em = Core::ICore::instance()->editorManager();
|
Core::EditorManager *em = Core::EditorManager::instance();
|
||||||
em->closeEditors(QList<Core::IEditor*>() << em->currentEditor());
|
em->closeEditors(QList<Core::IEditor*>() << em->currentEditor());
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1004,8 +1004,8 @@ bool PerforcePlugin::editorAboutToClose(Core::IEditor *editor)
|
|||||||
|
|
||||||
void PerforcePlugin::openFiles(const QStringList &files)
|
void PerforcePlugin::openFiles(const QStringList &files)
|
||||||
{
|
{
|
||||||
Core::EditorManager *em = Core::ICore::instance()->editorManager();
|
Core::EditorManager *em = Core::EditorManager::instance();
|
||||||
foreach (QString s, files)
|
foreach (const QString &s, files)
|
||||||
em->openEditor(clientFilePath(s));
|
em->openEditor(clientFilePath(s));
|
||||||
em->ensureEditorManagerVisible();
|
em->ensureEditorManagerVisible();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -40,6 +40,7 @@
|
|||||||
#include "projectexplorer.h"
|
#include "projectexplorer.h"
|
||||||
#include "taskwindow.h"
|
#include "taskwindow.h"
|
||||||
|
|
||||||
|
#include <coreplugin/icore.h>
|
||||||
#include <coreplugin/progressmanager/progressmanager.h>
|
#include <coreplugin/progressmanager/progressmanager.h>
|
||||||
#include <coreplugin/progressmanager/futureprogress.h>
|
#include <coreplugin/progressmanager/futureprogress.h>
|
||||||
#include <extensionsystem/pluginmanager.h>
|
#include <extensionsystem/pluginmanager.h>
|
||||||
|
|||||||
@@ -170,7 +170,7 @@ void FolderNavigationWidget::openItem(const QModelIndex &index)
|
|||||||
setCurrentTitle(QDir(m_dirModel->filePath(srcIndex)));
|
setCurrentTitle(QDir(m_dirModel->filePath(srcIndex)));
|
||||||
} else {
|
} else {
|
||||||
const QString filePath = m_dirModel->filePath(srcIndex);
|
const QString filePath = m_dirModel->filePath(srcIndex);
|
||||||
Core::EditorManager *editorManager = Core::ICore::instance()->editorManager();
|
Core::EditorManager *editorManager = Core::EditorManager::instance();
|
||||||
editorManager->openEditor(filePath);
|
editorManager->openEditor(filePath);
|
||||||
editorManager->ensureEditorManagerVisible();
|
editorManager->ensureEditorManagerVisible();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -62,9 +62,10 @@
|
|||||||
|
|
||||||
#include <coreplugin/basemode.h>
|
#include <coreplugin/basemode.h>
|
||||||
#include <coreplugin/coreconstants.h>
|
#include <coreplugin/coreconstants.h>
|
||||||
|
#include <coreplugin/filemanager.h>
|
||||||
|
#include <coreplugin/icore.h>
|
||||||
#include <coreplugin/mainwindow.h>
|
#include <coreplugin/mainwindow.h>
|
||||||
#include <coreplugin/mimedatabase.h>
|
#include <coreplugin/mimedatabase.h>
|
||||||
#include <coreplugin/filemanager.h>
|
|
||||||
#include <coreplugin/modemanager.h>
|
#include <coreplugin/modemanager.h>
|
||||||
#include <coreplugin/uniqueidmanager.h>
|
#include <coreplugin/uniqueidmanager.h>
|
||||||
#include <coreplugin/actionmanager/actionmanager.h>
|
#include <coreplugin/actionmanager/actionmanager.h>
|
||||||
@@ -871,7 +872,7 @@ bool ProjectExplorerPlugin::openProjects(const QStringList &fileNames)
|
|||||||
|
|
||||||
updateActions();
|
updateActions();
|
||||||
|
|
||||||
Core::ICore::instance()->modeManager()->activateMode(Core::Constants::MODE_EDIT);
|
Core::ModeManager::instance()->activateMode(Core::Constants::MODE_EDIT);
|
||||||
QApplication::restoreOverrideCursor();
|
QApplication::restoreOverrideCursor();
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
@@ -987,7 +988,7 @@ void ProjectExplorerPlugin::restoreSession()
|
|||||||
}
|
}
|
||||||
|
|
||||||
// update welcome page
|
// update welcome page
|
||||||
Core::ModeManager *modeManager = Core::ICore::instance()->modeManager();
|
Core::ModeManager *modeManager = Core::ModeManager::instance();
|
||||||
connect(modeManager, SIGNAL(currentModeChanged(Core::IMode*)), this, SLOT(currentModeChanged(Core::IMode*)));
|
connect(modeManager, SIGNAL(currentModeChanged(Core::IMode*)), this, SLOT(currentModeChanged(Core::IMode*)));
|
||||||
if (Core::Internal::WelcomeMode *welcomeMode = qobject_cast<Core::Internal::WelcomeMode*>(modeManager->mode(Core::Constants::MODE_WELCOME))) {
|
if (Core::Internal::WelcomeMode *welcomeMode = qobject_cast<Core::Internal::WelcomeMode*>(modeManager->mode(Core::Constants::MODE_WELCOME))) {
|
||||||
updateWelcomePage(welcomeMode);
|
updateWelcomePage(welcomeMode);
|
||||||
@@ -1619,9 +1620,9 @@ void ProjectExplorerPlugin::openFile()
|
|||||||
{
|
{
|
||||||
if (m_currentNode)
|
if (m_currentNode)
|
||||||
return;
|
return;
|
||||||
Core::ICore *core = Core::ICore::instance();
|
Core::EditorManager *em = Core::EditorManager::instance();
|
||||||
core->editorManager()->openEditor(m_currentNode->path());
|
em->openEditor(m_currentNode->path());
|
||||||
core->editorManager()->ensureEditorManagerVisible();
|
em->ensureEditorManagerVisible();
|
||||||
}
|
}
|
||||||
|
|
||||||
void ProjectExplorerPlugin::removeFile()
|
void ProjectExplorerPlugin::removeFile()
|
||||||
@@ -1803,7 +1804,7 @@ void ProjectExplorerPlugin::openWithMenuTriggered(QAction *action)
|
|||||||
qWarning() << "Editor Factory not attached to action, can't happen"<<editorFactory;
|
qWarning() << "Editor Factory not attached to action, can't happen"<<editorFactory;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
Core::EditorManager *em = Core::ICore::instance()->editorManager();
|
Core::EditorManager *em = Core::EditorManager::instance();
|
||||||
em->openEditor(currentNode()->path(), editorFactory->kind());
|
em->openEditor(currentNode()->path(), editorFactory->kind());
|
||||||
em->ensureEditorManagerVisible();
|
em->ensureEditorManagerVisible();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -286,7 +286,7 @@ void ProjectTreeWidget::openItem(const QModelIndex &mainIndex)
|
|||||||
{
|
{
|
||||||
Node *node = m_model->nodeForIndex(mainIndex);
|
Node *node = m_model->nodeForIndex(mainIndex);
|
||||||
if (node->nodeType() == FileNodeType) {
|
if (node->nodeType() == FileNodeType) {
|
||||||
Core::EditorManager *editorManager = Core::ICore::instance()->editorManager();
|
Core::EditorManager *editorManager = Core::EditorManager::instance();
|
||||||
editorManager->openEditor(node->path());
|
editorManager->openEditor(node->path());
|
||||||
editorManager->ensureEditorManagerVisible();
|
editorManager->ensureEditorManagerVisible();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -37,6 +37,7 @@
|
|||||||
#include <coreplugin/actionmanager/actionmanager.h>
|
#include <coreplugin/actionmanager/actionmanager.h>
|
||||||
#include <coreplugin/editormanager/editormanager.h>
|
#include <coreplugin/editormanager/editormanager.h>
|
||||||
#include <coreplugin/coreconstants.h>
|
#include <coreplugin/coreconstants.h>
|
||||||
|
#include <coreplugin/icore.h>
|
||||||
#include <coreplugin/uniqueidmanager.h>
|
#include <coreplugin/uniqueidmanager.h>
|
||||||
#include <extensionsystem/pluginmanager.h>
|
#include <extensionsystem/pluginmanager.h>
|
||||||
#include <texteditor/itexteditor.h>
|
#include <texteditor/itexteditor.h>
|
||||||
@@ -578,8 +579,8 @@ void TaskDelegate::paint(QPainter *painter, const QStyleOptionViewItem &option,
|
|||||||
TaskWindowContext::TaskWindowContext(QWidget *widget)
|
TaskWindowContext::TaskWindowContext(QWidget *widget)
|
||||||
: m_taskList(widget)
|
: m_taskList(widget)
|
||||||
{
|
{
|
||||||
Core::ICore *core = Core::ICore::instance();
|
Core::UniqueIDManager *uidm = Core::UniqueIDManager::instance();
|
||||||
m_context << core->uniqueIDManager()->uniqueIdentifier(Core::Constants::C_PROBLEM_PANE);
|
m_context << uidm->uniqueIdentifier(Core::Constants::C_PROBLEM_PANE);
|
||||||
}
|
}
|
||||||
|
|
||||||
QList<int> TaskWindowContext::context() const
|
QList<int> TaskWindowContext::context() const
|
||||||
|
|||||||
@@ -38,7 +38,6 @@
|
|||||||
|
|
||||||
#include <coreplugin/ioutputpane.h>
|
#include <coreplugin/ioutputpane.h>
|
||||||
#include <coreplugin/icontext.h>
|
#include <coreplugin/icontext.h>
|
||||||
#include <coreplugin/icore.h>
|
|
||||||
|
|
||||||
#include <QtGui/QTreeWidget>
|
#include <QtGui/QTreeWidget>
|
||||||
#include <QtGui/QStyledItemDelegate>
|
#include <QtGui/QStyledItemDelegate>
|
||||||
|
|||||||
@@ -40,7 +40,6 @@
|
|||||||
#include "proeditormodel.h"
|
#include "proeditormodel.h"
|
||||||
#include "procommandmanager.h"
|
#include "procommandmanager.h"
|
||||||
|
|
||||||
#include <coreplugin/icore.h>
|
|
||||||
#include <coreplugin/uniqueidmanager.h>
|
#include <coreplugin/uniqueidmanager.h>
|
||||||
#include <texteditor/fontsettings.h>
|
#include <texteditor/fontsettings.h>
|
||||||
#include <texteditor/texteditoractionhandler.h>
|
#include <texteditor/texteditoractionhandler.h>
|
||||||
@@ -62,13 +61,10 @@ using namespace ProjectExplorer;
|
|||||||
ProFileEditorEditable::ProFileEditorEditable(ProFileEditor *editor)
|
ProFileEditorEditable::ProFileEditorEditable(ProFileEditor *editor)
|
||||||
: BaseTextEditorEditable(editor)
|
: BaseTextEditorEditable(editor)
|
||||||
{
|
{
|
||||||
Core::ICore *core = Core::ICore::instance();
|
Core::UniqueIDManager *uidm = Core::UniqueIDManager::instance();
|
||||||
m_context << core->uniqueIDManager()->
|
m_context << uidm->uniqueIdentifier(Qt4ProjectManager::Constants::C_PROFILEEDITOR);
|
||||||
uniqueIdentifier(Qt4ProjectManager::Constants::C_PROFILEEDITOR);
|
m_context << uidm->uniqueIdentifier(TextEditor::Constants::C_TEXTEDITOR);
|
||||||
m_context << core->uniqueIDManager()->
|
// m_contexts << uidm->uniqueIdentifier(Qt4ProjectManager::Constants::PROJECT_KIND);
|
||||||
uniqueIdentifier(TextEditor::Constants::C_TEXTEDITOR);
|
|
||||||
// m_contexts << core->uniqueIDManager()->
|
|
||||||
// uniqueIdentifier(Qt4ProjectManager::Constants::PROJECT_KIND);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
TextEditor::BaseTextEditorEditable *ProFileEditor::createEditableInterface()
|
TextEditor::BaseTextEditorEditable *ProFileEditor::createEditableInterface()
|
||||||
|
|||||||
@@ -37,7 +37,6 @@
|
|||||||
#include "qt4projectmanagerconstants.h"
|
#include "qt4projectmanagerconstants.h"
|
||||||
#include "profileeditor.h"
|
#include "profileeditor.h"
|
||||||
|
|
||||||
#include <coreplugin/icore.h>
|
|
||||||
#include <coreplugin/fileiconprovider.h>
|
#include <coreplugin/fileiconprovider.h>
|
||||||
#include <coreplugin/editormanager/editormanager.h>
|
#include <coreplugin/editormanager/editormanager.h>
|
||||||
#include <texteditor/texteditoractionhandler.h>
|
#include <texteditor/texteditoractionhandler.h>
|
||||||
@@ -74,8 +73,7 @@ QString ProFileEditorFactory::kind() const
|
|||||||
|
|
||||||
Core::IFile *ProFileEditorFactory::open(const QString &fileName)
|
Core::IFile *ProFileEditorFactory::open(const QString &fileName)
|
||||||
{
|
{
|
||||||
Core::ICore *core = Core::ICore::instance();
|
Core::IEditor *iface = Core::EditorManager::instance()->openEditor(fileName, kind());
|
||||||
Core::IEditor *iface = core->editorManager()->openEditor(fileName, kind());
|
|
||||||
return iface ? iface->file() : 0;
|
return iface ? iface->file() : 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -40,6 +40,7 @@
|
|||||||
#include "qt4projectmanager.h"
|
#include "qt4projectmanager.h"
|
||||||
#include "ui_qt4buildconfigwidget.h"
|
#include "ui_qt4buildconfigwidget.h"
|
||||||
|
|
||||||
|
#include <coreplugin/icore.h>
|
||||||
#include <coreplugin/mainwindow.h>
|
#include <coreplugin/mainwindow.h>
|
||||||
|
|
||||||
#include <QtGui/QFileDialog>
|
#include <QtGui/QFileDialog>
|
||||||
|
|||||||
@@ -89,8 +89,8 @@ Qt4Manager::Qt4Manager(Qt4ProjectManagerPlugin *plugin)
|
|||||||
m_contextProject(0),
|
m_contextProject(0),
|
||||||
m_languageID(0)
|
m_languageID(0)
|
||||||
{
|
{
|
||||||
m_languageID = Core::ICore::instance()->uniqueIDManager()->
|
m_languageID = Core::UniqueIDManager::instance()->
|
||||||
uniqueIdentifier(ProjectExplorer::Constants::LANG_CXX);
|
uniqueIdentifier(ProjectExplorer::Constants::LANG_CXX);
|
||||||
}
|
}
|
||||||
|
|
||||||
Qt4Manager::~Qt4Manager()
|
Qt4Manager::~Qt4Manager()
|
||||||
|
|||||||
@@ -37,7 +37,6 @@
|
|||||||
#include "qtscripteditorconstants.h"
|
#include "qtscripteditorconstants.h"
|
||||||
#include "qtscripteditorplugin.h"
|
#include "qtscripteditorplugin.h"
|
||||||
|
|
||||||
#include <coreplugin/icore.h>
|
|
||||||
#include <coreplugin/editormanager/editormanager.h>
|
#include <coreplugin/editormanager/editormanager.h>
|
||||||
|
|
||||||
#include <QtCore/QFileInfo>
|
#include <QtCore/QFileInfo>
|
||||||
@@ -67,7 +66,7 @@ QString QtScriptEditorFactory::kind() const
|
|||||||
|
|
||||||
Core::IFile *QtScriptEditorFactory::open(const QString &fileName)
|
Core::IFile *QtScriptEditorFactory::open(const QString &fileName)
|
||||||
{
|
{
|
||||||
Core::IEditor *iface = Core::ICore::instance()->editorManager()->openEditor(fileName, kind());
|
Core::IEditor *iface = Core::EditorManager::instance()->openEditor(fileName, kind());
|
||||||
if (!iface) {
|
if (!iface) {
|
||||||
qWarning() << "QtScriptEditorFactory::open: openEditor failed for " << fileName;
|
qWarning() << "QtScriptEditorFactory::open: openEditor failed for " << fileName;
|
||||||
return 0;
|
return 0;
|
||||||
|
|||||||
@@ -33,7 +33,6 @@
|
|||||||
|
|
||||||
#include "basefilefilter.h"
|
#include "basefilefilter.h"
|
||||||
|
|
||||||
#include <coreplugin/icore.h>
|
|
||||||
#include <coreplugin/editormanager/editormanager.h>
|
#include <coreplugin/editormanager/editormanager.h>
|
||||||
|
|
||||||
#include <QtCore/QDir>
|
#include <QtCore/QDir>
|
||||||
@@ -89,7 +88,7 @@ QList<FilterEntry> BaseFileFilter::matchesFor(const QString &origEntry)
|
|||||||
|
|
||||||
void BaseFileFilter::accept(QuickOpen::FilterEntry selection) const
|
void BaseFileFilter::accept(QuickOpen::FilterEntry selection) const
|
||||||
{
|
{
|
||||||
Core::EditorManager *em = Core::ICore::instance()->editorManager();
|
Core::EditorManager *em = Core::EditorManager::instance();
|
||||||
em->openEditor(selection.internalData.toString());
|
em->openEditor(selection.internalData.toString());
|
||||||
em->ensureEditorManagerVisible();
|
em->ensureEditorManagerVisible();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -37,7 +37,6 @@
|
|||||||
#include "iquickopenfilter.h"
|
#include "iquickopenfilter.h"
|
||||||
#include "ui_filesystemfilter.h"
|
#include "ui_filesystemfilter.h"
|
||||||
|
|
||||||
#include <coreplugin/icore.h>
|
|
||||||
#include <coreplugin/editormanager/editormanager.h>
|
#include <coreplugin/editormanager/editormanager.h>
|
||||||
|
|
||||||
#include <QtCore/QString>
|
#include <QtCore/QString>
|
||||||
|
|||||||
@@ -47,9 +47,10 @@
|
|||||||
|
|
||||||
#include <coreplugin/baseview.h>
|
#include <coreplugin/baseview.h>
|
||||||
#include <coreplugin/coreconstants.h>
|
#include <coreplugin/coreconstants.h>
|
||||||
|
#include <coreplugin/icore.h>
|
||||||
#include <coreplugin/uniqueidmanager.h>
|
#include <coreplugin/uniqueidmanager.h>
|
||||||
#include <coreplugin/progressmanager/progressmanager.h>
|
|
||||||
#include <coreplugin/actionmanager/actionmanager.h>
|
#include <coreplugin/actionmanager/actionmanager.h>
|
||||||
|
#include <coreplugin/progressmanager/progressmanager.h>
|
||||||
#include <extensionsystem/pluginmanager.h>
|
#include <extensionsystem/pluginmanager.h>
|
||||||
#include <qtconcurrent/QtConcurrentTools>
|
#include <qtconcurrent/QtConcurrentTools>
|
||||||
|
|
||||||
|
|||||||
@@ -41,7 +41,6 @@
|
|||||||
#include <QtCore/QHash>
|
#include <QtCore/QHash>
|
||||||
|
|
||||||
#include <coreplugin/dialogs/ioptionspage.h>
|
#include <coreplugin/dialogs/ioptionspage.h>
|
||||||
#include <coreplugin/icore.h>
|
|
||||||
|
|
||||||
QT_BEGIN_NAMESPACE
|
QT_BEGIN_NAMESPACE
|
||||||
class QListWidgetItem;
|
class QListWidgetItem;
|
||||||
|
|||||||
@@ -36,7 +36,6 @@
|
|||||||
#include "resourceeditorplugin.h"
|
#include "resourceeditorplugin.h"
|
||||||
#include "resourceeditorconstants.h"
|
#include "resourceeditorconstants.h"
|
||||||
|
|
||||||
#include <coreplugin/icore.h>
|
|
||||||
#include <coreplugin/uniqueidmanager.h>
|
#include <coreplugin/uniqueidmanager.h>
|
||||||
#include <coreplugin/fileiconprovider.h>
|
#include <coreplugin/fileiconprovider.h>
|
||||||
#include <coreplugin/editormanager/editormanager.h>
|
#include <coreplugin/editormanager/editormanager.h>
|
||||||
@@ -53,7 +52,7 @@ ResourceEditorFactory::ResourceEditorFactory(ResourceEditorPlugin *plugin) :
|
|||||||
m_kind(QLatin1String(C_RESOURCEEDITOR)),
|
m_kind(QLatin1String(C_RESOURCEEDITOR)),
|
||||||
m_plugin(plugin)
|
m_plugin(plugin)
|
||||||
{
|
{
|
||||||
m_context += Core::ICore::instance()->uniqueIDManager()
|
m_context += Core::UniqueIDManager::instance()
|
||||||
->uniqueIdentifier(QLatin1String(ResourceEditor::Constants::C_RESOURCEEDITOR));
|
->uniqueIdentifier(QLatin1String(ResourceEditor::Constants::C_RESOURCEEDITOR));
|
||||||
Core::FileIconProvider *iconProvider = Core::FileIconProvider::instance();
|
Core::FileIconProvider *iconProvider = Core::FileIconProvider::instance();
|
||||||
iconProvider->registerIconForSuffix(QIcon(":/resourceeditor/images/qt_qrc.png"),
|
iconProvider->registerIconForSuffix(QIcon(":/resourceeditor/images/qt_qrc.png"),
|
||||||
@@ -67,7 +66,7 @@ QString ResourceEditorFactory::kind() const
|
|||||||
|
|
||||||
Core::IFile *ResourceEditorFactory::open(const QString &fileName)
|
Core::IFile *ResourceEditorFactory::open(const QString &fileName)
|
||||||
{
|
{
|
||||||
Core::IEditor *iface = Core::ICore::instance()->editorManager()->openEditor(fileName, kind());
|
Core::IEditor *iface = Core::EditorManager::instance()->openEditor(fileName, kind());
|
||||||
if (!iface) {
|
if (!iface) {
|
||||||
qWarning() << "ResourceEditorFactory::open: openEditor failed for " << fileName;
|
qWarning() << "ResourceEditorFactory::open: openEditor failed for " << fileName;
|
||||||
return 0;
|
return 0;
|
||||||
|
|||||||
@@ -129,7 +129,7 @@ void ResourceEditorPlugin::onUndoStackChanged(ResourceEditorW const *editor,
|
|||||||
ResourceEditorW * ResourceEditorPlugin::currentEditor() const
|
ResourceEditorW * ResourceEditorPlugin::currentEditor() const
|
||||||
{
|
{
|
||||||
ResourceEditorW * const focusEditor = qobject_cast<ResourceEditorW *>(
|
ResourceEditorW * const focusEditor = qobject_cast<ResourceEditorW *>(
|
||||||
Core::ICore::instance()->editorManager()->currentEditor());
|
Core::EditorManager::instance()->currentEditor());
|
||||||
QTC_ASSERT(focusEditor, return 0);
|
QTC_ASSERT(focusEditor, return 0);
|
||||||
return focusEditor;
|
return focusEditor;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -134,7 +134,7 @@ static inline QString debugCodec(const QTextCodec *c)
|
|||||||
|
|
||||||
Core::IEditor* locateEditor(const char *property, const QString &entry)
|
Core::IEditor* locateEditor(const char *property, const QString &entry)
|
||||||
{
|
{
|
||||||
foreach (Core::IEditor *ed, Core::ICore::instance()->editorManager()->openedEditors())
|
foreach (Core::IEditor *ed, Core::EditorManager::instance()->openedEditors())
|
||||||
if (ed->property(property).toString() == entry)
|
if (ed->property(property).toString() == entry)
|
||||||
return ed;
|
return ed;
|
||||||
return 0;
|
return 0;
|
||||||
@@ -407,7 +407,7 @@ bool SubversionPlugin::initialize(const QStringList &arguments, QString *errorMe
|
|||||||
|
|
||||||
// Actions of the submit editor
|
// Actions of the submit editor
|
||||||
QList<int> svncommitcontext;
|
QList<int> svncommitcontext;
|
||||||
svncommitcontext << Core::ICore::instance()->uniqueIDManager()->uniqueIdentifier(Constants::SUBVERSIONCOMMITEDITOR);
|
svncommitcontext << Core::UniqueIDManager::instance()->uniqueIdentifier(Constants::SUBVERSIONCOMMITEDITOR);
|
||||||
|
|
||||||
m_submitCurrentLogAction = new QAction(VCSBase::VCSBaseSubmitEditor::submitIcon(), tr("Commit"), this);
|
m_submitCurrentLogAction = new QAction(VCSBase::VCSBaseSubmitEditor::submitIcon(), tr("Commit"), this);
|
||||||
command = ami->registerAction(m_submitCurrentLogAction, Constants::SUBMIT_CURRENT, svncommitcontext);
|
command = ami->registerAction(m_submitCurrentLogAction, Constants::SUBMIT_CURRENT, svncommitcontext);
|
||||||
@@ -513,7 +513,7 @@ void SubversionPlugin::svnDiff(const QStringList &files, QString diffname)
|
|||||||
// Show in the same editor if diff has been executed before
|
// Show in the same editor if diff has been executed before
|
||||||
if (Core::IEditor *editor = locateEditor("originalFileName", files.front())) {
|
if (Core::IEditor *editor = locateEditor("originalFileName", files.front())) {
|
||||||
editor->createNew(response.stdOut);
|
editor->createNew(response.stdOut);
|
||||||
Core::ICore::instance()->editorManager()->setCurrentEditor(editor);
|
Core::EditorManager::instance()->setCurrentEditor(editor);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -525,7 +525,7 @@ void SubversionPlugin::svnDiff(const QStringList &files, QString diffname)
|
|||||||
|
|
||||||
SubversionSubmitEditor *SubversionPlugin::openSubversionSubmitEditor(const QString &fileName)
|
SubversionSubmitEditor *SubversionPlugin::openSubversionSubmitEditor(const QString &fileName)
|
||||||
{
|
{
|
||||||
Core::IEditor *editor = Core::ICore::instance()->editorManager()->openEditor(fileName, QLatin1String(Constants::SUBVERSIONCOMMITEDITOR_KIND));
|
Core::IEditor *editor = Core::EditorManager::instance()->openEditor(fileName, QLatin1String(Constants::SUBVERSIONCOMMITEDITOR_KIND));
|
||||||
SubversionSubmitEditor *submitEditor = qobject_cast<SubversionSubmitEditor*>(editor);
|
SubversionSubmitEditor *submitEditor = qobject_cast<SubversionSubmitEditor*>(editor);
|
||||||
QTC_ASSERT(submitEditor, /**/);
|
QTC_ASSERT(submitEditor, /**/);
|
||||||
submitEditor->registerActions(m_submitUndoAction, m_submitRedoAction, m_submitCurrentLogAction, m_submitDiffAction);
|
submitEditor->registerActions(m_submitUndoAction, m_submitRedoAction, m_submitCurrentLogAction, m_submitDiffAction);
|
||||||
@@ -776,7 +776,7 @@ void SubversionPlugin::filelog(const QString &file)
|
|||||||
|
|
||||||
if (Core::IEditor *editor = locateEditor("logFileName", file)) {
|
if (Core::IEditor *editor = locateEditor("logFileName", file)) {
|
||||||
editor->createNew(response.stdOut);
|
editor->createNew(response.stdOut);
|
||||||
Core::ICore::instance()->editorManager()->setCurrentEditor(editor);
|
Core::EditorManager::instance()->setCurrentEditor(editor);
|
||||||
} else {
|
} else {
|
||||||
const QString title = tr("svn log %1").arg(QFileInfo(file).fileName());
|
const QString title = tr("svn log %1").arg(QFileInfo(file).fileName());
|
||||||
Core::IEditor *newEditor = showOutputInEditor(title, response.stdOut, VCSBase::LogOutput, file, codec);
|
Core::IEditor *newEditor = showOutputInEditor(title, response.stdOut, VCSBase::LogOutput, file, codec);
|
||||||
@@ -819,7 +819,7 @@ void SubversionPlugin::annotate(const QString &file)
|
|||||||
|
|
||||||
if (Core::IEditor *editor = locateEditor("annotateFileName", file)) {
|
if (Core::IEditor *editor = locateEditor("annotateFileName", file)) {
|
||||||
editor->createNew(response.stdOut);
|
editor->createNew(response.stdOut);
|
||||||
Core::ICore::instance()->editorManager()->setCurrentEditor(editor);
|
Core::EditorManager::instance()->setCurrentEditor(editor);
|
||||||
} else {
|
} else {
|
||||||
const QString title = tr("svn annotate %1").arg(QFileInfo(file).fileName());
|
const QString title = tr("svn annotate %1").arg(QFileInfo(file).fileName());
|
||||||
Core::IEditor *newEditor = showOutputInEditor(title, response.stdOut, VCSBase::AnnotateOutput, file, codec);
|
Core::IEditor *newEditor = showOutputInEditor(title, response.stdOut, VCSBase::AnnotateOutput, file, codec);
|
||||||
@@ -873,7 +873,7 @@ void SubversionPlugin::describe(const QString &source, const QString &changeNr)
|
|||||||
const QString id = diffArg + source;
|
const QString id = diffArg + source;
|
||||||
if (Core::IEditor *editor = locateEditor("describeChange", id)) {
|
if (Core::IEditor *editor = locateEditor("describeChange", id)) {
|
||||||
editor->createNew(response.stdOut);
|
editor->createNew(response.stdOut);
|
||||||
Core::ICore::instance()->editorManager()->setCurrentEditor(editor);
|
Core::EditorManager::instance()->setCurrentEditor(editor);
|
||||||
} else {
|
} else {
|
||||||
const QString title = tr("svn describe %1#%2").arg(QFileInfo(source).fileName(), changeNr);
|
const QString title = tr("svn describe %1#%2").arg(QFileInfo(source).fileName(), changeNr);
|
||||||
Core::IEditor *newEditor = showOutputInEditor(title, response.stdOut, VCSBase::DiffOutput, source, codec);
|
Core::IEditor *newEditor = showOutputInEditor(title, response.stdOut, VCSBase::DiffOutput, source, codec);
|
||||||
@@ -883,8 +883,8 @@ void SubversionPlugin::describe(const QString &source, const QString &changeNr)
|
|||||||
|
|
||||||
void SubversionPlugin::submitCurrentLog()
|
void SubversionPlugin::submitCurrentLog()
|
||||||
{
|
{
|
||||||
Core::ICore::instance()->editorManager()->closeEditors(QList<Core::IEditor*>()
|
Core::EditorManager::instance()->closeEditors(QList<Core::IEditor*>()
|
||||||
<< Core::ICore::instance()->editorManager()->currentEditor());
|
<< Core::EditorManager::instance()->currentEditor());
|
||||||
}
|
}
|
||||||
|
|
||||||
QString SubversionPlugin::currentFileName() const
|
QString SubversionPlugin::currentFileName() const
|
||||||
@@ -990,8 +990,8 @@ Core::IEditor * SubversionPlugin::showOutputInEditor(const QString& title, const
|
|||||||
if (Subversion::Constants::debug)
|
if (Subversion::Constants::debug)
|
||||||
qDebug() << "SubversionPlugin::showOutputInEditor" << title << kind << "Size= " << output.size() << " Type=" << editorType << debugCodec(codec);
|
qDebug() << "SubversionPlugin::showOutputInEditor" << title << kind << "Size= " << output.size() << " Type=" << editorType << debugCodec(codec);
|
||||||
QString s = title;
|
QString s = title;
|
||||||
Core::IEditor *ediface = Core::ICore::instance()->editorManager()->newFile(kind, &s, output.toLocal8Bit());
|
Core::IEditor *editor = Core::EditorManager::instance()->newFile(kind, &s, output.toLocal8Bit());
|
||||||
SubversionEditor *e = qobject_cast<SubversionEditor*>(ediface->widget());
|
SubversionEditor *e = qobject_cast<SubversionEditor*>(editor->widget());
|
||||||
if (!e)
|
if (!e)
|
||||||
return 0;
|
return 0;
|
||||||
s.replace(QLatin1Char(' '), QLatin1Char('_'));
|
s.replace(QLatin1Char(' '), QLatin1Char('_'));
|
||||||
|
|||||||
@@ -33,6 +33,7 @@
|
|||||||
|
|
||||||
#include "basefilefind.h"
|
#include "basefilefind.h"
|
||||||
|
|
||||||
|
#include <coreplugin/icore.h>
|
||||||
#include <coreplugin/stylehelper.h>
|
#include <coreplugin/stylehelper.h>
|
||||||
#include <coreplugin/progressmanager/progressmanager.h>
|
#include <coreplugin/progressmanager/progressmanager.h>
|
||||||
#include <coreplugin/editormanager/editormanager.h>
|
#include <coreplugin/editormanager/editormanager.h>
|
||||||
@@ -40,7 +41,7 @@
|
|||||||
#include <texteditor/itexteditor.h>
|
#include <texteditor/itexteditor.h>
|
||||||
#include <texteditor/basetexteditor.h>
|
#include <texteditor/basetexteditor.h>
|
||||||
|
|
||||||
#include <QtDebug>
|
#include <QtCore/QDebug>
|
||||||
#include <QtCore/QDirIterator>
|
#include <QtCore/QDirIterator>
|
||||||
#include <QtGui/QPushButton>
|
#include <QtGui/QPushButton>
|
||||||
#include <QtGui/QFileDialog>
|
#include <QtGui/QFileDialog>
|
||||||
|
|||||||
@@ -43,7 +43,6 @@
|
|||||||
#include "codecselector.h"
|
#include "codecselector.h"
|
||||||
|
|
||||||
#ifndef TEXTEDITOR_STANDALONE
|
#ifndef TEXTEDITOR_STANDALONE
|
||||||
#include <coreplugin/icore.h>
|
|
||||||
#include <coreplugin/manhattanstyle.h>
|
#include <coreplugin/manhattanstyle.h>
|
||||||
#include <coreplugin/coreconstants.h>
|
#include <coreplugin/coreconstants.h>
|
||||||
#include <coreplugin/editormanager/editormanager.h>
|
#include <coreplugin/editormanager/editormanager.h>
|
||||||
@@ -132,7 +131,7 @@ ITextEditor *BaseTextEditor::openEditorAt(const QString &fileName,
|
|||||||
int column,
|
int column,
|
||||||
const QString &editorKind)
|
const QString &editorKind)
|
||||||
{
|
{
|
||||||
Core::EditorManager *editorManager = Core::ICore::instance()->editorManager();
|
Core::EditorManager *editorManager = Core::EditorManager::instance();
|
||||||
editorManager->addCurrentPositionToNavigationHistory(true);
|
editorManager->addCurrentPositionToNavigationHistory(true);
|
||||||
Core::IEditor *editor = editorManager->openEditor(fileName, editorKind, true);
|
Core::IEditor *editor = editorManager->openEditor(fileName, editorKind, true);
|
||||||
TextEditor::ITextEditor *texteditor = qobject_cast<TextEditor::ITextEditor *>(editor);
|
TextEditor::ITextEditor *texteditor = qobject_cast<TextEditor::ITextEditor *>(editor);
|
||||||
|
|||||||
@@ -35,7 +35,6 @@
|
|||||||
|
|
||||||
#include <coreplugin/editormanager/editormanager.h>
|
#include <coreplugin/editormanager/editormanager.h>
|
||||||
#include <extensionsystem/pluginmanager.h>
|
#include <extensionsystem/pluginmanager.h>
|
||||||
#include <coreplugin/icore.h>
|
|
||||||
|
|
||||||
#include <QtCore/QTimer>
|
#include <QtCore/QTimer>
|
||||||
|
|
||||||
@@ -57,7 +56,7 @@ BaseTextMark::BaseTextMark(const QString &filename, int line)
|
|||||||
void BaseTextMark::init()
|
void BaseTextMark::init()
|
||||||
{
|
{
|
||||||
m_init = true;
|
m_init = true;
|
||||||
Core::EditorManager *em = Core::ICore::instance()->editorManager();
|
Core::EditorManager *em = Core::EditorManager::instance();
|
||||||
connect(em, SIGNAL(editorOpened(Core::IEditor *)), this, SLOT(editorOpened(Core::IEditor *)));
|
connect(em, SIGNAL(editorOpened(Core::IEditor *)), this, SLOT(editorOpened(Core::IEditor *)));
|
||||||
|
|
||||||
foreach (Core::IEditor *editor, em->openedEditors())
|
foreach (Core::IEditor *editor, em->openedEditors())
|
||||||
@@ -117,7 +116,7 @@ void BaseTextMark::updateMarker()
|
|||||||
|
|
||||||
void BaseTextMark::moveMark(const QString & /* filename */, int /* line */)
|
void BaseTextMark::moveMark(const QString & /* filename */, int /* line */)
|
||||||
{
|
{
|
||||||
Core::EditorManager *em = Core::ICore::instance()->editorManager();
|
Core::EditorManager *em = Core::EditorManager::instance();
|
||||||
if (!m_init) {
|
if (!m_init) {
|
||||||
connect(em, SIGNAL(editorOpened(Core::IEditor *)), this, SLOT(editorOpened(Core::IEditor *)));
|
connect(em, SIGNAL(editorOpened(Core::IEditor *)), this, SLOT(editorOpened(Core::IEditor *)));
|
||||||
m_init = true;
|
m_init = true;
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user