diff --git a/src/plugins/qmlprofiler/qmlprofilerengine.cpp b/src/plugins/qmlprofiler/qmlprofilerengine.cpp index c4324f1d5ca..9a3c5dc2c5e 100644 --- a/src/plugins/qmlprofiler/qmlprofilerengine.cpp +++ b/src/plugins/qmlprofiler/qmlprofilerengine.cpp @@ -159,7 +159,7 @@ void QmlProfilerEngine::start() if (LocalQmlProfilerRunner *qmlRunner = qobject_cast(d->m_runner)) { if (!qmlRunner->hasExecutable()) { - showNoExecutableWarning(); + showNonmodalWarning(tr("No executable file to launch.")); AnalyzerManager::stopTool(); return; } @@ -193,15 +193,7 @@ void QmlProfilerEngine::stopped() { // user feedback if (d->m_running && d->m_fetchingData) { - Core::ICore * const core = Core::ICore::instance(); - QMessageBox *killedWarning = new QMessageBox(core->mainWindow()); - killedWarning->setIcon(QMessageBox::Warning); - killedWarning->setWindowTitle(tr("QML Profiler")); - killedWarning->setText(tr("Application finished before loading profiled data.\n Please use the stop button instead.")); - killedWarning->setStandardButtons(QMessageBox::Ok); - killedWarning->setDefaultButton(QMessageBox::Ok); - killedWarning->setModal(false); - killedWarning->show(); + showNonmodalWarning(tr("Application finished before loading profiled data.\n Please use the stop button instead.")); } d->m_running = false; @@ -300,13 +292,13 @@ void QmlProfilerEngine::wrongSetupMessageBoxFinished(int button) } } -void QmlProfilerEngine::showNoExecutableWarning() +void QmlProfilerEngine::showNonmodalWarning(const QString &warningMsg) { 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->setText(warningMsg); noExecWarning->setStandardButtons(QMessageBox::Ok); noExecWarning->setDefaultButton(QMessageBox::Ok); noExecWarning->setModal(false); diff --git a/src/plugins/qmlprofiler/qmlprofilerengine.h b/src/plugins/qmlprofiler/qmlprofilerengine.h index 48b3457ed5d..8b0133b9c92 100644 --- a/src/plugins/qmlprofiler/qmlprofilerengine.h +++ b/src/plugins/qmlprofiler/qmlprofilerengine.h @@ -48,7 +48,7 @@ public: ProjectExplorer::RunConfiguration *runConfiguration); ~QmlProfilerEngine(); - static void showNoExecutableWarning(); + static void showNonmodalWarning(const QString &warningMsg); signals: void processRunning(int port); void stopRecording();