Skip to content
Snippets Groups Projects
Commit 678e6b1e authored by Christiaan Janssen's avatar Christiaan Janssen Committed by Aurindam Jana
Browse files

QmlProfiler: show warning when no executable given

Task-number: QTCREATORBUG-5266
Change-Id: If1639e322f4ab0d7065e3394129c6649f17e98c9
Reviewed-on: http://codereview.qt.nokia.com/2039


Reviewed-by: default avatarQt Sanity Bot <qt_sanity_bot@ovi.com>
Reviewed-by: default avatarAurindam Jana <aurindam.jana@nokia.com>
parent bcb2965d
No related branches found
No related tags found
No related merge requests found
......@@ -62,6 +62,8 @@ public:
virtual void stop();
virtual int debugPort() const;
bool hasExecutable() const { return !m_configuration.executable.isEmpty(); }
private slots:
void spontaneousStop(int exitCode);
......
......@@ -150,12 +150,20 @@ void QmlProfilerEngine::start()
qobject_cast<QmlProjectManager::QmlProjectRunConfiguration *>(runConfiguration())) {
if (rc->observerPath().isEmpty()) {
QmlProjectManager::QmlProjectPlugin::showQmlObserverToolWarning();
AnalyzerManager::stopTool();
return;
}
}
d->m_runner = QmlProfilerEnginePrivate::createRunner(runConfiguration(), this);
if (LocalQmlProfilerRunner *qmlRunner = qobject_cast<LocalQmlProfilerRunner *>(d->m_runner)) {
if (!qmlRunner->hasExecutable()) {
showNoExecutableWarning();
AnalyzerManager::stopTool();
return;
}
}
connect(d->m_runner, SIGNAL(stopped()), this, SLOT(stopped()));
connect(d->m_runner, SIGNAL(appendMessage(QString,Utils::OutputFormat)),
......@@ -292,5 +300,18 @@ void QmlProfilerEngine::wrongSetupMessageBoxFinished(int button)
}
}
void QmlProfilerEngine::showNoExecutableWarning()
{
Core::ICore * const core = Core::ICore::instance();
QMessageBox *noExecWarning = new QMessageBox(core->mainWindow());
noExecWarning->setIcon(QMessageBox::Warning);
noExecWarning->setWindowTitle(tr("QML Profiler"));
noExecWarning->setText(tr("No executable file to launch."));
noExecWarning->setStandardButtons(QMessageBox::Ok);
noExecWarning->setDefaultButton(QMessageBox::Ok);
noExecWarning->setModal(false);
noExecWarning->show();
}
} // namespace Internal
} // namespace QmlProfiler
......@@ -48,6 +48,7 @@ public:
ProjectExplorer::RunConfiguration *runConfiguration);
~QmlProfilerEngine();
static void showNoExecutableWarning();
signals:
void processRunning(int port);
void stopRecording();
......
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