forked from qt-creator/qt-creator
Add Collapse All action to context menu of file system view
Task-number: QTCREATORBUG-19212 Change-Id: Ia8771a27dbcf77c956f013ed001c7890d6fe6e9a Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
This commit is contained in:
@@ -771,22 +771,27 @@ void FolderNavigationWidget::contextMenuEvent(QContextMenuEvent *ev)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
menu.addSeparator();
|
||||||
|
QAction * const collapseAllAction = menu.addAction(ProjectExplorerPlugin::tr("Collapse All"));
|
||||||
|
|
||||||
QAction *action = menu.exec(ev->globalPos());
|
QAction *action = menu.exec(ev->globalPos());
|
||||||
if (!action)
|
if (!action)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
ev->accept();
|
ev->accept();
|
||||||
if (action == actionOpenFile)
|
if (action == actionOpenFile) {
|
||||||
openItem(current);
|
openItem(current);
|
||||||
else if (action == actionOpenAsProject)
|
} else if (action == actionOpenAsProject) {
|
||||||
ProjectExplorerPlugin::openProject(filePath.toString());
|
ProjectExplorerPlugin::openProject(filePath.toString());
|
||||||
else if (action == actionOpenProjects)
|
} else if (action == actionOpenProjects)
|
||||||
openProjectsInDirectory(current);
|
openProjectsInDirectory(current);
|
||||||
else if (action == newFolder) {
|
else if (action == newFolder) {
|
||||||
if (isDir)
|
if (isDir)
|
||||||
createNewFolder(current);
|
createNewFolder(current);
|
||||||
else
|
else
|
||||||
createNewFolder(current.parent());
|
createNewFolder(current.parent());
|
||||||
|
} else if (action == collapseAllAction) {
|
||||||
|
m_listView->collapseAll();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user