MCPcopy Create free account
hub / github.com/aethersdr/AetherSDR / wireRadioSetupDialogSignals

Method wireRadioSetupDialogSignals

src/gui/MainWindow.cpp:2600–2709  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2598#endif
2599
2600void MainWindow::wireRadioSetupDialogSignals(RadioSetupDialog* dlg, const QString& prevComp)
2601{
2602 if (!dlg) return;
2603 connect(dlg, &RadioSetupDialog::txBandSettingsRequested,
2604 m_txBandAction, &QAction::trigger);
2605 // serialSettingsChanged is the "external-device settings changed" signal in
2606 // practice — the dialog emits it for serial-port, FlexControl, Ulanzi-dial,
2607 // and HID-encoder edits. The Ulanzi/HID branches below run regardless of
2608 // HAVE_SERIALPORT because those backends exist on all platforms (#3257).
2609 connect(dlg, &RadioSetupDialog::serialSettingsChanged, this, [this]() {
2610#ifdef HAVE_SERIALPORT
2611 QMetaObject::invokeMethod(m_serialPort, [this] { m_serialPort->loadSettings(); });
2612 auto& fcs = AppSettings::instance();
2613 const bool fcOpen = fcs.value("FlexControlOpen", "False").toString() == "True";
2614 const QString fcPort = fcs.value("FlexControlPort").toString();
2615 const bool fcInvert = fcs.value("FlexControlInvertDir", "False").toString() == "True";
2616 QMetaObject::invokeMethod(m_flexControl, [this, fcOpen, fcPort, fcInvert] {
2617 if (fcOpen) {
2618 if (fcPort.isEmpty()) {
2619 if (m_flexControl->isOpen())
2620 m_flexControl->close();
2621 } else if (!m_flexControl->isOpen() || m_flexControl->portName() != fcPort) {
2622 if (m_flexControl->isOpen())
2623 m_flexControl->close();
2624 m_flexControl->open(fcPort);
2625 }
2626 } else if (m_flexControl->isOpen()) {
2627 m_flexControl->close();
2628 }
2629 m_flexControl->setInvertDirection(fcInvert);
2630 });
2631 if (m_flexControlDialog)
2632 m_flexControlDialog->refreshButtonActions();
2633 syncFlexControlIndicatorForSettings();
2634#endif
2635 // External-device enable evaluation. start()/loadSettings() are
2636 // idempotent (each guards against re-open), so re-firing them when
2637 // unrelated settings change is harmless. Toggling the user-facing
2638 // checkbox from off → on is the moment the OS TCC prompt fires —
2639 // with user context — instead of every launch (#3257).
2640 auto& s = AppSettings::instance();
2641 if (m_dialBackend &&
2642 s.value("UlanziDialEnabled", "False").toString() == "True") {
2643 QMetaObject::invokeMethod(m_dialBackend, &UlanziDialBackend::start,
2644 Qt::QueuedConnection);
2645 }
2646#ifdef HAVE_HIDAPI
2647 if (m_hidEncoder &&
2648 s.value("HidEncoderEnabled", "False").toString() == "True") {
2649 QMetaObject::invokeMethod(m_hidEncoder, [this] {
2650 m_hidEncoder->loadSettings();
2651 });
2652 }
2653 refreshStreamDeckLabels();
2654#endif
2655 });
2656#ifdef HAVE_SERIALPORT
2657 dlg->setFlexControlConnectionStatus(

Callers

nothing calls this directly

Calls 15

refreshButtonActionsMethod · 0.80
slicesMethod · 0.80
emitLetterRefreshMethod · 0.80
audioCompressionParamMethod · 0.80
removeRxAudioStreamMethod · 0.80
createRxAudioStreamMethod · 0.80
loadSettingsMethod · 0.45
toStringMethod · 0.45
valueMethod · 0.45
isEmptyMethod · 0.45
isOpenMethod · 0.45

Tested by

no test coverage detected