Commit 9b7303a8 authored by Jasem Mutlaq's avatar Jasem Mutlaq

Add tooltip that contains driver information for local driver and remote driver tip for remotes

parent 1d8b974e
......@@ -441,84 +441,134 @@ void ProfileEditor::loadDrivers()
icon=remoteIcon;
}
QString toolTipText;
if(!locallyAvailable)
toolTipText = i18n("<nobr>Available as <b>Remote</b> Driver. To use locally, install the corresponding driver.<nobr/>");
else
toolTipText = i18n("<nobr><b>Label</b>: %1 &#9473; <b>Driver</b>: %2 &#9473; <b>Exec</b>: %3<nobr/>", dv->getTreeLabel(), dv->getName(), dv->getDriver());
switch (dv->getType())
{
case KSTARS_TELESCOPE:
{
ui->mountCombo->addItem(icon, dv->getTreeLabel());
ui->mountCombo->setItemData(ui->mountCombo->count()-1, toolTipText, Qt::ToolTipRole);
}
break;
case KSTARS_CCD:
{
ui->ccdCombo->addItem(icon, dv->getTreeLabel());
ui->ccdCombo->setItemData(ui->ccdCombo->count()-1, toolTipText, Qt::ToolTipRole);
ui->guiderCombo->addItem(icon, dv->getTreeLabel());
ui->guiderCombo->setItemData(ui->guiderCombo->count()-1, toolTipText, Qt::ToolTipRole);
ui->aux1Combo->addItem(icon, dv->getTreeLabel());
ui->aux1Combo->setItemData(ui->aux1Combo->count()-1, toolTipText, Qt::ToolTipRole);
ui->aux2Combo->addItem(icon, dv->getTreeLabel());
ui->aux2Combo->setItemData(ui->aux2Combo->count()-1, toolTipText, Qt::ToolTipRole);
ui->aux3Combo->addItem(icon, dv->getTreeLabel());
ui->aux3Combo->setItemData(ui->aux3Combo->count()-1, toolTipText, Qt::ToolTipRole);
ui->aux4Combo->addItem(icon, dv->getTreeLabel());
ui->aux4Combo->setItemData(ui->aux4Combo->count()-1, toolTipText, Qt::ToolTipRole);
}
break;
case KSTARS_ADAPTIVE_OPTICS:
{
ui->AOCombo->addItem(icon, dv->getTreeLabel());
ui->AOCombo->setItemData(ui->AOCombo->count()-1, toolTipText, Qt::ToolTipRole);
}
break;
case KSTARS_FOCUSER:
{
ui->focuserCombo->addItem(icon, dv->getTreeLabel());
ui->focuserCombo->setItemData(ui->focuserCombo->count()-1, toolTipText, Qt::ToolTipRole);
ui->aux1Combo->addItem(icon, dv->getTreeLabel());
ui->aux1Combo->setItemData(ui->aux1Combo->count()-1, toolTipText, Qt::ToolTipRole);
ui->aux2Combo->addItem(icon, dv->getTreeLabel());
ui->aux2Combo->setItemData(ui->aux2Combo->count()-1, toolTipText, Qt::ToolTipRole);
ui->aux3Combo->addItem(icon, dv->getTreeLabel());
ui->aux3Combo->setItemData(ui->aux3Combo->count()-1, toolTipText, Qt::ToolTipRole);
ui->aux4Combo->addItem(icon, dv->getTreeLabel());
ui->aux4Combo->setItemData(ui->aux4Combo->count()-1, toolTipText, Qt::ToolTipRole);
}
break;
case KSTARS_FILTER:
{
ui->filterCombo->addItem(icon, dv->getTreeLabel());
ui->filterCombo->setItemData(ui->filterCombo->count()-1, toolTipText, Qt::ToolTipRole);
ui->aux1Combo->addItem(icon, dv->getTreeLabel());
ui->aux1Combo->setItemData(ui->aux1Combo->count()-1, toolTipText, Qt::ToolTipRole);
ui->aux2Combo->addItem(icon, dv->getTreeLabel());
ui->aux2Combo->setItemData(ui->aux2Combo->count()-1, toolTipText, Qt::ToolTipRole);
ui->aux3Combo->addItem(icon, dv->getTreeLabel());
ui->aux3Combo->setItemData(ui->aux3Combo->count()-1, toolTipText, Qt::ToolTipRole);
ui->aux4Combo->addItem(icon, dv->getTreeLabel());
ui->aux4Combo->setItemData(ui->aux4Combo->count()-1, toolTipText, Qt::ToolTipRole);
}
break;
case KSTARS_DOME:
{
ui->domeCombo->addItem(icon, dv->getTreeLabel());
ui->domeCombo->setItemData(ui->domeCombo->count()-1, toolTipText, Qt::ToolTipRole);
}
break;
case KSTARS_WEATHER:
{
ui->weatherCombo->addItem(icon, dv->getTreeLabel());
ui->weatherCombo->setItemData(ui->weatherCombo->count()-1, toolTipText, Qt::ToolTipRole);
ui->aux1Combo->addItem(icon, dv->getTreeLabel());
ui->aux1Combo->setItemData(ui->aux1Combo->count()-1, toolTipText, Qt::ToolTipRole);
ui->aux2Combo->addItem(icon, dv->getTreeLabel());
ui->aux2Combo->setItemData(ui->aux2Combo->count()-1, toolTipText, Qt::ToolTipRole);
ui->aux3Combo->addItem(icon, dv->getTreeLabel());
ui->aux3Combo->setItemData(ui->aux3Combo->count()-1, toolTipText, Qt::ToolTipRole);
ui->aux4Combo->addItem(icon, dv->getTreeLabel());
ui->aux4Combo->setItemData(ui->aux4Combo->count()-1, toolTipText, Qt::ToolTipRole);
}
break;
case KSTARS_AUXILIARY:
{
ui->aux1Combo->addItem(icon, dv->getTreeLabel());
ui->aux1Combo->setItemData(ui->aux1Combo->count()-1, toolTipText, Qt::ToolTipRole);
ui->aux2Combo->addItem(icon, dv->getTreeLabel());
ui->aux2Combo->setItemData(ui->aux2Combo->count()-1, toolTipText, Qt::ToolTipRole);
ui->aux3Combo->addItem(icon, dv->getTreeLabel());
ui->aux3Combo->setItemData(ui->aux3Combo->count()-1, toolTipText, Qt::ToolTipRole);
ui->aux4Combo->addItem(icon, dv->getTreeLabel());
ui->aux4Combo->setItemData(ui->aux4Combo->count()-1, toolTipText, Qt::ToolTipRole);
}
break;
default:
continue;
break;
}
}
}
//ui->mountCombo->setCurrentIndex(-1);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment