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
......@@ -153,6 +153,11 @@ DebuggerUISwitcher::~DebuggerUISwitcher()
delete d;
}
QStringList DebuggerUISwitcher::supportedLanguages() const
{
return d->m_languages;
}
void DebuggerUISwitcher::addMenuAction(Core::Command *command, const QString &langName,
const QString &group)
{
......
......@@ -77,6 +77,8 @@ public:
void addMenuAction(Core::Command *command, const QString &langName,
const QString &group = QString());
QStringList supportedLanguages() const;
// Changes the active language UI to the one specified by langName.
// Does nothing if automatic switching is toggled off from settings.
void setActiveLanguage(const QString &langName);
......
......@@ -37,7 +37,6 @@
#include <projectexplorer/projectexplorerconstants.h>
#include <projectexplorer/applicationlauncher.h>
#include <utils/qtcassert.h>
#include <debugger/debuggerconstants.h>
#include <debugger/debuggerconstants.h>
#include <debugger/debuggeruiswitcher.h>
......@@ -147,8 +146,12 @@ QmlRunControlFactory::~QmlRunControlFactory()
bool QmlRunControlFactory::canRun(RunConfiguration *runConfiguration,
const QString &mode) const
{
Q_UNUSED(mode);
return (qobject_cast<QmlProjectRunConfiguration*>(runConfiguration) != 0);
QmlProjectRunConfiguration *config = qobject_cast<QmlProjectRunConfiguration*>(runConfiguration);
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,
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment