Commit 11264ef6 authored by Marco Bubke's avatar Marco Bubke

QmlDesigner: Switch to text mode if there is no qmlpuppet

Task-number: QTCREATORBUG-9390
Change-Id: I57da8b8b21fd14fe7e264f134ffa1f68eb9e06ce
Reviewed-by: default avatarThomas Hartmann <Thomas.Hartmann@digia.com>
parent 04126b47
......@@ -314,11 +314,13 @@ void PropertyEditorView::updateSize()
void PropertyEditorView::setupPanes()
{
QApplication::setOverrideCursor(QCursor(Qt::WaitCursor));
setupPane("QtQuick.Item");
resetView();
m_setupCompleted = true;
QApplication::restoreOverrideCursor();
if (isAttached()) {
QApplication::setOverrideCursor(QCursor(Qt::WaitCursor));
setupPane("QtQuick.Item");
resetView();
m_setupCompleted = true;
QApplication::restoreOverrideCursor();
}
}
void PropertyEditorView::setQmlDir(const QString &qmlDir)
......
......@@ -71,6 +71,8 @@
#include "import.h"
#include "qmldesignerplugin.h"
#include <utils/hostosinfo.h>
#include <QMessageBox>
......@@ -265,15 +267,19 @@ NodeInstanceServerProxy::NodeInstanceServerProxy(NodeInstanceView *nodeInstanceV
"Please check your installation. "
"QML Puppet is a process which runs in the background to render the items.").
arg(applicationPath));
QmlDesignerPlugin::instance()->switchToTextModeDeferred();
}
m_localServer->close();
} else {
QMessageBox::warning(0, tr("Wrong QML Puppet Executable Version"), tr("The QML Puppet version is incompatible with the Qt Creator version."));
QmlDesignerPlugin::instance()->switchToTextModeDeferred();
}
} else {
QMessageBox::warning(0, tr("Cannot Find QML Puppet Executable"), missingQmlPuppetErrorMessage(applicationPath));
QmlDesignerPlugin::instance()->switchToTextModeDeferred();
}
int indexOfCapturePuppetStream = QCoreApplication::arguments().indexOf("-capture-puppet-stream");
......
......@@ -48,7 +48,7 @@
#include <utils/hostosinfo.h>
#include <QAction>
#include <QTimer>
#include <QCoreApplication>
#include <qplugin.h>
#include <QDebug>
......@@ -373,6 +373,11 @@ Internal::DesignModeWidget *QmlDesignerPlugin::mainWidget() const
return m_mainWidget;
}
void QmlDesignerPlugin::switchToTextModeDeferred()
{
QTimer::singleShot(0, this, SLOT(switschToTextMode()));
}
void QmlDesignerPlugin::onTextEditorsClosed(QList<Core::IEditor*> editors)
{
if (m_documentManager.hasCurrentDesignDocument()
......@@ -440,6 +445,11 @@ void QmlDesignerPlugin::switchTextDesign()
}
}
void QmlDesignerPlugin::switschToTextMode()
{
Core::ModeManager::activateMode(Core::Constants::MODE_EDIT);
}
DesignerSettings QmlDesignerPlugin::settings()
{
m_settings.fromSettings(Core::ICore::settings());
......
......@@ -92,8 +92,11 @@ public:
DesignDocument *currentDesignDocument() const;
Internal::DesignModeWidget *mainWidget() const;
void switchToTextModeDeferred();
private slots:
void switchTextDesign();
void switschToTextMode();
void onTextEditorsClosed(QList<Core::IEditor *> editors);
void onCurrentEditorChanged(Core::IEditor *editor);
void onCurrentModeChanged(Core::IMode *mode, Core::IMode *oldMode);
......
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