1
0
mirror of https://bitbucket.org/librepilot/librepilot.git synced 2025-02-18 08:54:15 +01:00

Now the dropdown menu behaves better with unconfigured IP connection plugin. Restored the

type of connection for better clarity too ("Serial", "USB", "IP", "UDP", etc).
This commit is contained in:
Edouard Lafargue 2011-04-17 08:32:37 +02:00 committed by Edouard Lafargue
parent 08eabd21e4
commit cd1922cd52
2 changed files with 9 additions and 2 deletions

View File

@ -315,6 +315,9 @@ void ConnectionManager::unregisterAll(IConnection *connection)
/**
* Register a device from a specific connection plugin
* @param devN contains the connection shortname + device name which is diplayed in the tooltip
* @param disp is the name that is displayed in the dropdown menu
* @param name is the actual device name
*/
void ConnectionManager::registerDevice(IConnection *conn, const QString &devN, const QString &name, const QString &disp)
{
@ -344,7 +347,8 @@ void ConnectionManager::devChanged(IConnection *connection)
foreach (IConnection::device dev, availableDev)
{
QString cbName = connection->shortName() + ": " + dev.name;
registerDevice(connection,cbName,dev.name,dev.displayName);
QString disp = connection->shortName() + " : " + dev.displayName;
registerDevice(connection,cbName,dev.name,disp);
}
//add all the list again to the combobox

View File

@ -164,7 +164,10 @@ QList <Core::IConnection::device> IPconnectionConnection::availableDevices()
{
QList <Core::IConnection::device> list;
device d;
d.displayName=(const QString )m_config->HostName();
if (m_config->HostName().length()>1)
d.displayName=(const QString )m_config->HostName();
else
d.displayName="Unconfigured";
d.name=(const QString )m_config->HostName();
//we only have one "device" as defined by the configuration m_config
list.append(d);