* @brief Connects the primary device (device 0) and, in ProjectFile mode, all other sources. */
| 675 | * @brief Connects the primary device (device 0) and, in ProjectFile mode, all other sources. |
| 676 | */ |
| 677 | void IO::ConnectionManager::connectDevice() |
| 678 | { |
| 679 | #ifdef BUILD_COMMERCIAL |
| 680 | if ((Licensing::Trial::instance().trialExpired() |
| 681 | && !Licensing::CommercialToken::current().isValid()) |
| 682 | || !SS_LICENSE_GUARD()) { |
| 683 | disconnectDevice(); |
| 684 | Misc::Utilities::showMessageBox( |
| 685 | tr("Your trial period has ended."), |
| 686 | tr("To continue using Serial Studio, please activate your license.")); |
| 687 | return; |
| 688 | } |
| 689 | #endif |
| 690 | |
| 691 | if (AppState::instance().operationMode() == SerialStudio::ProjectFile) |
| 692 | DataModel::ControlScript::instance().runOnConnect(); |
| 693 | |
| 694 | QApplication::setOverrideCursor(Qt::WaitCursor); |
| 695 | |
| 696 | connectDevice(0); |
| 697 | |
| 698 | if (AppState::instance().operationMode() == SerialStudio::ProjectFile) |
| 699 | connectAllDevices(); |
| 700 | |
| 701 | QApplication::restoreOverrideCursor(); |
| 702 | Q_EMIT connectedChanged(); |
| 703 | } |
| 704 | |
| 705 | /** |
| 706 | * @brief Disconnects the primary device and any other project sources. |
no test coverage detected