Commit 3b4c322d authored by Kai Koehne's avatar Kai Koehne
Browse files

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
parent 2febf271
......@@ -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()
......
......@@ -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;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment