Skip to content
Snippets Groups Projects
Commit 308b4629 authored by Lasse Holmstedt's avatar Lasse Holmstedt
Browse files

QML Inspector: Disable debug actions when qml inspector is disabled

Reviewed-by: Thomas Hartmann
parent 4660ff4a
No related branches found
No related tags found
No related merge requests found
...@@ -153,6 +153,11 @@ DebuggerUISwitcher::~DebuggerUISwitcher() ...@@ -153,6 +153,11 @@ DebuggerUISwitcher::~DebuggerUISwitcher()
delete d; delete d;
} }
QStringList DebuggerUISwitcher::supportedLanguages() const
{
return d->m_languages;
}
void DebuggerUISwitcher::addMenuAction(Core::Command *command, const QString &langName, void DebuggerUISwitcher::addMenuAction(Core::Command *command, const QString &langName,
const QString &group) const QString &group)
{ {
......
...@@ -77,6 +77,8 @@ public: ...@@ -77,6 +77,8 @@ public:
void addMenuAction(Core::Command *command, const QString &langName, void addMenuAction(Core::Command *command, const QString &langName,
const QString &group = QString()); const QString &group = QString());
QStringList supportedLanguages() const;
// Changes the active language UI to the one specified by langName. // Changes the active language UI to the one specified by langName.
// Does nothing if automatic switching is toggled off from settings. // Does nothing if automatic switching is toggled off from settings.
void setActiveLanguage(const QString &langName); void setActiveLanguage(const QString &langName);
......
...@@ -37,7 +37,6 @@ ...@@ -37,7 +37,6 @@
#include <projectexplorer/projectexplorerconstants.h> #include <projectexplorer/projectexplorerconstants.h>
#include <projectexplorer/applicationlauncher.h> #include <projectexplorer/applicationlauncher.h>
#include <utils/qtcassert.h> #include <utils/qtcassert.h>
#include <debugger/debuggerconstants.h>
#include <debugger/debuggerconstants.h> #include <debugger/debuggerconstants.h>
#include <debugger/debuggeruiswitcher.h> #include <debugger/debuggeruiswitcher.h>
...@@ -147,8 +146,12 @@ QmlRunControlFactory::~QmlRunControlFactory() ...@@ -147,8 +146,12 @@ QmlRunControlFactory::~QmlRunControlFactory()
bool QmlRunControlFactory::canRun(RunConfiguration *runConfiguration, bool QmlRunControlFactory::canRun(RunConfiguration *runConfiguration,
const QString &mode) const const QString &mode) const
{ {
Q_UNUSED(mode); QmlProjectRunConfiguration *config = qobject_cast<QmlProjectRunConfiguration*>(runConfiguration);
return (qobject_cast<QmlProjectRunConfiguration*>(runConfiguration) != 0); if (mode == ProjectExplorer::Constants::RUNMODE) {
return config != 0;
} else {
return (config != 0) && Debugger::DebuggerUISwitcher::instance()->supportedLanguages().contains(Qml::Constants::LANG_QML);
}
} }
RunControl *QmlRunControlFactory::create(RunConfiguration *runConfiguration, RunControl *QmlRunControlFactory::create(RunConfiguration *runConfiguration,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment