summaryrefslogtreecommitdiff
path: root/src/plugins/qmlprojectmanager
diff options
context:
space:
mode:
authorChristiaan Janssen <christiaan.janssen@nokia.com>2011-07-21 10:40:56 +0200
committerChristiaan Janssen <christiaan.janssen@nokia.com>2011-07-21 10:54:16 +0200
commited5030f1249d6392d7fa613a9904ace7d98452c3 (patch)
treeec1394618e60e93a4a7b5083e0d9cae1dc0e4fed /src/plugins/qmlprojectmanager
parentc9ffc770aae31e73a216908ae5ae6f62252d4a52 (diff)
downloadqt-creator-ed5030f1249d6392d7fa613a9904ace7d98452c3.tar.gz
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>
Diffstat (limited to 'src/plugins/qmlprojectmanager')
-rw-r--r--src/plugins/qmlprojectmanager/qmlprojectplugin.cpp39
-rw-r--r--src/plugins/qmlprojectmanager/qmlprojectplugin.h10
-rw-r--r--src/plugins/qmlprojectmanager/qmlprojectruncontrol.cpp34
-rw-r--r--src/plugins/qmlprojectmanager/qmlprojectruncontrol.h1
4 files changed, 44 insertions, 40 deletions
diff --git a/src/plugins/qmlprojectmanager/qmlprojectplugin.cpp b/src/plugins/qmlprojectmanager/qmlprojectplugin.cpp
index bab91d3611..258927156f 100644
--- a/src/plugins/qmlprojectmanager/qmlprojectplugin.cpp
+++ b/src/plugins/qmlprojectmanager/qmlprojectplugin.cpp
@@ -50,10 +50,15 @@
#include <projectexplorer/taskhub.h>
+#include <qtsupport/qtsupportconstants.h>
+
#include <QtCore/QtPlugin>
+#include <QtGui/QApplication>
+#include <QtGui/QMessageBox>
+#include <QtGui/QPushButton>
+
namespace QmlProjectManager {
-namespace Internal {
QmlProjectPlugin::QmlProjectPlugin()
{ }
@@ -74,13 +79,13 @@ bool QmlProjectPlugin::initialize(const QStringList &, QString *errorMessage)
if (! mimeDB->addMimeTypes(mimetypesXml, errorMessage))
return false;
- Manager *manager = new Manager;
+ Internal::Manager *manager = new Internal::Manager;
addAutoReleasedObject(manager);
addAutoReleasedObject(new Internal::QmlProjectRunConfigurationFactory);
addAutoReleasedObject(new Internal::QmlProjectRunControlFactory);
- addAutoReleasedObject(new QmlProjectApplicationWizard);
- addAutoReleasedObject(new QmlProjectTargetFactory);
+ addAutoReleasedObject(new Internal::QmlProjectApplicationWizard);
+ addAutoReleasedObject(new Internal::QmlProjectTargetFactory);
QmlProjectFileFormat::registerDeclarativeTypes();
@@ -93,7 +98,29 @@ void QmlProjectPlugin::extensionsInitialized()
{
}
-} // namespace Internal
+void QmlProjectPlugin::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 QmlProjectManager
-Q_EXPORT_PLUGIN(QmlProjectManager::Internal::QmlProjectPlugin)
+Q_EXPORT_PLUGIN(QmlProjectManager::QmlProjectPlugin)
diff --git a/src/plugins/qmlprojectmanager/qmlprojectplugin.h b/src/plugins/qmlprojectmanager/qmlprojectplugin.h
index 7b5d37ac65..8e1ce09da0 100644
--- a/src/plugins/qmlprojectmanager/qmlprojectplugin.h
+++ b/src/plugins/qmlprojectmanager/qmlprojectplugin.h
@@ -33,6 +33,8 @@
#ifndef QMLPROJECTPLUGIN_H
#define QMLPROJECTPLUGIN_H
+#include "qmlprojectmanager_global.h"
+
#include <extensionsystem/iplugin.h>
#include <QtCore/QObject>
@@ -42,7 +44,9 @@ namespace Internal {
class ProjectFilesFactory;
-class QmlProjectPlugin: public ExtensionSystem::IPlugin
+}
+
+class QMLPROJECTMANAGER_EXPORT QmlProjectPlugin: public ExtensionSystem::IPlugin
{
Q_OBJECT
@@ -52,9 +56,11 @@ public:
virtual bool initialize(const QStringList &arguments, QString *errorString);
virtual void extensionsInitialized();
+
+ static void showQmlObserverToolWarning();
+
};
-} // namespace Internal
} // namespace QmlProject
#endif // QMLPROJECTPLUGIN_H
diff --git a/src/plugins/qmlprojectmanager/qmlprojectruncontrol.cpp b/src/plugins/qmlprojectmanager/qmlprojectruncontrol.cpp
index 6bf422b093..80c7d29df6 100644
--- a/src/plugins/qmlprojectmanager/qmlprojectruncontrol.cpp
+++ b/src/plugins/qmlprojectmanager/qmlprojectruncontrol.cpp
@@ -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
diff --git a/src/plugins/qmlprojectmanager/qmlprojectruncontrol.h b/src/plugins/qmlprojectmanager/qmlprojectruncontrol.h
index 02a22c9728..be612a0de5 100644
--- a/src/plugins/qmlprojectmanager/qmlprojectruncontrol.h
+++ b/src/plugins/qmlprojectmanager/qmlprojectruncontrol.h
@@ -82,7 +82,6 @@ public:
private:
ProjectExplorer::RunControl *createDebugRunControl(QmlProjectRunConfiguration *runConfig);
- static void showQmlObserverToolWarning();
};
} // namespace Internal