Commit afb7047b authored by Christian Kandeler's avatar Christian Kandeler Committed by Tobias Hunger

QbsProjectManager: Fix display of command line in step widgets.

The command line equivalent of the respective options often gets too
long for the summary, which means that the end of the string is cut off.
Not only does that look ugly, it also hides information that is not
trivially available otherwise, such as the full path to the install root.
This patch therefore adds a text edit field that is guaranteed to be
able to display the complete command line. This is also consistent
with what the qmake step does.

Change-Id: Ic8d20e484e9cfe4980ea9eff05843fef1012f067
Reviewed-by: default avatarTobias Hunger <tobias.hunger@digia.com>
parent 4d9ca94c
......@@ -415,6 +415,7 @@ void QbsBuildStepConfigWidget::updateState()
if (m_step->isQmlDebuggingEnabled())
command += QLatin1String(" Qt.declarative.qmlDebugging:true Qt.quick.qmlDebugging:true");
m_ui->commandLineTextEdit->setPlainText(command);
QString summary = tr("<b>Qbs:</b> %1").arg(command);
if (m_summary != summary) {
......
......@@ -6,23 +6,11 @@
<rect>
<x>0</x>
<y>0</y>
<width>463</width>
<height>121</height>
<width>557</width>
<height>233</height>
</rect>
</property>
<layout class="QGridLayout" name="gridLayout">
<property name="leftMargin">
<number>0</number>
</property>
<property name="topMargin">
<number>0</number>
</property>
<property name="rightMargin">
<number>0</number>
</property>
<property name="bottomMargin">
<number>0</number>
</property>
<layout class="QFormLayout" name="formLayout">
<item row="0" column="0">
<widget class="QLabel" name="buildVariantLabel">
<property name="text">
......@@ -31,56 +19,77 @@
</widget>
</item>
<item row="0" column="1">
<widget class="QComboBox" name="buildVariantComboBox">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<layout class="QHBoxLayout" name="horizontalLayout_5">
<item>
<property name="text">
<string>Debug</string>
</property>
<widget class="QComboBox" name="buildVariantComboBox">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<item>
<property name="text">
<string>Debug</string>
</property>
</item>
<item>
<property name="text">
<string>Release</string>
</property>
</item>
</widget>
</item>
<item>
<property name="text">
<string>Release</string>
</property>
<spacer name="spacer">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>70</width>
<height>13</height>
</size>
</property>
</spacer>
</item>
</widget>
</item>
<item row="0" column="2">
<widget class="QSpinBox" name="jobSpinBox"/>
</layout>
</item>
<item row="0" column="3">
<item row="1" column="0">
<widget class="QLabel" name="jobsLabel">
<property name="text">
<string>jobs</string>
<string>Parallel Jobs:</string>
</property>
</widget>
</item>
<item row="0" column="4">
<spacer name="spacer">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>15</width>
<height>5</height>
</size>
</property>
</spacer>
<item row="1" column="1">
<layout class="QHBoxLayout" name="horizontalLayout_6">
<item>
<widget class="QSpinBox" name="jobSpinBox"/>
</item>
<item>
<spacer name="horizontalSpacer_3">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
</layout>
</item>
<item row="1" column="0">
<item row="2" column="0">
<widget class="QLabel" name="qmlDebuggingLabel">
<property name="text">
<string>Enable QML debugging:</string>
</property>
</widget>
</item>
<item row="1" column="1" colspan="4">
<item row="2" column="1">
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<widget class="QCheckBox" name="qmlDebuggingLibraryCheckBox">
......@@ -121,17 +130,28 @@
</item>
</layout>
</item>
<item row="2" column="0">
<item row="3" column="0">
<widget class="QLabel" name="propertyLabel">
<property name="text">
<string>Properties:</string>
</property>
</widget>
</item>
<item row="2" column="1" colspan="4">
<widget class="QbsPropertyLineEdit" name="propertyEdit"/>
<item row="3" column="1">
<widget class="QbsPropertyLineEdit" name="propertyEdit">
<property name="text">
<string notr="true"/>
</property>
</widget>
</item>
<item row="4" column="0">
<widget class="QLabel" name="flagsLabel">
<property name="text">
<string>Flags:</string>
</property>
</widget>
</item>
<item row="3" column="0" colspan="5">
<item row="4" column="1">
<layout class="QHBoxLayout" name="horizontalLayout_2">
<item>
<widget class="QCheckBox" name="dryRunCheckBox">
......@@ -162,7 +182,43 @@
</item>
</layout>
</item>
<item row="5" column="0">
<widget class="QLabel" name="commandLineKeyLabel">
<property name="text">
<string>Equivalent command line:</string>
</property>
<property name="alignment">
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop</set>
</property>
</widget>
</item>
<item row="5" column="1">
<widget class="QPlainTextEdit" name="commandLineTextEdit">
<property name="undoRedoEnabled">
<bool>false</bool>
</property>
<property name="readOnly">
<bool>true</bool>
</property>
<property name="plainText">
<string notr="true"/>
</property>
<property name="textInteractionFlags">
<set>Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse</set>
</property>
</widget>
</item>
</layout>
<zorder>buildVariantLabel</zorder>
<zorder>qmlDebuggingLabel</zorder>
<zorder>propertyLabel</zorder>
<zorder>propertyEdit</zorder>
<zorder></zorder>
<zorder></zorder>
<zorder>commandLineKeyLabel</zorder>
<zorder>flagsLabel</zorder>
<zorder>jobsLabel</zorder>
<zorder>commandLineTextEdit</zorder>
</widget>
<customwidgets>
<customwidget>
......
......@@ -293,6 +293,7 @@ void QbsCleanStepConfigWidget::updateState()
command += QLatin1String("--keep-going ");
if (m_step->cleanAll())
command += QLatin1String(" --all-artifacts");
m_ui->commandLineTextEdit->setPlainText(command);
QString summary = tr("<b>Qbs:</b> %1").arg(command);
if (m_summary != summary) {
......
......@@ -6,58 +6,95 @@
<rect>
<x>0</x>
<y>0</y>
<width>376</width>
<height>41</height>
<width>585</width>
<height>140</height>
</rect>
</property>
<layout class="QHBoxLayout" name="horizontalLayout">
<property name="leftMargin">
<number>0</number>
</property>
<property name="topMargin">
<number>0</number>
</property>
<property name="rightMargin">
<number>0</number>
</property>
<property name="bottomMargin">
<number>0</number>
</property>
<item>
<widget class="QCheckBox" name="cleanAllCheckBox">
<layout class="QFormLayout" name="formLayout">
<item row="0" column="0">
<widget class="QLabel" name="flagsLabel">
<property name="text">
<string>Clean all artifacts</string>
<string>Flags:</string>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="dryRunCheckBox">
<property name="text">
<string>Dry run</string>
</property>
</widget>
<item row="0" column="1">
<layout class="QHBoxLayout" name="horizontalLayout_2">
<item>
<widget class="QCheckBox" name="cleanAllCheckBox">
<property name="text">
<string>Clean all artifacts</string>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="dryRunCheckBox">
<property name="text">
<string>Dry run</string>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="keepGoingCheckBox">
<property name="text">
<string>Keep going</string>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>58</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
</layout>
</item>
<item>
<widget class="QCheckBox" name="keepGoingCheckBox">
<item row="1" column="0">
<widget class="QLabel" name="commandLineKeyLabel">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Keep going</string>
<string>Equivalent command line:</string>
</property>
<property name="alignment">
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop</set>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer">
<property name="orientation">
<enum>Qt::Horizontal</enum>
<item row="1" column="1">
<widget class="QPlainTextEdit" name="commandLineTextEdit">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="undoRedoEnabled">
<bool>false</bool>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>58</width>
<height>20</height>
</size>
<property name="readOnly">
<bool>true</bool>
</property>
</spacer>
<property name="plainText">
<string notr="true"/>
</property>
</widget>
</item>
</layout>
<zorder>commandLineKeyLabel</zorder>
<zorder>flagsLabel</zorder>
<zorder>commandLineTextEdit</zorder>
</widget>
<resources/>
<connections/>
......
......@@ -318,6 +318,7 @@ void QbsInstallStepConfigWidget::updateState()
if (m_step->removeFirst())
command += QLatin1String("--remove-first ");
command += QString::fromLatin1("--install-root \"%1\"").arg(m_step->absoluteInstallRoot());
m_ui->commandLineTextEdit->setPlainText(command);
QString summary = tr("<b>Qbs:</b> %1").arg(command);
if (m_summary != summary) {
......
......@@ -6,29 +6,11 @@
<rect>
<x>0</x>
<y>0</y>
<width>371</width>
<height>60</height>
<width>474</width>
<height>146</height>
</rect>
</property>
<layout class="QGridLayout" name="gridLayout">
<property name="leftMargin">
<number>0</number>
</property>
<property name="topMargin">
<number>0</number>
</property>
<property name="rightMargin">
<number>0</number>
</property>
<property name="bottomMargin">
<number>0</number>
</property>
<property name="horizontalSpacing">
<number>6</number>
</property>
<property name="verticalSpacing">
<number>18</number>
</property>
<layout class="QFormLayout" name="formLayout">
<item row="0" column="0">
<widget class="QLabel" name="installRootLabel">
<property name="text">
......@@ -36,7 +18,7 @@
</property>
</widget>
</item>
<item row="0" column="1" colspan="2">
<item row="0" column="1">
<widget class="Utils::PathChooser" name="installRootChooser">
<property name="minimumSize">
<size>
......@@ -47,23 +29,82 @@
</widget>
</item>
<item row="1" column="0">
<widget class="QCheckBox" name="removeFirstCheckBox">
<widget class="QLabel" name="flagsLabel">
<property name="text">
<string>Remove first</string>
<string>Flags:</string>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QCheckBox" name="dryRunCheckBox">
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<widget class="QCheckBox" name="dryRunCheckBox">
<property name="text">
<string>Dry run</string>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="keepGoingCheckBox">
<property name="text">
<string>Keep going</string>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="removeFirstCheckBox">
<property name="text">
<string>Remove first</string>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
</layout>
</item>
<item row="2" column="0">
<widget class="QLabel" name="commandLineKeyLabel">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Dry run</string>
<string>Equivalent command line:</string>
</property>
<property name="alignment">
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop</set>
</property>
</widget>
</item>
<item row="1" column="2">
<widget class="QCheckBox" name="keepGoingCheckBox">
<property name="text">
<string>Keep going</string>
<item row="2" column="1">
<widget class="QPlainTextEdit" name="commandLineTextEdit">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="readOnly">
<bool>true</bool>
</property>
<property name="plainText">
<string notr="true"/>
</property>
<property name="textInteractionFlags">
<set>Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse</set>
</property>
</widget>
</item>
......
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