forked from qt-creator/qt-creator
Warn on import of a build into a wrong target
This commit is contained in:
@@ -284,7 +284,9 @@ void Qt4ProjectConfigWidget::shadowBuildEdited()
|
|||||||
void Qt4ProjectConfigWidget::updateImportLabel()
|
void Qt4ProjectConfigWidget::updateImportLabel()
|
||||||
{
|
{
|
||||||
bool visible = false;
|
bool visible = false;
|
||||||
|
bool targetMatches = false;
|
||||||
|
|
||||||
|
QtVersionManager *vm = QtVersionManager::instance();
|
||||||
// we only show if we actually have a qmake and makestep
|
// we only show if we actually have a qmake and makestep
|
||||||
if (m_buildConfiguration->qmakeStep() && m_buildConfiguration->makeStep()) {
|
if (m_buildConfiguration->qmakeStep() && m_buildConfiguration->makeStep()) {
|
||||||
QString qmakePath = QtVersionManager::findQMakeBinaryFromMakefile(m_buildConfiguration->buildDirectory());
|
QString qmakePath = QtVersionManager::findQMakeBinaryFromMakefile(m_buildConfiguration->buildDirectory());
|
||||||
@@ -295,6 +297,15 @@ void Qt4ProjectConfigWidget::updateImportLabel()
|
|||||||
if (qmakePath != (version ? version->qmakeCommand() : QString())) {
|
if (qmakePath != (version ? version->qmakeCommand() : QString())) {
|
||||||
// import enable
|
// import enable
|
||||||
visible = true;
|
visible = true;
|
||||||
|
QtVersion *newVersion = vm->qtVersionForQMakeBinary(qmakePath);
|
||||||
|
bool mustDelete(false);
|
||||||
|
if (!newVersion) {
|
||||||
|
newVersion = new QtVersion(qmakePath);
|
||||||
|
mustDelete = true;
|
||||||
|
}
|
||||||
|
targetMatches = newVersion->supportsTargetId(m_buildConfiguration->target()->id());
|
||||||
|
if (mustDelete)
|
||||||
|
delete newVersion;
|
||||||
} else {
|
} else {
|
||||||
// check that the qmake flags, arguments match
|
// check that the qmake flags, arguments match
|
||||||
visible = !m_buildConfiguration->compareToImportFrom(m_buildConfiguration->buildDirectory());
|
visible = !m_buildConfiguration->compareToImportFrom(m_buildConfiguration->buildDirectory());
|
||||||
@@ -304,7 +315,19 @@ void Qt4ProjectConfigWidget::updateImportLabel()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (targetMatches) {
|
||||||
|
m_ui->importProblemLabel->setVisible(false);
|
||||||
|
m_ui->importWarningLabel->setVisible(false);
|
||||||
m_ui->importLabel->setVisible(visible);
|
m_ui->importLabel->setVisible(visible);
|
||||||
|
} else {
|
||||||
|
m_ui->importWarningLabel->setVisible(visible);
|
||||||
|
m_ui->importProblemLabel->setVisible(visible);
|
||||||
|
m_ui->importProblemLabel->setText(tr("Qt Version used in %1 does not support target %2.",
|
||||||
|
"%1 is the build directory, %2 the targets display name.").
|
||||||
|
arg(m_ui->shadowBuildDirEdit->path()).
|
||||||
|
arg(m_buildConfiguration->target()->displayName()));
|
||||||
|
m_ui->importLabel->setVisible(false);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void Qt4ProjectConfigWidget::importLabelClicked()
|
void Qt4ProjectConfigWidget::importLabelClicked()
|
||||||
|
|||||||
@@ -6,15 +6,19 @@
|
|||||||
<rect>
|
<rect>
|
||||||
<x>0</x>
|
<x>0</x>
|
||||||
<y>0</y>
|
<y>0</y>
|
||||||
<width>455</width>
|
<width>487</width>
|
||||||
<height>201</height>
|
<height>194</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
<layout class="QFormLayout" name="formLayout">
|
<layout class="QGridLayout" name="gridLayout">
|
||||||
<property name="margin">
|
<item row="0" column="0">
|
||||||
<number>0</number>
|
<widget class="QLabel" name="nameLabel">
|
||||||
|
<property name="text">
|
||||||
|
<string>Configuration Name:</string>
|
||||||
</property>
|
</property>
|
||||||
<item row="1" column="1">
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="0" column="1">
|
||||||
<widget class="QLineEdit" name="nameLineEdit">
|
<widget class="QLineEdit" name="nameLineEdit">
|
||||||
<property name="sizePolicy">
|
<property name="sizePolicy">
|
||||||
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
|
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
|
||||||
@@ -24,7 +28,7 @@
|
|||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="2" column="0">
|
<item row="1" column="0">
|
||||||
<widget class="QLabel" name="qtVersionLabel">
|
<widget class="QLabel" name="qtVersionLabel">
|
||||||
<property name="sizePolicy">
|
<property name="sizePolicy">
|
||||||
<sizepolicy hsizetype="Maximum" vsizetype="Preferred">
|
<sizepolicy hsizetype="Maximum" vsizetype="Preferred">
|
||||||
@@ -37,7 +41,7 @@
|
|||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="2" column="1">
|
<item row="1" column="1">
|
||||||
<layout class="QHBoxLayout" name="horizontalLayout">
|
<layout class="QHBoxLayout" name="horizontalLayout">
|
||||||
<property name="spacing">
|
<property name="spacing">
|
||||||
<number>4</number>
|
<number>4</number>
|
||||||
@@ -74,21 +78,31 @@
|
|||||||
</item>
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
</item>
|
</item>
|
||||||
<item row="6" column="0">
|
<item row="2" column="0">
|
||||||
|
<widget class="QLabel" name="label_2">
|
||||||
|
<property name="text">
|
||||||
|
<string>Tool Chain:</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="2" column="1">
|
||||||
|
<widget class="QComboBox" name="toolChainComboBox"/>
|
||||||
|
</item>
|
||||||
|
<item row="3" column="0">
|
||||||
<widget class="QLabel" name="label">
|
<widget class="QLabel" name="label">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Shadow Build:</string>
|
<string>Shadow Build:</string>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="6" column="1">
|
<item row="3" column="1">
|
||||||
<widget class="QCheckBox" name="shadowBuildCheckBox">
|
<widget class="QCheckBox" name="shadowBuildCheckBox">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string/>
|
<string/>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="7" column="0">
|
<item row="4" column="0">
|
||||||
<widget class="QLabel" name="buildDirLabel">
|
<widget class="QLabel" name="buildDirLabel">
|
||||||
<property name="sizePolicy">
|
<property name="sizePolicy">
|
||||||
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
|
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
|
||||||
@@ -101,7 +115,7 @@
|
|||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="7" column="1">
|
<item row="4" column="1">
|
||||||
<widget class="Utils::PathChooser" name="shadowBuildDirEdit" native="true">
|
<widget class="Utils::PathChooser" name="shadowBuildDirEdit" native="true">
|
||||||
<property name="sizePolicy">
|
<property name="sizePolicy">
|
||||||
<sizepolicy hsizetype="Expanding" vsizetype="Preferred">
|
<sizepolicy hsizetype="Expanding" vsizetype="Preferred">
|
||||||
@@ -111,7 +125,9 @@
|
|||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="8" column="1">
|
<item row="5" column="1">
|
||||||
|
<layout class="QHBoxLayout" name="horizontalLayout_2">
|
||||||
|
<item>
|
||||||
<widget class="QLabel" name="importLabel">
|
<widget class="QLabel" name="importLabel">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string><a href="import">Import existing build</a></string>
|
<string><a href="import">Import existing build</a></string>
|
||||||
@@ -121,23 +137,35 @@
|
|||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="1" column="0">
|
<item>
|
||||||
<widget class="QLabel" name="nameLabel">
|
<widget class="QLabel" name="importWarningLabel">
|
||||||
<property name="text">
|
<property name="pixmap">
|
||||||
<string>Configuration Name:</string>
|
<pixmap resource="../projectexplorer/projectexplorer.qrc">:/projectexplorer/images/compile_warning.png</pixmap>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="5" column="1">
|
<item>
|
||||||
<widget class="QComboBox" name="toolChainComboBox"/>
|
<widget class="QLabel" name="importProblemLabel">
|
||||||
</item>
|
|
||||||
<item row="5" column="0">
|
|
||||||
<widget class="QLabel" name="label_2">
|
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Tool Chain:</string>
|
<string>Qt Version to import does not support this target!</string>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</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>
|
||||||
</layout>
|
</layout>
|
||||||
</widget>
|
</widget>
|
||||||
<customwidgets>
|
<customwidgets>
|
||||||
@@ -148,6 +176,8 @@
|
|||||||
<container>1</container>
|
<container>1</container>
|
||||||
</customwidget>
|
</customwidget>
|
||||||
</customwidgets>
|
</customwidgets>
|
||||||
<resources/>
|
<resources>
|
||||||
|
<include location="../projectexplorer/projectexplorer.qrc"/>
|
||||||
|
</resources>
|
||||||
<connections/>
|
<connections/>
|
||||||
</ui>
|
</ui>
|
||||||
|
|||||||
Reference in New Issue
Block a user