forked from qt-creator/qt-creator
QML Inspector: Disable debug actions when qml inspector is disabled
Reviewed-by: Thomas Hartmann
This commit is contained in:
@@ -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:
|
|||||||
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 @@
|
|||||||
#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()
|
|||||||
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,
|
||||||
|
Reference in New Issue
Block a user