IDevice: Introduce state 'device ready to use'.

A connected device might not be ready to use, so introduce another
state for this. The device settings widget is adapted to not only show
the icon, but also the state as string (the icon alone might not be
expressive enough).

Change-Id: I98d351b47a358ea59199e690e4b60f8030578ec6
Reviewed-by: Christian Kandeler <christian.kandeler@nokia.com>
Reviewed-by: Tobias Hunger <tobias.hunger@nokia.com>
This commit is contained in:
Nikolai Kosjar
2012-05-29 13:49:34 +02:00
parent a577cb2b62
commit d406b3cd1a
14 changed files with 97 additions and 61 deletions

View File

@@ -92,6 +92,7 @@ public:
RunConfiguration* m_activeRunConfiguration;
QPixmap m_connectedPixmap;
QPixmap m_readyToUsePixmap;
QPixmap m_disconnectedPixmap;
};
@@ -100,8 +101,9 @@ TargetPrivate::TargetPrivate() :
m_activeBuildConfiguration(0),
m_activeDeployConfiguration(0),
m_activeRunConfiguration(0),
m_connectedPixmap(QLatin1String(":/projectexplorer/images/ConnectionOn.png")),
m_disconnectedPixmap(QLatin1String(":/projectexplorer/images/ConnectionOff.png"))
m_connectedPixmap(QLatin1String(":/projectexplorer/images/DeviceConnected.png")),
m_readyToUsePixmap(QLatin1String(":/projectexplorer/images/DeviceReadyToUse.png")),
m_disconnectedPixmap(QLatin1String(":/projectexplorer/images/DeviceDisconnected.png"))
{
}
@@ -511,15 +513,18 @@ void Target::updateDeviceState()
if (current.isNull()) {
overlay = d->m_disconnectedPixmap;
} else {
switch (current->availability()) {
case IDevice::DeviceAvailabilityUnknown:
switch (current->deviceState()) {
case IDevice::DeviceStateUnknown:
setOverlayIcon(QIcon());
setToolTip(QString());
return;
case IDevice::DeviceAvailable:
case IDevice::DeviceReadyToUse:
overlay = d->m_readyToUsePixmap;
break;
case IDevice::DeviceConnected:
overlay = d->m_connectedPixmap;
break;
case IDevice::DeviceUnavailable:
case IDevice::DeviceDisconnected:
overlay = d->m_disconnectedPixmap;
break;
default: