Added "Open with" menu to FolderNavigationWidget.

This commit is contained in:
Robert Loehning
2010-02-03 13:15:44 +01:00
parent 3a463fc3c7
commit 55bd2977ea
3 changed files with 32 additions and 11 deletions

View File

@@ -284,6 +284,14 @@ void FolderNavigationWidget::contextMenuEvent(QContextMenuEvent *ev)
actionExplorer->setEnabled(hasCurrentItem);
QAction *actionTerminal = menu.addAction(msgTerminalAction());
actionTerminal->setEnabled(hasCurrentItem);
// open with...
if (!m_fileSystemModel->isDir(current)) {
QMenu *openWith = menu.addMenu(tr("Open with"));
ProjectExplorerPlugin::populateOpenWithMenu(openWith,
m_fileSystemModel->filePath(current));
}
// Open file dialog to choose a path starting from current
QAction *actionChooseFolder = menu.addAction(tr("Choose folder..."));
// Sync checkable action
@@ -319,6 +327,8 @@ void FolderNavigationWidget::contextMenuEvent(QContextMenuEvent *ev)
showInGraphicalShell(this, m_fileSystemModel->filePath(current));
return;
}
ProjectExplorerPlugin::openEditorFromAction(action,
m_fileSystemModel->filePath(current));
}
QString FolderNavigationWidget::msgGraphicalShellAction()