QmlObserver: Disable crumblepath if not active

This commit is contained in:
Kai Koehne
2011-04-27 17:20:44 +02:00
parent 7812f15240
commit 8a28be85c6
6 changed files with 29 additions and 5 deletions

View File

@@ -290,8 +290,6 @@ void QmlInspectorToolBar::createActions(const Core::Context &context)
m_colorBox->setOuterBorderColor(QColor(58, 58, 58));
toolBarLayout->addWidget(m_colorBox);
setEnabled(false);
connect(m_fromQmlAction, SIGNAL(triggered()), SLOT(activateFromQml()));
connect(m_showAppOnTopAction, SIGNAL(triggered()), SLOT(showAppOnTopClick()));
connect(m_observerModeAction, SIGNAL(triggered()), SLOT(activateDesignModeOnClick()));

View File

@@ -48,7 +48,7 @@ void ContextCrumblePath::updateContextPath(const QStringList &path, const QList<
{
Q_ASSERT(path.count() == debugIds.count());
clear();
CrumblePath::clear();
m_isEmpty = path.isEmpty();
if (m_isEmpty) {
@@ -66,6 +66,11 @@ void ContextCrumblePath::addChildren(const QStringList &childrenNames, const QLi
addChild(childrenNames[i], QVariant(childrenDebugIds[i]));
}
void ContextCrumblePath::clear()
{
updateContextPath(QStringList(), QList<int>());
}
bool ContextCrumblePath::isEmpty() const
{
return m_isEmpty;

View File

@@ -51,6 +51,7 @@ public:
public slots:
void updateContextPath(const QStringList &path, const QList<int> &debugIds);
void addChildren(const QStringList &childrenNames, const QList<int> &childrenDebugIds);
void clear();
private:
bool m_isEmpty;

View File

@@ -168,6 +168,8 @@ void InspectorUi::setupUi()
{
setupDockWidgets();
restoreSettings();
disable();
}
void InspectorUi::saveSettings() const
@@ -630,6 +632,7 @@ void InspectorUi::enable()
m_toolBar->enable();
m_crumblePath->setEnabled(true);
m_propertyInspector->setEnabled(true);
m_filterExp->setEnabled(true);
}
void InspectorUi::disable()
@@ -637,6 +640,7 @@ void InspectorUi::disable()
m_toolBar->disable();
m_crumblePath->setEnabled(false);
m_propertyInspector->setEnabled(false);
m_filterExp->setEnabled(false);
}
QDeclarativeDebugObjectReference InspectorUi::objectReferenceForLocation(const QString &fileName, int cursorPosition) const