forked from qt-creator/qt-creator
		
	QmlProfiler: remove dependency on QmlProjectManager
Change-Id: I6c13ce1636bbaf201602e4a9473aca4f9953d1cb Reviewed-by: hjk <hjk121@nokiamail.com>
This commit is contained in:
		| @@ -38,16 +38,19 @@ | ||||
| #include <projectexplorer/projectexplorerconstants.h> | ||||
| #include <projectexplorer/kitinformation.h> | ||||
| #include <projectexplorer/target.h> | ||||
| #include <qmlprojectmanager/qmlprojectplugin.h> | ||||
| #include <projectexplorer/environmentaspect.h> | ||||
| #include <projectexplorer/localapplicationruncontrol.h> | ||||
| #include <projectexplorer/localapplicationrunconfiguration.h> | ||||
| #include <qtsupport/qtsupportconstants.h> | ||||
| #include <qmldebug/qmloutputparser.h> | ||||
|  | ||||
| #include <QMainWindow> | ||||
| #include <QMessageBox> | ||||
| #include <QTimer> | ||||
| #include <QTcpServer> | ||||
| #include <QApplication> | ||||
| #include <QMessageBox> | ||||
| #include <QPushButton> | ||||
|  | ||||
| using namespace Analyzer; | ||||
| using namespace Core; | ||||
| @@ -113,7 +116,7 @@ bool QmlProfilerRunControl::startEngine() | ||||
|     if (ProjectExplorer::LocalApplicationRunConfiguration *rc = | ||||
|             qobject_cast<ProjectExplorer::LocalApplicationRunConfiguration *>(runConfiguration())) { | ||||
|         if (rc->executable().isEmpty()) { | ||||
|             QmlProjectManager::QmlProjectPlugin::showQmlObserverToolWarning(); | ||||
|             showQmlObserverToolWarning(); | ||||
|             d->m_profilerState->setCurrentState(QmlProfilerStateManager::Idle); | ||||
|             AnalyzerManager::stopTool(); | ||||
|             return false; | ||||
| @@ -314,5 +317,28 @@ void QmlProfilerRunControl::profilerStateChanged() | ||||
|     } | ||||
| } | ||||
|  | ||||
| void QmlProfilerRunControl::showQmlObserverToolWarning() | ||||
| { | ||||
|     QMessageBox dialog(QApplication::activeWindow()); | ||||
|     QPushButton *qtPref = dialog.addButton(tr("Open Qt Versions"), | ||||
|                                            QMessageBox::ActionRole); | ||||
|     dialog.addButton(QMessageBox::Cancel); | ||||
|     dialog.setDefaultButton(qtPref); | ||||
|     dialog.setWindowTitle(tr("QML Observer Missing")); | ||||
|     dialog.setText(tr("QML Observer could not be found for this Qt version.")); | ||||
|     dialog.setInformativeText(tr( | ||||
|                                   "QML Observer is used to offer debugging features for " | ||||
|                                   "Qt Quick UI projects in the Qt 4.7 series.\n\n" | ||||
|                                   "To compile QML Observer, go to the Qt Versions page, " | ||||
|                                   "select the current Qt version, " | ||||
|                                   "and click Build in the Helpers section.")); | ||||
|     dialog.exec(); | ||||
|     if (dialog.clickedButton() == qtPref) { | ||||
|         Core::ICore::showOptionsDialog( | ||||
|                     ProjectExplorer::Constants::PROJECTEXPLORER_SETTINGS_CATEGORY, | ||||
|                     QtSupport::Constants::QTVERSION_SETTINGS_PAGE_ID); | ||||
|     } | ||||
| } | ||||
|  | ||||
| } // namespace Internal | ||||
| } // namespace QmlProfiler | ||||
|   | ||||
		Reference in New Issue
	
	Block a user