forked from qt-creator/qt-creator
QmlProjectManager: moved the no-observer warning dialog to qmlprojectplugin
Change-Id: I6ce724e0db17d22616adcdf058d1f05af7124b64 Reviewed-on: http://codereview.qt.nokia.com/1929 Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Kai Koehne <kai.koehne@nokia.com>
This commit is contained in:
@@ -50,20 +50,15 @@
|
||||
#include <debugger/debuggerengine.h>
|
||||
#include <debugger/debuggerstartparameters.h>
|
||||
#include <qmljsinspector/qmljsinspectorconstants.h>
|
||||
#include <qtsupport/qtversionmanager.h>
|
||||
#include <qtsupport/qmlobservertool.h>
|
||||
#include <qtsupport/qtsupportconstants.h>
|
||||
|
||||
#include <QtGui/QApplication>
|
||||
#include <QtGui/QLabel>
|
||||
#include <QtGui/QMessageBox>
|
||||
#include <QtGui/QPushButton>
|
||||
#include <qmlprojectmanager/qmlprojectplugin.h>
|
||||
|
||||
#include <QtCore/QDir>
|
||||
|
||||
using namespace ProjectExplorer;
|
||||
|
||||
namespace QmlProjectManager {
|
||||
|
||||
namespace Internal {
|
||||
|
||||
QmlProjectRunControl::QmlProjectRunControl(QmlProjectRunConfiguration *runConfiguration, QString mode)
|
||||
@@ -213,35 +208,12 @@ RunControl *QmlProjectRunControlFactory::createDebugRunControl(QmlProjectRunConf
|
||||
params.projectSourceFiles = runConfig->target()->project()->files(Project::ExcludeGeneratedFiles);
|
||||
|
||||
if (params.executable.isEmpty()) {
|
||||
showQmlObserverToolWarning();
|
||||
QmlProjectPlugin::showQmlObserverToolWarning();
|
||||
return 0;
|
||||
}
|
||||
|
||||
return Debugger::DebuggerPlugin::createDebugger(params, runConfig);
|
||||
}
|
||||
|
||||
void QmlProjectRunControlFactory::showQmlObserverToolWarning()
|
||||
{
|
||||
QMessageBox dialog(QApplication::activeWindow());
|
||||
QPushButton *qtPref = dialog.addButton(tr("Open Qt4 Options"),
|
||||
QMessageBox::ActionRole);
|
||||
dialog.addButton(tr("Cancel"), QMessageBox::ActionRole);
|
||||
dialog.setDefaultButton(qtPref);
|
||||
dialog.setWindowTitle(tr("QML Observer Missing"));
|
||||
dialog.setText(tr("QML Observer could not be found."));
|
||||
dialog.setInformativeText(tr(
|
||||
"QML Observer is used to offer debugging features for "
|
||||
"QML applications, such as interactive debugging and inspection tools. "
|
||||
"It must be compiled for each used Qt version separately. "
|
||||
"On the Qt4 options page, select the current Qt installation "
|
||||
"and click Rebuild."));
|
||||
dialog.exec();
|
||||
if (dialog.clickedButton() == qtPref) {
|
||||
Core::ICore::instance()->showOptionsDialog(
|
||||
QtSupport::Constants::QT_SETTINGS_CATEGORY,
|
||||
QtSupport::Constants::QTVERSION_SETTINGS_PAGE_ID);
|
||||
}
|
||||
}
|
||||
|
||||
} // namespace Internal
|
||||
} // namespace QmlProjectManager
|
||||
|
||||
Reference in New Issue
Block a user