Commit 45141813 authored by con's avatar con

Hide building debug helper UI in cases where it's not supported.

Reviewed-by: Alessandro Portale
parent 21fbbc2c
......@@ -188,7 +188,7 @@ QtOptionsPageWidget::QtOptionsPageWidget(QWidget *parent, QList<QtVersion *> ver
item->setText(1, QDir::toNativeSeparators(version->qmakeCommand()));
item->setData(0, Qt::UserRole, version->uniqueId());
if (version->isValid())
if (version->isValid() && version->supportsBinaryDebuggingHelper())
item->setData(2, Qt::DecorationRole, version->hasDebuggingHelper() ? m_debuggingHelperOkIcon : m_debuggingHelperErrorIcon);
else
item->setData(2, Qt::DecorationRole, QIcon());
......@@ -447,6 +447,14 @@ void QtOptionsPageWidget::makeS60Visible(bool visible)
m_ui->gccePath->setVisible(visible);
}
void QtOptionsPageWidget::makeDebuggingHelperVisible(bool visible)
{
m_ui->debuggingHelperLabel->setVisible(visible);
m_ui->debuggingHelperStateLabel->setVisible(visible);
m_ui->showLogButton->setVisible(visible);
m_ui->rebuildButton->setVisible(visible);
}
void QtOptionsPageWidget::showEnvironmentPage(QTreeWidgetItem *item)
{
if (item) {
......@@ -456,11 +464,13 @@ void QtOptionsPageWidget::showEnvironmentPage(QTreeWidgetItem *item)
makeMSVCVisible(false);
makeMingwVisible(false);
makeS60Visible(false);
makeDebuggingHelperVisible(false);
return;
}
const QSharedPointerQtVersion qtVersion = m_versions.at(index);
QList<ProjectExplorer::ToolChain::ToolChainType> types = qtVersion->possibleToolChainTypes();
QSet<QString> targets = qtVersion->supportedTargetIds();
makeDebuggingHelperVisible(qtVersion->supportsBinaryDebuggingHelper());
if (types.isEmpty()) {
makeMSVCVisible(false);
makeMingwVisible(false);
......@@ -528,6 +538,7 @@ void QtOptionsPageWidget::showEnvironmentPage(QTreeWidgetItem *item)
makeMSVCVisible(false);
makeMingwVisible(false);
makeS60Visible(false);
makeDebuggingHelperVisible(false);
}
}
......@@ -668,7 +679,7 @@ void QtOptionsPageWidget::updateCurrentQMakeLocation()
currentItem->setText(1, QDir::toNativeSeparators(version->qmakeCommand()));
showEnvironmentPage(currentItem);
if (version->isValid()) {
if (version->isValid() && version->supportsBinaryDebuggingHelper()) {
const bool hasLog = !currentItem->data(2, Qt::UserRole).toString().isEmpty();
currentItem->setData(2, Qt::DecorationRole, version->hasDebuggingHelper() ? m_debuggingHelperOkIcon : m_debuggingHelperErrorIcon);
m_ui->showLogButton->setEnabled(hasLog);
......
......@@ -112,6 +112,7 @@ private slots:
void makeMingwVisible(bool visible);
void makeMSVCVisible(bool visible);
void makeS60Visible(bool visible);
void makeDebuggingHelperVisible(bool visible);
void onQtBrowsed();
void onMingwBrowsed();
void updateCurrentQtName();
......
......@@ -1550,6 +1550,20 @@ QStringList QtVersion::debuggingHelperLibraryLocations() const
return DebuggingHelperLibrary::debuggingHelperLibraryLocationsByInstallData(qtInstallData);
}
bool QtVersion::supportsBinaryDebuggingHelper() const
{
QList<ProjectExplorer::ToolChain::ToolChainType> types = possibleToolChainTypes();
if (types.contains(ProjectExplorer::ToolChain::GCC)
|| types.contains(ProjectExplorer::ToolChain::LINUX_ICC)
|| types.contains(ProjectExplorer::ToolChain::MSVC)
|| types.contains(ProjectExplorer::ToolChain::WINCE)
|| types.contains(ProjectExplorer::ToolChain::GCC_MAEMO)
|| types.contains(ProjectExplorer::ToolChain::OTHER)
|| types.contains(ProjectExplorer::ToolChain::UNKNOWN))
return true;
return false;
}
bool QtVersion::hasDocumentation() const
{
updateVersionInfo();
......
......@@ -108,6 +108,7 @@ public:
bool hasDebuggingHelper() const;
QString debuggingHelperLibrary() const;
QStringList debuggingHelperLibraryLocations() const;
bool supportsBinaryDebuggingHelper() const;
// Builds a debugging library
// returns the output of the commands
......
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