From 4168e1937c6097354a9197f6553f38147942e5c3 Mon Sep 17 00:00:00 2001 From: Jordan Sherer Date: Thu, 11 Oct 2018 01:11:48 -0400 Subject: [PATCH] Fixed beacon scheduling with a beacon now context menu item --- mainwindow.cpp | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/mainwindow.cpp b/mainwindow.cpp index 2373f09..e271ef6 100644 --- a/mainwindow.cpp +++ b/mainwindow.cpp @@ -1391,6 +1391,20 @@ MainWindow::MainWindow(QDir const& temp_directory, bool multiple, // Don't block beacon's first run... m_lastTxTime = DriftingDateTime::currentDateTimeUtc().addSecs(-300); + + auto beaconNow = new QAction(QString("Beacon Now"), ui->beaconButton); + connect(beaconNow, &QAction::triggered, this, [this](){ + if(m_transmitting){ + return; + } + if(!ui->beaconButton->isChecked()){ + ui->beaconButton->setChecked(true); + } + scheduleBeacon(true); + }); + ui->beaconButton->setContextMenuPolicy(Qt::ActionsContextMenu); + ui->beaconButton->addAction(beaconNow); + pskSetLocal(); aprsSetLocal(); @@ -7180,7 +7194,7 @@ void MainWindow::on_beaconButton_clicked() // then process the action if(ui->beaconButton->isChecked()){ - scheduleBeacon(true); + scheduleBeacon(false); } else { pauseBeacon(); }