forked from qt-creator/qt-creator
EditorManager: Clean up public interface
By moving internally used methods to EditorManagerPrivate Change-Id: I046ce92b8baffe4bcd2ea0529557a3ae69f74338 Reviewed-by: hjk <hjk121@nokiamail.com>
This commit is contained in:
@@ -30,7 +30,7 @@
|
|||||||
#include "readonlyfilesdialog.h"
|
#include "readonlyfilesdialog.h"
|
||||||
#include "ui_readonlyfilesdialog.h"
|
#include "ui_readonlyfilesdialog.h"
|
||||||
|
|
||||||
#include <coreplugin/editormanager/editormanager.h>
|
#include <coreplugin/editormanager/editormanager_p.h>
|
||||||
#include <coreplugin/fileiconprovider.h>
|
#include <coreplugin/fileiconprovider.h>
|
||||||
#include <coreplugin/icore.h>
|
#include <coreplugin/icore.h>
|
||||||
#include <coreplugin/idocument.h>
|
#include <coreplugin/idocument.h>
|
||||||
@@ -275,7 +275,7 @@ int ReadOnlyFilesDialog::exec()
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case RO_SaveAs:
|
case RO_SaveAs:
|
||||||
if (!EditorManager::saveDocumentAs(d->document)) {
|
if (!EditorManagerPrivate::saveDocumentAs(d->document)) {
|
||||||
failedToMakeWritable << buttongroup.fileName;
|
failedToMakeWritable << buttongroup.fileName;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
@@ -37,6 +37,7 @@
|
|||||||
#include <coreplugin/dialogs/readonlyfilesdialog.h>
|
#include <coreplugin/dialogs/readonlyfilesdialog.h>
|
||||||
#include <coreplugin/dialogs/saveitemsdialog.h>
|
#include <coreplugin/dialogs/saveitemsdialog.h>
|
||||||
#include <coreplugin/editormanager/editormanager.h>
|
#include <coreplugin/editormanager/editormanager.h>
|
||||||
|
#include <coreplugin/editormanager/editormanager_p.h>
|
||||||
#include <coreplugin/editormanager/editorview.h>
|
#include <coreplugin/editormanager/editorview.h>
|
||||||
#include <coreplugin/editormanager/ieditor.h>
|
#include <coreplugin/editormanager/ieditor.h>
|
||||||
#include <coreplugin/editormanager/ieditorfactory.h>
|
#include <coreplugin/editormanager/ieditorfactory.h>
|
||||||
@@ -617,7 +618,7 @@ static bool saveModifiedFilesHelper(const QList<IDocument *> &documents,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
foreach (IDocument *document, documentsToSave) {
|
foreach (IDocument *document, documentsToSave) {
|
||||||
if (!EditorManager::saveDocument(document)) {
|
if (!EditorManagerPrivate::saveDocument(document)) {
|
||||||
if (cancelled)
|
if (cancelled)
|
||||||
*cancelled = true;
|
*cancelled = true;
|
||||||
notSaved.append(document);
|
notSaved.append(document);
|
||||||
@@ -913,7 +914,7 @@ void DocumentManager::checkForReload()
|
|||||||
|
|
||||||
d->m_blockActivated = true;
|
d->m_blockActivated = true;
|
||||||
|
|
||||||
IDocument::ReloadSetting defaultBehavior = EditorManager::reloadSetting();
|
IDocument::ReloadSetting defaultBehavior = EditorManagerPrivate::reloadSetting();
|
||||||
Utils::ReloadPromptAnswer previousReloadAnswer = Utils::ReloadCurrent;
|
Utils::ReloadPromptAnswer previousReloadAnswer = Utils::ReloadCurrent;
|
||||||
Utils::FileDeletedPromptAnswer previousDeletedAnswer = Utils::FileDeletedSave;
|
Utils::FileDeletedPromptAnswer previousDeletedAnswer = Utils::FileDeletedSave;
|
||||||
|
|
||||||
@@ -1421,7 +1422,7 @@ void DocumentManager::executeOpenWithMenuAction(QAction *action)
|
|||||||
QList<IEditor *> editorsOpenForFile
|
QList<IEditor *> editorsOpenForFile
|
||||||
= DocumentModel::editorsForFilePath(entry.fileName);
|
= DocumentModel::editorsForFilePath(entry.fileName);
|
||||||
foreach (IEditor *openEditor, editorsOpenForFile) {
|
foreach (IEditor *openEditor, editorsOpenForFile) {
|
||||||
Internal::EditorView *view = EditorManager::viewForEditor(openEditor);
|
Internal::EditorView *view = EditorManagerPrivate::viewForEditor(openEditor);
|
||||||
if (view && view->currentEditor() == openEditor) // visible
|
if (view && view->currentEditor() == openEditor) // visible
|
||||||
views.append(view);
|
views.append(view);
|
||||||
}
|
}
|
||||||
@@ -1431,15 +1432,15 @@ void DocumentManager::executeOpenWithMenuAction(QAction *action)
|
|||||||
if (views.isEmpty()) {
|
if (views.isEmpty()) {
|
||||||
EditorManager::openEditor(entry.fileName, entry.editorFactory->id());
|
EditorManager::openEditor(entry.fileName, entry.editorFactory->id());
|
||||||
} else {
|
} else {
|
||||||
if (Internal::EditorView *currentView = EditorManager::currentEditorView()) {
|
if (Internal::EditorView *currentView = EditorManagerPrivate::currentEditorView()) {
|
||||||
if (views.removeOne(currentView))
|
if (views.removeOne(currentView))
|
||||||
views.prepend(currentView); // open editor in current view first
|
views.prepend(currentView); // open editor in current view first
|
||||||
}
|
}
|
||||||
EditorManager::OpenEditorFlags flags;
|
EditorManager::OpenEditorFlags flags;
|
||||||
foreach (Internal::EditorView *view, views) {
|
foreach (Internal::EditorView *view, views) {
|
||||||
IEditor *editor =
|
IEditor *editor =
|
||||||
EditorManager::openEditor(view, entry.fileName, entry.editorFactory->id(),
|
EditorManagerPrivate::openEditor(view, entry.fileName,
|
||||||
flags);
|
entry.editorFactory->id(), flags);
|
||||||
// Do not change the current editor after opening the first one. That
|
// Do not change the current editor after opening the first one. That
|
||||||
// * prevents multiple updates of focus etc which are not necessary
|
// * prevents multiple updates of focus etc which are not necessary
|
||||||
// * lets us control which editor is made current by putting the current editor view
|
// * lets us control which editor is made current by putting the current editor view
|
||||||
|
File diff suppressed because it is too large
Load Diff
@@ -66,6 +66,7 @@ enum MakeWritableResult {
|
|||||||
|
|
||||||
namespace Internal {
|
namespace Internal {
|
||||||
class EditorClosingCoreListener;
|
class EditorClosingCoreListener;
|
||||||
|
class EditorManagerPrivate;
|
||||||
class EditorView;
|
class EditorView;
|
||||||
class MainWindow;
|
class MainWindow;
|
||||||
class OpenEditorsViewFactory;
|
class OpenEditorsViewFactory;
|
||||||
@@ -115,30 +116,23 @@ public:
|
|||||||
static IEditor *openEditorWithContents(Id editorId, QString *titlePattern = 0,
|
static IEditor *openEditorWithContents(Id editorId, QString *titlePattern = 0,
|
||||||
const QByteArray &contents = QByteArray(),
|
const QByteArray &contents = QByteArray(),
|
||||||
OpenEditorFlags flags = NoFlags);
|
OpenEditorFlags flags = NoFlags);
|
||||||
static IEditor *openEditor(Internal::EditorView *view, const QString &fileName,
|
|
||||||
Id id = Id(), OpenEditorFlags flags = NoFlags, bool *newEditor = 0);
|
|
||||||
|
|
||||||
static bool openExternalEditor(const QString &fileName, Id editorId);
|
static bool openExternalEditor(const QString &fileName, Id editorId);
|
||||||
|
|
||||||
static QStringList getOpenFileNames();
|
static QStringList getOpenFileNames();
|
||||||
static Id getOpenWithEditorId(const QString &fileName, bool *isExternalEditor = 0);
|
|
||||||
|
|
||||||
static IDocument *currentDocument();
|
static IDocument *currentDocument();
|
||||||
static IEditor *currentEditor();
|
static IEditor *currentEditor();
|
||||||
static Internal::EditorView *currentEditorView();
|
|
||||||
static QList<IEditor *> visibleEditors();
|
static QList<IEditor *> visibleEditors();
|
||||||
|
|
||||||
static void activateEditor(IEditor *editor, OpenEditorFlags flags = 0);
|
static void activateEditor(IEditor *editor, OpenEditorFlags flags = 0);
|
||||||
static void activateEditorForEntry(DocumentModel::Entry *entry, OpenEditorFlags flags = 0);
|
static void activateEditorForEntry(DocumentModel::Entry *entry, OpenEditorFlags flags = 0);
|
||||||
static IEditor *activateEditorForDocument(IDocument *document, OpenEditorFlags flags = 0);
|
static IEditor *activateEditorForDocument(IDocument *document, OpenEditorFlags flags = 0);
|
||||||
static IEditor *activateEditorForDocument(Internal::EditorView *view, IDocument *document, OpenEditorFlags flags = 0);
|
|
||||||
|
|
||||||
static bool closeDocuments(const QList<IDocument *> &documents, bool askAboutModifiedEditors = true);
|
static bool closeDocuments(const QList<IDocument *> &documents, bool askAboutModifiedEditors = true);
|
||||||
static void closeEditor(DocumentModel::Entry *entry);
|
static void closeEditor(DocumentModel::Entry *entry);
|
||||||
static void closeOtherEditors(IDocument *document);
|
static void closeOtherEditors(IDocument *document);
|
||||||
|
|
||||||
static Internal::EditorView *viewForEditor(IEditor *editor);
|
|
||||||
|
|
||||||
static void addCurrentPositionToNavigationHistory(IEditor *editor = 0, const QByteArray &saveState = QByteArray());
|
static void addCurrentPositionToNavigationHistory(IEditor *editor = 0, const QByteArray &saveState = QByteArray());
|
||||||
static void cutForwardNavigationHistory();
|
static void cutForwardNavigationHistory();
|
||||||
|
|
||||||
@@ -147,35 +141,19 @@ public:
|
|||||||
static bool closeEditors(const QList<IEditor *> &editorsToClose, bool askAboutModifiedEditors = true);
|
static bool closeEditors(const QList<IEditor *> &editorsToClose, bool askAboutModifiedEditors = true);
|
||||||
static void closeEditor(IEditor *editor, bool askAboutModifiedEditors = true);
|
static void closeEditor(IEditor *editor, bool askAboutModifiedEditors = true);
|
||||||
|
|
||||||
static MakeWritableResult makeFileWritable(IDocument *document);
|
|
||||||
|
|
||||||
static QByteArray saveState();
|
static QByteArray saveState();
|
||||||
static bool restoreState(const QByteArray &state);
|
static bool restoreState(const QByteArray &state);
|
||||||
static bool hasSplitter();
|
static bool hasSplitter();
|
||||||
|
|
||||||
static void saveSettings();
|
|
||||||
static void readSettings();
|
|
||||||
|
|
||||||
static Internal::OpenEditorsWindow *windowPopup();
|
|
||||||
static void showPopupOrSelectDocument();
|
|
||||||
|
|
||||||
static void showEditorStatusBar(const QString &id,
|
static void showEditorStatusBar(const QString &id,
|
||||||
const QString &infoText,
|
const QString &infoText,
|
||||||
const QString &buttonText = QString(),
|
const QString &buttonText = QString(),
|
||||||
QObject *object = 0, const char *member = 0);
|
QObject *object = 0, const char *member = 0);
|
||||||
|
|
||||||
static void hideEditorStatusBar(const QString &id);
|
static void hideEditorStatusBar(const QString &id);
|
||||||
|
|
||||||
static EditorFactoryList editorFactories(const MimeType &mimeType, bool bestMatchOnly = true);
|
static EditorFactoryList editorFactories(const MimeType &mimeType, bool bestMatchOnly = true);
|
||||||
static ExternalEditorList externalEditors(const MimeType &mimeType, bool bestMatchOnly = true);
|
static ExternalEditorList externalEditors(const MimeType &mimeType, bool bestMatchOnly = true);
|
||||||
|
|
||||||
static void setReloadSetting(IDocument::ReloadSetting behavior);
|
|
||||||
static IDocument::ReloadSetting reloadSetting();
|
|
||||||
|
|
||||||
static void setAutoSaveEnabled(bool enabled);
|
|
||||||
static bool autoSaveEnabled();
|
|
||||||
static void setAutoSaveInterval(int interval);
|
|
||||||
static int autoSaveInterval();
|
|
||||||
static bool isAutoSaveFile(const QString &fileName);
|
static bool isAutoSaveFile(const QString &fileName);
|
||||||
|
|
||||||
static QTextCodec *defaultTextCodec();
|
static QTextCodec *defaultTextCodec();
|
||||||
@@ -201,92 +179,22 @@ signals:
|
|||||||
void findOnFileSystemRequest(const QString &path);
|
void findOnFileSystemRequest(const QString &path);
|
||||||
|
|
||||||
public slots:
|
public slots:
|
||||||
static bool closeAllEditors(bool askAboutModifiedEditors = true);
|
static void saveDocument();
|
||||||
static void closeAllEditorsExceptVisible();
|
static void saveDocumentAs();
|
||||||
|
|
||||||
static bool saveDocument(Core::IDocument *documentParam = 0);
|
|
||||||
static bool saveDocumentAs(Core::IDocument *documentParam = 0);
|
|
||||||
static void revertToSaved();
|
static void revertToSaved();
|
||||||
static void revertToSaved(IDocument *document);
|
static bool closeAllEditors(bool askAboutModifiedEditors = true);
|
||||||
static void closeEditor();
|
static void closeEditor();
|
||||||
static void closeOtherEditors();
|
static void closeOtherEditors();
|
||||||
static void doEscapeKeyFocusMoveMagic();
|
static void splitSideBySide();
|
||||||
|
static void gotoOtherSplit();
|
||||||
private slots:
|
|
||||||
static void gotoNextDocHistory();
|
|
||||||
static void gotoPreviousDocHistory();
|
|
||||||
static void handleContextChange(const QList<Core::IContext *> &context);
|
|
||||||
static void updateActions();
|
|
||||||
static void makeCurrentEditorWritable();
|
|
||||||
static void vcsOpenCurrentEditor();
|
|
||||||
static void updateWindowTitle();
|
|
||||||
void handleDocumentStateChange();
|
|
||||||
static void autoSave();
|
|
||||||
|
|
||||||
static void saveDocumentFromContextMenu();
|
|
||||||
static void saveDocumentAsFromContextMenu();
|
|
||||||
static void revertToSavedFromContextMenu();
|
|
||||||
|
|
||||||
static void closeEditorFromContextMenu();
|
|
||||||
static void closeOtherEditorsFromContextMenu();
|
|
||||||
|
|
||||||
static void showInGraphicalShell();
|
|
||||||
static void openTerminal();
|
|
||||||
static void findInDirectory();
|
|
||||||
|
|
||||||
static void rootDestroyed(QObject *root);
|
|
||||||
static void setCurrentEditorFromContextChange();
|
|
||||||
|
|
||||||
static void gotoNextSplit();
|
|
||||||
|
|
||||||
public slots:
|
|
||||||
static void goBackInNavigationHistory();
|
static void goBackInNavigationHistory();
|
||||||
static void goForwardInNavigationHistory();
|
static void goForwardInNavigationHistory();
|
||||||
static void split(Qt::Orientation orientation);
|
|
||||||
static void split();
|
|
||||||
static void splitSideBySide();
|
|
||||||
static void splitNewWindow();
|
|
||||||
static void removeCurrentSplit();
|
|
||||||
static void removeAllSplits();
|
|
||||||
static void gotoOtherSplit();
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
explicit EditorManager(QObject *parent);
|
explicit EditorManager(QObject *parent);
|
||||||
~EditorManager();
|
~EditorManager();
|
||||||
static void init();
|
|
||||||
|
|
||||||
static IEditor *createEditor(Id id = Id(), const QString &fileName = QString());
|
|
||||||
static void addEditor(IEditor *editor);
|
|
||||||
static void removeEditor(IEditor *editor);
|
|
||||||
|
|
||||||
static void restoreEditorState(IEditor *editor);
|
|
||||||
|
|
||||||
static IEditor *placeEditor(Internal::EditorView *view, IEditor *editor);
|
|
||||||
static IEditor *duplicateEditor(IEditor *editor);
|
|
||||||
static IEditor *activateEditor(Internal::EditorView *view, IEditor *editor, OpenEditorFlags flags = NoFlags);
|
|
||||||
static void activateEditorForEntry(Internal::EditorView *view, DocumentModel::Entry *entry,
|
|
||||||
OpenEditorFlags flags = NoFlags);
|
|
||||||
static void activateView(Internal::EditorView *view);
|
|
||||||
static int visibleDocumentsCount();
|
|
||||||
|
|
||||||
static void setCurrentEditor(IEditor *editor, bool ignoreNavigationHistory = false);
|
|
||||||
static void setCurrentView(Internal::EditorView *view);
|
|
||||||
static Internal::SplitterOrView *findRoot(const Internal::EditorView *view, int *rootIndex = 0);
|
|
||||||
|
|
||||||
static void closeView(Internal::EditorView *view);
|
|
||||||
static void emptyView(Internal::EditorView *view);
|
|
||||||
static void splitNewWindow(Internal::EditorView *view);
|
|
||||||
static IEditor *pickUnusedEditor(Internal::EditorView **foundView = 0);
|
|
||||||
static void addDocumentToRecentFiles(IDocument *document);
|
|
||||||
static void updateAutoSave();
|
|
||||||
static void setCloseSplitEnabled(Internal::SplitterOrView *splitterOrView, bool enable);
|
|
||||||
static void updateMakeWritableWarning();
|
|
||||||
static void setupSaveActions(IDocument *document, QAction *saveAction, QAction *saveAsAction, QAction *revertToSavedAction);
|
|
||||||
|
|
||||||
friend class Core::Internal::MainWindow;
|
friend class Core::Internal::MainWindow;
|
||||||
friend class Core::Internal::SplitterOrView;
|
|
||||||
friend class Core::Internal::EditorView;
|
|
||||||
friend class Core::EditorToolBar;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace Core
|
} // namespace Core
|
||||||
|
@@ -32,10 +32,12 @@
|
|||||||
|
|
||||||
#include "idocument.h"
|
#include "idocument.h"
|
||||||
#include "documentmodel.h"
|
#include "documentmodel.h"
|
||||||
|
#include "editormanager.h"
|
||||||
#include "editorview.h"
|
#include "editorview.h"
|
||||||
#include "ieditor.h"
|
#include "ieditor.h"
|
||||||
|
|
||||||
#include <QList>
|
#include <QList>
|
||||||
|
#include <QObject>
|
||||||
#include <QPointer>
|
#include <QPointer>
|
||||||
#include <QString>
|
#include <QString>
|
||||||
#include <QVariant>
|
#include <QVariant>
|
||||||
@@ -46,19 +48,125 @@ class QTimer;
|
|||||||
QT_END_NAMESPACE
|
QT_END_NAMESPACE
|
||||||
|
|
||||||
namespace Core {
|
namespace Core {
|
||||||
|
|
||||||
|
class EditorManager;
|
||||||
|
|
||||||
namespace Internal {
|
namespace Internal {
|
||||||
|
|
||||||
class EditorClosingCoreListener;
|
class EditorClosingCoreListener;
|
||||||
|
class MainWindow;
|
||||||
class OpenEditorsViewFactory;
|
class OpenEditorsViewFactory;
|
||||||
class OpenEditorsWindow;
|
class OpenEditorsWindow;
|
||||||
|
|
||||||
class EditorManagerPrivate
|
class EditorManagerPrivate : public QObject
|
||||||
{
|
{
|
||||||
|
Q_OBJECT
|
||||||
|
|
||||||
|
friend class Core::EditorManager;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
static QWidget *rootWidget();
|
||||||
|
static EditorView *currentEditorView();
|
||||||
|
static void setCurrentEditor(IEditor *editor, bool ignoreNavigationHistory = false);
|
||||||
|
static IEditor *openEditor(EditorView *view,
|
||||||
|
const QString &fileName,
|
||||||
|
Id editorId = Id(),
|
||||||
|
EditorManager::OpenEditorFlags flags = EditorManager::NoFlags,
|
||||||
|
bool *newEditor = 0);
|
||||||
|
static IEditor *duplicateEditor(IEditor *editor);
|
||||||
|
static IEditor *activateEditor(EditorView *view, IEditor *editor,
|
||||||
|
EditorManager::OpenEditorFlags flags = EditorManager::NoFlags);
|
||||||
|
static IEditor *activateEditorForDocument(EditorView *view, IDocument *document,
|
||||||
|
EditorManager::OpenEditorFlags flags = 0);
|
||||||
|
static void activateEditorForEntry(EditorView *view, DocumentModel::Entry *entry,
|
||||||
|
EditorManager::OpenEditorFlags flags = EditorManager::NoFlags);
|
||||||
|
static EditorView *viewForEditor(IEditor *editor);
|
||||||
|
static void setCurrentView(EditorView *view);
|
||||||
|
|
||||||
|
static MakeWritableResult makeFileWritable(IDocument *document);
|
||||||
|
static void doEscapeKeyFocusMoveMagic();
|
||||||
|
|
||||||
|
static Id getOpenWithEditorId(const QString &fileName, bool *isExternalEditor = 0);
|
||||||
|
|
||||||
|
static void saveSettings();
|
||||||
|
static void readSettings();
|
||||||
|
static void setReloadSetting(IDocument::ReloadSetting behavior);
|
||||||
|
static IDocument::ReloadSetting reloadSetting();
|
||||||
|
static void setAutoSaveEnabled(bool enabled);
|
||||||
|
static bool autoSaveEnabled();
|
||||||
|
static void setAutoSaveInterval(int interval);
|
||||||
|
static int autoSaveInterval();
|
||||||
|
|
||||||
|
static void splitNewWindow(Internal::EditorView *view);
|
||||||
|
static void closeView(Internal::EditorView *view);
|
||||||
|
static void emptyView(Internal::EditorView *view);
|
||||||
|
|
||||||
|
static void updateActions();
|
||||||
|
|
||||||
|
public slots:
|
||||||
|
static bool saveDocument(Core::IDocument *document);
|
||||||
|
static bool saveDocumentAs(Core::IDocument *document);
|
||||||
|
static void makeCurrentEditorWritable();
|
||||||
|
static void vcsOpenCurrentEditor();
|
||||||
|
|
||||||
|
static void split(Qt::Orientation orientation);
|
||||||
|
static void removeAllSplits();
|
||||||
|
static void gotoNextSplit();
|
||||||
|
|
||||||
|
void handleDocumentStateChange();
|
||||||
|
static void rootDestroyed(QObject *root);
|
||||||
|
|
||||||
|
private slots:
|
||||||
|
static void gotoNextDocHistory();
|
||||||
|
static void gotoPreviousDocHistory();
|
||||||
|
|
||||||
|
static void autoSave();
|
||||||
|
static void handleContextChange(const QList<Core::IContext *> &context);
|
||||||
|
|
||||||
|
static void saveDocumentFromContextMenu();
|
||||||
|
static void saveDocumentAsFromContextMenu();
|
||||||
|
static void revertToSavedFromContextMenu();
|
||||||
|
static void closeEditorFromContextMenu();
|
||||||
|
static void closeOtherEditorsFromContextMenu();
|
||||||
|
|
||||||
|
static void closeAllEditorsExceptVisible();
|
||||||
|
static void revertToSaved(IDocument *document);
|
||||||
|
|
||||||
|
static void showInGraphicalShell();
|
||||||
|
static void openTerminal();
|
||||||
|
static void findInDirectory();
|
||||||
|
|
||||||
|
static void split();
|
||||||
|
static void splitNewWindow();
|
||||||
|
static void removeCurrentSplit();
|
||||||
|
|
||||||
|
static void setCurrentEditorFromContextChange();
|
||||||
|
|
||||||
|
private:
|
||||||
|
static OpenEditorsWindow *windowPopup();
|
||||||
|
static void showPopupOrSelectDocument();
|
||||||
|
|
||||||
|
static IEditor *createEditor(Id editorId = Id(), const QString &fileName = QString());
|
||||||
|
static void addEditor(IEditor *editor);
|
||||||
|
static void removeEditor(IEditor *editor);
|
||||||
|
static IEditor *placeEditor(EditorView *view, IEditor *editor);
|
||||||
|
static void activateView(EditorView *view);
|
||||||
|
static void restoreEditorState(IEditor *editor);
|
||||||
|
static int visibleDocumentsCount();
|
||||||
|
static SplitterOrView *findRoot(const EditorView *view, int *rootIndex = 0);
|
||||||
|
static IEditor *pickUnusedEditor(Internal::EditorView **foundView = 0);
|
||||||
|
static void addDocumentToRecentFiles(IDocument *document);
|
||||||
|
static void updateAutoSave();
|
||||||
|
static void setCloseSplitEnabled(Internal::SplitterOrView *splitterOrView, bool enable);
|
||||||
|
static void updateMakeWritableWarning();
|
||||||
|
static void setupSaveActions(IDocument *document, QAction *saveAction,
|
||||||
|
QAction *saveAsAction, QAction *revertToSavedAction);
|
||||||
|
static void updateWindowTitle();
|
||||||
|
|
||||||
|
private:
|
||||||
explicit EditorManagerPrivate(QObject *parent);
|
explicit EditorManagerPrivate(QObject *parent);
|
||||||
~EditorManagerPrivate();
|
~EditorManagerPrivate();
|
||||||
|
void init();
|
||||||
static QWidget *rootWidget();
|
|
||||||
|
|
||||||
QList<EditLocation> m_globalHistory;
|
QList<EditLocation> m_globalHistory;
|
||||||
QList<SplitterOrView *> m_root;
|
QList<SplitterOrView *> m_root;
|
||||||
|
@@ -28,7 +28,9 @@
|
|||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
#include "editorview.h"
|
#include "editorview.h"
|
||||||
|
|
||||||
#include "editormanager.h"
|
#include "editormanager.h"
|
||||||
|
#include "editormanager_p.h"
|
||||||
#include "documentmodel.h"
|
#include "documentmodel.h"
|
||||||
|
|
||||||
#include <coreplugin/editortoolbar.h>
|
#include <coreplugin/editortoolbar.h>
|
||||||
@@ -229,7 +231,7 @@ void EditorView::updateEditorHistory(IEditor *editor, QList<EditLocation> &histo
|
|||||||
|
|
||||||
void EditorView::paintEvent(QPaintEvent *)
|
void EditorView::paintEvent(QPaintEvent *)
|
||||||
{
|
{
|
||||||
EditorView *editorView = EditorManager::currentEditorView();
|
EditorView *editorView = EditorManagerPrivate::currentEditorView();
|
||||||
if (editorView != this)
|
if (editorView != this)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
@@ -254,7 +256,7 @@ void EditorView::mousePressEvent(QMouseEvent *e)
|
|||||||
|
|
||||||
void EditorView::focusInEvent(QFocusEvent *)
|
void EditorView::focusInEvent(QFocusEvent *)
|
||||||
{
|
{
|
||||||
EditorManager::setCurrentView(this);
|
EditorManagerPrivate::setCurrentView(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
void EditorView::addEditor(IEditor *editor)
|
void EditorView::addEditor(IEditor *editor)
|
||||||
@@ -306,39 +308,39 @@ IEditor *EditorView::currentEditor() const
|
|||||||
|
|
||||||
void EditorView::listSelectionActivated(int index)
|
void EditorView::listSelectionActivated(int index)
|
||||||
{
|
{
|
||||||
EditorManager::activateEditorForEntry(this, DocumentModel::entryAtRow(index));
|
EditorManagerPrivate::activateEditorForEntry(this, DocumentModel::entryAtRow(index));
|
||||||
}
|
}
|
||||||
|
|
||||||
void EditorView::splitHorizontally()
|
void EditorView::splitHorizontally()
|
||||||
{
|
{
|
||||||
if (m_parentSplitterOrView)
|
if (m_parentSplitterOrView)
|
||||||
m_parentSplitterOrView->split(Qt::Vertical);
|
m_parentSplitterOrView->split(Qt::Vertical);
|
||||||
EditorManager::updateActions();
|
EditorManagerPrivate::updateActions();
|
||||||
}
|
}
|
||||||
|
|
||||||
void EditorView::splitVertically()
|
void EditorView::splitVertically()
|
||||||
{
|
{
|
||||||
if (m_parentSplitterOrView)
|
if (m_parentSplitterOrView)
|
||||||
m_parentSplitterOrView->split(Qt::Horizontal);
|
m_parentSplitterOrView->split(Qt::Horizontal);
|
||||||
EditorManager::updateActions();
|
EditorManagerPrivate::updateActions();
|
||||||
}
|
}
|
||||||
|
|
||||||
void EditorView::splitNewWindow()
|
void EditorView::splitNewWindow()
|
||||||
{
|
{
|
||||||
EditorManager::splitNewWindow(this);
|
EditorManagerPrivate::splitNewWindow(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
void EditorView::closeSplit()
|
void EditorView::closeSplit()
|
||||||
{
|
{
|
||||||
EditorManager::closeView(this);
|
EditorManagerPrivate::closeView(this);
|
||||||
EditorManager::updateActions();
|
EditorManagerPrivate::updateActions();
|
||||||
}
|
}
|
||||||
|
|
||||||
void EditorView::openDroppedFiles(const QStringList &files)
|
void EditorView::openDroppedFiles(const QStringList &files)
|
||||||
{
|
{
|
||||||
const int count = files.size();
|
const int count = files.size();
|
||||||
for (int i = 0; i < count; ++i) {
|
for (int i = 0; i < count; ++i) {
|
||||||
EditorManager::openEditor(this, files.at(i), Id(),
|
EditorManagerPrivate::openEditor(this, files.at(i), Id(),
|
||||||
i < count - 1 ? EditorManager::DoNotChangeCurrentEditor
|
i < count - 1 ? EditorManager::DoNotChangeCurrentEditor
|
||||||
| EditorManager::DoNotMakeVisible
|
| EditorManager::DoNotMakeVisible
|
||||||
: EditorManager::NoFlags);
|
: EditorManager::NoFlags);
|
||||||
@@ -486,11 +488,11 @@ void EditorView::goBackInNavigationHistory()
|
|||||||
EditLocation location = m_navigationHistory.at(m_currentNavigationHistoryPosition);
|
EditLocation location = m_navigationHistory.at(m_currentNavigationHistoryPosition);
|
||||||
IEditor *editor = 0;
|
IEditor *editor = 0;
|
||||||
if (location.document) {
|
if (location.document) {
|
||||||
editor = EditorManager::activateEditorForDocument(this, location.document,
|
editor = EditorManagerPrivate::activateEditorForDocument(this, location.document,
|
||||||
EditorManager::IgnoreNavigationHistory);
|
EditorManager::IgnoreNavigationHistory);
|
||||||
}
|
}
|
||||||
if (!editor) {
|
if (!editor) {
|
||||||
editor = EditorManager::openEditor(this, location.fileName, location.id,
|
editor = EditorManagerPrivate::openEditor(this, location.fileName, location.id,
|
||||||
EditorManager::IgnoreNavigationHistory);
|
EditorManager::IgnoreNavigationHistory);
|
||||||
if (!editor) {
|
if (!editor) {
|
||||||
m_navigationHistory.removeAt(m_currentNavigationHistoryPosition);
|
m_navigationHistory.removeAt(m_currentNavigationHistoryPosition);
|
||||||
@@ -512,11 +514,12 @@ void EditorView::goForwardInNavigationHistory()
|
|||||||
EditLocation location = m_navigationHistory.at(m_currentNavigationHistoryPosition);
|
EditLocation location = m_navigationHistory.at(m_currentNavigationHistoryPosition);
|
||||||
IEditor *editor = 0;
|
IEditor *editor = 0;
|
||||||
if (location.document) {
|
if (location.document) {
|
||||||
editor = EditorManager::activateEditorForDocument(this, location.document,
|
editor = EditorManagerPrivate::activateEditorForDocument(this, location.document,
|
||||||
EditorManager::IgnoreNavigationHistory);
|
EditorManager::IgnoreNavigationHistory);
|
||||||
}
|
}
|
||||||
if (!editor) {
|
if (!editor) {
|
||||||
editor = EditorManager::openEditor(this, location.fileName, location.id, EditorManager::IgnoreNavigationHistory);
|
editor = EditorManagerPrivate::openEditor(this, location.fileName, location.id,
|
||||||
|
EditorManager::IgnoreNavigationHistory);
|
||||||
if (!editor) {
|
if (!editor) {
|
||||||
//TODO
|
//TODO
|
||||||
qDebug() << Q_FUNC_INFO << "can't open file" << location.fileName;
|
qDebug() << Q_FUNC_INFO << "can't open file" << location.fileName;
|
||||||
@@ -555,7 +558,7 @@ SplitterOrView::~SplitterOrView()
|
|||||||
delete m_layout;
|
delete m_layout;
|
||||||
m_layout = 0;
|
m_layout = 0;
|
||||||
if (m_view)
|
if (m_view)
|
||||||
EditorManager::emptyView(m_view);
|
EditorManagerPrivate::emptyView(m_view);
|
||||||
delete m_view;
|
delete m_view;
|
||||||
m_view = 0;
|
m_view = 0;
|
||||||
delete m_splitter;
|
delete m_splitter;
|
||||||
@@ -630,7 +633,7 @@ void SplitterOrView::split(Qt::Orientation orientation)
|
|||||||
|
|
||||||
SplitterOrView *view = 0;
|
SplitterOrView *view = 0;
|
||||||
SplitterOrView *otherView = 0;
|
SplitterOrView *otherView = 0;
|
||||||
IEditor *duplicate = e && e->duplicateSupported() ? EditorManager::duplicateEditor(e) : 0;
|
IEditor *duplicate = e && e->duplicateSupported() ? EditorManagerPrivate::duplicateEditor(e) : 0;
|
||||||
m_splitter->addWidget((view = new SplitterOrView(duplicate)));
|
m_splitter->addWidget((view = new SplitterOrView(duplicate)));
|
||||||
m_splitter->addWidget((otherView = new SplitterOrView(editorView)));
|
m_splitter->addWidget((otherView = new SplitterOrView(editorView)));
|
||||||
|
|
||||||
@@ -648,9 +651,9 @@ void SplitterOrView::split(Qt::Orientation orientation)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (e)
|
if (e)
|
||||||
EditorManager::activateEditor(otherView->view(), e);
|
EditorManagerPrivate::activateEditor(otherView->view(), e);
|
||||||
else
|
else
|
||||||
EditorManager::setCurrentView(otherView->view());
|
EditorManagerPrivate::setCurrentView(otherView->view());
|
||||||
}
|
}
|
||||||
|
|
||||||
void SplitterOrView::unsplitAll()
|
void SplitterOrView::unsplitAll()
|
||||||
@@ -665,7 +668,7 @@ void SplitterOrView::unsplitAll()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
EditorView *currentView = EditorManager::currentEditorView();
|
EditorView *currentView = EditorManagerPrivate::currentEditorView();
|
||||||
if (currentView) {
|
if (currentView) {
|
||||||
currentView->parentSplitterOrView()->takeView();
|
currentView->parentSplitterOrView()->takeView();
|
||||||
currentView->setParentSplitterOrView(this);
|
currentView->setParentSplitterOrView(this);
|
||||||
@@ -692,7 +695,7 @@ void SplitterOrView::unsplitAll()
|
|||||||
void SplitterOrView::unsplitAll_helper()
|
void SplitterOrView::unsplitAll_helper()
|
||||||
{
|
{
|
||||||
if (m_view)
|
if (m_view)
|
||||||
EditorManager::emptyView(m_view);
|
EditorManagerPrivate::emptyView(m_view);
|
||||||
if (m_splitter) {
|
if (m_splitter) {
|
||||||
for (int i = 0; i < m_splitter->count(); ++i) {
|
for (int i = 0; i < m_splitter->count(); ++i) {
|
||||||
if (SplitterOrView *splitterOrView = qobject_cast<SplitterOrView*>(m_splitter->widget(i)))
|
if (SplitterOrView *splitterOrView = qobject_cast<SplitterOrView*>(m_splitter->widget(i)))
|
||||||
@@ -726,7 +729,7 @@ void SplitterOrView::unsplit()
|
|||||||
m_view->addEditor(e);
|
m_view->addEditor(e);
|
||||||
m_view->setCurrentEditor(e);
|
m_view->setCurrentEditor(e);
|
||||||
}
|
}
|
||||||
EditorManager::emptyView(childView);
|
EditorManagerPrivate::emptyView(childView);
|
||||||
} else {
|
} else {
|
||||||
m_view = childSplitterOrView->takeView();
|
m_view = childSplitterOrView->takeView();
|
||||||
m_view->setParentSplitterOrView(this);
|
m_view->setParentSplitterOrView(this);
|
||||||
@@ -749,7 +752,7 @@ void SplitterOrView::unsplit()
|
|||||||
m_layout->setCurrentWidget(m_view);
|
m_layout->setCurrentWidget(m_view);
|
||||||
}
|
}
|
||||||
delete oldSplitter;
|
delete oldSplitter;
|
||||||
EditorManager::setCurrentView(findFirstView());
|
EditorManagerPrivate::setCurrentView(findFirstView());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -812,20 +815,22 @@ void SplitterOrView::restoreState(const QByteArray &state)
|
|||||||
stream >> fileName >> id >> editorState;
|
stream >> fileName >> id >> editorState;
|
||||||
if (!QFile::exists(fileName))
|
if (!QFile::exists(fileName))
|
||||||
return;
|
return;
|
||||||
IEditor *e = EditorManager::openEditor(view(), fileName, Id::fromString(id), Core::EditorManager::IgnoreNavigationHistory
|
IEditor *e = EditorManagerPrivate::openEditor(view(), fileName, Id::fromString(id),
|
||||||
|
Core::EditorManager::IgnoreNavigationHistory
|
||||||
| Core::EditorManager::DoNotChangeCurrentEditor);
|
| Core::EditorManager::DoNotChangeCurrentEditor);
|
||||||
|
|
||||||
if (!e) {
|
if (!e) {
|
||||||
DocumentModel::Entry *entry = DocumentModel::firstRestoredEntry();
|
DocumentModel::Entry *entry = DocumentModel::firstRestoredEntry();
|
||||||
if (entry)
|
if (entry) {
|
||||||
EditorManager::activateEditorForEntry(view(), entry, Core::EditorManager::IgnoreNavigationHistory
|
EditorManagerPrivate::activateEditorForEntry(view(), entry,
|
||||||
| Core::EditorManager::DoNotChangeCurrentEditor);
|
EditorManager::IgnoreNavigationHistory | EditorManager::DoNotChangeCurrentEditor);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (e) {
|
if (e) {
|
||||||
e->restoreState(editorState);
|
e->restoreState(editorState);
|
||||||
if (mode == "currenteditor")
|
if (mode == "currenteditor")
|
||||||
EditorManager::setCurrentEditor(e);
|
EditorManagerPrivate::setCurrentEditor(e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -28,8 +28,10 @@
|
|||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
#include "openeditorswindow.h"
|
#include "openeditorswindow.h"
|
||||||
|
|
||||||
#include "documentmodel.h"
|
#include "documentmodel.h"
|
||||||
#include "editormanager.h"
|
#include "editormanager.h"
|
||||||
|
#include "editormanager_p.h"
|
||||||
#include "editorview.h"
|
#include "editorview.h"
|
||||||
#include <coreplugin/idocument.h>
|
#include <coreplugin/idocument.h>
|
||||||
|
|
||||||
@@ -196,7 +198,7 @@ void OpenEditorsWindow::selectEditor(QTreeWidgetItem *item)
|
|||||||
return;
|
return;
|
||||||
if (IDocument *document = item->data(0, Qt::UserRole).value<IDocument*>()) {
|
if (IDocument *document = item->data(0, Qt::UserRole).value<IDocument*>()) {
|
||||||
EditorView *view = item->data(0, Qt::UserRole+1).value<EditorView*>();
|
EditorView *view = item->data(0, Qt::UserRole+1).value<EditorView*>();
|
||||||
EditorManager::activateEditorForDocument(view, document);
|
EditorManagerPrivate::activateEditorForDocument(view, document);
|
||||||
} else {
|
} else {
|
||||||
if (!EditorManager::openEditor(
|
if (!EditorManager::openEditor(
|
||||||
item->toolTip(0), item->data(0, Qt::UserRole+2).value<Core::Id>())) {
|
item->toolTip(0), item->data(0, Qt::UserRole+2).value<Core::Id>())) {
|
||||||
|
@@ -34,6 +34,7 @@
|
|||||||
#include <coreplugin/icore.h>
|
#include <coreplugin/icore.h>
|
||||||
|
|
||||||
#include <coreplugin/editormanager/editormanager.h>
|
#include <coreplugin/editormanager/editormanager.h>
|
||||||
|
#include <coreplugin/editormanager/editormanager_p.h>
|
||||||
#include <coreplugin/editormanager/documentmodel.h>
|
#include <coreplugin/editormanager/documentmodel.h>
|
||||||
#include <coreplugin/actionmanager/actionmanager.h>
|
#include <coreplugin/actionmanager/actionmanager.h>
|
||||||
|
|
||||||
@@ -339,7 +340,7 @@ void EditorToolBar::listContextMenu(QPoint pos)
|
|||||||
void EditorToolBar::makeEditorWritable()
|
void EditorToolBar::makeEditorWritable()
|
||||||
{
|
{
|
||||||
if (IDocument *current = EditorManager::currentDocument())
|
if (IDocument *current = EditorManager::currentDocument())
|
||||||
EditorManager::makeFileWritable(current);
|
Internal::EditorManagerPrivate::makeFileWritable(current);
|
||||||
}
|
}
|
||||||
|
|
||||||
void EditorToolBar::setCanGoBack(bool canGoBack)
|
void EditorToolBar::setCanGoBack(bool canGoBack)
|
||||||
|
@@ -33,7 +33,7 @@
|
|||||||
#include "infobar.h"
|
#include "infobar.h"
|
||||||
#include "patchtool.h"
|
#include "patchtool.h"
|
||||||
#include "vcsmanager.h"
|
#include "vcsmanager.h"
|
||||||
#include "editormanager/editormanager.h"
|
#include "editormanager/editormanager_p.h"
|
||||||
|
|
||||||
#include <utils/checkablemessagebox.h>
|
#include <utils/checkablemessagebox.h>
|
||||||
#include <utils/consoleprocess.h>
|
#include <utils/consoleprocess.h>
|
||||||
@@ -113,7 +113,7 @@ QWidget *GeneralSettings::widget()
|
|||||||
fillLanguageBox();
|
fillLanguageBox();
|
||||||
|
|
||||||
m_page->colorButton->setColor(StyleHelper::requestedBaseColor());
|
m_page->colorButton->setColor(StyleHelper::requestedBaseColor());
|
||||||
m_page->reloadBehavior->setCurrentIndex(EditorManager::reloadSetting());
|
m_page->reloadBehavior->setCurrentIndex(EditorManagerPrivate::reloadSetting());
|
||||||
if (HostOsInfo::isAnyUnixHost()) {
|
if (HostOsInfo::isAnyUnixHost()) {
|
||||||
const QStringList availableTerminals = ConsoleProcess::availableTerminalEmulators();
|
const QStringList availableTerminals = ConsoleProcess::availableTerminalEmulators();
|
||||||
const QString currentTerminal = ConsoleProcess::terminalEmulator(ICore::settings(), false);
|
const QString currentTerminal = ConsoleProcess::terminalEmulator(ICore::settings(), false);
|
||||||
@@ -141,8 +141,8 @@ QWidget *GeneralSettings::widget()
|
|||||||
m_page->patchChooser->setExpectedKind(PathChooser::ExistingCommand);
|
m_page->patchChooser->setExpectedKind(PathChooser::ExistingCommand);
|
||||||
m_page->patchChooser->setHistoryCompleter(QLatin1String("General.PatchCommand.History"));
|
m_page->patchChooser->setHistoryCompleter(QLatin1String("General.PatchCommand.History"));
|
||||||
m_page->patchChooser->setPath(PatchTool::patchCommand());
|
m_page->patchChooser->setPath(PatchTool::patchCommand());
|
||||||
m_page->autoSaveCheckBox->setChecked(EditorManager::autoSaveEnabled());
|
m_page->autoSaveCheckBox->setChecked(EditorManagerPrivate::autoSaveEnabled());
|
||||||
m_page->autoSaveInterval->setValue(EditorManager::autoSaveInterval());
|
m_page->autoSaveInterval->setValue(EditorManagerPrivate::autoSaveInterval());
|
||||||
m_page->resetWarningsButton->setEnabled(InfoBar::anyGloballySuppressed()
|
m_page->resetWarningsButton->setEnabled(InfoBar::anyGloballySuppressed()
|
||||||
|| CheckableMessageBox::hasSuppressedQuestions(ICore::settings()));
|
|| CheckableMessageBox::hasSuppressedQuestions(ICore::settings()));
|
||||||
|
|
||||||
@@ -175,7 +175,7 @@ void GeneralSettings::apply()
|
|||||||
setLanguage(m_page->languageBox->itemData(currentIndex, Qt::UserRole).toString());
|
setLanguage(m_page->languageBox->itemData(currentIndex, Qt::UserRole).toString());
|
||||||
// Apply the new base color if accepted
|
// Apply the new base color if accepted
|
||||||
StyleHelper::setBaseColor(m_page->colorButton->color());
|
StyleHelper::setBaseColor(m_page->colorButton->color());
|
||||||
EditorManager::setReloadSetting(IDocument::ReloadSetting(m_page->reloadBehavior->currentIndex()));
|
EditorManagerPrivate::setReloadSetting(IDocument::ReloadSetting(m_page->reloadBehavior->currentIndex()));
|
||||||
if (HostOsInfo::isAnyUnixHost()) {
|
if (HostOsInfo::isAnyUnixHost()) {
|
||||||
ConsoleProcess::setTerminalEmulator(ICore::settings(),
|
ConsoleProcess::setTerminalEmulator(ICore::settings(),
|
||||||
m_page->terminalComboBox->lineEdit()->text());
|
m_page->terminalComboBox->lineEdit()->text());
|
||||||
@@ -185,8 +185,8 @@ void GeneralSettings::apply()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
PatchTool::setPatchCommand(m_page->patchChooser->path());
|
PatchTool::setPatchCommand(m_page->patchChooser->path());
|
||||||
EditorManager::setAutoSaveEnabled(m_page->autoSaveCheckBox->isChecked());
|
EditorManagerPrivate::setAutoSaveEnabled(m_page->autoSaveCheckBox->isChecked());
|
||||||
EditorManager::setAutoSaveInterval(m_page->autoSaveInterval->value());
|
EditorManagerPrivate::setAutoSaveInterval(m_page->autoSaveInterval->value());
|
||||||
}
|
}
|
||||||
|
|
||||||
void GeneralSettings::finish()
|
void GeneralSettings::finish()
|
||||||
|
@@ -65,6 +65,7 @@
|
|||||||
#include <coreplugin/dialogs/settingsdialog.h>
|
#include <coreplugin/dialogs/settingsdialog.h>
|
||||||
#include <coreplugin/dialogs/shortcutsettings.h>
|
#include <coreplugin/dialogs/shortcutsettings.h>
|
||||||
#include <coreplugin/editormanager/editormanager.h>
|
#include <coreplugin/editormanager/editormanager.h>
|
||||||
|
#include <coreplugin/editormanager/editormanager_p.h>
|
||||||
#include <coreplugin/editormanager/ieditor.h>
|
#include <coreplugin/editormanager/ieditor.h>
|
||||||
#include <coreplugin/icorelistener.h>
|
#include <coreplugin/icorelistener.h>
|
||||||
#include <coreplugin/inavigationwidgetfactory.h>
|
#include <coreplugin/inavigationwidgetfactory.h>
|
||||||
@@ -335,7 +336,6 @@ void MainWindow::extensionsInitialized()
|
|||||||
{
|
{
|
||||||
m_windowSupport = new WindowSupport(this, Context("Core.MainWindow"));
|
m_windowSupport = new WindowSupport(this, Context("Core.MainWindow"));
|
||||||
m_windowSupport->setCloseActionEnabled(false);
|
m_windowSupport->setCloseActionEnabled(false);
|
||||||
m_editorManager->init();
|
|
||||||
m_statusBarManager->extensionsInitalized();
|
m_statusBarManager->extensionsInitalized();
|
||||||
OutputPaneManager::instance()->init();
|
OutputPaneManager::instance()->init();
|
||||||
m_vcsManager->extensionsInitialized();
|
m_vcsManager->extensionsInitialized();
|
||||||
@@ -801,7 +801,7 @@ IDocument *MainWindow::openFiles(const QStringList &fileNames, ICore::OpenFilesF
|
|||||||
|
|
||||||
void MainWindow::setFocusToEditor()
|
void MainWindow::setFocusToEditor()
|
||||||
{
|
{
|
||||||
m_editorManager->doEscapeKeyFocusMoveMagic();
|
EditorManagerPrivate::doEscapeKeyFocusMoveMagic();
|
||||||
}
|
}
|
||||||
|
|
||||||
void MainWindow::showNewItemDialog(const QString &title,
|
void MainWindow::showNewItemDialog(const QString &title,
|
||||||
@@ -847,7 +847,7 @@ void MainWindow::openFileWith()
|
|||||||
{
|
{
|
||||||
foreach (const QString &fileName, EditorManager::getOpenFileNames()) {
|
foreach (const QString &fileName, EditorManager::getOpenFileNames()) {
|
||||||
bool isExternal;
|
bool isExternal;
|
||||||
const Id editorId = EditorManager::getOpenWithEditorId(fileName, &isExternal);
|
const Id editorId = EditorManagerPrivate::getOpenWithEditorId(fileName, &isExternal);
|
||||||
if (!editorId.isValid())
|
if (!editorId.isValid())
|
||||||
continue;
|
continue;
|
||||||
if (isExternal)
|
if (isExternal)
|
||||||
@@ -970,7 +970,7 @@ void MainWindow::readSettings()
|
|||||||
|
|
||||||
settings->endGroup();
|
settings->endGroup();
|
||||||
|
|
||||||
m_editorManager->readSettings();
|
EditorManagerPrivate::readSettings();
|
||||||
m_navigationWidget->restoreSettings(settings);
|
m_navigationWidget->restoreSettings(settings);
|
||||||
m_rightPaneWidget->readSettings(settings);
|
m_rightPaneWidget->readSettings(settings);
|
||||||
}
|
}
|
||||||
@@ -991,7 +991,7 @@ void MainWindow::writeSettings()
|
|||||||
|
|
||||||
DocumentManager::saveSettings();
|
DocumentManager::saveSettings();
|
||||||
m_actionManager->saveSettings(settings);
|
m_actionManager->saveSettings(settings);
|
||||||
m_editorManager->saveSettings();
|
EditorManagerPrivate::saveSettings();
|
||||||
m_navigationWidget->saveSettings(settings);
|
m_navigationWidget->saveSettings(settings);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user