forked from qt-creator/qt-creator
QmlJSInspector: Disable Zoom Tool for QmlDebugger
Zoom Tool and Select Tool are combined for QmlDebugger. The Zoom Tool is enabled only for backwards compatibility. Change-Id: Id66eb94ce0535ccac169fa5a80f937370a0f9f6f Reviewed-by: Kai Koehne <kai.koehne@nokia.com>
This commit is contained in:
@@ -30,12 +30,13 @@
|
||||
**************************************************************************/
|
||||
|
||||
#include "qmldebuggerclient.h"
|
||||
#include "qmljsdebugclientconstants.h"
|
||||
|
||||
namespace QmlJsDebugClient {
|
||||
|
||||
QmlDebuggerClient::QmlDebuggerClient(
|
||||
QDeclarativeDebugConnection *connection)
|
||||
: QmlEngineDebugClient(QLatin1String("QmlDebugger"), connection)
|
||||
: QmlEngineDebugClient(QLatin1String(Constants::QML_DEBUGGER), connection)
|
||||
{
|
||||
}
|
||||
|
||||
|
@@ -30,8 +30,7 @@
|
||||
**************************************************************************/
|
||||
|
||||
#include "qmlenginedebugclient.h"
|
||||
|
||||
const float CURRENT_SUPPORTED_VERSION = 2.0;
|
||||
#include "qmljsdebugclientconstants.h"
|
||||
|
||||
namespace QmlJsDebugClient {
|
||||
|
||||
@@ -80,7 +79,7 @@ void QmlEngineDebugClient::decode(QDataStream &ds,
|
||||
ds >> data;
|
||||
int parentId = -1;
|
||||
if (objectName() == QLatin1String("QmlDebugger") &&
|
||||
serviceVersion() >= CURRENT_SUPPORTED_VERSION )
|
||||
serviceVersion() >= Constants::CURRENT_SUPPORTED_VERSION )
|
||||
ds >> parentId;
|
||||
o.m_debugId = data.objectId;
|
||||
o.m_className = data.objectType;
|
||||
|
@@ -44,6 +44,9 @@ const char STR_IGNORING_DEBUGGER[] = "Ignoring \"-qmljsdebugger=";
|
||||
const char STR_IGNORING_DEBUGGER2[] = "Ignoring\"-qmljsdebugger="; // There is (was?) a bug in one of the error strings - safest to handle both
|
||||
const char STR_CONNECTION_ESTABLISHED[] = "Connection established";
|
||||
|
||||
const char QML_DEBUGGER[] = "QmlDebugger";
|
||||
const float CURRENT_SUPPORTED_VERSION = 2.0;
|
||||
|
||||
} // namespace Constants
|
||||
} // namespace QmlJsDebugClient
|
||||
|
||||
|
@@ -127,6 +127,11 @@ void ClientProxy::clientStatusChanged(QDeclarativeDebugClient::Status status)
|
||||
updateConnected();
|
||||
}
|
||||
|
||||
QDeclarativeDebugClient *ClientProxy::qmlDebugger() const
|
||||
{
|
||||
return m_engineClient;
|
||||
}
|
||||
|
||||
void ClientProxy::engineClientStatusChanged(QDeclarativeDebugClient::Status status)
|
||||
{
|
||||
if (status == QDeclarativeDebugClient::Enabled) {
|
||||
|
@@ -99,6 +99,8 @@ public:
|
||||
void fetchContextObjectRecursive(const QmlDebugContextReference &context, bool clear);
|
||||
void insertObjectInTreeIfNeeded(const QmlDebugObjectReference &object);
|
||||
|
||||
QDeclarativeDebugClient *qmlDebugger() const;
|
||||
|
||||
signals:
|
||||
void objectTreeUpdated();
|
||||
void connectionStatusMessage(const QString &text);
|
||||
|
@@ -50,6 +50,7 @@
|
||||
#include <debugger/qml/qmlengine.h>
|
||||
#include <debugger/debuggerstartparameters.h>
|
||||
#include <debugger/qml/qmladapter.h>
|
||||
#include <qmljsdebugclient/qmljsdebugclientconstants.h>
|
||||
|
||||
#include <utils/filterlineedit.h>
|
||||
#include <utils/qtcassert.h>
|
||||
@@ -315,7 +316,12 @@ void InspectorUi::connected(ClientProxy *clientProxy)
|
||||
if (m_clientProxy)
|
||||
connect(m_clientProxy, SIGNAL(result(quint32,QVariant)),
|
||||
SLOT(onResult(quint32,QVariant)));
|
||||
|
||||
using namespace QmlJsDebugClient::Constants;
|
||||
if (m_clientProxy->qmlDebugger()->objectName() == QML_DEBUGGER &&
|
||||
m_clientProxy->qmlDebugger()->serviceVersion() >= CURRENT_SUPPORTED_VERSION)
|
||||
m_toolBar->setZoomToolEnabled(false);
|
||||
else
|
||||
m_toolBar->setZoomToolEnabled(true);
|
||||
QmlJS::Snapshot snapshot = modelManager()->snapshot();
|
||||
for (QHash<QString, QmlJSLiveTextPreview *>::const_iterator it = m_textPreviews.constBegin();
|
||||
it != m_textPreviews.constEnd(); ++it) {
|
||||
|
@@ -79,7 +79,8 @@ QmlJsInspectorToolBar::QmlJsInspectorToolBar(QObject *parent) :
|
||||
m_animationSpeed(1.0f),
|
||||
m_designModeActive(false),
|
||||
m_activeTool(NoTool),
|
||||
m_barWidget(0)
|
||||
m_barWidget(0),
|
||||
m_zoomActionEnable(true)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -89,7 +90,7 @@ void QmlJsInspectorToolBar::setEnabled(bool value)
|
||||
m_showAppOnTopAction->setEnabled(value);
|
||||
m_playAction->setEnabled(value);
|
||||
m_selectAction->setEnabled(value);
|
||||
m_zoomAction->setEnabled(value);
|
||||
m_zoomAction->setEnabled(value && m_zoomActionEnable);
|
||||
}
|
||||
|
||||
void QmlJsInspectorToolBar::enable()
|
||||
@@ -162,6 +163,12 @@ void QmlJsInspectorToolBar::setShowAppOnTop(bool showAppOnTop)
|
||||
m_emitSignals = true;
|
||||
}
|
||||
|
||||
void QmlJsInspectorToolBar::setZoomToolEnabled(bool enable)
|
||||
{
|
||||
m_zoomActionEnable = enable;
|
||||
m_zoomAction->setEnabled(m_zoomActionEnable);
|
||||
}
|
||||
|
||||
void QmlJsInspectorToolBar::createActions()
|
||||
{
|
||||
Core::Context context(Debugger::Constants::C_QMLDEBUGGER);
|
||||
|
@@ -71,6 +71,7 @@ public:
|
||||
void createActions();
|
||||
QWidget *widget() const;
|
||||
void readSettings();
|
||||
void setZoomToolEnabled(bool enable);
|
||||
|
||||
public slots:
|
||||
void writeSettings() const;
|
||||
@@ -137,6 +138,7 @@ private:
|
||||
DesignTool m_activeTool;
|
||||
|
||||
QWidget *m_barWidget;
|
||||
bool m_zoomActionEnable;
|
||||
};
|
||||
|
||||
} // namespace Internal
|
||||
|
Reference in New Issue
Block a user