forked from qt-creator/qt-creator
Fix exported headers in Core and TextEditor.
- Unexport Core::Internal::MainWindow and remove its includes. - Move RssFetcher from Core::Internal to Core. - Unexport CopyTaskHandler. - Move TextEditor's completion support and Refactor Overlay helper classes from TextEditor::Internal to TextEditor as they are exported. - Move internal BaseTextBlockSelection into private header. - Unexport TextEditorOverlay as they are not used.
This commit is contained in:
@@ -34,7 +34,6 @@
|
|||||||
|
|
||||||
#include <coreplugin/icore.h>
|
#include <coreplugin/icore.h>
|
||||||
#include <coreplugin/imode.h>
|
#include <coreplugin/imode.h>
|
||||||
#include <coreplugin/mainwindow.h>
|
|
||||||
|
|
||||||
#include <QtGui/QHBoxLayout>
|
#include <QtGui/QHBoxLayout>
|
||||||
#include <QtGui/QPainter>
|
#include <QtGui/QPainter>
|
||||||
|
@@ -125,6 +125,8 @@ QWidget *GeneralSettings::createPage(QWidget *parent)
|
|||||||
m_page->setupUi(w);
|
m_page->setupUi(w);
|
||||||
|
|
||||||
QSettings* settings = Core::ICore::instance()->settings();
|
QSettings* settings = Core::ICore::instance()->settings();
|
||||||
|
Q_UNUSED(settings) // Windows
|
||||||
|
|
||||||
fillLanguageBox();
|
fillLanguageBox();
|
||||||
|
|
||||||
m_page->colorButton->setColor(StyleHelper::requestedBaseColor());
|
m_page->colorButton->setColor(StyleHelper::requestedBaseColor());
|
||||||
|
@@ -30,7 +30,6 @@
|
|||||||
#ifndef MAINWINDOW_H
|
#ifndef MAINWINDOW_H
|
||||||
#define MAINWINDOW_H
|
#define MAINWINDOW_H
|
||||||
|
|
||||||
#include "core_global.h"
|
|
||||||
#include "icontext.h"
|
#include "icontext.h"
|
||||||
#include "icore.h"
|
#include "icore.h"
|
||||||
#include "dialogs/iwizard.h"
|
#include "dialogs/iwizard.h"
|
||||||
@@ -81,7 +80,7 @@ class StatusBarManager;
|
|||||||
class VersionDialog;
|
class VersionDialog;
|
||||||
class SystemEditor;
|
class SystemEditor;
|
||||||
|
|
||||||
class CORE_EXPORT MainWindow : public EventFilteringMainWindow
|
class MainWindow : public EventFilteringMainWindow
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
|
@@ -34,6 +34,7 @@
|
|||||||
#include <QtCore/QSysInfo>
|
#include <QtCore/QSysInfo>
|
||||||
#include <QtCore/QLocale>
|
#include <QtCore/QLocale>
|
||||||
#include <QtCore/QEventLoop>
|
#include <QtCore/QEventLoop>
|
||||||
|
#include <QtCore/QUrl>
|
||||||
#include <QtGui/QDesktopServices>
|
#include <QtGui/QDesktopServices>
|
||||||
#include <QtGui/QLineEdit>
|
#include <QtGui/QLineEdit>
|
||||||
#include <QtNetwork/QNetworkReply>
|
#include <QtNetwork/QNetworkReply>
|
||||||
@@ -48,7 +49,7 @@
|
|||||||
#include <sys/utsname.h>
|
#include <sys/utsname.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
using namespace Core::Internal;
|
namespace Core {
|
||||||
|
|
||||||
static const QString getOsString()
|
static const QString getOsString()
|
||||||
{
|
{
|
||||||
@@ -119,7 +120,7 @@ RssFetcher::RssFetcher(int maxItems)
|
|||||||
: QThread(0), m_maxItems(maxItems), m_items(0),
|
: QThread(0), m_maxItems(maxItems), m_items(0),
|
||||||
m_requestCount(0), m_networkAccessManager(0)
|
m_requestCount(0), m_networkAccessManager(0)
|
||||||
{
|
{
|
||||||
qRegisterMetaType<RssItem>("RssItem");
|
qRegisterMetaType<Core::RssItem>("Core::RssItem");
|
||||||
moveToThread(this);
|
moveToThread(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -241,3 +242,5 @@ void RssFetcher::parseXml(QIODevice *device)
|
|||||||
qPrintable(item.title));
|
qPrintable(item.title));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
} // namespace Core
|
||||||
|
@@ -33,16 +33,15 @@
|
|||||||
#include "core_global.h"
|
#include "core_global.h"
|
||||||
|
|
||||||
#include <QtCore/QThread>
|
#include <QtCore/QThread>
|
||||||
#include <QtCore/QUrl>
|
|
||||||
|
|
||||||
QT_BEGIN_NAMESPACE
|
QT_BEGIN_NAMESPACE
|
||||||
|
class QUrl;
|
||||||
class QNetworkReply;
|
class QNetworkReply;
|
||||||
class QNetworkAccessManager;
|
class QNetworkAccessManager;
|
||||||
class QIODevice;
|
class QIODevice;
|
||||||
QT_END_NAMESPACE
|
QT_END_NAMESPACE
|
||||||
|
|
||||||
namespace Core {
|
namespace Core {
|
||||||
namespace Internal {
|
|
||||||
|
|
||||||
class CORE_EXPORT RssItem
|
class CORE_EXPORT RssItem
|
||||||
{
|
{
|
||||||
@@ -64,7 +63,7 @@ public:
|
|||||||
|
|
||||||
signals:
|
signals:
|
||||||
void newsItemReady(const QString& title, const QString& desciption, const QString& url);
|
void newsItemReady(const QString& title, const QString& desciption, const QString& url);
|
||||||
void rssItemReady(const RssItem& item);
|
void rssItemReady(const Core::RssItem& item);
|
||||||
void finished(bool error);
|
void finished(bool error);
|
||||||
|
|
||||||
public slots:
|
public slots:
|
||||||
@@ -84,7 +83,6 @@ private:
|
|||||||
QNetworkAccessManager* m_networkAccessManager;
|
QNetworkAccessManager* m_networkAccessManager;
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace Core
|
|
||||||
} // namespace Internal
|
} // namespace Internal
|
||||||
|
|
||||||
#endif // RSSFETCHER_H
|
#endif // RSSFETCHER_H
|
||||||
|
@@ -173,7 +173,7 @@ void CppPlugin::initializeEditor(CPPEditor *editor)
|
|||||||
|
|
||||||
// auto completion
|
// auto completion
|
||||||
connect(editor, SIGNAL(requestAutoCompletion(TextEditor::ITextEditable*, bool)),
|
connect(editor, SIGNAL(requestAutoCompletion(TextEditor::ITextEditable*, bool)),
|
||||||
TextEditor::Internal::CompletionSupport::instance(), SLOT(autoComplete(TextEditor::ITextEditable*, bool)));
|
TextEditor::CompletionSupport::instance(), SLOT(autoComplete(TextEditor::ITextEditable*, bool)));
|
||||||
|
|
||||||
// quick fix
|
// quick fix
|
||||||
connect(editor, SIGNAL(requestQuickFix(TextEditor::ITextEditable*)),
|
connect(editor, SIGNAL(requestQuickFix(TextEditor::ITextEditable*)),
|
||||||
@@ -400,7 +400,7 @@ void CppPlugin::quickFixNow()
|
|||||||
if (editor->isOutdated())
|
if (editor->isOutdated())
|
||||||
m_quickFixTimer->start(QUICKFIX_INTERVAL);
|
m_quickFixTimer->start(QUICKFIX_INTERVAL);
|
||||||
else
|
else
|
||||||
TextEditor::Internal::CompletionSupport::instance()->quickFix(m_currentTextEditable);
|
TextEditor::CompletionSupport::instance()->quickFix(m_currentTextEditable);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -906,7 +906,7 @@ void FakeVimPluginPrivate::triggerCompletions()
|
|||||||
if (!handler)
|
if (!handler)
|
||||||
return;
|
return;
|
||||||
if (BaseTextEditor *bt = qobject_cast<BaseTextEditor *>(handler->widget()))
|
if (BaseTextEditor *bt = qobject_cast<BaseTextEditor *>(handler->widget()))
|
||||||
TextEditor::Internal::CompletionSupport::instance()->
|
TextEditor::CompletionSupport::instance()->
|
||||||
autoComplete(bt->editableInterface(), false);
|
autoComplete(bt->editableInterface(), false);
|
||||||
// bt->triggerCompletions();
|
// bt->triggerCompletions();
|
||||||
}
|
}
|
||||||
|
@@ -30,14 +30,12 @@
|
|||||||
#ifndef PROJECTEXPLORER_COPYTASKHANDLER_H
|
#ifndef PROJECTEXPLORER_COPYTASKHANDLER_H
|
||||||
#define PROJECTEXPLORER_COPYTASKHANDLER_H
|
#define PROJECTEXPLORER_COPYTASKHANDLER_H
|
||||||
|
|
||||||
#include "projectexplorer_export.h"
|
|
||||||
|
|
||||||
#include "itaskhandler.h"
|
#include "itaskhandler.h"
|
||||||
|
|
||||||
namespace ProjectExplorer {
|
namespace ProjectExplorer {
|
||||||
namespace Internal {
|
namespace Internal {
|
||||||
|
|
||||||
class PROJECTEXPLORER_EXPORT CopyTaskHandler : public ITaskHandler
|
class CopyTaskHandler : public ITaskHandler
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
|
@@ -37,7 +37,6 @@
|
|||||||
#include <utils/stylehelper.h>
|
#include <utils/stylehelper.h>
|
||||||
|
|
||||||
#include <coreplugin/icore.h>
|
#include <coreplugin/icore.h>
|
||||||
#include <coreplugin/mainwindow.h>
|
|
||||||
#include <coreplugin/coreconstants.h>
|
#include <coreplugin/coreconstants.h>
|
||||||
|
|
||||||
#include <projectexplorer/projectexplorer.h>
|
#include <projectexplorer/projectexplorer.h>
|
||||||
@@ -57,6 +56,7 @@
|
|||||||
#include <QtGui/QPainter>
|
#include <QtGui/QPainter>
|
||||||
#include <QtGui/QAction>
|
#include <QtGui/QAction>
|
||||||
#include <QtGui/QItemDelegate>
|
#include <QtGui/QItemDelegate>
|
||||||
|
#include <QtGui/QMainWindow>
|
||||||
|
|
||||||
#include <QtGui/QApplication>
|
#include <QtGui/QApplication>
|
||||||
|
|
||||||
|
@@ -81,7 +81,6 @@
|
|||||||
#include <coreplugin/coreconstants.h>
|
#include <coreplugin/coreconstants.h>
|
||||||
#include <coreplugin/filemanager.h>
|
#include <coreplugin/filemanager.h>
|
||||||
#include <coreplugin/icore.h>
|
#include <coreplugin/icore.h>
|
||||||
#include <coreplugin/mainwindow.h>
|
|
||||||
#include <coreplugin/mimedatabase.h>
|
#include <coreplugin/mimedatabase.h>
|
||||||
#include <coreplugin/modemanager.h>
|
#include <coreplugin/modemanager.h>
|
||||||
#include <coreplugin/actionmanager/actionmanager.h>
|
#include <coreplugin/actionmanager/actionmanager.h>
|
||||||
@@ -112,6 +111,7 @@
|
|||||||
#include <QtGui/QFileDialog>
|
#include <QtGui/QFileDialog>
|
||||||
#include <QtGui/QMenu>
|
#include <QtGui/QMenu>
|
||||||
#include <QtGui/QMessageBox>
|
#include <QtGui/QMessageBox>
|
||||||
|
#include <QtGui/QMainWindow>
|
||||||
|
|
||||||
Q_DECLARE_METATYPE(Core::IEditorFactory*);
|
Q_DECLARE_METATYPE(Core::IEditorFactory*);
|
||||||
Q_DECLARE_METATYPE(Core::IExternalEditor*);
|
Q_DECLARE_METATYPE(Core::IExternalEditor*);
|
||||||
|
@@ -36,7 +36,6 @@
|
|||||||
#include <coreplugin/modemanager.h>
|
#include <coreplugin/modemanager.h>
|
||||||
#include <coreplugin/icore.h>
|
#include <coreplugin/icore.h>
|
||||||
#include <coreplugin/dialogs/iwizard.h>
|
#include <coreplugin/dialogs/iwizard.h>
|
||||||
#include <coreplugin/mainwindow.h>
|
|
||||||
#include <coreplugin/filemanager.h>
|
#include <coreplugin/filemanager.h>
|
||||||
|
|
||||||
#include <utils/stringutils.h>
|
#include <utils/stringutils.h>
|
||||||
|
@@ -39,11 +39,11 @@
|
|||||||
#include "toolchaintype.h"
|
#include "toolchaintype.h"
|
||||||
|
|
||||||
#include <coreplugin/icore.h>
|
#include <coreplugin/icore.h>
|
||||||
#include <coreplugin/mainwindow.h>
|
|
||||||
#include <coreplugin/ifile.h>
|
#include <coreplugin/ifile.h>
|
||||||
#include <utils/qtcassert.h>
|
#include <utils/qtcassert.h>
|
||||||
|
|
||||||
#include <QtGui/QApplication>
|
#include <QtGui/QApplication>
|
||||||
|
#include <QtGui/QMainWindow>
|
||||||
#include <QtCore/QFile>
|
#include <QtCore/QFile>
|
||||||
#include <QtGui/QMessageBox>
|
#include <QtGui/QMessageBox>
|
||||||
#include <QtNetwork/QHostInfo>
|
#include <QtNetwork/QHostInfo>
|
||||||
|
@@ -751,8 +751,8 @@ QmlJSTextEditor::QmlJSTextEditor(QWidget *parent) :
|
|||||||
connect(m_semanticHighlighter, SIGNAL(changed(QmlJSEditor::Internal::SemanticInfo)),
|
connect(m_semanticHighlighter, SIGNAL(changed(QmlJSEditor::Internal::SemanticInfo)),
|
||||||
this, SLOT(updateSemanticInfo(QmlJSEditor::Internal::SemanticInfo)));
|
this, SLOT(updateSemanticInfo(QmlJSEditor::Internal::SemanticInfo)));
|
||||||
|
|
||||||
connect(this, SIGNAL(refactorMarkerClicked(TextEditor::Internal::RefactorMarker)),
|
connect(this, SIGNAL(refactorMarkerClicked(TextEditor::RefactorMarker)),
|
||||||
SLOT(onRefactorMarkerClicked(TextEditor::Internal::RefactorMarker)));
|
SLOT(onRefactorMarkerClicked(TextEditor::RefactorMarker)));
|
||||||
|
|
||||||
setRequestMarkEnabled(true);
|
setRequestMarkEnabled(true);
|
||||||
}
|
}
|
||||||
@@ -986,21 +986,21 @@ void QmlJSTextEditor::updateCursorPositionNow()
|
|||||||
m_contextPane->apply(editableInterface(), semanticInfo().document, LookupContext::Ptr(),newNode, false);
|
m_contextPane->apply(editableInterface(), semanticInfo().document, LookupContext::Ptr(),newNode, false);
|
||||||
if (m_contextPane->isAvailable(editableInterface(), semanticInfo().document, newNode) &&
|
if (m_contextPane->isAvailable(editableInterface(), semanticInfo().document, newNode) &&
|
||||||
!m_contextPane->widget()->isVisible()) {
|
!m_contextPane->widget()->isVisible()) {
|
||||||
QList<TextEditor::Internal::RefactorMarker> markers;
|
QList<TextEditor::RefactorMarker> markers;
|
||||||
if (UiObjectMember *m = newNode->uiObjectMemberCast()) {
|
if (UiObjectMember *m = newNode->uiObjectMemberCast()) {
|
||||||
const int start = qualifiedTypeNameId(m)->identifierToken.begin();
|
const int start = qualifiedTypeNameId(m)->identifierToken.begin();
|
||||||
for (UiQualifiedId *q = qualifiedTypeNameId(m); q; q = q->next) {
|
for (UiQualifiedId *q = qualifiedTypeNameId(m); q; q = q->next) {
|
||||||
if (! q->next) {
|
if (! q->next) {
|
||||||
const int end = q->identifierToken.end();
|
const int end = q->identifierToken.end();
|
||||||
if (position() >= start && position() <= end) {
|
if (position() >= start && position() <= end) {
|
||||||
TextEditor::Internal::RefactorMarker marker;
|
TextEditor::RefactorMarker marker;
|
||||||
QTextCursor tc(document());
|
QTextCursor tc(document());
|
||||||
tc.setPosition(end);
|
tc.setPosition(end);
|
||||||
marker.cursor = tc;
|
marker.cursor = tc;
|
||||||
marker.tooltip = tr("Show Qt Quick ToolBar");
|
marker.tooltip = tr("Show Qt Quick ToolBar");
|
||||||
markers.append(marker);
|
markers.append(marker);
|
||||||
} else {
|
} else {
|
||||||
QList<TextEditor::Internal::RefactorMarker> markers;
|
QList<TextEditor::RefactorMarker> markers;
|
||||||
setRefactorMarkers(markers);
|
setRefactorMarkers(markers);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1008,7 +1008,7 @@ void QmlJSTextEditor::updateCursorPositionNow()
|
|||||||
}
|
}
|
||||||
setRefactorMarkers(markers);
|
setRefactorMarkers(markers);
|
||||||
} else if (oldNode != newNode) {
|
} else if (oldNode != newNode) {
|
||||||
QList<TextEditor::Internal::RefactorMarker> markers;
|
QList<TextEditor::RefactorMarker> markers;
|
||||||
setRefactorMarkers(markers);
|
setRefactorMarkers(markers);
|
||||||
}
|
}
|
||||||
m_oldCursorPosition = position();
|
m_oldCursorPosition = position();
|
||||||
@@ -1456,7 +1456,7 @@ void QmlJSTextEditor::showContextPane()
|
|||||||
Node *newNode = m_semanticInfo.declaringMemberNoProperties(position());
|
Node *newNode = m_semanticInfo.declaringMemberNoProperties(position());
|
||||||
m_contextPane->apply(editableInterface(), m_semanticInfo.document, m_semanticInfo.lookupContext(), newNode, false, true);
|
m_contextPane->apply(editableInterface(), m_semanticInfo.document, m_semanticInfo.lookupContext(), newNode, false, true);
|
||||||
m_oldCursorPosition = position();
|
m_oldCursorPosition = position();
|
||||||
QList<TextEditor::Internal::RefactorMarker> markers;
|
QList<TextEditor::RefactorMarker> markers;
|
||||||
setRefactorMarkers(markers);
|
setRefactorMarkers(markers);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1814,7 +1814,7 @@ void QmlJSTextEditor::updateSemanticInfo(const SemanticInfo &semanticInfo)
|
|||||||
setExtraSelections(CodeWarningsSelection, selections);
|
setExtraSelections(CodeWarningsSelection, selections);
|
||||||
}
|
}
|
||||||
|
|
||||||
void QmlJSTextEditor::onRefactorMarkerClicked(const TextEditor::Internal::RefactorMarker &)
|
void QmlJSTextEditor::onRefactorMarkerClicked(const TextEditor::RefactorMarker &)
|
||||||
{
|
{
|
||||||
showContextPane();
|
showContextPane();
|
||||||
}
|
}
|
||||||
|
@@ -278,7 +278,7 @@ private slots:
|
|||||||
void forceSemanticRehighlight();
|
void forceSemanticRehighlight();
|
||||||
void updateSemanticInfo(const QmlJSEditor::Internal::SemanticInfo &semanticInfo);
|
void updateSemanticInfo(const QmlJSEditor::Internal::SemanticInfo &semanticInfo);
|
||||||
void onCursorPositionChanged();
|
void onCursorPositionChanged();
|
||||||
void onRefactorMarkerClicked(const TextEditor::Internal::RefactorMarker &marker);
|
void onRefactorMarkerClicked(const TextEditor::RefactorMarker &marker);
|
||||||
|
|
||||||
void performQuickFix(int index);
|
void performQuickFix(int index);
|
||||||
|
|
||||||
|
@@ -257,7 +257,7 @@ void QmlJSEditorPlugin::initializeEditor(QmlJSEditor::Internal::QmlJSTextEditor
|
|||||||
|
|
||||||
// auto completion
|
// auto completion
|
||||||
connect(editor, SIGNAL(requestAutoCompletion(TextEditor::ITextEditable*, bool)),
|
connect(editor, SIGNAL(requestAutoCompletion(TextEditor::ITextEditable*, bool)),
|
||||||
TextEditor::Internal::CompletionSupport::instance(), SLOT(autoComplete(TextEditor::ITextEditable*, bool)));
|
TextEditor::CompletionSupport::instance(), SLOT(autoComplete(TextEditor::ITextEditable*, bool)));
|
||||||
|
|
||||||
// quick fix
|
// quick fix
|
||||||
connect(editor, SIGNAL(requestQuickFix(TextEditor::ITextEditable*)),
|
connect(editor, SIGNAL(requestQuickFix(TextEditor::ITextEditable*)),
|
||||||
@@ -323,7 +323,7 @@ void QmlJSEditorPlugin::quickFixNow()
|
|||||||
// ### FIXME: m_quickFixTimer->start(QUICKFIX_INTERVAL);
|
// ### FIXME: m_quickFixTimer->start(QUICKFIX_INTERVAL);
|
||||||
m_quickFixTimer->stop();
|
m_quickFixTimer->stop();
|
||||||
} else {
|
} else {
|
||||||
TextEditor::Internal::CompletionSupport::instance()->quickFix(m_currentTextEditable);
|
TextEditor::CompletionSupport::instance()->quickFix(m_currentTextEditable);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -34,7 +34,6 @@
|
|||||||
#include <coreplugin/helpmanager.h>
|
#include <coreplugin/helpmanager.h>
|
||||||
#include <coreplugin/coreconstants.h>
|
#include <coreplugin/coreconstants.h>
|
||||||
#include <coreplugin/editormanager/editormanager.h>
|
#include <coreplugin/editormanager/editormanager.h>
|
||||||
#include <coreplugin/mainwindow.h>
|
|
||||||
#include <coreplugin/rssfetcher.h>
|
#include <coreplugin/rssfetcher.h>
|
||||||
#include <projectexplorer/projectexplorer.h>
|
#include <projectexplorer/projectexplorer.h>
|
||||||
|
|
||||||
@@ -60,8 +59,6 @@
|
|||||||
#include <QtGui/QMenu>
|
#include <QtGui/QMenu>
|
||||||
#include <QtGui/QDesktopServices>
|
#include <QtGui/QDesktopServices>
|
||||||
|
|
||||||
using namespace Core::Internal;
|
|
||||||
|
|
||||||
namespace Qt4ProjectManager {
|
namespace Qt4ProjectManager {
|
||||||
namespace Internal {
|
namespace Internal {
|
||||||
|
|
||||||
@@ -119,8 +116,8 @@ GettingStartedWelcomePageWidget::GettingStartedWelcomePageWidget(QWidget *parent
|
|||||||
ui->openProjectButton->setIcon(
|
ui->openProjectButton->setIcon(
|
||||||
QIcon::fromTheme(QLatin1String("document-open"), ui->openProjectButton->icon()));
|
QIcon::fromTheme(QLatin1String("document-open"), ui->openProjectButton->icon()));
|
||||||
|
|
||||||
m_rssFetcher = new RssFetcher;
|
m_rssFetcher = new Core::RssFetcher;
|
||||||
connect (m_rssFetcher, SIGNAL(rssItemReady(const RssItem&)), SLOT(addToFeatures(const RssItem&)));
|
connect (m_rssFetcher, SIGNAL(rssItemReady(Core::RssItem)), SLOT(addToFeatures(Core::RssItem)));
|
||||||
connect (m_rssFetcher, SIGNAL(finished(bool)), SLOT(showFeature()), Qt::QueuedConnection);
|
connect (m_rssFetcher, SIGNAL(finished(bool)), SLOT(showFeature()), Qt::QueuedConnection);
|
||||||
connect(this, SIGNAL(startRssFetching(QUrl)), m_rssFetcher, SLOT(fetch(QUrl)), Qt::QueuedConnection);
|
connect(this, SIGNAL(startRssFetching(QUrl)), m_rssFetcher, SLOT(fetch(QUrl)), Qt::QueuedConnection);
|
||||||
m_rssFetcher->start(QThread::LowestPriority);
|
m_rssFetcher->start(QThread::LowestPriority);
|
||||||
@@ -486,7 +483,7 @@ QStringList GettingStartedWelcomePageWidget::tipsOfTheDay()
|
|||||||
return tips;
|
return tips;
|
||||||
}
|
}
|
||||||
|
|
||||||
void GettingStartedWelcomePageWidget::addToFeatures(const RssItem &feature)
|
void GettingStartedWelcomePageWidget::addToFeatures(const Core::RssItem &feature)
|
||||||
{
|
{
|
||||||
m_featuredItems.append(feature);
|
m_featuredItems.append(feature);
|
||||||
ui->nextFeatureBtn->setEnabled(true);
|
ui->nextFeatureBtn->setEnabled(true);
|
||||||
@@ -503,7 +500,7 @@ void GettingStartedWelcomePageWidget::showFeature(int feature)
|
|||||||
m_currentFeature = rand()%m_featuredItems.count();
|
m_currentFeature = rand()%m_featuredItems.count();
|
||||||
}
|
}
|
||||||
|
|
||||||
RssItem item = m_featuredItems.at(m_currentFeature);
|
const Core::RssItem &item = m_featuredItems.at(m_currentFeature);
|
||||||
ui->featuredTextLabel->setTextFormat(Qt::RichText);
|
ui->featuredTextLabel->setTextFormat(Qt::RichText);
|
||||||
QString text = QString::fromLatin1("<b style='color: rgb(85, 85, 85);'>%1</b><br><b>%2</b><br/><br/>%3").arg(item.category).arg(item.title).arg(item.description);
|
QString text = QString::fromLatin1("<b style='color: rgb(85, 85, 85);'>%1</b><br><b>%2</b><br/><br/>%3").arg(item.category).arg(item.title).arg(item.description);
|
||||||
ui->featuredTextLabel->setText(text);
|
ui->featuredTextLabel->setText(text);
|
||||||
|
@@ -42,14 +42,10 @@ class QMenu;
|
|||||||
QT_END_NAMESPACE
|
QT_END_NAMESPACE
|
||||||
|
|
||||||
namespace Core {
|
namespace Core {
|
||||||
namespace Internal {
|
class RssFetcher;
|
||||||
class RssFetcher;
|
class RssItem;
|
||||||
class RssItem;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
using namespace Core::Internal;
|
|
||||||
|
|
||||||
namespace Qt4ProjectManager {
|
namespace Qt4ProjectManager {
|
||||||
namespace Internal {
|
namespace Internal {
|
||||||
|
|
||||||
@@ -98,7 +94,7 @@ private slots:
|
|||||||
void slotNextFeature();
|
void slotNextFeature();
|
||||||
void slotPrevFeature();
|
void slotPrevFeature();
|
||||||
void slotCreateNewProject();
|
void slotCreateNewProject();
|
||||||
void addToFeatures(const RssItem&);
|
void addToFeatures(const Core::RssItem&);
|
||||||
void showFeature(int feature = -1);
|
void showFeature(int feature = -1);
|
||||||
|
|
||||||
signals:
|
signals:
|
||||||
@@ -111,8 +107,8 @@ private:
|
|||||||
Ui::GettingStartedWelcomePageWidget *ui;
|
Ui::GettingStartedWelcomePageWidget *ui;
|
||||||
int m_currentTip;
|
int m_currentTip;
|
||||||
int m_currentFeature;
|
int m_currentFeature;
|
||||||
QList<Core::Internal::RssItem> m_featuredItems;
|
QList<Core::RssItem> m_featuredItems;
|
||||||
Core::Internal::RssFetcher *m_rssFetcher;
|
Core::RssFetcher *m_rssFetcher;
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace Internal
|
} // namespace Internal
|
||||||
|
@@ -38,7 +38,7 @@
|
|||||||
#include "ui_qt4projectconfigwidget.h"
|
#include "ui_qt4projectconfigwidget.h"
|
||||||
|
|
||||||
#include <coreplugin/icore.h>
|
#include <coreplugin/icore.h>
|
||||||
#include <coreplugin/mainwindow.h>
|
|
||||||
#include <projectexplorer/toolchain.h>
|
#include <projectexplorer/toolchain.h>
|
||||||
#include <projectexplorer/projectexplorerconstants.h>
|
#include <projectexplorer/projectexplorerconstants.h>
|
||||||
#include <projectexplorer/buildconfiguration.h>
|
#include <projectexplorer/buildconfiguration.h>
|
||||||
|
@@ -5655,10 +5655,10 @@ QString BaseTextEditorEditable::contextHelpId() const
|
|||||||
|
|
||||||
void BaseTextEditor::setRefactorMarkers(const Internal::RefactorMarkers &markers)
|
void BaseTextEditor::setRefactorMarkers(const Internal::RefactorMarkers &markers)
|
||||||
{
|
{
|
||||||
foreach (const Internal::RefactorMarker &marker, d->m_refactorOverlay->markers())
|
foreach (const RefactorMarker &marker, d->m_refactorOverlay->markers())
|
||||||
requestBlockUpdate(marker.cursor.block());
|
requestBlockUpdate(marker.cursor.block());
|
||||||
d->m_refactorOverlay->setMarkers(markers);
|
d->m_refactorOverlay->setMarkers(markers);
|
||||||
foreach (const Internal::RefactorMarker &marker, markers)
|
foreach (const RefactorMarker &marker, markers)
|
||||||
requestBlockUpdate(marker.cursor.block());
|
requestBlockUpdate(marker.cursor.block());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -50,36 +50,13 @@ namespace Utils {
|
|||||||
|
|
||||||
namespace TextEditor {
|
namespace TextEditor {
|
||||||
class TabSettings;
|
class TabSettings;
|
||||||
|
class RefactorOverlay;
|
||||||
|
struct RefactorMarker;
|
||||||
|
|
||||||
namespace Internal {
|
namespace Internal {
|
||||||
class BaseTextEditorPrivate;
|
class BaseTextEditorPrivate;
|
||||||
class TextEditorOverlay;
|
class TextEditorOverlay;
|
||||||
class RefactorOverlay;
|
|
||||||
struct RefactorMarker;
|
|
||||||
typedef QList<RefactorMarker> RefactorMarkers;
|
typedef QList<RefactorMarker> RefactorMarkers;
|
||||||
|
|
||||||
class TEXTEDITOR_EXPORT BaseTextBlockSelection
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
|
|
||||||
bool isValid() const{ return !firstBlock.isNull() && !lastBlock.isNull(); }
|
|
||||||
void clear() { firstBlock = lastBlock = QTextCursor(); }
|
|
||||||
|
|
||||||
QTextCursor firstBlock; // defines the first block
|
|
||||||
QTextCursor lastBlock; // defines the last block
|
|
||||||
int firstVisualColumn; // defines the first visual column of the selection
|
|
||||||
int lastVisualColumn; // defines the last visual column of the selection
|
|
||||||
enum Anchor {TopLeft = 0, TopRight, BottomLeft, BottomRight} anchor;
|
|
||||||
BaseTextBlockSelection():firstVisualColumn(0), lastVisualColumn(0), anchor(BottomRight){}
|
|
||||||
void moveAnchor(int blockNumber, int visualColumn);
|
|
||||||
inline int anchorColumnNumber() const { return (anchor % 2) ? lastVisualColumn : firstVisualColumn; }
|
|
||||||
inline int anchorBlockNumber() const {
|
|
||||||
return (anchor <= TopRight ? firstBlock.blockNumber() : lastBlock.blockNumber()); }
|
|
||||||
QTextCursor selection(const TabSettings &ts) const;
|
|
||||||
void fromSelection(const TabSettings &ts, const QTextCursor &selection);
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
class ITextMarkable;
|
class ITextMarkable;
|
||||||
@@ -351,7 +328,7 @@ private:
|
|||||||
Internal::BaseTextEditorPrivate *d;
|
Internal::BaseTextEditorPrivate *d;
|
||||||
friend class Internal::BaseTextEditorPrivate;
|
friend class Internal::BaseTextEditorPrivate;
|
||||||
friend class Internal::TextEditorOverlay;
|
friend class Internal::TextEditorOverlay;
|
||||||
friend class Internal::RefactorOverlay;
|
friend class RefactorOverlay;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
QWidget *extraArea() const;
|
QWidget *extraArea() const;
|
||||||
@@ -387,7 +364,7 @@ public:
|
|||||||
|
|
||||||
void setRefactorMarkers(const Internal::RefactorMarkers &markers);
|
void setRefactorMarkers(const Internal::RefactorMarkers &markers);
|
||||||
signals:
|
signals:
|
||||||
void refactorMarkerClicked(const TextEditor::Internal::RefactorMarker &marker);
|
void refactorMarkerClicked(const TextEditor::RefactorMarker &marker);
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
|
@@ -53,6 +53,27 @@ class TextEditorActionHandler;
|
|||||||
|
|
||||||
namespace Internal {
|
namespace Internal {
|
||||||
|
|
||||||
|
class TEXTEDITOR_EXPORT BaseTextBlockSelection
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
|
||||||
|
bool isValid() const{ return !firstBlock.isNull() && !lastBlock.isNull(); }
|
||||||
|
void clear() { firstBlock = lastBlock = QTextCursor(); }
|
||||||
|
|
||||||
|
QTextCursor firstBlock; // defines the first block
|
||||||
|
QTextCursor lastBlock; // defines the last block
|
||||||
|
int firstVisualColumn; // defines the first visual column of the selection
|
||||||
|
int lastVisualColumn; // defines the last visual column of the selection
|
||||||
|
enum Anchor {TopLeft = 0, TopRight, BottomLeft, BottomRight} anchor;
|
||||||
|
BaseTextBlockSelection():firstVisualColumn(0), lastVisualColumn(0), anchor(BottomRight){}
|
||||||
|
void moveAnchor(int blockNumber, int visualColumn);
|
||||||
|
inline int anchorColumnNumber() const { return (anchor % 2) ? lastVisualColumn : firstVisualColumn; }
|
||||||
|
inline int anchorBlockNumber() const {
|
||||||
|
return (anchor <= TopRight ? firstBlock.blockNumber() : lastBlock.blockNumber()); }
|
||||||
|
QTextCursor selection(const TabSettings &ts) const;
|
||||||
|
void fromSelection(const TabSettings &ts, const QTextCursor &selection);
|
||||||
|
};
|
||||||
|
|
||||||
//========== Pointers with reference count ==========
|
//========== Pointers with reference count ==========
|
||||||
|
|
||||||
template <class T> class QRefCountData : public QSharedData
|
template <class T> class QRefCountData : public QSharedData
|
||||||
|
@@ -40,11 +40,7 @@
|
|||||||
#include <QtCore/QString>
|
#include <QtCore/QString>
|
||||||
#include <QtCore/QList>
|
#include <QtCore/QList>
|
||||||
|
|
||||||
#include <algorithm>
|
namespace TextEditor {
|
||||||
|
|
||||||
using namespace TextEditor;
|
|
||||||
using namespace TextEditor::Internal;
|
|
||||||
|
|
||||||
|
|
||||||
CompletionSupport *CompletionSupport::instance()
|
CompletionSupport *CompletionSupport::instance()
|
||||||
{
|
{
|
||||||
@@ -54,48 +50,68 @@ CompletionSupport *CompletionSupport::instance()
|
|||||||
return m_instance;
|
return m_instance;
|
||||||
}
|
}
|
||||||
|
|
||||||
CompletionSupport::CompletionSupport()
|
class CompletionSupportPrivate {
|
||||||
: QObject(Core::ICore::instance()),
|
public:
|
||||||
|
CompletionSupportPrivate();
|
||||||
|
|
||||||
|
Internal::CompletionWidget *m_completionList;
|
||||||
|
int m_startPosition;
|
||||||
|
bool m_checkCompletionTrigger; // Whether to check for completion trigger after cleanup
|
||||||
|
ITextEditable *m_editor;
|
||||||
|
const QList<ICompletionCollector *> m_completionCollectors;
|
||||||
|
ICompletionCollector *m_completionCollector;
|
||||||
|
};
|
||||||
|
|
||||||
|
CompletionSupportPrivate::CompletionSupportPrivate() :
|
||||||
m_completionList(0),
|
m_completionList(0),
|
||||||
m_startPosition(0),
|
m_startPosition(0),
|
||||||
m_checkCompletionTrigger(false),
|
m_checkCompletionTrigger(false),
|
||||||
m_editor(0),
|
m_editor(0),
|
||||||
|
m_completionCollectors(ExtensionSystem::PluginManager::instance()
|
||||||
|
->getObjects<ICompletionCollector>()),
|
||||||
m_completionCollector(0)
|
m_completionCollector(0)
|
||||||
{
|
{
|
||||||
m_completionCollectors = ExtensionSystem::PluginManager::instance()
|
}
|
||||||
->getObjects<ICompletionCollector>();
|
|
||||||
|
CompletionSupport::CompletionSupport() :
|
||||||
|
QObject(Core::ICore::instance()), d(new CompletionSupportPrivate)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
CompletionSupport::~CompletionSupport()
|
||||||
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
void CompletionSupport::performCompletion(const CompletionItem &item)
|
void CompletionSupport::performCompletion(const CompletionItem &item)
|
||||||
{
|
{
|
||||||
item.collector->complete(item, m_completionList->typedChar());
|
item.collector->complete(item, d->m_completionList->typedChar());
|
||||||
m_checkCompletionTrigger = true;
|
d->m_checkCompletionTrigger = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
void CompletionSupport::cleanupCompletions()
|
void CompletionSupport::cleanupCompletions()
|
||||||
{
|
{
|
||||||
if (m_completionList)
|
if (d->m_completionList)
|
||||||
disconnect(m_completionList, SIGNAL(destroyed(QObject*)),
|
disconnect(d->m_completionList, SIGNAL(destroyed(QObject*)),
|
||||||
this, SLOT(cleanupCompletions()));
|
this, SLOT(cleanupCompletions()));
|
||||||
|
|
||||||
if (m_checkCompletionTrigger)
|
if (d->m_checkCompletionTrigger)
|
||||||
m_checkCompletionTrigger = m_completionCollector->shouldRestartCompletion();
|
d->m_checkCompletionTrigger = d->m_completionCollector->shouldRestartCompletion();
|
||||||
|
|
||||||
m_completionList = 0;
|
d->m_completionList = 0;
|
||||||
m_completionCollector->cleanup();
|
d->m_completionCollector->cleanup();
|
||||||
|
|
||||||
if (m_checkCompletionTrigger) {
|
if (d->m_checkCompletionTrigger) {
|
||||||
m_checkCompletionTrigger = false;
|
d->m_checkCompletionTrigger = false;
|
||||||
|
|
||||||
// Only check for completion trigger when some text was entered
|
// Only check for completion trigger when some text was entered
|
||||||
if (m_editor->position() > m_startPosition)
|
if (d->m_editor->position() > d->m_startPosition)
|
||||||
autoComplete(m_editor, false);
|
autoComplete(d->m_editor, false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
bool CompletionSupport::isActive() const
|
bool CompletionSupport::isActive() const
|
||||||
{
|
{
|
||||||
return m_completionList != 0;
|
return d->m_completionList != 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
void CompletionSupport::autoComplete(ITextEditable *editor, bool forced)
|
void CompletionSupport::autoComplete(ITextEditable *editor, bool forced)
|
||||||
@@ -113,68 +129,68 @@ void CompletionSupport::quickFix(ITextEditable *editor)
|
|||||||
void CompletionSupport::autoComplete_helper(ITextEditable *editor, bool forced,
|
void CompletionSupport::autoComplete_helper(ITextEditable *editor, bool forced,
|
||||||
bool quickFix)
|
bool quickFix)
|
||||||
{
|
{
|
||||||
m_completionCollector = 0;
|
d->m_completionCollector = 0;
|
||||||
|
|
||||||
foreach (ICompletionCollector *collector, m_completionCollectors) {
|
foreach (ICompletionCollector *collector, d->m_completionCollectors) {
|
||||||
if (quickFix)
|
if (quickFix)
|
||||||
collector = qobject_cast<IQuickFixCollector *>(collector);
|
collector = qobject_cast<IQuickFixCollector *>(collector);
|
||||||
|
|
||||||
if (collector && collector->supportsEditor(editor)) {
|
if (collector && collector->supportsEditor(editor)) {
|
||||||
m_completionCollector = collector;
|
d->m_completionCollector = collector;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!m_completionCollector)
|
if (!d->m_completionCollector)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
m_editor = editor;
|
d->m_editor = editor;
|
||||||
QList<CompletionItem> completionItems;
|
QList<CompletionItem> completionItems;
|
||||||
|
|
||||||
int currentIndex = 0;
|
int currentIndex = 0;
|
||||||
|
|
||||||
if (!m_completionList) {
|
if (!d->m_completionList) {
|
||||||
if (!forced) {
|
if (!forced) {
|
||||||
const CompletionSettings &completionSettings = m_completionCollector->completionSettings();
|
const CompletionSettings &completionSettings = d->m_completionCollector->completionSettings();
|
||||||
if (completionSettings.m_completionTrigger == ManualCompletion)
|
if (completionSettings.m_completionTrigger == ManualCompletion)
|
||||||
return;
|
return;
|
||||||
if (!m_completionCollector->triggersCompletion(editor))
|
if (!d->m_completionCollector->triggersCompletion(editor))
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
m_startPosition = m_completionCollector->startCompletion(editor);
|
d->m_startPosition = d->m_completionCollector->startCompletion(editor);
|
||||||
completionItems = getCompletions();
|
completionItems = getCompletions();
|
||||||
|
|
||||||
QTC_ASSERT(!(m_startPosition == -1 && completionItems.size() > 0), return);
|
QTC_ASSERT(!(d->m_startPosition == -1 && completionItems.size() > 0), return);
|
||||||
|
|
||||||
if (completionItems.isEmpty()) {
|
if (completionItems.isEmpty()) {
|
||||||
cleanupCompletions();
|
cleanupCompletions();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
m_completionList = new CompletionWidget(this, editor);
|
d->m_completionList = new Internal::CompletionWidget(this, editor);
|
||||||
m_completionList->setQuickFix(quickFix);
|
d->m_completionList->setQuickFix(quickFix);
|
||||||
|
|
||||||
connect(m_completionList, SIGNAL(itemSelected(TextEditor::CompletionItem)),
|
connect(d->m_completionList, SIGNAL(itemSelected(TextEditor::CompletionItem)),
|
||||||
this, SLOT(performCompletion(TextEditor::CompletionItem)));
|
this, SLOT(performCompletion(TextEditor::CompletionItem)));
|
||||||
connect(m_completionList, SIGNAL(completionListClosed()),
|
connect(d->m_completionList, SIGNAL(completionListClosed()),
|
||||||
this, SLOT(cleanupCompletions()));
|
this, SLOT(cleanupCompletions()));
|
||||||
|
|
||||||
// Make sure to clean up the completions if the list is destroyed without
|
// Make sure to clean up the completions if the list is destroyed without
|
||||||
// emitting completionListClosed (can happen when no focus out event is received,
|
// emitting completionListClosed (can happen when no focus out event is received,
|
||||||
// for example when switching applications on the Mac)
|
// for example when switching applications on the Mac)
|
||||||
connect(m_completionList, SIGNAL(destroyed(QObject*)),
|
connect(d->m_completionList, SIGNAL(destroyed(QObject*)),
|
||||||
this, SLOT(cleanupCompletions()));
|
this, SLOT(cleanupCompletions()));
|
||||||
} else {
|
} else {
|
||||||
completionItems = getCompletions();
|
completionItems = getCompletions();
|
||||||
|
|
||||||
if (completionItems.isEmpty()) {
|
if (completionItems.isEmpty()) {
|
||||||
m_completionList->closeList();
|
d->m_completionList->closeList();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (m_completionList->explicitlySelected()) {
|
if (d->m_completionList->explicitlySelected()) {
|
||||||
const int originalIndex = m_completionList->currentCompletionItem().originalIndex;
|
const int originalIndex = d->m_completionList->currentCompletionItem().originalIndex;
|
||||||
|
|
||||||
for (int index = 0; index < completionItems.size(); ++index) {
|
for (int index = 0; index < completionItems.size(); ++index) {
|
||||||
if (completionItems.at(index).originalIndex == originalIndex) {
|
if (completionItems.at(index).originalIndex == originalIndex) {
|
||||||
@@ -185,24 +201,26 @@ void CompletionSupport::autoComplete_helper(ITextEditable *editor, bool forced,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
m_completionList->setCompletionItems(completionItems);
|
d->m_completionList->setCompletionItems(completionItems);
|
||||||
|
|
||||||
if (currentIndex)
|
if (currentIndex)
|
||||||
m_completionList->setCurrentIndex(currentIndex);
|
d->m_completionList->setCurrentIndex(currentIndex);
|
||||||
|
|
||||||
// Partially complete when completion was forced
|
// Partially complete when completion was forced
|
||||||
if (forced && m_completionCollector->partiallyComplete(completionItems)) {
|
if (forced && d->m_completionCollector->partiallyComplete(completionItems)) {
|
||||||
m_checkCompletionTrigger = true;
|
d->m_checkCompletionTrigger = true;
|
||||||
m_completionList->closeList();
|
d->m_completionList->closeList();
|
||||||
} else {
|
} else {
|
||||||
m_completionList->showCompletions(m_startPosition);
|
d->m_completionList->showCompletions(d->m_startPosition);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
QList<CompletionItem> CompletionSupport::getCompletions() const
|
QList<CompletionItem> CompletionSupport::getCompletions() const
|
||||||
{
|
{
|
||||||
if (m_completionCollector)
|
if (d->m_completionCollector)
|
||||||
return m_completionCollector->getCompletions();
|
return d->m_completionCollector->getCompletions();
|
||||||
|
|
||||||
return QList<CompletionItem>();
|
return QList<CompletionItem>();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
} // namespace TextEditor
|
||||||
|
@@ -40,9 +40,7 @@ class CompletionItem;
|
|||||||
class ICompletionCollector;
|
class ICompletionCollector;
|
||||||
class ITextEditable;
|
class ITextEditable;
|
||||||
|
|
||||||
namespace Internal {
|
class CompletionSupportPrivate;
|
||||||
|
|
||||||
class CompletionWidget;
|
|
||||||
|
|
||||||
/* Completion support is responsible for querying the list of completion collectors
|
/* Completion support is responsible for querying the list of completion collectors
|
||||||
and popping up the CompletionWidget with the available completions.
|
and popping up the CompletionWidget with the available completions.
|
||||||
@@ -52,7 +50,7 @@ class TEXTEDITOR_EXPORT CompletionSupport : public QObject
|
|||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
CompletionSupport();
|
virtual ~CompletionSupport();
|
||||||
|
|
||||||
static CompletionSupport *instance();
|
static CompletionSupport *instance();
|
||||||
|
|
||||||
@@ -67,18 +65,14 @@ private slots:
|
|||||||
void cleanupCompletions();
|
void cleanupCompletions();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
CompletionSupport();
|
||||||
|
|
||||||
QList<CompletionItem> getCompletions() const;
|
QList<CompletionItem> getCompletions() const;
|
||||||
void autoComplete_helper(ITextEditable *editor, bool forced, bool quickFix);
|
void autoComplete_helper(ITextEditable *editor, bool forced, bool quickFix);
|
||||||
|
|
||||||
CompletionWidget *m_completionList;
|
QScopedPointer<CompletionSupportPrivate> d;
|
||||||
int m_startPosition;
|
|
||||||
bool m_checkCompletionTrigger; // Whether to check for completion trigger after cleanup
|
|
||||||
ITextEditable *m_editor;
|
|
||||||
QList<ICompletionCollector *> m_completionCollectors;
|
|
||||||
ICompletionCollector *m_completionCollector;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace Internal
|
|
||||||
} // namespace TextEditor
|
} // namespace TextEditor
|
||||||
|
|
||||||
#endif // COMPLETIONSUPPORT_H
|
#endif // COMPLETIONSUPPORT_H
|
||||||
|
@@ -38,11 +38,11 @@ namespace TextEditor {
|
|||||||
|
|
||||||
class CompletionItem;
|
class CompletionItem;
|
||||||
class ITextEditable;
|
class ITextEditable;
|
||||||
|
class CompletionSupport;
|
||||||
|
|
||||||
namespace Internal {
|
namespace Internal {
|
||||||
|
|
||||||
class AutoCompletionModel;
|
class AutoCompletionModel;
|
||||||
class CompletionSupport;
|
|
||||||
class CompletionListView;
|
class CompletionListView;
|
||||||
class CompletionInfoFrame;
|
class CompletionInfoFrame;
|
||||||
|
|
||||||
|
@@ -1,10 +1,42 @@
|
|||||||
#include "refactoroverlay.h"
|
/**************************************************************************
|
||||||
#include <QPainter>
|
**
|
||||||
#include <QTextBlock>
|
** This file is part of Qt Creator
|
||||||
#include "basetextdocumentlayout.h"
|
**
|
||||||
#include <QDebug>
|
** Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
|
||||||
|
**
|
||||||
|
** Contact: Nokia Corporation (qt-info@nokia.com)
|
||||||
|
**
|
||||||
|
** Commercial Usage
|
||||||
|
**
|
||||||
|
** Licensees holding valid Qt Commercial licenses may use this file in
|
||||||
|
** accordance with the Qt Commercial License Agreement provided with the
|
||||||
|
** Software or, alternatively, in accordance with the terms contained in
|
||||||
|
** a written agreement between you and Nokia.
|
||||||
|
**
|
||||||
|
** GNU Lesser General Public License Usage
|
||||||
|
**
|
||||||
|
** Alternatively, this file may be used under the terms of the GNU Lesser
|
||||||
|
** General Public License version 2.1 as published by the Free Software
|
||||||
|
** Foundation and appearing in the file LICENSE.LGPL included in the
|
||||||
|
** packaging of this file. Please review the following information to
|
||||||
|
** ensure the GNU Lesser General Public License version 2.1 requirements
|
||||||
|
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
|
||||||
|
**
|
||||||
|
** If you are unsure which license is appropriate for your use, please
|
||||||
|
** contact the sales department at http://qt.nokia.com/contact.
|
||||||
|
**
|
||||||
|
**************************************************************************/
|
||||||
|
|
||||||
using namespace TextEditor::Internal;
|
#include "refactoroverlay.h"
|
||||||
|
#include "basetextdocumentlayout.h"
|
||||||
|
#include "basetexteditor.h"
|
||||||
|
|
||||||
|
#include <QtGui/QPainter>
|
||||||
|
#include <QtGui/QTextBlock>
|
||||||
|
|
||||||
|
#include <QtCore/QDebug>
|
||||||
|
|
||||||
|
namespace TextEditor {
|
||||||
|
|
||||||
RefactorOverlay::RefactorOverlay(TextEditor::BaseTextEditor *editor) :
|
RefactorOverlay::RefactorOverlay(TextEditor::BaseTextEditor *editor) :
|
||||||
QObject(editor),
|
QObject(editor),
|
||||||
@@ -62,4 +94,4 @@ void RefactorOverlay::paintMarker(const RefactorMarker& marker, QPainter *painte
|
|||||||
m_maxWidth = qMax((qreal)m_maxWidth, x + sz.width() - offset.x());
|
m_maxWidth = qMax((qreal)m_maxWidth, x + sz.width() - offset.x());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
} // namespace TextEditor
|
||||||
|
@@ -1,13 +1,42 @@
|
|||||||
|
/**************************************************************************
|
||||||
|
**
|
||||||
|
** This file is part of Qt Creator
|
||||||
|
**
|
||||||
|
** Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
|
||||||
|
**
|
||||||
|
** Contact: Nokia Corporation (qt-info@nokia.com)
|
||||||
|
**
|
||||||
|
** Commercial Usage
|
||||||
|
**
|
||||||
|
** Licensees holding valid Qt Commercial licenses may use this file in
|
||||||
|
** accordance with the Qt Commercial License Agreement provided with the
|
||||||
|
** Software or, alternatively, in accordance with the terms contained in
|
||||||
|
** a written agreement between you and Nokia.
|
||||||
|
**
|
||||||
|
** GNU Lesser General Public License Usage
|
||||||
|
**
|
||||||
|
** Alternatively, this file may be used under the terms of the GNU Lesser
|
||||||
|
** General Public License version 2.1 as published by the Free Software
|
||||||
|
** Foundation and appearing in the file LICENSE.LGPL included in the
|
||||||
|
** packaging of this file. Please review the following information to
|
||||||
|
** ensure the GNU Lesser General Public License version 2.1 requirements
|
||||||
|
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
|
||||||
|
**
|
||||||
|
** If you are unsure which license is appropriate for your use, please
|
||||||
|
** contact the sales department at http://qt.nokia.com/contact.
|
||||||
|
**
|
||||||
|
**************************************************************************/
|
||||||
|
|
||||||
#ifndef REFACTOROVERLAY_H
|
#ifndef REFACTOROVERLAY_H
|
||||||
#define REFACTOROVERLAY_H
|
#define REFACTOROVERLAY_H
|
||||||
|
|
||||||
#include "basetexteditor.h"
|
#include "texteditor_global.h"
|
||||||
|
|
||||||
#include <QtGui/QTextCursor>
|
#include <QtGui/QTextCursor>
|
||||||
#include <QtGui/QIcon>
|
#include <QtGui/QIcon>
|
||||||
|
|
||||||
namespace TextEditor {
|
namespace TextEditor {
|
||||||
namespace Internal {
|
class BaseTextEditor;
|
||||||
|
|
||||||
struct TEXTEDITOR_EXPORT RefactorMarker {
|
struct TEXTEDITOR_EXPORT RefactorMarker {
|
||||||
inline bool isValid() const { return !cursor.isNull(); }
|
inline bool isValid() const { return !cursor.isNull(); }
|
||||||
@@ -41,11 +70,9 @@ private:
|
|||||||
RefactorMarkers m_markers;
|
RefactorMarkers m_markers;
|
||||||
BaseTextEditor *m_editor;
|
BaseTextEditor *m_editor;
|
||||||
int m_maxWidth;
|
int m_maxWidth;
|
||||||
QIcon m_icon;
|
const QIcon m_icon;
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
} // namespace TextEditor
|
||||||
}
|
|
||||||
|
|
||||||
#endif // REFACTOROVERLAY_H
|
#endif // REFACTOROVERLAY_H
|
||||||
|
@@ -28,6 +28,7 @@
|
|||||||
**************************************************************************/
|
**************************************************************************/
|
||||||
|
|
||||||
#include "texteditoroverlay.h"
|
#include "texteditoroverlay.h"
|
||||||
|
#include "basetexteditor.h"
|
||||||
|
|
||||||
#include <QtGui/QPainter>
|
#include <QtGui/QPainter>
|
||||||
#include <QtGui/QTextBlock>
|
#include <QtGui/QTextBlock>
|
||||||
@@ -35,8 +36,6 @@
|
|||||||
using namespace TextEditor;
|
using namespace TextEditor;
|
||||||
using namespace TextEditor::Internal;
|
using namespace TextEditor::Internal;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
TextEditorOverlay::TextEditorOverlay(BaseTextEditor *editor)
|
TextEditorOverlay::TextEditorOverlay(BaseTextEditor *editor)
|
||||||
:QObject(editor) {
|
:QObject(editor) {
|
||||||
m_visible = false;
|
m_visible = false;
|
||||||
|
@@ -30,13 +30,20 @@
|
|||||||
#ifndef TEXTEDITOROVERLAY_H
|
#ifndef TEXTEDITOROVERLAY_H
|
||||||
#define TEXTEDITOROVERLAY_H
|
#define TEXTEDITOROVERLAY_H
|
||||||
|
|
||||||
#include <QtGui/QWidget>
|
#include <QtCore/QObject>
|
||||||
#include "basetexteditor.h"
|
|
||||||
|
#include <QtGui/QTextCursor>
|
||||||
|
#include <QtGui/QColor>
|
||||||
|
|
||||||
|
QT_FORWARD_DECLARE_CLASS(QWidget)
|
||||||
|
|
||||||
namespace TextEditor {
|
namespace TextEditor {
|
||||||
|
class BaseTextEditor;
|
||||||
|
|
||||||
namespace Internal {
|
namespace Internal {
|
||||||
|
|
||||||
struct TEXTEDITOR_EXPORT OverlaySelection {
|
struct OverlaySelection
|
||||||
|
{
|
||||||
OverlaySelection():m_fixedLength(-1), m_dropShadow(false){}
|
OverlaySelection():m_fixedLength(-1), m_dropShadow(false){}
|
||||||
QTextCursor m_cursor_begin;
|
QTextCursor m_cursor_begin;
|
||||||
QTextCursor m_cursor_end;
|
QTextCursor m_cursor_end;
|
||||||
@@ -44,22 +51,22 @@ struct TEXTEDITOR_EXPORT OverlaySelection {
|
|||||||
QColor m_bg;
|
QColor m_bg;
|
||||||
int m_fixedLength;
|
int m_fixedLength;
|
||||||
bool m_dropShadow;
|
bool m_dropShadow;
|
||||||
};
|
};
|
||||||
|
|
||||||
class TEXTEDITOR_EXPORT TextEditorOverlay : public QObject
|
class TextEditorOverlay : public QObject
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
BaseTextEditor *m_editor;
|
BaseTextEditor *m_editor;
|
||||||
QWidget *m_viewport;
|
QWidget *m_viewport;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
QList<OverlaySelection> m_selections;
|
QList<OverlaySelection> m_selections;
|
||||||
private:
|
|
||||||
|
|
||||||
bool m_visible;
|
private:
|
||||||
int m_borderWidth;
|
bool m_visible;
|
||||||
int m_dropShadowWidth;
|
int m_borderWidth;
|
||||||
bool m_alpha;
|
int m_dropShadowWidth;
|
||||||
|
bool m_alpha;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
TextEditorOverlay(BaseTextEditor *editor);
|
TextEditorOverlay(BaseTextEditor *editor);
|
||||||
@@ -103,7 +110,6 @@ private:
|
|||||||
QPainterPath createSelectionPath(const QTextCursor &begin, const QTextCursor &end, const QRect& clip);
|
QPainterPath createSelectionPath(const QTextCursor &begin, const QTextCursor &end, const QRect& clip);
|
||||||
void paintSelection(QPainter *painter, const OverlaySelection &selection);
|
void paintSelection(QPainter *painter, const OverlaySelection &selection);
|
||||||
void fillSelection(QPainter *painter, const OverlaySelection &selection, const QColor &color);
|
void fillSelection(QPainter *painter, const OverlaySelection &selection, const QColor &color);
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace Internal
|
} // namespace Internal
|
||||||
|
@@ -37,8 +37,6 @@
|
|||||||
#include <QtGui/QDesktopServices>
|
#include <QtGui/QDesktopServices>
|
||||||
#include <QtGui/QTreeWidgetItem>
|
#include <QtGui/QTreeWidgetItem>
|
||||||
|
|
||||||
using namespace Core::Internal;
|
|
||||||
|
|
||||||
struct Site {
|
struct Site {
|
||||||
const char *description;
|
const char *description;
|
||||||
const char *url;
|
const char *url;
|
||||||
@@ -82,7 +80,7 @@ static inline void populateWelcomeTreeWidget(const Site *sites, int count, Utils
|
|||||||
|
|
||||||
CommunityWelcomePageWidget::CommunityWelcomePageWidget(QWidget *parent) :
|
CommunityWelcomePageWidget::CommunityWelcomePageWidget(QWidget *parent) :
|
||||||
QWidget(parent),
|
QWidget(parent),
|
||||||
m_rssFetcher(new RssFetcher(7)),
|
m_rssFetcher(new Core::RssFetcher(7)),
|
||||||
ui(new Ui::CommunityWelcomePageWidget)
|
ui(new Ui::CommunityWelcomePageWidget)
|
||||||
{
|
{
|
||||||
ui->setupUi(this);
|
ui->setupUi(this);
|
||||||
|
@@ -37,9 +37,7 @@ class QUrl;
|
|||||||
QT_END_NAMESPACE
|
QT_END_NAMESPACE
|
||||||
|
|
||||||
namespace Core{
|
namespace Core{
|
||||||
namespace Internal {
|
class RssFetcher;
|
||||||
class RssFetcher;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
namespace Welcome {
|
namespace Welcome {
|
||||||
@@ -65,7 +63,7 @@ private slots:
|
|||||||
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
Core::Internal::RssFetcher *m_rssFetcher;
|
Core::RssFetcher *m_rssFetcher;
|
||||||
Ui::CommunityWelcomePageWidget *ui;
|
Ui::CommunityWelcomePageWidget *ui;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user