From b1e2a2075e8dee11fd62b3983ed9e5f4591db5b2 Mon Sep 17 00:00:00 2001
From: Tobias Hunger <tobias.hunger@nokia.com>
Date: Mon, 22 Feb 2010 14:36:23 +0100
Subject: [PATCH] Disable target selection combobox if necessary

 * Set the first target to active in the addtargetdialog's
   target selection combobox
 * Disable the combobox if there is only one element in it.
---
 src/plugins/projectexplorer/addtargetdialog.cpp | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/src/plugins/projectexplorer/addtargetdialog.cpp b/src/plugins/projectexplorer/addtargetdialog.cpp
index c7385f8e56d..d6d41d9275c 100644
--- a/src/plugins/projectexplorer/addtargetdialog.cpp
+++ b/src/plugins/projectexplorer/addtargetdialog.cpp
@@ -47,6 +47,8 @@ AddTargetDialog::AddTargetDialog(Project *project, QWidget *parent) :
         ui->targetComboBox->addItem(m_project->targetFactory()->displayNameForId(id),
                                     id);
     }
+    ui->targetComboBox->setCurrentIndex(0);
+    ui->targetComboBox->setEnabled(ui->targetComboBox->count() > 1);
 
     connect(ui->buttonBox, SIGNAL(accepted()),
             this, SLOT(accept()));
-- 
GitLab