Commit 02120e45 authored by Christiaan Janssen's avatar Christiaan Janssen Committed by Aurindam Jana
Browse files

QmlProfiler: refactored warning messagebox

Change-Id: I41e361fc2dc1cab0f103eccbb15b9c38cc78cb77
Reviewed-on: http://codereview.qt.nokia.com/2041

Reviewed-by: default avatarQt Sanity Bot <qt_sanity_bot@ovi.com>
Reviewed-by: default avatarAurindam Jana <aurindam.jana@nokia.com>
parent cd9fceba
...@@ -159,7 +159,7 @@ void QmlProfilerEngine::start() ...@@ -159,7 +159,7 @@ void QmlProfilerEngine::start()
if (LocalQmlProfilerRunner *qmlRunner = qobject_cast<LocalQmlProfilerRunner *>(d->m_runner)) { if (LocalQmlProfilerRunner *qmlRunner = qobject_cast<LocalQmlProfilerRunner *>(d->m_runner)) {
if (!qmlRunner->hasExecutable()) { if (!qmlRunner->hasExecutable()) {
showNoExecutableWarning(); showNonmodalWarning(tr("No executable file to launch."));
AnalyzerManager::stopTool(); AnalyzerManager::stopTool();
return; return;
} }
...@@ -193,15 +193,7 @@ void QmlProfilerEngine::stopped() ...@@ -193,15 +193,7 @@ void QmlProfilerEngine::stopped()
{ {
// user feedback // user feedback
if (d->m_running && d->m_fetchingData) { if (d->m_running && d->m_fetchingData) {
Core::ICore * const core = Core::ICore::instance(); showNonmodalWarning(tr("Application finished before loading profiled data.\n Please use the stop button instead."));
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();
} }
d->m_running = false; d->m_running = false;
...@@ -300,13 +292,13 @@ void QmlProfilerEngine::wrongSetupMessageBoxFinished(int button) ...@@ -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(); Core::ICore * const core = Core::ICore::instance();
QMessageBox *noExecWarning = new QMessageBox(core->mainWindow()); QMessageBox *noExecWarning = new QMessageBox(core->mainWindow());
noExecWarning->setIcon(QMessageBox::Warning); noExecWarning->setIcon(QMessageBox::Warning);
noExecWarning->setWindowTitle(tr("QML Profiler")); noExecWarning->setWindowTitle(tr("QML Profiler"));
noExecWarning->setText(tr("No executable file to launch.")); noExecWarning->setText(warningMsg);
noExecWarning->setStandardButtons(QMessageBox::Ok); noExecWarning->setStandardButtons(QMessageBox::Ok);
noExecWarning->setDefaultButton(QMessageBox::Ok); noExecWarning->setDefaultButton(QMessageBox::Ok);
noExecWarning->setModal(false); noExecWarning->setModal(false);
......
...@@ -48,7 +48,7 @@ public: ...@@ -48,7 +48,7 @@ public:
ProjectExplorer::RunConfiguration *runConfiguration); ProjectExplorer::RunConfiguration *runConfiguration);
~QmlProfilerEngine(); ~QmlProfilerEngine();
static void showNoExecutableWarning(); static void showNonmodalWarning(const QString &warningMsg);
signals: signals:
void processRunning(int port); void processRunning(int port);
void stopRecording(); void stopRecording();
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment