forked from qt-creator/qt-creator
Merge remote branch 'origin/2.1'
Conflicts: README doc/qt-html-templates.qdocconf doc/qtcreator.qdoc doc/qtcreator.qdocconf share/qtcreator/templates/wizards/qtcreatorplugin/MyPlugin.pluginspec src/app/Info.plist src/plugins/bineditor/BinEditor.pluginspec src/plugins/bookmarks/Bookmarks.pluginspec src/plugins/classview/ClassView.pluginspec src/plugins/cmakeprojectmanager/CMakeProjectManager.pluginspec src/plugins/coreplugin/Core.pluginspec src/plugins/coreplugin/coreconstants.h src/plugins/cpaster/CodePaster.pluginspec src/plugins/cppeditor/CppEditor.pluginspec src/plugins/cpptools/CppTools.pluginspec src/plugins/cvs/CVS.pluginspec src/plugins/debugger/Debugger.pluginspec src/plugins/debugger/breakhandler.cpp src/plugins/designer/Designer.pluginspec src/plugins/fakevim/FakeVim.pluginspec src/plugins/find/Find.pluginspec src/plugins/genericprojectmanager/GenericProjectManager.pluginspec src/plugins/git/ScmGit.pluginspec src/plugins/helloworld/HelloWorld.pluginspec src/plugins/help/Help.pluginspec src/plugins/imageviewer/ImageViewer.pluginspec src/plugins/locator/Locator.pluginspec src/plugins/mercurial/Mercurial.pluginspec src/plugins/perforce/Perforce.pluginspec src/plugins/projectexplorer/ProjectExplorer.pluginspec src/plugins/qmldesigner/QmlDesigner.pluginspec src/plugins/qmljseditor/QmlJSEditor.pluginspec src/plugins/qmljsinspector/QmlJSInspector.pluginspec src/plugins/qmlprojectmanager/QmlProjectManager.pluginspec src/plugins/qt4projectmanager/Qt4ProjectManager.pluginspec src/plugins/regexp/RegExp.pluginspec src/plugins/resourceeditor/ResourceEditor.pluginspec src/plugins/snippets/Snippets.pluginspec src/plugins/subversion/Subversion.pluginspec src/plugins/tasklist/TaskList.pluginspec src/plugins/texteditor/TextEditor.pluginspec src/plugins/vcsbase/VCSBase.pluginspec src/plugins/welcome/Welcome.pluginspec tests/auto/cplusplus/codeformatter/tst_codeformatter.cpp tests/manual/fakevim/fakevim.pro tests/manual/ssh/errorhandling/main.cpp
This commit is contained in:
@@ -59,7 +59,7 @@ static QToolButton *createToolButton(QAction *action)
|
||||
QmlInspectorToolbar::QmlInspectorToolbar(QObject *parent) :
|
||||
QObject(parent),
|
||||
m_observerModeAction(0),
|
||||
m_reloadAction(0),
|
||||
// m_reloadAction(0),
|
||||
m_playAction(0),
|
||||
m_selectAction(0),
|
||||
m_zoomAction(0),
|
||||
@@ -91,7 +91,7 @@ void QmlInspectorToolbar::setEnabled(bool value)
|
||||
//m_toQmlAction->setEnabled(value);
|
||||
m_fromQmlAction->setEnabled(value);
|
||||
|
||||
m_reloadAction->setEnabled(value);
|
||||
// m_reloadAction->setEnabled(value);
|
||||
m_playAction->setEnabled(value);
|
||||
m_selectAction->setEnabled(value);
|
||||
m_zoomAction->setEnabled(value);
|
||||
@@ -178,10 +178,10 @@ void QmlInspectorToolbar::createActions(const Core::Context &context)
|
||||
Core::ICore *core = Core::ICore::instance();
|
||||
Core::ActionManager *am = core->actionManager();
|
||||
|
||||
m_fromQmlAction = new QAction(QIcon(QLatin1String(":/qml/images/from-qml-small.png")), tr("Apply Changes to Document"), this);
|
||||
m_observerModeAction = new QAction(QIcon(QLatin1String(":/qml/images/observermode.png")), tr("Observer Mode"), this);
|
||||
m_fromQmlAction = new QAction(QIcon(QLatin1String(":/qml/images/from-qml-small.png")), tr("Apply Changes on Save"), this);
|
||||
// m_reloadAction = new QAction(QIcon(QLatin1String(":/qml/images/reload.png")), tr("Reload QML"), this);
|
||||
|
||||
m_reloadAction = new QAction(QIcon(QLatin1String(":/qml/images/reload.png")), tr("Reload"), this);
|
||||
m_observerModeAction = new QAction(QIcon(QLatin1String(":/qml/images/observermode.png")), tr("Observer Mode"), this);
|
||||
m_playAction = new QAction(m_pauseIcon, tr("Play/Pause Animations"), this);
|
||||
m_selectAction = new QAction(QIcon(QLatin1String(":/qml/images/select-small.png")), tr("Select"), this);
|
||||
m_zoomAction = new QAction(QIcon(QLatin1String(":/qml/images/zoom-small.png")), tr("Zoom"), this);
|
||||
@@ -198,7 +198,7 @@ void QmlInspectorToolbar::createActions(const Core::Context &context)
|
||||
m_fromQmlAction->setChecked(true);
|
||||
|
||||
am->registerAction(m_observerModeAction, QmlJSInspector::Constants::DESIGNMODE_ACTION, context);
|
||||
am->registerAction(m_reloadAction, QmlJSInspector::Constants::RELOAD_ACTION, context);
|
||||
// am->registerAction(m_reloadAction, QmlJSInspector::Constants::RELOAD_ACTION, context);
|
||||
am->registerAction(m_playAction, QmlJSInspector::Constants::PLAY_ACTION, context);
|
||||
am->registerAction(m_selectAction, QmlJSInspector::Constants::SELECT_ACTION, context);
|
||||
am->registerAction(m_zoomAction, QmlJSInspector::Constants::ZOOM_ACTION, context);
|
||||
@@ -248,9 +248,10 @@ void QmlInspectorToolbar::createActions(const Core::Context &context)
|
||||
// configBarLayout->addWidget(createToolButton(am->command(ProjectExplorer::Constants::DEBUG)->action()));
|
||||
// configBarLayout->addWidget(createToolButton(am->command(ProjectExplorer::Constants::STOP)->action()));
|
||||
configBarLayout->addWidget(createToolButton(am->command(QmlJSInspector::Constants::FROM_QML_ACTION)->action()));
|
||||
configBarLayout->addWidget(createToolButton(am->command(QmlJSInspector::Constants::DESIGNMODE_ACTION)->action()));
|
||||
configBarLayout->addWidget(createToolButton(am->command(QmlJSInspector::Constants::RELOAD_ACTION)->action()));
|
||||
// configBarLayout->addWidget(createToolButton(am->command(QmlJSInspector::Constants::RELOAD_ACTION)->action()));
|
||||
configBarLayout->addSpacing(10);
|
||||
|
||||
configBarLayout->addWidget(createToolButton(am->command(QmlJSInspector::Constants::DESIGNMODE_ACTION)->action()));
|
||||
m_playButton = createToolButton(am->command(QmlJSInspector::Constants::PLAY_ACTION)->action());
|
||||
m_playButton->setMenu(playSpeedMenu);
|
||||
configBarLayout->addWidget(m_playButton);
|
||||
@@ -277,7 +278,7 @@ void QmlInspectorToolbar::createActions(const Core::Context &context)
|
||||
setEnabled(false);
|
||||
|
||||
connect(m_observerModeAction, SIGNAL(triggered()), SLOT(activateDesignModeOnClick()));
|
||||
connect(m_reloadAction, SIGNAL(triggered()), SIGNAL(reloadSelected()));
|
||||
// connect(m_reloadAction, SIGNAL(triggered()), SIGNAL(reloadSelected()));
|
||||
|
||||
connect(m_colorPickerAction, SIGNAL(triggered()), SLOT(activateColorPickerOnClick()));
|
||||
|
||||
@@ -330,7 +331,7 @@ void QmlInspectorToolbar::activateDesignModeOnClick()
|
||||
{
|
||||
bool checked = m_observerModeAction->isChecked();
|
||||
|
||||
m_reloadAction->setEnabled(true);
|
||||
// m_reloadAction->setEnabled(true);
|
||||
m_playAction->setEnabled(checked);
|
||||
m_selectAction->setEnabled(checked);
|
||||
m_zoomAction->setEnabled(checked);
|
||||
|
||||
@@ -116,7 +116,7 @@ private slots:
|
||||
|
||||
private:
|
||||
QAction *m_observerModeAction;
|
||||
QAction *m_reloadAction;
|
||||
// QAction *m_reloadAction;
|
||||
QAction *m_playAction;
|
||||
QAction *m_selectAction;
|
||||
QAction *m_zoomAction;
|
||||
|
||||
@@ -44,6 +44,10 @@
|
||||
#include <QAbstractSocket>
|
||||
#include <QDebug>
|
||||
|
||||
enum {
|
||||
debug = false
|
||||
};
|
||||
|
||||
using namespace QmlJSInspector::Internal;
|
||||
|
||||
ClientProxy::ClientProxy(Debugger::QmlAdapter *adapter, QObject *parent)
|
||||
@@ -266,7 +270,8 @@ bool ClientProxy::setBindingForObject(int objectDebugId,
|
||||
const QVariant &value,
|
||||
bool isLiteralValue)
|
||||
{
|
||||
qDebug() << "setBindingForObject():" << objectDebugId << propertyName << value;
|
||||
if (debug)
|
||||
qDebug() << "setBindingForObject():" << objectDebugId << propertyName << value;
|
||||
if (objectDebugId == -1)
|
||||
return false;
|
||||
|
||||
@@ -280,7 +285,8 @@ bool ClientProxy::setBindingForObject(int objectDebugId,
|
||||
|
||||
bool ClientProxy::setMethodBodyForObject(int objectDebugId, const QString &methodName, const QString &methodBody)
|
||||
{
|
||||
qDebug() << "setMethodBodyForObject():" << objectDebugId << methodName << methodBody;
|
||||
if (debug)
|
||||
qDebug() << "setMethodBodyForObject():" << objectDebugId << methodName << methodBody;
|
||||
if (objectDebugId == -1)
|
||||
return 0;
|
||||
return m_client->setMethodBody(objectDebugId, methodName, methodBody);
|
||||
@@ -288,7 +294,8 @@ bool ClientProxy::setMethodBodyForObject(int objectDebugId, const QString &metho
|
||||
|
||||
bool ClientProxy::resetBindingForObject(int objectDebugId, const QString& propertyName)
|
||||
{
|
||||
qDebug() << "resetBindingForObject():" << objectDebugId << propertyName;
|
||||
if (debug)
|
||||
qDebug() << "resetBindingForObject():" << objectDebugId << propertyName;
|
||||
if (objectDebugId == -1)
|
||||
return false;
|
||||
// if (propertyName == QLatin1String("id")) return false;
|
||||
@@ -297,6 +304,8 @@ bool ClientProxy::resetBindingForObject(int objectDebugId, const QString& proper
|
||||
|
||||
QDeclarativeDebugExpressionQuery *ClientProxy::queryExpressionResult(int objectDebugId, const QString &expr, QObject *parent)
|
||||
{
|
||||
if (debug)
|
||||
qDebug() << "queryExpressionResult():" << objectDebugId << expr << parent;
|
||||
if (objectDebugId != -1)
|
||||
return m_client->queryExpressionResult(objectDebugId,expr,parent);
|
||||
return 0;
|
||||
@@ -401,14 +410,14 @@ void ClientProxy::buildDebugIdHashRecursive(const QDeclarativeDebugObjectReferen
|
||||
int rev = 0;
|
||||
|
||||
// handle the case where the url contains the revision number encoded. (for object created by the debugger)
|
||||
static QRegExp rx("^(.*)_(\\d+):(\\d+)$");
|
||||
static QRegExp rx("^file://(.*)_(\\d+):(\\d+)$");
|
||||
if (rx.exactMatch(filename)) {
|
||||
filename = rx.cap(1);
|
||||
rev = rx.cap(2).toInt();
|
||||
lineNum += rx.cap(3).toInt() - 1;
|
||||
}
|
||||
|
||||
//convert the filename to a canonical filename in case of febug build.
|
||||
//convert the filename to a canonical filename in case of shadow build.
|
||||
bool isShadowBuild = InspectorUi::instance()->isShadowBuildProject();
|
||||
if (isShadowBuild && rev == 0) {
|
||||
QString shadowBuildDir = InspectorUi::instance()->debugProjectBuildDirectory();
|
||||
|
||||
@@ -261,6 +261,11 @@ void InspectorUi::debugQueryUpdated(QDeclarativeDebugQuery::State newState)
|
||||
disconnect(m_debugQuery,SIGNAL(stateChanged(QDeclarativeDebugQuery::State)),this,SLOT(debugQueryUpdated(QDeclarativeDebugQuery::State)));
|
||||
}
|
||||
|
||||
bool InspectorUi::isConnected() const
|
||||
{
|
||||
return m_clientProxy;
|
||||
}
|
||||
|
||||
void InspectorUi::connected(ClientProxy *clientProxy)
|
||||
{
|
||||
m_clientProxy = clientProxy;
|
||||
|
||||
@@ -103,6 +103,7 @@ public:
|
||||
bool isShadowBuildProject() const;
|
||||
|
||||
void setupUi();
|
||||
bool isConnected() const;
|
||||
void connected(ClientProxy *clientProxy);
|
||||
void disconnected();
|
||||
void setDebuggerEngine(Debugger::QmlEngine *qmlEngine);
|
||||
|
||||
@@ -43,7 +43,7 @@ const char * const INFO_EXPERIMENTAL = "QmlInspector.Experimental";
|
||||
const char * const INFO_OUT_OF_SYNC = "QmlInspector.OutOfSyncWarning";
|
||||
|
||||
const char * const DESIGNMODE_ACTION = "QmlInspector.DesignMode";
|
||||
const char * const RELOAD_ACTION = "QmlInspector.Reload";
|
||||
//const char * const RELOAD_ACTION = "QmlInspector.Reload";
|
||||
const char * const PLAY_ACTION = "QmlInspector.Play";
|
||||
const char * const SELECT_ACTION = "QmlInspector.Select";
|
||||
const char * const SELECT_MARQUEE_ACTION = "QmlInspector.SelectMarquee";
|
||||
|
||||
@@ -140,7 +140,8 @@ void InspectorPlugin::objectAdded(QObject *object)
|
||||
void InspectorPlugin::aboutToRemoveObject(QObject *obj)
|
||||
{
|
||||
if (m_clientProxy && m_clientProxy->qmlAdapter() == obj) {
|
||||
m_inspectorUi->disconnected();
|
||||
if (m_inspectorUi->isConnected())
|
||||
m_inspectorUi->disconnected();
|
||||
delete m_clientProxy;
|
||||
m_clientProxy = 0;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user