diff options
author | Kai Koehne <kai.koehne@nokia.com> | 2010-08-20 11:34:02 +0200 |
---|---|---|
committer | Kai Koehne <kai.koehne@nokia.com> | 2010-08-20 12:27:12 +0200 |
commit | 3b4c322d59d0b6380759e1e7e6c94055bbad3fc4 (patch) | |
tree | bb2393c8c203e45d15236568b13c28a641bac3bf | |
parent | 2febf2718ce9ac3e78e3121ff7c1a3c33cf8840f (diff) | |
download | qt-creator-3b4c322d59d0b6380759e1e7e6c94055bbad3fc4.tar.gz |
QmlProject: Show effective qmlviewer call in separate row
Don't misuse the input field for a custom qmlviewer path with displaying
the effective qmlviewer used. Previously the effective qmlviewer was
only calculated when the project pane is shown first, and then never
updated.
Reviewed-by: holmstedt
-rw-r--r-- | src/plugins/qmlprojectmanager/qmlprojectrunconfiguration.cpp | 16 | ||||
-rw-r--r-- | src/plugins/qmlprojectmanager/qmlprojectrunconfiguration.h | 2 |
2 files changed, 17 insertions, 1 deletions
diff --git a/src/plugins/qmlprojectmanager/qmlprojectrunconfiguration.cpp b/src/plugins/qmlprojectmanager/qmlprojectrunconfiguration.cpp index 1e47de5b1f..25f395034b 100644 --- a/src/plugins/qmlprojectmanager/qmlprojectrunconfiguration.cpp +++ b/src/plugins/qmlprojectmanager/qmlprojectrunconfiguration.cpp @@ -98,6 +98,8 @@ void QmlProjectRunConfiguration::ctor() Qt4ProjectManager::QtVersionManager *qtVersions = Qt4ProjectManager::QtVersionManager::instance(); connect(qtVersions, SIGNAL(qtVersionsChanged(QList<int>)), this, SLOT(updateEnabled())); + connect(qtVersions, SIGNAL(qtVersionsChanged(QList<int>)), this, SLOT(onViewerChanged())); + setDisplayName(tr("QML Viewer", "QMLRunConfiguration display name.")); } @@ -174,16 +176,21 @@ QWidget *QmlProjectRunConfiguration::createConfigurationWidget() Utils::PathChooser *qmlViewer = new Utils::PathChooser; qmlViewer->setExpectedKind(Utils::PathChooser::Command); - qmlViewer->setPath(viewerPath()); + qmlViewer->setPath(m_qmlViewerCustomPath); connect(qmlViewer, SIGNAL(changed(QString)), this, SLOT(onViewerChanged())); + m_qmlViewerExecutable = new QLabel; + m_qmlViewerExecutable.data()->setText(viewerPath() + " " + m_qmlViewerArgs); + QLineEdit *qmlViewerArgs = new QLineEdit; qmlViewerArgs->setText(m_qmlViewerArgs); connect(qmlViewerArgs, SIGNAL(textChanged(QString)), this, SLOT(onViewerArgsChanged())); form->addRow(tr("QML Viewer"), qmlViewer); form->addRow(tr("QML Viewer arguments:"), qmlViewerArgs); + form->addRow(QString(), m_qmlViewerExecutable.data()); + form->addRow(tr("Main QML File:"), m_fileListCombo.data()); return config; @@ -258,12 +265,19 @@ void QmlProjectRunConfiguration::onViewerChanged() if (Utils::PathChooser *chooser = qobject_cast<Utils::PathChooser *>(sender())) { m_qmlViewerCustomPath = chooser->path(); } + if (!m_qmlViewerExecutable.isNull()) { + m_qmlViewerExecutable.data()->setText(viewerPath() + " " + m_qmlViewerArgs); + } } void QmlProjectRunConfiguration::onViewerArgsChanged() { if (QLineEdit *lineEdit = qobject_cast<QLineEdit*>(sender())) m_qmlViewerArgs = lineEdit->text(); + + if (!m_qmlViewerExecutable.isNull()) { + m_qmlViewerExecutable.data()->setText(viewerPath() + " " + m_qmlViewerArgs); + } } void QmlProjectRunConfiguration::onDebugServerPortChanged() diff --git a/src/plugins/qmlprojectmanager/qmlprojectrunconfiguration.h b/src/plugins/qmlprojectmanager/qmlprojectrunconfiguration.h index 53adfb0cb6..1c3f12cd6e 100644 --- a/src/plugins/qmlprojectmanager/qmlprojectrunconfiguration.h +++ b/src/plugins/qmlprojectmanager/qmlprojectrunconfiguration.h @@ -34,6 +34,7 @@ #include <projectexplorer/runconfiguration.h> #include <QWeakPointer> #include <QComboBox> +#include <QLabel> QT_FORWARD_DECLARE_CLASS(QStringListModel); @@ -121,6 +122,7 @@ private: QStringListModel *m_fileListModel; // weakpointer is used to make sure we don't try to manipulate // widget which was deleted already, as can be the case here. + QWeakPointer<QLabel> m_qmlViewerExecutable; QWeakPointer<QComboBox> m_fileListCombo; Internal::QmlProjectTarget *m_projectTarget; |