bool isQmlActive() const;
void setSimpleDockWidgetArrangement();
void updateUi();
+ // Debuggable languages are registered with this function.
+ void addLanguage(const DebuggerLanguage &language, const Core::Context &context);
+
public slots:
void resetDebuggerLayout();
{
d = new DebuggerMainWindowPrivate(this);
d->createViewsMenuItems();
-
- addLanguage(CppLanguage, Context(C_CPPDEBUGGER));
- addLanguage(QmlLanguage, Context(C_QMLDEBUGGER));
+ d->addLanguage(CppLanguage, Context(C_CPPDEBUGGER));
+ d->addLanguage(QmlLanguage, Context(C_QMLDEBUGGER));
}
DebuggerMainWindow::~DebuggerMainWindow()
m_viewsMenu->addAction(cmd);
}
-void DebuggerMainWindow::addLanguage(const DebuggerLanguage &languageId,
+void DebuggerMainWindowPrivate::addLanguage(const DebuggerLanguage &languageId,
const Context &context)
{
- d->m_supportedLanguages = d->m_supportedLanguages | languageId;
- d->m_languageCount++;
+ m_supportedLanguages = m_supportedLanguages | languageId;
+ m_languageCount++;
- d->m_toolBars.insert(languageId, 0);
- d->m_contextsForLanguage.insert(languageId, context);
+ m_toolBars.insert(languageId, 0);
+ m_contextsForLanguage.insert(languageId, context);
}
void DebuggerMainWindowPrivate::updateUi()
DebuggerMainWindow();
~DebuggerMainWindow();
- // Debuggable languages are registered with this function.
- void addLanguage(const DebuggerLanguage &language, const Core::Context &context);
-
// Debugger toolbars are registered with this function.
void setToolbar(const DebuggerLanguage &language, QWidget *widget);
// Called when all dependent plugins have loaded.
void initialize();
-
void onModeChanged(Core::IMode *mode);
QDockWidget *dockWidget(const QString &objectName) const;
bool isDockVisible(const QString &objectName) const;
//
////////////////////////////////////////////////////////////////////////
-DebuggerRunControl::DebuggerRunControl(RunConfiguration *runConfiguration,
- unsigned enabledEngines, const DebuggerStartParameters &sp)
- : RunControl(runConfiguration, Constants::DEBUGMODE),
- d(new DebuggerRunControlPrivate(this, runConfiguration, enabledEngines))
-{
- connect(this, SIGNAL(finished()), SLOT(handleFinished()));
- createEngine(sp);
-}
-
-DebuggerRunControl::~DebuggerRunControl()
-{
- disconnect();
- if (DebuggerEngine *engine = d->m_engine) {
- d->m_engine = 0;
- engine->disconnect();
- delete engine;
- }
-}
-
-const DebuggerStartParameters &DebuggerRunControl::startParameters() const
-{
- QTC_ASSERT(d->m_engine, return *(new DebuggerStartParameters()));
- return d->m_engine->startParameters();
-}
-
static DebuggerEngineType engineForToolChain(int toolChainType)
{
switch (toolChainType) {
return NoEngineType;
}
-void DebuggerRunControl::createEngine(const DebuggerStartParameters &startParams)
+DebuggerRunControl::DebuggerRunControl(RunConfiguration *runConfiguration,
+ unsigned enabledEngines, const DebuggerStartParameters &startParams)
+ : RunControl(runConfiguration, Constants::DEBUGMODE),
+ d(new DebuggerRunControlPrivate(this, runConfiguration, enabledEngines))
{
- DebuggerStartParameters sp = startParams;
+ connect(this, SIGNAL(finished()), SLOT(handleFinished()));
// Figure out engine according to toolchain, executable, attach or default.
DebuggerEngineType engineType = NoEngineType;
DebuggerLanguages activeLangs = debuggerCore()->activeLanguages();
+ DebuggerStartParameters sp = startParams;
const unsigned enabledEngineTypes = d->enabledEngines();
if (sp.executable.endsWith(_(".js")))
engineType = ScriptEngineType;
}
}
+DebuggerRunControl::~DebuggerRunControl()
+{
+ disconnect();
+ if (DebuggerEngine *engine = d->m_engine) {
+ d->m_engine = 0;
+ engine->disconnect();
+ delete engine;
+ }
+}
+
+const DebuggerStartParameters &DebuggerRunControl::startParameters() const
+{
+ QTC_ASSERT(d->m_engine, return *(new DebuggerStartParameters()));
+ return d->m_engine->startParameters();
+}
+
QString DebuggerRunControl::displayName() const
{
QTC_ASSERT(d->m_engine, return QString());
QTC_ASSERT(false, /**/);
}
-void DebuggerRunControl::emitAddToOutputWindow(const QString &line, bool onStdErr)
-{
- emit addToOutputWindow(this, line, onStdErr);
-}
-
-void DebuggerRunControl::emitAppendMessage(const QString &m, bool isError)
-{
- emit appendMessage(this, m, isError);
-}
-
RunConfiguration *DebuggerRunControl::runConfiguration() const
{
return d->m_myRunConfiguration.data();
public:
typedef ProjectExplorer::RunConfiguration RunConfiguration;
- explicit DebuggerRunControl(RunConfiguration *runConfiguration,
+ DebuggerRunControl(RunConfiguration *runConfiguration,
unsigned enabledEngines, const DebuggerStartParameters &sp);
~DebuggerRunControl();
// ProjectExplorer::RunControl
- virtual void start();
- virtual bool aboutToStop() const;
- virtual StopResult stop();
- virtual bool isRunning() const;
+ void start();
+ bool aboutToStop() const;
+ StopResult stop(); // Called from SnapshotWindow.
+ bool isRunning() const;
QString displayName() const;
- void createEngine(const DebuggerStartParameters &startParameters);
void setCustomEnvironment(Utils::Environment env);
void startFailed();
void debuggingFinished();
signals:
void engineRequestSetup();
-public slots:
- void emitAddToOutputWindow(const QString &line, bool onStdErr);
- void emitAppendMessage(const QString &, bool isError);
-
private slots:
void handleFinished();
emit remoteStartupRequested();
} else {
connect(&d->m_applicationLauncher, SIGNAL(processExited(int)),
- this, SLOT(disconnected()));
+ SLOT(disconnected()));
connect(&d->m_applicationLauncher, SIGNAL(appendMessage(QString,bool)),
- runControl(), SLOT(emitAppendMessage(QString,bool)));
- connect(&d->m_applicationLauncher, SIGNAL(appendOutput(QString, bool)),
- runControl(), SLOT(emitAddToOutputWindow(QString, bool)));
+ SLOT(appendMessage(QString,bool)));
+ connect(&d->m_applicationLauncher, SIGNAL(appendOutput(QString,bool)),
+ SLOT(appendOutput(QString,bool)));
connect(&d->m_applicationLauncher, SIGNAL(bringToForegroundRequested(qint64)),
runControl(), SLOT(bringApplicationToForeground(qint64)));
}
}
+void QmlEngine::appendMessage(const QString &msg, bool)
+{
+ showMessage(msg, AppStuff);
+}
+
+void QmlEngine::appendOutput(const QString &msg, bool)
+{
+ showMessage(msg, AppOutput);
+}
+
void QmlEngine::connectionEstablished()
{
attemptBreakpointSynchronization();
void connectionStartupFailed();
void connectionError(QAbstractSocket::SocketError error);
void serviceConnectionError(const QString &service);
+ void appendMessage(const QString &msg, bool);
+ void appendOutput(const QString &msg, bool);
private:
void expandObject(const QByteArray &iname, quint64 objectId);
QWidget *observerWidget = new QWidget;
observerWidget->setWindowTitle(tr("QML Observer"));
- observerWidget->setObjectName(QLatin1String("QMLObserver"));
+ observerWidget->setObjectName(Debugger::Constants::DOCKWIDGET_QML_INSPECTOR);
QVBoxLayout *wlay = new QVBoxLayout(observerWidget);
wlay->setMargin(0);
wlay->addWidget(m_crumblePath);
Debugger::DebuggerMainWindow *mw = Debugger::DebuggerPlugin::mainWindow();
- QDockWidget *dock = mw->createDockWidget(Debugger::QmlLanguage,
- observerWidget, Debugger::Constants::DOCKWIDGET_QML_INSPECTOR,
- Qt::BottomDockWidgetArea);
+ QDockWidget *dock = mw->createDockWidget(Debugger::QmlLanguage, observerWidget);
dock->setAllowedAreas(Qt::TopDockWidgetArea | Qt::BottomDockWidgetArea);
dock->setTitleBarWidget(new QWidget(dock));
}