Commit 51219a88 authored by Nikolai Kosjar's avatar Nikolai Kosjar
Browse files

{Qbs,QMake}ProjectManager: Make executable selectable/copyable



Change-Id: I7947ec85173f0898d54333f174fa6c14bcb051d6
Reviewed-by: default avatarDaniel Teske <daniel.teske@theqtcompany.com>
Reviewed-by: default avatarChristian Kandeler <christian.kandeler@theqtcompany.com>
parent 3c8a8eb8
...@@ -411,10 +411,10 @@ QbsRunConfigurationWidget::QbsRunConfigurationWidget(QbsRunConfiguration *rc, QW ...@@ -411,10 +411,10 @@ QbsRunConfigurationWidget::QbsRunConfigurationWidget(QbsRunConfiguration *rc, QW
toplayout->setFieldGrowthPolicy(QFormLayout::ExpandingFieldsGrow); toplayout->setFieldGrowthPolicy(QFormLayout::ExpandingFieldsGrow);
toplayout->setMargin(0); toplayout->setMargin(0);
m_executableLineEdit = new QLineEdit(this); m_executableLineLabel = new QLabel(this);
m_executableLineEdit->setEnabled(false); m_executableLineLabel->setTextInteractionFlags(Qt::TextSelectableByMouse);
m_executableLineEdit->setPlaceholderText(tr("<unknown>")); setExecutableLineText();
toplayout->addRow(tr("Executable:"), m_executableLineEdit); toplayout->addRow(tr("Executable:"), m_executableLineLabel);
QLabel *argumentsLabel = new QLabel(tr("Arguments:"), this); QLabel *argumentsLabel = new QLabel(tr("Arguments:"), this);
m_argumentsLineEdit = new QLineEdit(m_rc->rawCommandLineArguments(), this); m_argumentsLineEdit = new QLineEdit(m_rc->rawCommandLineArguments(), this);
...@@ -526,13 +526,19 @@ void QbsRunConfigurationWidget::termToggled(bool on) ...@@ -526,13 +526,19 @@ void QbsRunConfigurationWidget::termToggled(bool on)
void QbsRunConfigurationWidget::targetInformationHasChanged() void QbsRunConfigurationWidget::targetInformationHasChanged()
{ {
m_ignoreChange = true; m_ignoreChange = true;
m_executableLineEdit->setText(m_rc->executable()); setExecutableLineText(m_rc->executable());
m_workingDirectoryEdit->setPath(m_rc->baseWorkingDirectory()); m_workingDirectoryEdit->setPath(m_rc->baseWorkingDirectory());
m_workingDirectoryEdit->setBaseFileName(m_rc->target()->project()->projectDirectory()); m_workingDirectoryEdit->setBaseFileName(m_rc->target()->project()->projectDirectory());
m_ignoreChange = false; m_ignoreChange = false;
} }
void QbsRunConfigurationWidget::setExecutableLineText(const QString &text)
{
const QString newText = text.isEmpty() ? tr("<unknown>") : text;
m_executableLineLabel->setText(newText);
}
void QbsRunConfigurationWidget::workingDirectoryChanged(const QString &workingDirectory) void QbsRunConfigurationWidget::workingDirectoryChanged(const QString &workingDirectory)
{ {
if (!m_ignoreChange) if (!m_ignoreChange)
......
...@@ -157,11 +157,13 @@ private slots: ...@@ -157,11 +157,13 @@ private slots:
void targetInformationHasChanged(); void targetInformationHasChanged();
private: private:
void setExecutableLineText(const QString &text = QString());
QbsRunConfiguration *m_rc; QbsRunConfiguration *m_rc;
bool m_ignoreChange; bool m_ignoreChange;
QLabel *m_disabledIcon; QLabel *m_disabledIcon;
QLabel *m_disabledReason; QLabel *m_disabledReason;
QLineEdit *m_executableLineEdit; QLabel *m_executableLineLabel;
Utils::PathChooser *m_workingDirectoryEdit; Utils::PathChooser *m_workingDirectoryEdit;
QLineEdit *m_argumentsLineEdit; QLineEdit *m_argumentsLineEdit;
QCheckBox *m_useTerminalCheck; QCheckBox *m_useTerminalCheck;
......
...@@ -213,9 +213,9 @@ DesktopQmakeRunConfigurationWidget::DesktopQmakeRunConfigurationWidget(DesktopQm ...@@ -213,9 +213,9 @@ DesktopQmakeRunConfigurationWidget::DesktopQmakeRunConfigurationWidget(DesktopQm
toplayout->setFieldGrowthPolicy(QFormLayout::ExpandingFieldsGrow); toplayout->setFieldGrowthPolicy(QFormLayout::ExpandingFieldsGrow);
toplayout->setMargin(0); toplayout->setMargin(0);
m_executableLineEdit = new QLineEdit(m_qmakeRunConfiguration->executable(), this); m_executableLineLabel = new QLabel(m_qmakeRunConfiguration->executable(), this);
m_executableLineEdit->setEnabled(false); m_executableLineLabel->setTextInteractionFlags(Qt::TextSelectableByMouse);
toplayout->addRow(tr("Executable:"), m_executableLineEdit); toplayout->addRow(tr("Executable:"), m_executableLineLabel);
QLabel *argumentsLabel = new QLabel(tr("Arguments:"), this); QLabel *argumentsLabel = new QLabel(tr("Arguments:"), this);
m_argumentsLineEdit = new QLineEdit(qmakeRunConfiguration->rawCommandLineArguments(), this); m_argumentsLineEdit = new QLineEdit(qmakeRunConfiguration->rawCommandLineArguments(), this);
...@@ -393,7 +393,7 @@ void DesktopQmakeRunConfigurationWidget::usingDyldImageSuffixChanged(bool state) ...@@ -393,7 +393,7 @@ void DesktopQmakeRunConfigurationWidget::usingDyldImageSuffixChanged(bool state)
void DesktopQmakeRunConfigurationWidget::effectiveTargetInformationChanged() void DesktopQmakeRunConfigurationWidget::effectiveTargetInformationChanged()
{ {
if (m_isShown) { if (m_isShown) {
m_executableLineEdit->setText(QDir::toNativeSeparators(m_qmakeRunConfiguration->executable())); m_executableLineLabel->setText(QDir::toNativeSeparators(m_qmakeRunConfiguration->executable()));
m_ignoreChange = true; m_ignoreChange = true;
m_workingDirectoryEdit->setPath(QDir::toNativeSeparators(m_qmakeRunConfiguration->baseWorkingDirectory())); m_workingDirectoryEdit->setPath(QDir::toNativeSeparators(m_qmakeRunConfiguration->baseWorkingDirectory()));
m_ignoreChange = false; m_ignoreChange = false;
......
...@@ -171,7 +171,7 @@ private: ...@@ -171,7 +171,7 @@ private:
bool m_ignoreChange; bool m_ignoreChange;
QLabel *m_disabledIcon; QLabel *m_disabledIcon;
QLabel *m_disabledReason; QLabel *m_disabledReason;
QLineEdit *m_executableLineEdit; QLabel *m_executableLineLabel;
Utils::PathChooser *m_workingDirectoryEdit; Utils::PathChooser *m_workingDirectoryEdit;
QLineEdit *m_argumentsLineEdit; QLineEdit *m_argumentsLineEdit;
QCheckBox *m_useTerminalCheck; QCheckBox *m_useTerminalCheck;
......
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