Commit 45141813 authored by con's avatar con
Browse files

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