Fixed issue with callsign selection
This commit is contained in:
parent
88d8070db4
commit
08d1f007fa
@ -1166,7 +1166,10 @@ MainWindow::MainWindow(QDir const& temp_directory, bool multiple,
|
|||||||
QMenu * menu = new QMenu(ui->tableWidgetRXAll);
|
QMenu * menu = new QMenu(ui->tableWidgetRXAll);
|
||||||
|
|
||||||
// clear the selection of the call widget on right click
|
// clear the selection of the call widget on right click
|
||||||
|
// but only if the table has rows.
|
||||||
|
if(ui->tableWidgetRXAll->rowAt(point.y()) != -1){
|
||||||
ui->tableWidgetCalls->selectionModel()->clearSelection();
|
ui->tableWidgetCalls->selectionModel()->clearSelection();
|
||||||
|
}
|
||||||
|
|
||||||
QString selectedCall = callsignSelected();
|
QString selectedCall = callsignSelected();
|
||||||
bool missingCallsign = selectedCall.isEmpty();
|
bool missingCallsign = selectedCall.isEmpty();
|
||||||
@ -1182,7 +1185,6 @@ MainWindow::MainWindow(QDir const& temp_directory, bool multiple,
|
|||||||
auto qsyAction = menu->addAction(QString("Jump to %1Hz").arg(selectedOffset));
|
auto qsyAction = menu->addAction(QString("Jump to %1Hz").arg(selectedOffset));
|
||||||
connect(qsyAction, &QAction::triggered, this, [this, selectedOffset](){
|
connect(qsyAction, &QAction::triggered, this, [this, selectedOffset](){
|
||||||
setFreqOffsetForRestore(selectedOffset, false);
|
setFreqOffsetForRestore(selectedOffset, false);
|
||||||
// TODO: prompt mode switch?
|
|
||||||
});
|
});
|
||||||
|
|
||||||
auto items = m_bandActivity.value(selectedOffset);
|
auto items = m_bandActivity.value(selectedOffset);
|
||||||
@ -1401,7 +1403,11 @@ MainWindow::MainWindow(QDir const& temp_directory, bool multiple,
|
|||||||
connect(ui->tableWidgetCalls, &QTableWidget::customContextMenuRequested, this, [this, logAction, historyAction, localMessageAction, clearAction4, clearActionAll, addStation, removeStation](QPoint const &point){
|
connect(ui->tableWidgetCalls, &QTableWidget::customContextMenuRequested, this, [this, logAction, historyAction, localMessageAction, clearAction4, clearActionAll, addStation, removeStation](QPoint const &point){
|
||||||
QMenu * menu = new QMenu(ui->tableWidgetCalls);
|
QMenu * menu = new QMenu(ui->tableWidgetCalls);
|
||||||
|
|
||||||
|
// clear the selection of the call widget on right click
|
||||||
|
// but only if the table has rows.
|
||||||
|
if(ui->tableWidgetCalls->rowAt(point.y()) != -1){
|
||||||
ui->tableWidgetRXAll->selectionModel()->clearSelection();
|
ui->tableWidgetRXAll->selectionModel()->clearSelection();
|
||||||
|
}
|
||||||
|
|
||||||
QString selectedCall = callsignSelected();
|
QString selectedCall = callsignSelected();
|
||||||
bool isAllCall = isAllCallIncluded(selectedCall);
|
bool isAllCall = isAllCallIncluded(selectedCall);
|
||||||
@ -10103,6 +10109,12 @@ QString MainWindow::callsignSelected(bool useInputText){
|
|||||||
auto selectedItems = ui->tableWidgetRXAll->selectedItems();
|
auto selectedItems = ui->tableWidgetRXAll->selectedItems();
|
||||||
selectedOffset = selectedItems.first()->data(Qt::UserRole).toInt();
|
selectedOffset = selectedItems.first()->data(Qt::UserRole).toInt();
|
||||||
|
|
||||||
|
int threshold = 0;
|
||||||
|
auto activity = m_bandActivity.value(selectedOffset);
|
||||||
|
if(!activity.isEmpty()){
|
||||||
|
threshold = rxThreshold(activity.last().submode);
|
||||||
|
}
|
||||||
|
|
||||||
auto keys = m_callActivity.keys();
|
auto keys = m_callActivity.keys();
|
||||||
qStableSort(keys.begin(), keys.end(), [this](QString const &a, QString const &b){
|
qStableSort(keys.begin(), keys.end(), [this](QString const &a, QString const &b){
|
||||||
auto tA = m_callActivity[a].utcTimestamp;
|
auto tA = m_callActivity[a].utcTimestamp;
|
||||||
@ -10114,7 +10126,9 @@ QString MainWindow::callsignSelected(bool useInputText){
|
|||||||
});
|
});
|
||||||
foreach(auto call, keys){
|
foreach(auto call, keys){
|
||||||
auto d = m_callActivity[call];
|
auto d = m_callActivity[call];
|
||||||
if(d.freq == selectedOffset){
|
|
||||||
|
// if this callsign is at a frequency within the threshold limit of the selected offset
|
||||||
|
if(selectedOffset - threshold <= d.freq && d.freq <= selectedOffset + threshold){
|
||||||
return d.call;
|
return d.call;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user