Skip to content
Snippets Groups Projects
Commit d201c681 authored by Christian Kandeler's avatar Christian Kandeler
Browse files

Device support: Disable some widgets when there are no devices.


Change-Id: I7849054f6a3942bf6d8affdf1cdc5a7d28fb997d
Reviewed-by: default avatarTobias Hunger <tobias.hunger@nokia.com>
parent a3a7e708
No related branches found
No related tags found
No related merge requests found
......@@ -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));
......
......@@ -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();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment