diff options
author | Eike Ziller <eike.ziller@digia.com> | 2014-07-02 17:35:10 +0200 |
---|---|---|
committer | Eike Ziller <eike.ziller@digia.com> | 2014-07-04 08:51:03 +0200 |
commit | 9c6f559156281a7b7198075382559b90ad9dd6de (patch) | |
tree | 97ebaedee4864a532501babb09fa932b5d221a4d /src/plugins/coreplugin/editormanager/editormanager.cpp | |
parent | db918592ecd2b66edbf9f982547ea2563237b9d0 (diff) | |
download | qt-creator-9c6f559156281a7b7198075382559b90ad9dd6de.tar.gz |
Editors: Add "Open with" to open editors and combo box context menus
Change-Id: I67e75220ac86c7fd4d5005424f8b1922e2cbacfd
Reviewed-by: David Schulz <david.schulz@digia.com>
Reviewed-by: Jarek Kobus <jaroslaw.kobus@digia.com>
Diffstat (limited to 'src/plugins/coreplugin/editormanager/editormanager.cpp')
-rw-r--r-- | src/plugins/coreplugin/editormanager/editormanager.cpp | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/plugins/coreplugin/editormanager/editormanager.cpp b/src/plugins/coreplugin/editormanager/editormanager.cpp index 441efa5032..1c3fe72bc7 100644 --- a/src/plugins/coreplugin/editormanager/editormanager.cpp +++ b/src/plugins/coreplugin/editormanager/editormanager.cpp @@ -820,7 +820,7 @@ void EditorManager::addSaveAndCloseEditorActions(QMenu *contextMenu, DocumentMod contextMenu->addAction(d->m_closeAllEditorsExceptVisibleContextAction); } -void EditorManager::addNativeDirActions(QMenu *contextMenu, DocumentModel::Entry *entry) +void EditorManager::addNativeDirAndOpenWithActions(QMenu *contextMenu, DocumentModel::Entry *entry) { QTC_ASSERT(contextMenu, return); bool enabled = entry && !entry->fileName().isEmpty(); @@ -830,6 +830,12 @@ void EditorManager::addNativeDirActions(QMenu *contextMenu, DocumentModel::Entry contextMenu->addAction(d->m_openGraphicalShellAction); contextMenu->addAction(d->m_openTerminalAction); contextMenu->addAction(d->m_findInDirectoryAction); + QMenu *openWith = contextMenu->addMenu(tr("Open with")); + connect(openWith, SIGNAL(triggered(QAction*)), + DocumentManager::instance(), SLOT(executeOpenWithMenuAction(QAction*))); + openWith->setEnabled(enabled); + if (enabled) + DocumentManager::populateOpenWithMenu(openWith, entry->fileName()); } static void setFocusToEditorViewAndUnmaximizePanes(EditorView *view) |