| 64 | namespace AetherSDR { |
| 65 | |
| 66 | void MainWindow::buildMenuBar() |
| 67 | { |
| 68 | auto* fileMenu = menuBar()->addMenu("&File"); |
| 69 | |
| 70 | auto* waveformsAct = fileMenu->addAction("Waveforms..."); |
| 71 | waveformsAct->setMenuRole(QAction::NoRole); |
| 72 | connect(waveformsAct, &QAction::triggered, this, [this] { |
| 73 | showOrRaisePersistent(m_waveformsDialog, &m_radioModel); |
| 74 | }); |
| 75 | |
| 76 | fileMenu->addSeparator(); |
| 77 | auto* quitAct = fileMenu->addAction("&Quit"); |
| 78 | quitAct->setShortcut(QKeySequence::Quit); |
| 79 | quitAct->setMenuRole(QAction::QuitRole); |
| 80 | connect(quitAct, &QAction::triggered, this, [this]() { |
| 81 | if (m_panStack) { |
| 82 | m_panStack->setShuttingDown(true); |
| 83 | } |
| 84 | close(); |
| 85 | }); |
| 86 | |
| 87 | // ── Settings menu ────────────────────────────────────────────────────── |
| 88 | auto* settingsMenu = menuBar()->addMenu("&Settings"); |
| 89 | |
| 90 | auto* radioSetup = settingsMenu->addAction("Radio Setup..."); |
| 91 | radioSetup->setMenuRole(QAction::PreferencesRole); // macOS: appears in app menu as Preferences (#883, #1013) |
| 92 | connect(radioSetup, &QAction::triggered, this, [this] { |
| 93 | // Snapshot compression setting before dialog opens — used by the |
| 94 | // finished handler to detect a change and recreate the RX audio stream. |
| 95 | const QString prevComp = m_radioModel.audioCompressionParam(); |
| 96 | const bool wasFresh = !m_radioSetupDialog; |
| 97 | showOrRaisePersistent(m_radioSetupDialog, |
| 98 | &m_radioModel, m_audio, |
| 99 | &m_tgxlConn, &m_pgxlConn, &m_antennaGenius, |
| 100 | m_kiwiSdrManager); |
| 101 | if (wasFresh && m_radioSetupDialog) |
| 102 | wireRadioSetupDialogSignals(m_radioSetupDialog, prevComp); |
| 103 | }); |
| 104 | |
| 105 | auto* chooseRadio = settingsMenu->addAction("Connect to Radio..."); |
| 106 | chooseRadio->setMenuRole(QAction::NoRole); // prevent macOS auto-reparenting (#883) |
| 107 | connect(chooseRadio, &QAction::triggered, this, [this] { |
| 108 | toggleConnectionDialog(); |
| 109 | }); |
| 110 | |
| 111 | auto* flexControlAction = settingsMenu->addAction("AetherControl..."); |
| 112 | flexControlAction->setMenuRole(QAction::NoRole); |
| 113 | connect(flexControlAction, &QAction::triggered, |
| 114 | this, &MainWindow::showFlexControlDialog); |
| 115 | |
| 116 | auto* networkAction = settingsMenu->addAction("Network..."); |
| 117 | connect(networkAction, &QAction::triggered, this, [this] { |
| 118 | showNetworkDiagnosticsDialog(); |
| 119 | }); |
| 120 | |
| 121 | auto* receiveSyncMenu = settingsMenu->addMenu("Receive Sync"); |
| 122 | auto* receiveSyncEnabledAct = |
| 123 | receiveSyncMenu->addAction("Sync Kiwi Audio && Display"); |
nothing calls this directly
no test coverage detected