diff --git a/src/plugins/qt4projectmanager/qtoptionspage.cpp b/src/plugins/qt4projectmanager/qtoptionspage.cpp index 59efc8f678f520967c0b3e27daa78a938d71b0d8..e61904d1df8b79fff31cddb4a5ab02a8a2a50b6a 100644 --- a/src/plugins/qt4projectmanager/qtoptionspage.cpp +++ b/src/plugins/qt4projectmanager/qtoptionspage.cpp @@ -5,6 +5,7 @@ #include "qtversionmanager.h" #include <coreplugin/coreconstants.h> +#include <QtCore/QDebug> #include <QtCore/QDir> using namespace Qt4ProjectManager; @@ -254,25 +255,32 @@ void QtOptionsPageWidget::makeMingwVisible(bool visible) m_ui->mingwPath->setVisible(visible); } +void QtOptionsPageWidget::makeMSVCVisible(bool visible) +{ + m_ui->msvcLabel->setVisible(visible); + m_ui->msvcComboBox->setVisible(visible); + m_ui->msvcNotFoundLabel->setVisible(false); +} + void QtOptionsPageWidget::showEnvironmentPage(QTreeWidgetItem *item) { - m_ui->msvcComboBox->setVisible(false); if (item) { int index = m_ui->qtdirList->indexOfTopLevelItem(item); m_ui->errorLabel->setText(""); ProjectExplorer::ToolChain::ToolChainType t = m_versions.at(index)->toolchainType(); if (t == ProjectExplorer::ToolChain::MinGW) { - m_ui->msvcComboBox->setVisible(false); + makeMSVCVisible(false); makeMingwVisible(true); m_ui->mingwPath->setPath(m_versions.at(index)->mingwDirectory()); } else if (t == ProjectExplorer::ToolChain::MSVC || t == ProjectExplorer::ToolChain::WINCE){ - m_ui->msvcComboBox->setVisible(false); + makeMSVCVisible(false); makeMingwVisible(false); QStringList msvcEnvironments = ProjectExplorer::ToolChain::availableMSVCVersions(); if (msvcEnvironments.count() == 0) { - } else if (msvcEnvironments.count() == 1) { + m_ui->msvcLabel->setVisible(true); + m_ui->msvcNotFoundLabel->setVisible(true); } else { - m_ui->msvcComboBox->setVisible(true); + makeMSVCVisible(true); bool block = m_ui->msvcComboBox->blockSignals(true); m_ui->msvcComboBox->clear(); foreach(const QString &msvcenv, msvcEnvironments) { @@ -284,7 +292,7 @@ void QtOptionsPageWidget::showEnvironmentPage(QTreeWidgetItem *item) m_ui->msvcComboBox->blockSignals(block); } } else if (t == ProjectExplorer::ToolChain::INVALID) { - m_ui->msvcComboBox->setVisible(false); + makeMSVCVisible(false); makeMingwVisible(false); if (!m_versions.at(index)->isInstalled()) m_ui->errorLabel->setText(tr("The Qt Version %1 is not installed. Run make install") @@ -292,14 +300,14 @@ void QtOptionsPageWidget::showEnvironmentPage(QTreeWidgetItem *item) else m_ui->errorLabel->setText(tr("%1 is not a valid Qt directory").arg(QDir::toNativeSeparators(m_versions.at(index)->path()))); } else { //ProjectExplorer::ToolChain::GCC - m_ui->msvcComboBox->setVisible(false); + makeMSVCVisible(false); makeMingwVisible(false); m_ui->errorLabel->setText(tr("Found Qt version %1, using mkspec %2") .arg(m_versions.at(index)->qtVersionString(), m_versions.at(index)->mkspec())); } } else { - m_ui->msvcComboBox->setVisible(false); + makeMSVCVisible(false); makeMingwVisible(false); } } diff --git a/src/plugins/qt4projectmanager/qtoptionspage.h b/src/plugins/qt4projectmanager/qtoptionspage.h index be4fee3d8fb0467d8882f57ce38109fd59b68e58..71e0a538e79b4e8d4e389f256ddd5e724c3e820e 100644 --- a/src/plugins/qt4projectmanager/qtoptionspage.h +++ b/src/plugins/qt4projectmanager/qtoptionspage.h @@ -72,6 +72,7 @@ private slots: void removeQtDir(); void updateState(); void makeMingwVisible(bool visible); + void makeMSVCVisible(bool visible); void onQtBrowsed(); void onMingwBrowsed(); void defaultChanged(int index); diff --git a/src/plugins/qt4projectmanager/qtversionmanager.ui b/src/plugins/qt4projectmanager/qtversionmanager.ui index 9cf209006831cb33b271d4562dedde0f1fc7010c..3f9cc7303ac37d7566a173a4e349b2bb6aedbc14 100644 --- a/src/plugins/qt4projectmanager/qtversionmanager.ui +++ b/src/plugins/qt4projectmanager/qtversionmanager.ui @@ -6,8 +6,8 @@ <rect> <x>0</x> <y>0</y> - <width>811</width> - <height>505</height> + <width>577</width> + <height>477</height> </rect> </property> <layout class="QVBoxLayout" name="verticalLayout"> @@ -16,8 +16,36 @@ <property name="title"> <string>Qt versions</string> </property> - <layout class="QGridLayout" name="gridLayout_2"> - <item row="0" column="3"> + <layout class="QGridLayout" name="gridLayout"> + <item row="0" column="0" colspan="2"> + <widget class="QTreeWidget" name="qtdirList"> + <property name="uniformRowHeights"> + <bool>true</bool> + </property> + <property name="itemsExpandable"> + <bool>false</bool> + </property> + <property name="columnCount"> + <number>3</number> + </property> + <column> + <property name="text"> + <string>Name</string> + </property> + </column> + <column> + <property name="text"> + <string>Path</string> + </property> + </column> + <column> + <property name="text"> + <string>Debugging Helper</string> + </property> + </column> + </widget> + </item> + <item row="0" column="2"> <layout class="QVBoxLayout"> <property name="spacing"> <number>6</number> @@ -66,34 +94,6 @@ </item> </layout> </item> - <item row="0" column="0" colspan="3"> - <widget class="QTreeWidget" name="qtdirList"> - <property name="uniformRowHeights"> - <bool>true</bool> - </property> - <property name="itemsExpandable"> - <bool>false</bool> - </property> - <property name="columnCount"> - <number>3</number> - </property> - <column> - <property name="text"> - <string>Name</string> - </property> - </column> - <column> - <property name="text"> - <string>Path</string> - </property> - </column> - <column> - <property name="text"> - <string>Debugging Helper</string> - </property> - </column> - </widget> - </item> <item row="1" column="0"> <widget class="QLabel" name="versionNameLabel"> <property name="text"> @@ -101,7 +101,7 @@ </property> </widget> </item> - <item row="1" column="1" colspan="2"> + <item row="1" column="1"> <widget class="QLineEdit" name="nameEdit"/> </item> <item row="2" column="0"> @@ -111,6 +111,9 @@ </property> </widget> </item> + <item row="2" column="1"> + <widget class="Core::Utils::PathChooser" name="qtPath" native="true"/> + </item> <item row="3" column="0"> <widget class="QLabel" name="mingwLabel"> <property name="text"> @@ -118,33 +121,67 @@ </property> </widget> </item> - <item row="6" column="0" colspan="4"> - <widget class="QLabel" name="errorLabel"> + <item row="3" column="1"> + <widget class="Core::Utils::PathChooser" name="mingwPath" native="true"/> + </item> + <item row="4" column="0"> + <widget class="QLabel" name="msvcLabel"> <property name="text"> - <string/> + <string>MSVC Version:</string> </property> </widget> </item> - <item row="4" column="1" colspan="2"> - <widget class="QComboBox" name="msvcComboBox"/> - </item> - <item row="2" column="1" colspan="2"> - <widget class="Core::Utils::PathChooser" name="qtPath" native="true"/> - </item> - <item row="3" column="1" colspan="2"> - <widget class="Core::Utils::PathChooser" name="mingwPath" native="true"/> + <item row="4" column="1"> + <layout class="QHBoxLayout" name="horizontalLayout"> + <property name="spacing"> + <number>0</number> + </property> + <item> + <widget class="QComboBox" name="msvcComboBox"> + <property name="sizePolicy"> + <sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + </widget> + </item> + <item> + <widget class="QLabel" name="msvcNotFoundLabel"> + <property name="sizePolicy"> + <sizepolicy hsizetype="MinimumExpanding" vsizetype="Preferred"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="text"> + <string><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"> +<html><head><meta name="qrichtext" content="1" /><style type="text/css"> +p, li { white-space: pre-wrap; } +</style></head><body style=" font-family:'MS Shell Dlg 2'; font-size:8.25pt; font-weight:400; font-style:normal;"> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" color:#ff0000;">Unable to detect MSVC version.</span></p></body></html></string> + </property> + </widget> + </item> + </layout> </item> - <item row="5" column="0"> + <item row="6" column="0"> <widget class="QLabel" name="label"> <property name="text"> <string>Debugging Helper:</string> </property> </widget> </item> - <item row="5" column="1" colspan="2"> + <item row="6" column="1"> <layout class="QHBoxLayout" name="horizontalLayout_2"> <item> <widget class="QLabel" name="debuggingHelperStateLabel"> + <property name="sizePolicy"> + <sizepolicy hsizetype="MinimumExpanding" vsizetype="Preferred"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> <property name="text"> <string/> </property> @@ -166,11 +203,18 @@ </item> </layout> </item> + <item row="7" column="1"> + <widget class="QLabel" name="errorLabel"> + <property name="text"> + <string/> + </property> + </widget> + </item> </layout> </widget> </item> <item> - <layout class="QHBoxLayout" name="horizontalLayout"> + <layout class="QHBoxLayout" name="horizontalLayout_3"> <item> <widget class="QLabel" name="defaultLabel"> <property name="text">