Fix QmlInspector to work properly now that QmlProjectManager

no longer uses LocalAppRunConfiguration. QmlInspector now uses
the qmlviewer started by QmlProjectManager instead of starting
its own, and clicking the Start Debug button within a QML
project will switch to QML Inspect mode and start the inspector.
This commit is contained in:
Bea Lam
2009-12-18 15:32:36 +10:00
parent 6ca55f201f
commit 200a03ed20
9 changed files with 54 additions and 385 deletions

View File

@@ -39,6 +39,7 @@
#include <coreplugin/icore.h>
#include <coreplugin/editormanager/editormanager.h>
#include <coreplugin/editormanager/ieditor.h>
#include <coreplugin/modemanager.h>
#include <qmleditor/qmlmodelmanagerinterface.h>
@@ -59,6 +60,7 @@
#include <QtGui/QLabel>
#include <QtGui/QSpinBox>
using namespace QmlProjectManager;
using namespace QmlProjectManager::Internal;
using namespace ProjectExplorer;
@@ -508,7 +510,7 @@ ProjectExplorer::RunConfiguration *QmlRunConfigurationFactory::create(ProjectExp
}
QmlRunControl::QmlRunControl(QmlRunConfiguration *runConfiguration, bool debugMode)
: RunControl(runConfiguration)
: RunControl(runConfiguration), m_debugMode(debugMode)
{
Environment environment = ProjectExplorer::Environment::systemEnvironment();
if (debugMode)
@@ -527,7 +529,7 @@ QmlRunControl::QmlRunControl(QmlRunConfiguration *runConfiguration, bool debugMo
connect(&m_applicationLauncher, SIGNAL(processExited(int)),
this, SLOT(processExited(int)));
connect(&m_applicationLauncher, SIGNAL(bringToForegroundRequested(qint64)),
this, SLOT(bringApplicationToForeground(qint64)));
this, SLOT(slotBringApplicationToForeground(qint64)));
}
QmlRunControl::~QmlRunControl()
@@ -551,6 +553,16 @@ bool QmlRunControl::isRunning() const
return m_applicationLauncher.isRunning();
}
void QmlRunControl::slotBringApplicationToForeground(qint64 pid)
{
if (m_debugMode) {
Core::ICore *core = Core::ICore::instance();
core->modeManager()->activateMode(QLatin1String("QML_INSPECT_MODE"));
}
bringApplicationToForeground(pid);
}
void QmlRunControl::slotError(const QString &err)
{
emit error(this, err);