forked from qt-creator/qt-creator
getting closer
This commit is contained in:
@@ -450,8 +450,11 @@ void EditorManager::updateEditorHistory()
|
|||||||
|
|
||||||
void EditorManager::removeEditor(IEditor *editor)
|
void EditorManager::removeEditor(IEditor *editor)
|
||||||
{
|
{
|
||||||
|
bool isDuplicate = m_d->m_editorModel->isDuplicate(editor);
|
||||||
m_d->m_editorModel->removeEditor(editor);
|
m_d->m_editorModel->removeEditor(editor);
|
||||||
m_d->m_core->fileManager()->removeFile(editor->file());
|
if (!isDuplicate) {
|
||||||
|
m_d->m_core->fileManager()->removeFile(editor->file());
|
||||||
|
}
|
||||||
m_d->m_editorHistory.removeAll(editor);
|
m_d->m_editorHistory.removeAll(editor);
|
||||||
m_d->m_core->removeContextObject(editor);
|
m_d->m_core->removeContextObject(editor);
|
||||||
|
|
||||||
@@ -510,31 +513,35 @@ IEditor *EditorManager::currentEditor() const
|
|||||||
// we simply postpone it with a single shot timer
|
// we simply postpone it with a single shot timer
|
||||||
void EditorManager::closeEditor()
|
void EditorManager::closeEditor()
|
||||||
{
|
{
|
||||||
static bool postpone = true;
|
closeEditor(m_d->m_currentEditor);
|
||||||
if (postpone) {
|
|
||||||
QTimer::singleShot(0, this, SLOT(closeEditor()));
|
|
||||||
postpone = false;
|
|
||||||
} else {
|
|
||||||
closeEditor(m_d->m_splitter->findView(m_d->m_currentEditor)->view(), m_d->m_currentEditor);
|
|
||||||
postpone = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void EditorManager::closeEditor(Core::Internal::EditorView *view, Core::IEditor *editor)
|
void EditorManager::closeView(Core::Internal::EditorView *view)
|
||||||
{
|
{
|
||||||
if (!editor || !view)
|
if (!view)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
Q_ASSERT(view->hasEditor(editor));
|
|
||||||
if (view == m_d->m_view) {
|
if (view == m_d->m_view) {
|
||||||
closeEditors(QList<IEditor *>() << editor);
|
closeEditors(QList<IEditor *>() << view->currentEditor());
|
||||||
} else {
|
} else {
|
||||||
view->removeEditor(editor);
|
QList<IEditor *> editors = view->editors();
|
||||||
closeDuplicate(editor, true);
|
foreach (IEditor *editor, editors) {
|
||||||
|
emit editorAboutToClose(editor);
|
||||||
|
removeEditor(editor);
|
||||||
|
view->removeEditor(editor);
|
||||||
|
}
|
||||||
|
emit editorsClosed(editors);
|
||||||
|
foreach (IEditor *editor, editors) {
|
||||||
|
delete editor;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void EditorManager::closeEditor(Core::IEditor *editor)
|
||||||
|
{
|
||||||
|
if (!editor)
|
||||||
|
return;
|
||||||
|
closeEditors(QList<IEditor *>() << editor);
|
||||||
}
|
}
|
||||||
|
|
||||||
QList<IEditor*>
|
QList<IEditor*>
|
||||||
@@ -582,6 +589,8 @@ bool EditorManager::closeEditors(const QList<IEditor*> editorsToClose, bool askA
|
|||||||
pluginManager()->getObjects<ICoreListener>();
|
pluginManager()->getObjects<ICoreListener>();
|
||||||
foreach (IEditor *editor, editorsToClose) {
|
foreach (IEditor *editor, editorsToClose) {
|
||||||
bool editorAccepted = true;
|
bool editorAccepted = true;
|
||||||
|
if (m_d->m_editorModel->isDuplicate(editor))
|
||||||
|
editor = m_d->m_editorModel->originalForDuplicate(editor);
|
||||||
foreach (ICoreListener *listener, listeners) {
|
foreach (ICoreListener *listener, listeners) {
|
||||||
if (!listener->editorAboutToClose(editor)) {
|
if (!listener->editorAboutToClose(editor)) {
|
||||||
editorAccepted = false;
|
editorAccepted = false;
|
||||||
@@ -609,6 +618,11 @@ bool EditorManager::closeEditors(const QList<IEditor*> editorsToClose, bool askA
|
|||||||
}
|
}
|
||||||
if (acceptedEditors.isEmpty())
|
if (acceptedEditors.isEmpty())
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
|
// add duplicates
|
||||||
|
foreach(IEditor *editor, acceptedEditors)
|
||||||
|
acceptedEditors += m_d->m_editorModel->duplicatesFor(editor);
|
||||||
|
|
||||||
bool currentEditorRemoved = false;
|
bool currentEditorRemoved = false;
|
||||||
IEditor *current = currentEditor();
|
IEditor *current = currentEditor();
|
||||||
if (current)
|
if (current)
|
||||||
@@ -627,8 +641,10 @@ bool EditorManager::closeEditors(const QList<IEditor*> editorsToClose, bool askA
|
|||||||
if (!state.isEmpty())
|
if (!state.isEmpty())
|
||||||
m_d->m_editorStates.insert(editor->file()->fileName(), QVariant(state));
|
m_d->m_editorStates.insert(editor->file()->fileName(), QVariant(state));
|
||||||
}
|
}
|
||||||
|
|
||||||
removeEditor(editor);
|
removeEditor(editor);
|
||||||
m_d->m_view->removeEditor(editor);
|
if (SplitterOrView *view = m_d->m_splitter->findView(editor))
|
||||||
|
view->view()->removeEditor(editor);
|
||||||
}
|
}
|
||||||
emit editorsClosed(acceptedEditors);
|
emit editorsClosed(acceptedEditors);
|
||||||
foreach (IEditor *editor, acceptedEditors) {
|
foreach (IEditor *editor, acceptedEditors) {
|
||||||
@@ -640,18 +656,13 @@ bool EditorManager::closeEditors(const QList<IEditor*> editorsToClose, bool askA
|
|||||||
return !closingFailed;
|
return !closingFailed;
|
||||||
}
|
}
|
||||||
|
|
||||||
void EditorManager::closeDuplicate(Core::IEditor *editor, bool doDelete)
|
|
||||||
{
|
|
||||||
m_d->m_editorHistory.removeAll(editor);
|
|
||||||
emit editorAboutToClose(editor);
|
|
||||||
emit editorsClosed(QList<Core::IEditor *>() << editor);
|
|
||||||
if (doDelete)
|
|
||||||
delete editor;
|
|
||||||
}
|
|
||||||
|
|
||||||
void EditorManager::activateEditor(IEditor *editor, OpenEditorFlags flags)
|
void EditorManager::activateEditor(IEditor *editor, OpenEditorFlags flags)
|
||||||
{
|
{
|
||||||
activateEditor(m_d->m_splitter->findView(m_d->m_currentEditor)->view(), editor, flags);
|
SplitterOrView *splitterOrView = m_d->m_currentEditor ?
|
||||||
|
m_d->m_splitter->findView(m_d->m_currentEditor)
|
||||||
|
: m_d->m_splitter->findFirstView();
|
||||||
|
activateEditor(splitterOrView->view(), editor, flags);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -662,10 +673,24 @@ void EditorManager::activateEditor(Core::Internal::EditorView *view, Core::IEdit
|
|||||||
|
|
||||||
Q_ASSERT(view && editor);
|
Q_ASSERT(view && editor);
|
||||||
|
|
||||||
|
qDebug() << "activateEditor" << editor->file()->fileName() << view;
|
||||||
if (!view->hasEditor(editor)) {
|
if (!view->hasEditor(editor)) {
|
||||||
if (SplitterOrView *sourceView = m_d->m_splitter->findView(editor))
|
qDebug() << "not in requested view";
|
||||||
sourceView->view()->removeEditor(editor);
|
bool duplicateSupported = editor->duplicateSupported();
|
||||||
|
qDebug() << "duplicateSupported" << duplicateSupported;
|
||||||
|
if (SplitterOrView *sourceView = m_d->m_splitter->findView(editor)) {
|
||||||
|
qDebug() << "found editor in another view";
|
||||||
|
if (editor != sourceView->editor() || !duplicateSupported) {
|
||||||
|
qDebug() << "steal editor";
|
||||||
|
sourceView->view()->removeEditor(editor);
|
||||||
|
} else if (duplicateSupported) {
|
||||||
|
qDebug() << "do duplicate";
|
||||||
|
editor = duplicateEditor(editor);
|
||||||
|
Q_ASSERT(editor);
|
||||||
|
}
|
||||||
|
}
|
||||||
view->addEditor(editor);
|
view->addEditor(editor);
|
||||||
|
view->setCurrentEditor(editor);
|
||||||
}
|
}
|
||||||
|
|
||||||
setCurrentEditor(editor, (flags & IgnoreNavigationHistory));
|
setCurrentEditor(editor, (flags & IgnoreNavigationHistory));
|
||||||
@@ -788,8 +813,8 @@ void EditorManager::addEditor(IEditor *editor, bool isDuplicate)
|
|||||||
return;
|
return;
|
||||||
m_d->m_core->addContextObject(editor);
|
m_d->m_core->addContextObject(editor);
|
||||||
|
|
||||||
|
m_d->m_editorModel->addEditor(editor, isDuplicate);
|
||||||
if (!isDuplicate) {
|
if (!isDuplicate) {
|
||||||
m_d->m_editorModel->addEditor(editor);
|
|
||||||
m_d->m_core->fileManager()->addFile(editor->file());
|
m_d->m_core->fileManager()->addFile(editor->file());
|
||||||
m_d->m_core->fileManager()->addToRecentFiles(editor->file()->fileName());
|
m_d->m_core->fileManager()->addToRecentFiles(editor->file()->fileName());
|
||||||
}
|
}
|
||||||
@@ -1579,20 +1604,16 @@ void EditorManager::unsplitAll()
|
|||||||
|
|
||||||
void EditorManager::gotoOtherWindow()
|
void EditorManager::gotoOtherWindow()
|
||||||
{
|
{
|
||||||
qDebug() << "gotoOtherWindow";
|
|
||||||
if (!m_d->m_currentEditor)
|
if (!m_d->m_currentEditor)
|
||||||
return;
|
return;
|
||||||
qDebug() << "current editor" << m_d->m_currentEditor->file()->fileName();
|
|
||||||
if (m_d->m_splitter->isSplitter()) {
|
if (m_d->m_splitter->isSplitter()) {
|
||||||
qDebug() << "we have a splitter";
|
|
||||||
SplitterOrView *view = m_d->m_splitter->findNextView(m_d->m_currentEditor);
|
SplitterOrView *view = m_d->m_splitter->findNextView(m_d->m_currentEditor);
|
||||||
qDebug() << "next view is" << view;
|
|
||||||
if (!view)
|
if (!view)
|
||||||
view = m_d->m_splitter->findFirstView();
|
view = m_d->m_splitter->findFirstView();
|
||||||
if (view) {
|
if (view) {
|
||||||
if (IEditor *editor = view->editor()) {
|
if (IEditor *editor = view->editor()) {
|
||||||
qDebug() << "set new current editor to" << editor->file()->fileName();
|
setCurrentEditor(editor);
|
||||||
view->view()->setCurrentEditor(editor);
|
editor->widget()->setFocus();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -222,10 +222,10 @@ private:
|
|||||||
void restoreEditorState(IEditor *editor);
|
void restoreEditorState(IEditor *editor);
|
||||||
|
|
||||||
Core::IEditor *duplicateEditor(IEditor *editor);
|
Core::IEditor *duplicateEditor(IEditor *editor);
|
||||||
void closeDuplicate(Core::IEditor *editor, bool doDelete);
|
|
||||||
void setCurrentEditor(IEditor *editor, bool ignoreNavigationHistory = false);
|
void setCurrentEditor(IEditor *editor, bool ignoreNavigationHistory = false);
|
||||||
void activateEditor(Core::Internal::EditorView *view, Core::IEditor *editor, OpenEditorFlags flags = 0);
|
void activateEditor(Core::Internal::EditorView *view, Core::IEditor *editor, OpenEditorFlags flags = 0);
|
||||||
void closeEditor(Core::Internal::EditorView *view, Core::IEditor *editor);
|
void closeEditor(Core::IEditor *editor);
|
||||||
|
void closeView(Core::Internal::EditorView *view);
|
||||||
|
|
||||||
static EditorManager *m_instance;
|
static EditorManager *m_instance;
|
||||||
EditorManagerPrivate *m_d;
|
EditorManagerPrivate *m_d;
|
||||||
|
@@ -77,8 +77,13 @@ int EditorModel::rowCount(const QModelIndex &parent) const
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
void EditorModel::addEditor(IEditor *editor)
|
void EditorModel::addEditor(IEditor *editor, bool isDuplicate)
|
||||||
{
|
{
|
||||||
|
if (isDuplicate) {
|
||||||
|
m_duplicateEditors.append(editor);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
int index = 0;
|
int index = 0;
|
||||||
|
|
||||||
QString fileName = editor->file()->fileName();
|
QString fileName = editor->file()->fileName();
|
||||||
@@ -94,6 +99,7 @@ void EditorModel::addEditor(IEditor *editor)
|
|||||||
|
|
||||||
void EditorModel::removeEditor(IEditor *editor)
|
void EditorModel::removeEditor(IEditor *editor)
|
||||||
{
|
{
|
||||||
|
m_duplicateEditors.removeAll(editor);
|
||||||
int idx = m_editors.indexOf(editor);
|
int idx = m_editors.indexOf(editor);
|
||||||
if (idx < 0)
|
if (idx < 0)
|
||||||
return;
|
return;
|
||||||
@@ -103,6 +109,29 @@ void EditorModel::removeEditor(IEditor *editor)
|
|||||||
disconnect(editor, SIGNAL(changed()), this, SLOT(itemChanged()));
|
disconnect(editor, SIGNAL(changed()), this, SLOT(itemChanged()));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool EditorModel::isDuplicate(IEditor *editor) const
|
||||||
|
{
|
||||||
|
return m_duplicateEditors.contains(editor);
|
||||||
|
}
|
||||||
|
|
||||||
|
IEditor *EditorModel::originalForDuplicate(IEditor *duplicate) const
|
||||||
|
{
|
||||||
|
IFile *file = duplicate->file();
|
||||||
|
foreach(IEditor *e, m_editors)
|
||||||
|
if (e->file() == file)
|
||||||
|
return e;
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
QList<IEditor *> EditorModel::duplicatesFor(IEditor *editor) const
|
||||||
|
{
|
||||||
|
QList<IEditor *> result;
|
||||||
|
IFile *file = editor->file();
|
||||||
|
foreach(IEditor *e, m_duplicateEditors)
|
||||||
|
if (e->file() == file)
|
||||||
|
result += e;
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
void EditorModel::emitDataChanged(IEditor *editor)
|
void EditorModel::emitDataChanged(IEditor *editor)
|
||||||
{
|
{
|
||||||
@@ -236,7 +265,7 @@ EditorView::EditorView(EditorModel *model, QWidget *parent) :
|
|||||||
|
|
||||||
connect(m_editorList, SIGNAL(activated(int)), this, SLOT(listSelectionActivated(int)));
|
connect(m_editorList, SIGNAL(activated(int)), this, SLOT(listSelectionActivated(int)));
|
||||||
connect(m_lockButton, SIGNAL(clicked()), this, SLOT(makeEditorWritable()));
|
connect(m_lockButton, SIGNAL(clicked()), this, SLOT(makeEditorWritable()));
|
||||||
connect(m_closeButton, SIGNAL(clicked()), this, SLOT(sendCloseRequest()));
|
connect(m_closeButton, SIGNAL(clicked()), this, SLOT(closeView()));
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
m_infoWidget->setFrameStyle(QFrame::Panel | QFrame::Raised);
|
m_infoWidget->setFrameStyle(QFrame::Panel | QFrame::Raised);
|
||||||
@@ -326,10 +355,12 @@ bool EditorView::hasEditor(IEditor *editor) const
|
|||||||
return (m_container->indexOf(editor->widget()) != -1);
|
return (m_container->indexOf(editor->widget()) != -1);
|
||||||
}
|
}
|
||||||
|
|
||||||
void EditorView::sendCloseRequest()
|
void EditorView::closeView()
|
||||||
{
|
{
|
||||||
|
if (editorCount() == 0)
|
||||||
|
return;
|
||||||
EditorManager *em = CoreImpl::instance()->editorManager();
|
EditorManager *em = CoreImpl::instance()->editorManager();
|
||||||
em->closeEditor(this, currentEditor());
|
em->closeView(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
void EditorView::removeEditor(IEditor *editor)
|
void EditorView::removeEditor(IEditor *editor)
|
||||||
@@ -367,7 +398,7 @@ void EditorView::setCurrentEditor(IEditor *editor)
|
|||||||
|| m_container->indexOf(editor->widget()) == -1)
|
|| m_container->indexOf(editor->widget()) == -1)
|
||||||
return;
|
return;
|
||||||
if (editor)
|
if (editor)
|
||||||
qDebug() << "EditorView::setCurrentEditor" << editor->file()->fileName();
|
qDebug() << "EditorView::setCurrentEditor" << editor << editor->file()->fileName();
|
||||||
|
|
||||||
const int idx = m_container->indexOf(editor->widget());
|
const int idx = m_container->indexOf(editor->widget());
|
||||||
QTC_ASSERT(idx >= 0, return);
|
QTC_ASSERT(idx >= 0, return);
|
||||||
@@ -513,6 +544,21 @@ SplitterOrView *SplitterOrView::findSplitter(Core::IEditor *editor)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
SplitterOrView *SplitterOrView::findSplitter(SplitterOrView *child)
|
||||||
|
{
|
||||||
|
if (m_splitter) {
|
||||||
|
for (int i = 0; i < m_splitter->count(); ++i) {
|
||||||
|
if (SplitterOrView *splitterOrView = qobject_cast<SplitterOrView*>(m_splitter->widget(i))) {
|
||||||
|
if (splitterOrView == child)
|
||||||
|
return this;
|
||||||
|
if (SplitterOrView *result = splitterOrView->findSplitter(child))
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
SplitterOrView *SplitterOrView::findNextView(Core::IEditor *editor)
|
SplitterOrView *SplitterOrView::findNextView(Core::IEditor *editor)
|
||||||
{
|
{
|
||||||
bool found = false;
|
bool found = false;
|
||||||
@@ -569,10 +615,12 @@ void SplitterOrView::split(Qt::Orientation orientation)
|
|||||||
|
|
||||||
void SplitterOrView::close()
|
void SplitterOrView::close()
|
||||||
{
|
{
|
||||||
qDebug() << "SplitterOrView::close TODO";
|
Q_ASSERT(!m_isRoot);
|
||||||
return;
|
if (m_view) {
|
||||||
foreach(Core::IEditor *e, editors())
|
m_view->closeView();
|
||||||
CoreImpl::instance()->editorManager()->closeDuplicate(e, false);
|
delete m_view;
|
||||||
|
m_view = 0;
|
||||||
|
}
|
||||||
closeSplitterEditors();
|
closeSplitterEditors();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -587,22 +635,42 @@ void SplitterOrView::closeSplitterEditors()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void SplitterOrView::unsplit(Core::IEditor */*editor*/)
|
void SplitterOrView::unsplit(Core::IEditor *editor)
|
||||||
{
|
{
|
||||||
qDebug() << "SplitterOrView::unsplit TODO";
|
|
||||||
return;
|
|
||||||
/*
|
|
||||||
if (!m_splitter)
|
if (!m_splitter)
|
||||||
return;
|
return;
|
||||||
Q_ASSERT(m_isRoot || (m_view == 0 && editor));
|
|
||||||
if (!m_isRoot) {
|
qDebug() << "unsplit" << this << m_splitter;
|
||||||
m_view = new EditorView(CoreImpl::instance()->editorManager()->openedEditorsModel());
|
#if 0
|
||||||
m_view->addEditor(editor);
|
SplitterOrView *splitterOrView = qobject_cast<SplitterOrView*>(m_splitter->widget(0));
|
||||||
m_layout->addWidget(m_view);
|
Q_ASSERT(splitterOrView != 0);
|
||||||
m_view->setCurrentEditor(editor);
|
|
||||||
|
qDebug() << "splitter or view is" << splitterOrView;
|
||||||
|
|
||||||
|
if (editor) { // pick the other side
|
||||||
|
if (SplitterOrView *view = findView(editor)) {
|
||||||
|
qDebug() << "view to close is" << view;
|
||||||
|
view->close();
|
||||||
|
delete view;
|
||||||
|
}
|
||||||
|
splitterOrView = qobject_cast<SplitterOrView*>(m_splitter->widget(0));
|
||||||
|
qDebug() << "other splitter or view is" << splitterOrView;
|
||||||
}
|
}
|
||||||
closeSplitterEditors();
|
|
||||||
delete m_splitter;
|
QSplitter *old_splitter = m_splitter;
|
||||||
m_splitter = 0;
|
EditorView *old_view = m_view;
|
||||||
*/
|
|
||||||
|
m_splitter = splitterOrView->splitter();
|
||||||
|
m_view = splitterOrView->view();
|
||||||
|
|
||||||
|
qDebug() << "new splitter/view" << m_splitter << m_view;
|
||||||
|
|
||||||
|
if (m_splitter)
|
||||||
|
m_layout->addWidget(m_splitter);
|
||||||
|
if (m_view)
|
||||||
|
m_layout->addWidget(m_view);
|
||||||
|
|
||||||
|
// delete old_view;
|
||||||
|
// delete old_splitter;
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
@@ -73,12 +73,15 @@ public:
|
|||||||
int rowCount(const QModelIndex &parent = QModelIndex()) const;
|
int rowCount(const QModelIndex &parent = QModelIndex()) const;
|
||||||
QModelIndex index(int row, int column = 0, const QModelIndex &parent = QModelIndex()) const;
|
QModelIndex index(int row, int column = 0, const QModelIndex &parent = QModelIndex()) const;
|
||||||
|
|
||||||
void addEditor(IEditor *editor);
|
void addEditor(IEditor *editor, bool isDuplicate = false);
|
||||||
|
|
||||||
void removeEditor(IEditor *editor);
|
void removeEditor(IEditor *editor);
|
||||||
void emitDataChanged(IEditor *editor);
|
void emitDataChanged(IEditor *editor);
|
||||||
|
|
||||||
QList<IEditor *> editors() const { return m_editors; }
|
QList<IEditor *> editors() const { return m_editors; }
|
||||||
|
bool isDuplicate(IEditor *editor) const;
|
||||||
|
QList<IEditor *> duplicatesFor(IEditor *editor) const;
|
||||||
|
IEditor *originalForDuplicate(IEditor *duplicate) const;
|
||||||
QModelIndex indexOf(IEditor *editor) const;
|
QModelIndex indexOf(IEditor *editor) const;
|
||||||
QModelIndex indexOf(const QString &filename) const;
|
QModelIndex indexOf(const QString &filename) const;
|
||||||
|
|
||||||
@@ -86,6 +89,7 @@ private slots:
|
|||||||
void itemChanged();
|
void itemChanged();
|
||||||
private:
|
private:
|
||||||
QList<IEditor *> m_editors;
|
QList<IEditor *> m_editors;
|
||||||
|
QList<IEditor *>m_duplicateEditors;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
@@ -114,8 +118,10 @@ public:
|
|||||||
void hideEditorInfoBar(const QString &kind);
|
void hideEditorInfoBar(const QString &kind);
|
||||||
|
|
||||||
|
|
||||||
|
public slots:
|
||||||
|
void closeView();
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
void sendCloseRequest();
|
|
||||||
void updateEditorStatus(Core::IEditor *editor = 0);
|
void updateEditorStatus(Core::IEditor *editor = 0);
|
||||||
void checkEditorStatus();
|
void checkEditorStatus();
|
||||||
void makeEditorWritable();
|
void makeEditorWritable();
|
||||||
@@ -152,6 +158,8 @@ public:
|
|||||||
void unsplit(Core::IEditor *editor);
|
void unsplit(Core::IEditor *editor);
|
||||||
|
|
||||||
bool isView() const { return m_view != 0; }
|
bool isView() const { return m_view != 0; }
|
||||||
|
bool isRoot() const { return m_isRoot; }
|
||||||
|
|
||||||
bool isSplitter() const { return m_splitter != 0; }
|
bool isSplitter() const { return m_splitter != 0; }
|
||||||
Core::IEditor *editor() const { return m_view ? m_view->currentEditor() : 0; }
|
Core::IEditor *editor() const { return m_view ? m_view->currentEditor() : 0; }
|
||||||
QList<Core::IEditor *> editors() const { return m_view ? m_view->editors() : QList<Core::IEditor*>(); }
|
QList<Core::IEditor *> editors() const { return m_view ? m_view->editors() : QList<Core::IEditor*>(); }
|
||||||
@@ -162,6 +170,7 @@ public:
|
|||||||
SplitterOrView *findView(Core::IEditor *editor);
|
SplitterOrView *findView(Core::IEditor *editor);
|
||||||
SplitterOrView *findFirstView();
|
SplitterOrView *findFirstView();
|
||||||
SplitterOrView *findSplitter(Core::IEditor *editor);
|
SplitterOrView *findSplitter(Core::IEditor *editor);
|
||||||
|
SplitterOrView *findSplitter(SplitterOrView *child);
|
||||||
|
|
||||||
SplitterOrView *findNextView(Core::IEditor *editor);
|
SplitterOrView *findNextView(Core::IEditor *editor);
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user