forked from qt-creator/qt-creator
ProjectExplorer: level-up m_openTerminalHere action
With Q_OS_UNIX && QT < 5.10, the m_openTerminalHereBuildEnv and m_openTerminalHereRunEnv is disabled, there is only an action of m_openTerminalHere in the m_openTerminalMenu, so let's just level it up. Change-Id: Ia37364dca7f80cedd02ef89de86b6d66c70cd4af Reviewed-by: Eike Ziller <eike.ziller@qt.io> Reviewed-by: Christian Stenger <christian.stenger@qt.io> Reviewed-by: André Hartmann <aha_1980@gmx.de> Reviewed-by: Orgad Shaneh <orgads@gmail.com>
This commit is contained in:
@@ -807,11 +807,13 @@ bool ProjectExplorerPlugin::initialize(const QStringList &arguments, QString *er
|
||||
mfileContextMenu->appendGroup(Constants::G_PROJECT_TREE);
|
||||
|
||||
// Open Terminal submenu
|
||||
#if !defined(Q_OS_UNIX) || QT_VERSION >= QT_VERSION_CHECK(5, 10, 0)
|
||||
ActionContainer * const openTerminal =
|
||||
ActionManager::createMenu(ProjectExplorer::Constants::M_OPENTERMINALCONTEXT);
|
||||
openTerminal->setOnAllDisabledBehavior(ActionContainer::Show);
|
||||
dd->m_openTerminalMenu = openTerminal->menu();
|
||||
dd->m_openTerminalMenu->setTitle(FileUtils::msgTerminalAction());
|
||||
#endif
|
||||
|
||||
// "open with" submenu
|
||||
ActionContainer * const openWith =
|
||||
@@ -879,6 +881,7 @@ bool ProjectExplorerPlugin::initialize(const QStringList &arguments, QString *er
|
||||
mfileContextMenu->addAction(cmd, Constants::G_FILE_OPEN);
|
||||
mfolderContextMenu->addAction(cmd, Constants::G_FOLDER_FILES);
|
||||
|
||||
#if !defined(Q_OS_UNIX) || QT_VERSION >= QT_VERSION_CHECK(5, 10, 0)
|
||||
// Open Terminal Here menu
|
||||
mfileContextMenu->addMenu(openTerminal, Constants::G_FILE_OPEN);
|
||||
mfolderContextMenu->addMenu(openTerminal, Constants::G_FOLDER_FILES);
|
||||
@@ -887,6 +890,14 @@ bool ProjectExplorerPlugin::initialize(const QStringList &arguments, QString *er
|
||||
cmd = ActionManager::registerAction(dd->m_openTerminalHere, Constants::OPENTERMINALHERE,
|
||||
projecTreeContext);
|
||||
dd->m_openTerminalMenu->addAction(dd->m_openTerminalHere);
|
||||
#else
|
||||
dd->m_openTerminalHere = new QAction(FileUtils::msgTerminalAction(), this);
|
||||
cmd = ActionManager::registerAction(dd->m_openTerminalHere, Constants::OPENTERMINALHERE,
|
||||
projecTreeContext);
|
||||
|
||||
mfileContextMenu->addAction(cmd, Constants::G_FILE_OPEN);
|
||||
mfolderContextMenu->addAction(cmd, Constants::G_FOLDER_FILES);
|
||||
#endif
|
||||
|
||||
dd->m_openTerminalHereBuildEnv = new QAction(tr("Build Environment"), this);
|
||||
dd->m_openTerminalHereRunEnv = new QAction(tr("Run Environment"), this);
|
||||
|
Reference in New Issue
Block a user