Commit 18af5cef authored by Eike Ziller's avatar Eike Ziller

EditorManager: closeOtherEditors --> closeOtherDocuments

Change-Id: Id8b225ed7ba6ea88669db06943d862793aa2671d
Reviewed-by: default avatarDaniel Teske <daniel.teske@digia.com>
parent 0a3a3be4
...@@ -227,7 +227,7 @@ EditorManagerPrivate::EditorManagerPrivate(QObject *parent) : ...@@ -227,7 +227,7 @@ EditorManagerPrivate::EditorManagerPrivate(QObject *parent) :
m_saveAsAction(new QAction(this)), m_saveAsAction(new QAction(this)),
m_closeCurrentEditorAction(new QAction(EditorManager::tr("Close"), this)), m_closeCurrentEditorAction(new QAction(EditorManager::tr("Close"), this)),
m_closeAllEditorsAction(new QAction(EditorManager::tr("Close All"), this)), m_closeAllEditorsAction(new QAction(EditorManager::tr("Close All"), this)),
m_closeOtherEditorsAction(new QAction(EditorManager::tr("Close Others"), this)), m_closeOtherDocumentsAction(new QAction(EditorManager::tr("Close Others"), this)),
m_closeAllEditorsExceptVisibleAction(new QAction(EditorManager::tr("Close All Except Visible"), this)), m_closeAllEditorsExceptVisibleAction(new QAction(EditorManager::tr("Close All Except Visible"), this)),
m_gotoNextDocHistoryAction(new QAction(EditorManager::tr("Next Open Document in History"), this)), m_gotoNextDocHistoryAction(new QAction(EditorManager::tr("Next Open Document in History"), this)),
m_gotoPreviousDocHistoryAction(new QAction(EditorManager::tr("Previous Open Document in History"), this)), m_gotoPreviousDocHistoryAction(new QAction(EditorManager::tr("Previous Open Document in History"), this)),
...@@ -238,7 +238,7 @@ EditorManagerPrivate::EditorManagerPrivate(QObject *parent) : ...@@ -238,7 +238,7 @@ EditorManagerPrivate::EditorManagerPrivate(QObject *parent) :
m_revertToSavedCurrentEditorContextAction(new QAction(EditorManager::tr("Revert to Saved"), this)), m_revertToSavedCurrentEditorContextAction(new QAction(EditorManager::tr("Revert to Saved"), this)),
m_closeCurrentEditorContextAction(new QAction(EditorManager::tr("Close"), this)), m_closeCurrentEditorContextAction(new QAction(EditorManager::tr("Close"), this)),
m_closeAllEditorsContextAction(new QAction(EditorManager::tr("Close All"), this)), m_closeAllEditorsContextAction(new QAction(EditorManager::tr("Close All"), this)),
m_closeOtherEditorsContextAction(new QAction(EditorManager::tr("Close Others"), this)), m_closeOtherDocumentsContextAction(new QAction(EditorManager::tr("Close Others"), this)),
m_closeAllEditorsExceptVisibleContextAction(new QAction(EditorManager::tr("Close All Except Visible"), this)), m_closeAllEditorsExceptVisibleContextAction(new QAction(EditorManager::tr("Close All Except Visible"), this)),
m_openGraphicalShellAction(new QAction(FileUtils::msgGraphicalShellAction(), this)), m_openGraphicalShellAction(new QAction(FileUtils::msgGraphicalShellAction(), this)),
m_openTerminalAction(new QAction(FileUtils::msgTerminalAction(), this)), m_openTerminalAction(new QAction(FileUtils::msgTerminalAction(), this)),
...@@ -336,10 +336,10 @@ void EditorManagerPrivate::init() ...@@ -336,10 +336,10 @@ void EditorManagerPrivate::init()
connect(m_closeAllEditorsAction, SIGNAL(triggered()), m_instance, SLOT(closeAllEditors())); connect(m_closeAllEditorsAction, SIGNAL(triggered()), m_instance, SLOT(closeAllEditors()));
// Close All Others Action // Close All Others Action
cmd = ActionManager::registerAction(m_closeOtherEditorsAction, Constants::CLOSEOTHERS, editManagerContext, true); cmd = ActionManager::registerAction(m_closeOtherDocumentsAction, Constants::CLOSEOTHERS, editManagerContext, true);
mfile->addAction(cmd, Constants::G_FILE_CLOSE); mfile->addAction(cmd, Constants::G_FILE_CLOSE);
cmd->setAttribute(Core::Command::CA_UpdateText); cmd->setAttribute(Core::Command::CA_UpdateText);
connect(m_closeOtherEditorsAction, SIGNAL(triggered()), m_instance, SLOT(closeOtherEditors())); connect(m_closeOtherDocumentsAction, SIGNAL(triggered()), m_instance, SLOT(closeOtherDocuments()));
// Close All Others Except Visible Action // Close All Others Except Visible Action
cmd = ActionManager::registerAction(m_closeAllEditorsExceptVisibleAction, Constants::CLOSEALLEXCEPTVISIBLE, editManagerContext, true); cmd = ActionManager::registerAction(m_closeAllEditorsExceptVisibleAction, Constants::CLOSEALLEXCEPTVISIBLE, editManagerContext, true);
...@@ -360,8 +360,8 @@ void EditorManagerPrivate::init() ...@@ -360,8 +360,8 @@ void EditorManagerPrivate::init()
m_instance, SLOT(closeAllEditors())); m_instance, SLOT(closeAllEditors()));
connect(m_closeCurrentEditorContextAction, SIGNAL(triggered()), connect(m_closeCurrentEditorContextAction, SIGNAL(triggered()),
this, SLOT(closeEditorFromContextMenu())); this, SLOT(closeEditorFromContextMenu()));
connect(m_closeOtherEditorsContextAction, SIGNAL(triggered()), connect(m_closeOtherDocumentsContextAction, SIGNAL(triggered()),
this, SLOT(closeOtherEditorsFromContextMenu())); this, SLOT(closeOtherDocumentsFromContextMenu()));
connect(m_closeAllEditorsExceptVisibleContextAction, SIGNAL(triggered()), connect(m_closeAllEditorsExceptVisibleContextAction, SIGNAL(triggered()),
this, SLOT(closeAllEditorsExceptVisible())); this, SLOT(closeAllEditorsExceptVisible()));
...@@ -1312,8 +1312,8 @@ void EditorManagerPrivate::updateActions() ...@@ -1312,8 +1312,8 @@ void EditorManagerPrivate::updateActions()
d->m_closeCurrentEditorAction->setEnabled(curDocument); d->m_closeCurrentEditorAction->setEnabled(curDocument);
d->m_closeCurrentEditorAction->setText(tr("Close %1").arg(quotedName)); d->m_closeCurrentEditorAction->setText(tr("Close %1").arg(quotedName));
d->m_closeAllEditorsAction->setEnabled(openedCount > 0); d->m_closeAllEditorsAction->setEnabled(openedCount > 0);
d->m_closeOtherEditorsAction->setEnabled(openedCount > 1); d->m_closeOtherDocumentsAction->setEnabled(openedCount > 1);
d->m_closeOtherEditorsAction->setText((openedCount > 1 ? tr("Close All Except %1").arg(quotedName) : tr("Close Others"))); d->m_closeOtherDocumentsAction->setText((openedCount > 1 ? tr("Close All Except %1").arg(quotedName) : tr("Close Others")));
d->m_closeAllEditorsExceptVisibleAction->setEnabled(visibleDocumentsCount() < openedCount); d->m_closeAllEditorsExceptVisibleAction->setEnabled(visibleDocumentsCount() < openedCount);
...@@ -1579,10 +1579,10 @@ void EditorManagerPrivate::closeEditorFromContextMenu() ...@@ -1579,10 +1579,10 @@ void EditorManagerPrivate::closeEditorFromContextMenu()
EditorManager::closeEditors(DocumentModel::editorsForDocument(document)); EditorManager::closeEditors(DocumentModel::editorsForDocument(document));
} }
void EditorManagerPrivate::closeOtherEditorsFromContextMenu() void EditorManagerPrivate::closeOtherDocumentsFromContextMenu()
{ {
IDocument *document = d->m_contextMenuEntry ? d->m_contextMenuEntry->document : 0; IDocument *document = d->m_contextMenuEntry ? d->m_contextMenuEntry->document : 0;
EditorManager::closeOtherEditors(document); EditorManager::closeOtherDocuments(document);
} }
bool EditorManagerPrivate::saveDocument(IDocument *document) bool EditorManagerPrivate::saveDocument(IDocument *document)
...@@ -1824,7 +1824,7 @@ bool EditorManager::closeAllEditors(bool askAboutModifiedEditors) ...@@ -1824,7 +1824,7 @@ bool EditorManager::closeAllEditors(bool askAboutModifiedEditors)
return false; return false;
} }
void EditorManager::closeOtherEditors(IDocument *document) void EditorManager::closeOtherDocuments(IDocument *document)
{ {
DocumentModel::removeAllRestoredEntries(); DocumentModel::removeAllRestoredEntries();
QList<IDocument *> documentsToClose = DocumentModel::openedDocuments(); QList<IDocument *> documentsToClose = DocumentModel::openedDocuments();
...@@ -1841,9 +1841,9 @@ void EditorManager::closeEditor() ...@@ -1841,9 +1841,9 @@ void EditorManager::closeEditor()
closeEditor(d->m_currentEditor); closeEditor(d->m_currentEditor);
} }
void EditorManager::closeOtherEditors() void EditorManager::closeOtherDocuments()
{ {
closeOtherEditors(currentDocument()); closeOtherDocuments(currentDocument());
} }
static void assignAction(QAction *self, QAction *other) static void assignAction(QAction *self, QAction *other)
...@@ -1881,17 +1881,17 @@ void EditorManager::addSaveAndCloseEditorActions(QMenu *contextMenu, DocumentMod ...@@ -1881,17 +1881,17 @@ void EditorManager::addSaveAndCloseEditorActions(QMenu *contextMenu, DocumentMod
d->m_closeCurrentEditorContextAction->setText(entry d->m_closeCurrentEditorContextAction->setText(entry
? tr("Close \"%1\"").arg(entry->displayName()) ? tr("Close \"%1\"").arg(entry->displayName())
: tr("Close Editor")); : tr("Close Editor"));
d->m_closeOtherEditorsContextAction->setText(entry d->m_closeOtherDocumentsContextAction->setText(entry
? tr("Close All Except \"%1\"").arg(entry->displayName()) ? tr("Close All Except \"%1\"").arg(entry->displayName())
: tr("Close Other Editors")); : tr("Close Other Editors"));
d->m_closeCurrentEditorContextAction->setEnabled(entry != 0); d->m_closeCurrentEditorContextAction->setEnabled(entry != 0);
d->m_closeOtherEditorsContextAction->setEnabled(entry != 0); d->m_closeOtherDocumentsContextAction->setEnabled(entry != 0);
d->m_closeAllEditorsContextAction->setEnabled(!DocumentModel::entries().isEmpty()); d->m_closeAllEditorsContextAction->setEnabled(!DocumentModel::entries().isEmpty());
d->m_closeAllEditorsExceptVisibleContextAction->setEnabled( d->m_closeAllEditorsExceptVisibleContextAction->setEnabled(
EditorManagerPrivate::visibleDocumentsCount() < DocumentModel::entries().count()); EditorManagerPrivate::visibleDocumentsCount() < DocumentModel::entries().count());
contextMenu->addAction(d->m_closeCurrentEditorContextAction); contextMenu->addAction(d->m_closeCurrentEditorContextAction);
contextMenu->addAction(d->m_closeAllEditorsContextAction); contextMenu->addAction(d->m_closeAllEditorsContextAction);
contextMenu->addAction(d->m_closeOtherEditorsContextAction); contextMenu->addAction(d->m_closeOtherDocumentsContextAction);
contextMenu->addAction(d->m_closeAllEditorsExceptVisibleContextAction); contextMenu->addAction(d->m_closeAllEditorsExceptVisibleContextAction);
} }
......
...@@ -134,7 +134,7 @@ public: ...@@ -134,7 +134,7 @@ public:
static bool closeDocuments(const QList<IDocument *> &documents, bool askAboutModifiedEditors = true); static bool closeDocuments(const QList<IDocument *> &documents, bool askAboutModifiedEditors = true);
static void closeDocument(DocumentModel::Entry *entry); static void closeDocument(DocumentModel::Entry *entry);
static void closeOtherEditors(IDocument *document); static void closeOtherDocuments(IDocument *document);
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();
...@@ -184,7 +184,7 @@ public slots: ...@@ -184,7 +184,7 @@ public slots:
static void revertToSaved(); static void revertToSaved();
static bool closeAllEditors(bool askAboutModifiedEditors = true); static bool closeAllEditors(bool askAboutModifiedEditors = true);
static void closeEditor(); static void closeEditor();
static void closeOtherEditors(); static void closeOtherDocuments();
static void splitSideBySide(); static void splitSideBySide();
static void gotoOtherSplit(); static void gotoOtherSplit();
static void goBackInNavigationHistory(); static void goBackInNavigationHistory();
......
...@@ -131,7 +131,7 @@ private slots: ...@@ -131,7 +131,7 @@ private slots:
static void saveDocumentAsFromContextMenu(); static void saveDocumentAsFromContextMenu();
static void revertToSavedFromContextMenu(); static void revertToSavedFromContextMenu();
static void closeEditorFromContextMenu(); static void closeEditorFromContextMenu();
static void closeOtherEditorsFromContextMenu(); static void closeOtherDocumentsFromContextMenu();
static void closeAllEditorsExceptVisible(); static void closeAllEditorsExceptVisible();
static void revertToSaved(IDocument *document); static void revertToSaved(IDocument *document);
...@@ -185,7 +185,7 @@ private: ...@@ -185,7 +185,7 @@ private:
QAction *m_saveAsAction; QAction *m_saveAsAction;
QAction *m_closeCurrentEditorAction; QAction *m_closeCurrentEditorAction;
QAction *m_closeAllEditorsAction; QAction *m_closeAllEditorsAction;
QAction *m_closeOtherEditorsAction; QAction *m_closeOtherDocumentsAction;
QAction *m_closeAllEditorsExceptVisibleAction; QAction *m_closeAllEditorsExceptVisibleAction;
QAction *m_gotoNextDocHistoryAction; QAction *m_gotoNextDocHistoryAction;
QAction *m_gotoPreviousDocHistoryAction; QAction *m_gotoPreviousDocHistoryAction;
...@@ -204,7 +204,7 @@ private: ...@@ -204,7 +204,7 @@ private:
QAction *m_closeCurrentEditorContextAction; QAction *m_closeCurrentEditorContextAction;
QAction *m_closeAllEditorsContextAction; QAction *m_closeAllEditorsContextAction;
QAction *m_closeOtherEditorsContextAction; QAction *m_closeOtherDocumentsContextAction;
QAction *m_closeAllEditorsExceptVisibleContextAction; QAction *m_closeAllEditorsExceptVisibleContextAction;
QAction *m_openGraphicalShellAction; QAction *m_openGraphicalShellAction;
QAction *m_openTerminalAction; QAction *m_openTerminalAction;
......
...@@ -100,7 +100,7 @@ void ShortCutManager::registerActions(const Core::Context &qmlDesignerMainContex ...@@ -100,7 +100,7 @@ void ShortCutManager::registerActions(const Core::Context &qmlDesignerMainContex
//Close All Others Action //Close All Others Action
Core::ActionManager::registerAction(&m_closeOtherEditorsAction, Core::Constants::CLOSEOTHERS, qmlDesignerMainContext); Core::ActionManager::registerAction(&m_closeOtherEditorsAction, Core::Constants::CLOSEOTHERS, qmlDesignerMainContext);
connect(&m_closeOtherEditorsAction, SIGNAL(triggered()), em, SLOT(closeOtherEditors())); connect(&m_closeOtherEditorsAction, SIGNAL(triggered()), em, SLOT(closeOtherDocuments()));
// Undo / Redo // Undo / Redo
Core::ActionManager::registerAction(&m_undoAction, Core::Constants::UNDO, qmlDesignerMainContext); Core::ActionManager::registerAction(&m_undoAction, Core::Constants::UNDO, qmlDesignerMainContext);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment