instance->insertItem(DebugDebuggingHelpers, item);
item = new SavedAction(instance);
- item->setSettingsKey(debugModeGroup, QLatin1String("UseQmlObserver"));
- item->setText(tr("Use QML Observer"));
- item->setCheckable(true);
- item->setDefaultValue(true);
- item->setValue(true);
- instance->insertItem(UseQmlObserver, item);
-
- item = new SavedAction(instance);
item->setSettingsKey(debugModeGroup, QLatin1String("UseCodeModel"));
item->setText(tr("Use Code Model"));
item->setToolTip(tr("Selecting this causes the C++ Code Model being asked "
CustomDebuggingHelperLocation,
DebugDebuggingHelpers,
- UseQmlObserver,
-
UseCodeModel,
UseToolTipsInMainEditor,
}
}
-void DebuggerEngine::showQmlObserverToolWarning()
-{
- QMessageBox dialog(plugin()->mainWindow());
- QPushButton *qtPref = dialog.addButton(tr("Open Qt4 Options"),
- QMessageBox::ActionRole);
- QPushButton *helperOff = dialog.addButton(tr("Turn off QML Observer Usage"),
- QMessageBox::ActionRole);
- QPushButton *justContinue = dialog.addButton(tr("Continue Anyway"),
- QMessageBox::AcceptRole);
- dialog.setDefaultButton(justContinue);
- dialog.setWindowTitle(tr("QML Observer Missing"));
- dialog.setText(tr("QML Observer could not be found."));
- dialog.setInformativeText(tr(
- "QML Observer is used to offer additional 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 a Qt installation "
- "and click Rebuild."));
- dialog.exec();
- if (dialog.clickedButton() == qtPref) {
- Core::ICore::instance()->showOptionsDialog(
- _(Qt4ProjectManager::Constants::QT_SETTINGS_CATEGORY),
- _(Qt4ProjectManager::Constants::QTVERSION_SETTINGS_PAGE_ID));
- } else if (dialog.clickedButton() == helperOff) {
- theDebuggerAction(UseQmlObserver)
- ->setValue(qVariantFromValue(false), false);
- }
-}
-
QString DebuggerEngine::qtDumperLibraryName() const
{
if (theDebuggerAction(UseCustomDebuggingHelperLocation)->value().toBool())
quint16 qmlServerPort;
QString projectBuildDir;
QString projectDir;
- bool qmlObserverAvailable;
// for cpp+qml debugging
DebuggerEngineType cppEngineType;
QString qtDumperLibraryName() const;
QStringList qtDumperLibraryLocations() const;
void showQtDumperLibraryWarning(const QString &details);
- void showQmlObserverToolWarning();
static const char *stateName(int s);
m_group.insert(theDebuggerAction(UseCodeModel),
m_ui.checkBoxUseCodeModel);
- m_group.insert(theDebuggerAction(UseQmlObserver),
- m_ui.checkBoxUseQmlObserver);
-
#ifdef QT_DEBUG
m_group.insert(theDebuggerAction(DebugDebuggingHelpers),
m_ui.checkBoxDebugDebuggingHelpers);
<< ' ' << m_ui.customLocationGroupBox->title()
<< ' ' << m_ui.dumperLocationLabel->text()
<< ' ' << m_ui.checkBoxUseCodeModel->text()
- << ' ' << m_ui.checkBoxDebugDebuggingHelpers->text()
- << ' ' << m_ui.checkBoxUseQmlObserver->text();
+ << ' ' << m_ui.checkBoxDebugDebuggingHelpers->text();
m_searchKeywords.remove(QLatin1Char('&'));
}
return w;
<x>0</x>
<y>0</y>
<width>529</width>
- <height>411</height>
+ <height>303</height>
</rect>
</property>
<layout class="QVBoxLayout" name="verticalLayout_3">
</widget>
</item>
<item>
- <widget class="QLabel" name="label_2">
- <property name="text">
- <string>QML Observer is used to offer additional debugging facilities to QML applications, such as interactive preview of code changes and inspection tools.
-
-It is not strictly necessary for debugging with Qt Creator.</string>
- </property>
- <property name="wordWrap">
- <bool>true</bool>
- </property>
- </widget>
- </item>
- <item>
- <widget class="QCheckBox" name="checkBoxUseQmlObserver">
- <property name="text">
- <string>Use QML Observer</string>
- </property>
- </widget>
- </item>
- <item>
<spacer name="verticalSpacer">
<property name="orientation">
<enum>Qt::Vertical</enum>
<extends>QWidget</extends>
<header location="global">utils/pathchooser.h</header>
<container>1</container>
+ <slots>
+ <signal>editingFinished()</signal>
+ <signal>browsingFinished()</signal>
+ </slots>
</customwidget>
</customwidgets>
<resources/>
void QmlEngine::setupEngine()
{
- if (!d->m_attachToRunningExternalApp
- && !startParameters().qmlObserverAvailable
- && Internal::theDebuggerBoolSetting(Internal::UseQmlObserver))
- {
- showQmlObserverToolWarning();
- }
-
d->m_adapter->setMaxConnectionAttempts(MaxConnectionAttempts);
d->m_adapter->setConnectionAttemptInterval(ConnectionAttemptDefaultInterval);
connect(d->m_adapter, SIGNAL(connectionError(QAbstractSocket::SocketError)),
#include <debugger/debuggeruiswitcher.h>
#include <debugger/debuggerengine.h>
#include <qmljsinspector/qmljsinspectorconstants.h>
+#include <qt4projectmanager/qt4projectmanagerconstants.h>
+#include <QApplication>
#include <QDir>
#include <QLabel>
#include <QMessageBox>
+#include <QPushButton>
using ProjectExplorer::RunConfiguration;
using ProjectExplorer::RunControl;
m_applicationLauncher.setEnvironment(environment.toStringList());
m_applicationLauncher.setWorkingDirectory(runConfiguration->workingDirectory());
- m_executable = runConfiguration->viewerPath();
+ if (mode == ProjectExplorer::Constants::RUNMODE) {
+ m_executable = runConfiguration->viewerPath();
+ } else {
+ m_executable = runConfiguration->observerPath();
+ }
m_commandLineArguments = runConfiguration->viewerArguments();
connect(&m_applicationLauncher, SIGNAL(appendMessage(QString,bool)),
{
QmlProjectRunConfiguration *config = qobject_cast<QmlProjectRunConfiguration*>(runConfiguration);
if (mode == ProjectExplorer::Constants::RUNMODE) {
- return config != 0;
- } else if (mode == ProjectExplorer::Constants::DEBUGMODE) {
+ return config != 0 && !config->viewerPath().isEmpty();
+ } else {
bool qmlDebugSupportInstalled = Debugger::DebuggerUISwitcher::instance()->supportedLanguages()
& Debugger::QmlLanguage;
+ // don't check for qmlobserver already here because we can't update the run buttons
+ // if it has been built in the meantime
return (config != 0) && qmlDebugSupportInstalled;
}
RunControl *runControl = 0;
if (mode == ProjectExplorer::Constants::RUNMODE) {
runControl = new QmlRunControl(config, mode);
- } else {
+ } else if (mode == ProjectExplorer::Constants::DEBUGMODE) {
runControl = createDebugRunControl(config);
}
return runControl;
Utils::Environment environment = Utils::Environment::systemEnvironment();
Debugger::DebuggerStartParameters params;
params.startMode = Debugger::StartInternal;
- params.executable = runConfig->viewerPath();
+ params.executable = runConfig->observerPath();
params.qmlServerAddress = "127.0.0.1";
params.qmlServerPort = runConfig->qmlDebugServerPort();
- params.qmlObserverAvailable = runConfig->qmlObserverAvailable();
params.processArgs = runConfig->viewerArguments();
params.processArgs.append(QLatin1String("-qmljsdebugger=port:") + QString::number(runConfig->qmlDebugServerPort()));
params.workingDirectory = runConfig->workingDirectory();
params.environment = environment.toStringList();
params.displayName = runConfig->displayName();
+ if (params.executable.isEmpty()) {
+ showQmlObserverToolWarning();
+ return 0;
+ }
+
Debugger::DebuggerRunControl *debuggerRunControl = Debugger::DebuggerPlugin::createDebugger(params, runConfig);
return debuggerRunControl;
}
+void QmlRunControlFactory::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(
+ Qt4ProjectManager::Constants::QT_SETTINGS_CATEGORY,
+ Qt4ProjectManager::Constants::QTVERSION_SETTINGS_PAGE_ID);
+ }
+}
+
} // namespace Internal
} // namespace QmlProjectManager
private:
ProjectExplorer::RunControl *createDebugRunControl(QmlProjectRunConfiguration *runConfig);
+ static void showQmlObserverToolWarning();
};
} // namespace Internal