Selection tracking
This commit is contained in:
parent
0a95c79f3a
commit
d048f5a2ab
@ -2860,7 +2860,7 @@ void MainWindow::readFromStdout() //readFromStdout
|
|||||||
{
|
{
|
||||||
while(proc_jt9.canReadLine()) {
|
while(proc_jt9.canReadLine()) {
|
||||||
QByteArray t=proc_jt9.readLine();
|
QByteArray t=proc_jt9.readLine();
|
||||||
qDebug()<< QString(t);
|
qDebug() << "JT9: " << QString(t);
|
||||||
if(m_mode=="FT8" and !m_config.bHound() and t.contains(";")) {
|
if(m_mode=="FT8" and !m_config.bHound() and t.contains(";")) {
|
||||||
if(t.contains("<...>")) continue;
|
if(t.contains("<...>")) continue;
|
||||||
if(!m_bWarnedHound) {
|
if(!m_bWarnedHound) {
|
||||||
@ -7090,6 +7090,11 @@ void MainWindow::postDecode (bool is_new, QString const& message)
|
|||||||
|
|
||||||
|
|
||||||
// TODO: keep track of selection
|
// TODO: keep track of selection
|
||||||
|
int selectedOffset = -1;
|
||||||
|
auto selectedItems = ui->tableWidgetRXAll->selectedItems();
|
||||||
|
if(!selectedItems.isEmpty()){
|
||||||
|
selectedOffset = selectedItems.first()->text().toInt();
|
||||||
|
}
|
||||||
int now = QDateTime::currentDateTimeUtc().toMSecsSinceEpoch();
|
int now = QDateTime::currentDateTimeUtc().toMSecsSinceEpoch();
|
||||||
for(int i = ui->tableWidgetRXAll->rowCount(); i >= 0; i--){
|
for(int i = ui->tableWidgetRXAll->rowCount(); i >= 0; i--){
|
||||||
ui->tableWidgetRXAll->removeRow(i);
|
ui->tableWidgetRXAll->removeRow(i);
|
||||||
@ -7117,17 +7122,34 @@ void MainWindow::postDecode (bool is_new, QString const& message)
|
|||||||
ui->tableWidgetRXAll->setItem(ui->tableWidgetRXAll->rowCount() - 1, 0, new QTableWidgetItem(QString("%1").arg(offset)));
|
ui->tableWidgetRXAll->setItem(ui->tableWidgetRXAll->rowCount() - 1, 0, new QTableWidgetItem(QString("%1").arg(offset)));
|
||||||
ui->tableWidgetRXAll->setItem(ui->tableWidgetRXAll->rowCount() - 1, 1, new QTableWidgetItem(QString("%1").arg(snr)));
|
ui->tableWidgetRXAll->setItem(ui->tableWidgetRXAll->rowCount() - 1, 1, new QTableWidgetItem(QString("%1").arg(snr)));
|
||||||
ui->tableWidgetRXAll->setItem(ui->tableWidgetRXAll->rowCount() - 1, 2, new QTableWidgetItem(joined));
|
ui->tableWidgetRXAll->setItem(ui->tableWidgetRXAll->rowCount() - 1, 2, new QTableWidgetItem(joined));
|
||||||
|
if(offset == selectedOffset){
|
||||||
|
ui->tableWidgetRXAll->selectRow(ui->tableWidgetRXAll->rowCount() - 1);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
ui->tableWidgetRXAll->resizeColumnsToContents();
|
ui->tableWidgetRXAll->resizeColumnsToContents();
|
||||||
|
|
||||||
// TODO: keep track of selection
|
// TODO: keep track of selection
|
||||||
ui->listWidget->clear();
|
QString selectedCall;
|
||||||
ui->listWidget->addItem("allcall");
|
auto selectedCalls = ui->tableWidgetCalls->selectedItems();
|
||||||
|
if(!selectedCalls.isEmpty()){
|
||||||
|
selectedCall = selectedCalls.first()->text();
|
||||||
|
}
|
||||||
|
for(int i = ui->tableWidgetCalls->rowCount(); i >= 0; i--){
|
||||||
|
ui->tableWidgetCalls->removeRow(i);
|
||||||
|
}
|
||||||
|
|
||||||
|
ui->tableWidgetCalls->insertRow(ui->tableWidgetCalls->rowCount());
|
||||||
|
ui->tableWidgetCalls->setItem(ui->tableWidgetCalls->rowCount() - 1, 0, new QTableWidgetItem("allcall"));
|
||||||
|
|
||||||
QList<QString> calls = m_callActivity.keys();
|
QList<QString> calls = m_callActivity.keys();
|
||||||
qSort(calls.begin(), calls.end());
|
qSort(calls.begin(), calls.end());
|
||||||
foreach(QString call, calls){
|
foreach(QString call, calls){
|
||||||
ui->listWidget->addItem(call);
|
ui->tableWidgetCalls->insertRow(ui->tableWidgetCalls->rowCount());
|
||||||
|
ui->tableWidgetCalls->setItem(ui->tableWidgetCalls->rowCount() - 1, 0, new QTableWidgetItem(call));
|
||||||
|
if(call == selectedCall){
|
||||||
|
ui->tableWidgetCalls->selectRow(ui->tableWidgetCalls->rowCount() - 1);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -835,23 +835,36 @@ QTextEdit[readOnly="true"] {
|
|||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</widget>
|
</widget>
|
||||||
<widget class="QListWidget" name="listWidget">
|
<widget class="QTableWidget" name="tableWidgetCalls">
|
||||||
<property name="sizePolicy">
|
<property name="selectionMode">
|
||||||
<sizepolicy hsizetype="Minimum" vsizetype="Expanding">
|
<enum>QAbstractItemView::SingleSelection</enum>
|
||||||
<horstretch>1</horstretch>
|
|
||||||
<verstretch>0</verstretch>
|
|
||||||
</sizepolicy>
|
|
||||||
</property>
|
</property>
|
||||||
<property name="maximumSize">
|
<property name="selectionBehavior">
|
||||||
<size>
|
<enum>QAbstractItemView::SelectRows</enum>
|
||||||
<width>16777215</width>
|
|
||||||
<height>16777215</height>
|
|
||||||
</size>
|
|
||||||
</property>
|
</property>
|
||||||
<property name="styleSheet">
|
<property name="gridStyle">
|
||||||
<string notr="true">QListWidget { background:rgb(255, 255, 255); }</string>
|
<enum>Qt::DotLine</enum>
|
||||||
</property>
|
</property>
|
||||||
<item>
|
<attribute name="horizontalHeaderVisible">
|
||||||
|
<bool>false</bool>
|
||||||
|
</attribute>
|
||||||
|
<attribute name="horizontalHeaderStretchLastSection">
|
||||||
|
<bool>true</bool>
|
||||||
|
</attribute>
|
||||||
|
<attribute name="verticalHeaderVisible">
|
||||||
|
<bool>false</bool>
|
||||||
|
</attribute>
|
||||||
|
<row>
|
||||||
|
<property name="text">
|
||||||
|
<string>0</string>
|
||||||
|
</property>
|
||||||
|
</row>
|
||||||
|
<column>
|
||||||
|
<property name="text">
|
||||||
|
<string>Callsign</string>
|
||||||
|
</property>
|
||||||
|
</column>
|
||||||
|
<item row="0" column="0">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>allcall</string>
|
<string>allcall</string>
|
||||||
</property>
|
</property>
|
||||||
|
Loading…
Reference in New Issue
Block a user