summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Kandeler <christian.kandeler@nokia.com>2012-05-08 17:24:24 +0200
committerChristian Kandeler <christian.kandeler@nokia.com>2012-05-09 12:12:51 +0200
commitd201c681daae42b005c9ea4f3a1e272ea9cc5ef5 (patch)
tree776f8b4440f94e0facdbd18fd33f5fc74b46584f
parenta3a7e7081a884737e6216abdbb80d694acb7686f (diff)
downloadqt-creator-d201c681daae42b005c9ea4f3a1e272ea9cc5ef5.tar.gz
Device support: Disable some widgets when there are no devices.
Change-Id: I7849054f6a3942bf6d8affdf1cdc5a7d28fb997d Reviewed-by: Tobias Hunger <tobias.hunger@nokia.com>
-rw-r--r--src/plugins/projectexplorer/devicesupport/devicesettingswidget.cpp10
-rw-r--r--src/plugins/projectexplorer/devicesupport/devicesettingswidget.h1
2 files changed, 11 insertions, 0 deletions
diff --git a/src/plugins/projectexplorer/devicesupport/devicesettingswidget.cpp b/src/plugins/projectexplorer/devicesupport/devicesettingswidget.cpp
index b6b3ce9221..be12996554 100644
--- a/src/plugins/projectexplorer/devicesupport/devicesettingswidget.cpp
+++ b/src/plugins/projectexplorer/devicesupport/devicesettingswidget.cpp
@@ -197,6 +197,14 @@ void DeviceSettingsWidget::displayCurrent()
fillInValues();
}
+void DeviceSettingsWidget::setDeviceInfoWidgetsEnabled(bool enable)
+{
+ m_ui->configurationLabel->setEnabled(enable);
+ m_ui->configurationComboBox->setEnabled(enable);
+ m_ui->generalGroupBox->setEnabled(enable);
+ m_ui->osSpecificGroupBox->setEnabled(enable);
+}
+
void DeviceSettingsWidget::fillInValues()
{
const IDevice::ConstPtr &current = currentDevice();
@@ -252,10 +260,12 @@ void DeviceSettingsWidget::currentDeviceChanged(int index)
m_additionalActionButtons.clear();
const IDevice::ConstPtr device = m_deviceManagerModel->device(index);
if (device.isNull()) {
+ setDeviceInfoWidgetsEnabled(false);
m_ui->removeConfigButton->setEnabled(false);
clearDetails();
m_ui->defaultDeviceButton->setEnabled(false);
} else {
+ setDeviceInfoWidgetsEnabled(true);
m_ui->removeConfigButton->setEnabled(true);
foreach (const Core::Id actionId, device->actionIds()) {
QPushButton * const button = new QPushButton(device->displayNameForActionId(actionId));
diff --git a/src/plugins/projectexplorer/devicesupport/devicesettingswidget.h b/src/plugins/projectexplorer/devicesupport/devicesettingswidget.h
index da63e3b029..7495dc9caf 100644
--- a/src/plugins/projectexplorer/devicesupport/devicesettingswidget.h
+++ b/src/plugins/projectexplorer/devicesupport/devicesettingswidget.h
@@ -75,6 +75,7 @@ private slots:
private:
void initGui();
void displayCurrent();
+ void setDeviceInfoWidgetsEnabled(bool enable);
QSharedPointer<const IDevice> currentDevice() const;
int currentIndex() const;
void clearDetails();