ProjectExplorer: Enable location in subproject context menus

Enable location support in subproject context menu and update
the display of the location menu.

Change-Id: Iac09fb3d7ed3474b14f827ea6e8226b2c2ce9325
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
This commit is contained in:
Tobias Hunger
2019-06-13 13:46:08 +02:00
parent 62d41f1d93
commit 61e087fe8a

View File

@@ -749,12 +749,12 @@ bool ProjectExplorerPlugin::initialize(const QStringList &arguments, QString *er
ActionContainer *folderOpenLocationCtxMenu = ActionContainer *folderOpenLocationCtxMenu =
ActionManager::createMenu(Constants::FOLDER_OPEN_LOCATIONS_CONTEXT_MENU); ActionManager::createMenu(Constants::FOLDER_OPEN_LOCATIONS_CONTEXT_MENU);
folderOpenLocationCtxMenu->menu()->setTitle(tr("Open...")); folderOpenLocationCtxMenu->menu()->setTitle(tr("Open..."));
folderOpenLocationCtxMenu->setOnAllDisabledBehavior(ActionContainer::Show); folderOpenLocationCtxMenu->setOnAllDisabledBehavior(ActionContainer::Hide);
ActionContainer *projectOpenLocationCtxMenu = ActionContainer *projectOpenLocationCtxMenu =
ActionManager::createMenu(Constants::PROJECT_OPEN_LOCATIONS_CONTEXT_MENU); ActionManager::createMenu(Constants::PROJECT_OPEN_LOCATIONS_CONTEXT_MENU);
projectOpenLocationCtxMenu->menu()->setTitle(tr("Open...")); projectOpenLocationCtxMenu->menu()->setTitle(tr("Open..."));
projectOpenLocationCtxMenu->setOnAllDisabledBehavior(ActionContainer::Show); projectOpenLocationCtxMenu->setOnAllDisabledBehavior(ActionContainer::Hide);
// build menu // build menu
ActionContainer *mbuild = ActionContainer *mbuild =
@@ -791,10 +791,10 @@ bool ProjectExplorerPlugin::initialize(const QStringList &arguments, QString *er
msessionContextMenu->appendGroup(Constants::G_PROJECT_TREE); msessionContextMenu->appendGroup(Constants::G_PROJECT_TREE);
mprojectContextMenu->appendGroup(Constants::G_PROJECT_FIRST); mprojectContextMenu->appendGroup(Constants::G_PROJECT_FIRST);
mprojectContextMenu->appendGroup(Constants::G_FOLDER_LOCATIONS);
mprojectContextMenu->appendGroup(Constants::G_PROJECT_BUILD); mprojectContextMenu->appendGroup(Constants::G_PROJECT_BUILD);
mprojectContextMenu->appendGroup(Constants::G_PROJECT_RUN); mprojectContextMenu->appendGroup(Constants::G_PROJECT_RUN);
mprojectContextMenu->appendGroup(Constants::G_PROJECT_REBUILD); mprojectContextMenu->appendGroup(Constants::G_PROJECT_REBUILD);
mprojectContextMenu->appendGroup(Constants::G_FOLDER_LOCATIONS);
mprojectContextMenu->appendGroup(Constants::G_PROJECT_FILES); mprojectContextMenu->appendGroup(Constants::G_PROJECT_FILES);
mprojectContextMenu->appendGroup(Constants::G_PROJECT_LAST); mprojectContextMenu->appendGroup(Constants::G_PROJECT_LAST);
mprojectContextMenu->appendGroup(Constants::G_PROJECT_TREE); mprojectContextMenu->appendGroup(Constants::G_PROJECT_TREE);
@@ -804,13 +804,14 @@ bool ProjectExplorerPlugin::initialize(const QStringList &arguments, QString *er
dd, &ProjectExplorerPluginPrivate::updateLocationSubMenus); dd, &ProjectExplorerPluginPrivate::updateLocationSubMenus);
msubProjectContextMenu->appendGroup(Constants::G_PROJECT_FIRST); msubProjectContextMenu->appendGroup(Constants::G_PROJECT_FIRST);
msubProjectContextMenu->appendGroup(Constants::G_FOLDER_LOCATIONS);
msubProjectContextMenu->appendGroup(Constants::G_PROJECT_BUILD); msubProjectContextMenu->appendGroup(Constants::G_PROJECT_BUILD);
msubProjectContextMenu->appendGroup(Constants::G_PROJECT_RUN); msubProjectContextMenu->appendGroup(Constants::G_PROJECT_RUN);
msubProjectContextMenu->appendGroup(Constants::G_FOLDER_LOCATIONS);
msubProjectContextMenu->appendGroup(Constants::G_PROJECT_FILES); msubProjectContextMenu->appendGroup(Constants::G_PROJECT_FILES);
msubProjectContextMenu->appendGroup(Constants::G_PROJECT_LAST); msubProjectContextMenu->appendGroup(Constants::G_PROJECT_LAST);
msubProjectContextMenu->appendGroup(Constants::G_PROJECT_TREE); msubProjectContextMenu->appendGroup(Constants::G_PROJECT_TREE);
msubProjectContextMenu->addMenu(projectOpenLocationCtxMenu, Constants::G_FOLDER_LOCATIONS);
connect(msubProjectContextMenu->menu(), &QMenu::aboutToShow, connect(msubProjectContextMenu->menu(), &QMenu::aboutToShow,
dd, &ProjectExplorerPluginPrivate::updateLocationSubMenus); dd, &ProjectExplorerPluginPrivate::updateLocationSubMenus);