| 336 | } |
| 337 | |
| 338 | QStringList ScopyMainWindow_API::getToolsForPlugin(QString plugin) |
| 339 | { |
| 340 | Q_ASSERT(m_w->dm != nullptr); |
| 341 | QString devID = ""; |
| 342 | QStringList resultList; |
| 343 | if(!m_w->dm->connectedDev.isEmpty()) { |
| 344 | devID = m_w->dm->connectedDev.back(); |
| 345 | } else { |
| 346 | qWarning(CAT_SCOPY_API) << "No device connected"; |
| 347 | return resultList; |
| 348 | } |
| 349 | Device *dev = m_w->dm->getDevice(devID); |
| 350 | if(dev) { |
| 351 | QList<ToolMenuEntry *> toolList = dev->toolList(); |
| 352 | for(int i = 0; i < toolList.size(); i++) { |
| 353 | if(toolList[i]->pluginName() == plugin) { |
| 354 | resultList.append(toolList[i]->name()); |
| 355 | } |
| 356 | } |
| 357 | } else { |
| 358 | qWarning(CAT_SCOPY_API) << "Device with id " << devID << " is not available!"; |
| 359 | } |
| 360 | return resultList; |
| 361 | } |
| 362 | |
| 363 | QPair<QString, QVariant> ScopyMainWindow_API::getPreference(QString prefName) |
| 364 | { |
no test coverage detected