diff options
author | dt <qtc-committer@nokia.com> | 2011-03-28 17:57:17 +0200 |
---|---|---|
committer | dt <qtc-committer@nokia.com> | 2011-03-28 17:58:44 +0200 |
commit | e945acef450c4fbf9b417a485b50a50a9c05c58b (patch) | |
tree | f0a6a0731b4466d5ac3e4e29026b9cf6973667be /src/plugins/projectexplorer/environmentwidget.cpp | |
parent | c6a74143b28c3097716e8dc4ac3f217ddcb35f48 (diff) | |
download | qt-creator-e945acef450c4fbf9b417a485b50a50a9c05c58b.tar.gz |
Environment Widget: Linkfy summary text
Jumps to the variable on clicking.
Task-Nr: QTCREATORBUG-3316
Diffstat (limited to 'src/plugins/projectexplorer/environmentwidget.cpp')
-rw-r--r-- | src/plugins/projectexplorer/environmentwidget.cpp | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/src/plugins/projectexplorer/environmentwidget.cpp b/src/plugins/projectexplorer/environmentwidget.cpp index 7f6e597aef..ade5dd3d2d 100644 --- a/src/plugins/projectexplorer/environmentwidget.cpp +++ b/src/plugins/projectexplorer/environmentwidget.cpp @@ -147,6 +147,9 @@ EnvironmentWidget::EnvironmentWidget(QWidget *parent, QWidget *additionalDetails connect(d->m_environmentView->selectionModel(), SIGNAL(currentChanged(QModelIndex,QModelIndex)), this, SLOT(environmentCurrentIndexChanged(QModelIndex))); + connect(d->m_detailsContainer, SIGNAL(linkActivated(QString)), + this, SLOT(linkActivated(QString))); + connect(d->m_model, SIGNAL(userChangesChanged()), this, SLOT(updateSummaryText())); } @@ -199,9 +202,9 @@ void EnvironmentWidget::updateSummaryText() if (item.name != Utils::EnvironmentModel::tr("<VARIABLE>")) { text.append("<br>"); if (item.unset) - text.append(tr("Unset <b>%1</b>").arg(Qt::escape(item.name))); + text.append(tr("Unset <a href=\"%1\"><b>%1</b></a>").arg(Qt::escape(item.name))); else - text.append(tr("Set <b>%1</b> to <b>%2</b>").arg(Qt::escape(item.name), Qt::escape(item.value))); + text.append(tr("Set <a href=\"%1\"><b>%1</b></a> to <b>%2</b>").arg(Qt::escape(item.name), Qt::escape(item.value))); } } @@ -213,6 +216,13 @@ void EnvironmentWidget::updateSummaryText() d->m_detailsContainer->setSummaryText(text); } +void EnvironmentWidget::linkActivated(const QString &link) +{ + d->m_detailsContainer->setState(Utils::DetailsWidget::Expanded); + QModelIndex idx = d->m_model->variableToIndex(link); + focusIndex(idx); +} + void EnvironmentWidget::updateButtons() { environmentCurrentIndexChanged(d->m_environmentView->currentIndex()); |