Skip to content

Commit

Permalink
Disable QSY button if the user is already on our frequency.
Browse files Browse the repository at this point in the history
  • Loading branch information
tmiw committed Jul 3, 2023
1 parent dca9a6c commit 606a716
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/freedv_reporter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -188,9 +188,15 @@ void FreeDVReporterDialog::refreshQSYButtonState()
{
auto selectedCallsign = m_listSpots->GetItemText(selectedIndex);

if (selectedCallsign != wxGetApp().m_reportingCallsign && wxGetApp().m_reportingFrequency > 0)
if (selectedCallsign != wxGetApp().m_reportingCallsign &&
wxGetApp().m_reportingFrequency > 0)
{
enabled = true;
wxString theirFreqString = m_listSpots->GetItemText(selectedIndex, 3);
wxRegEx mhzRegex(" MHz$");
mhzRegex.Replace(&theirFreqString, "");

uint64_t theirFreq = wxAtof(theirFreqString) * 1000 * 1000;
enabled = theirFreq != wxGetApp().m_reportingFrequency;
}
}

Expand Down

0 comments on commit 606a716

Please sign in to comment.