| 764 | } |
| 765 | |
| 766 | bool ConnectionPanel::automationConnectLocalSerial(const QString& serial, QString* error) |
| 767 | { |
| 768 | const QString wanted = serial.trimmed(); |
| 769 | if (wanted.isEmpty()) { |
| 770 | setAutomationError(error, QStringLiteral("local serial selector is empty")); |
| 771 | return false; |
| 772 | } |
| 773 | if (m_connected) { |
| 774 | setAutomationError(error, QStringLiteral("already connected to a radio")); |
| 775 | return false; |
| 776 | } |
| 777 | |
| 778 | for (int i = 0; i < m_radios.size(); ++i) { |
| 779 | if (m_radios[i].serial.compare(wanted, Qt::CaseInsensitive) == 0) { |
| 780 | setCurrentMode(LocalMode); |
| 781 | m_radioList->setCurrentRow(i); |
| 782 | onLocalConnectClicked(); |
| 783 | return true; |
| 784 | } |
| 785 | } |
| 786 | |
| 787 | setAutomationError( |
| 788 | error, |
| 789 | QStringLiteral("no discovered local radio has serial '%1'").arg(wanted)); |
| 790 | return false; |
| 791 | } |
| 792 | |
| 793 | bool ConnectionPanel::automationConnectByIp(const QString& hostOrIp, QString* error) |
| 794 | { |
no test coverage detected