diff --git a/mainwindow.cpp b/mainwindow.cpp index b706115..7fab325 100644 --- a/mainwindow.cpp +++ b/mainwindow.cpp @@ -7709,14 +7709,7 @@ void MainWindow::on_tableWidgetRXAll_selectionChanged(const QItemSelection &/*se ui->extFreeTextMsgEdit->setPlaceholderText(placeholderText); #if JS8CALL_SHOW_CALL_DETAIL_BROWSER - // heard detail - QString hearing = m_heardGraphOutgoing.value(selectedCall).values().join(", "); - QString heardby = m_heardGraphIncoming.value(selectedCall).values().join(", "); - auto html = selectedCall.isEmpty() || selectedCall.contains("@") ? "" : ( - QString("
HEARING: %1
").arg(hearing.toHtmlEscaped()) + - QString("HEARD BY: %1
").arg(heardby.toHtmlEscaped()) - ); + auto html = generateCallDetail(selectedCall); ui->callDetailTextBrowser->setHtml(html); ui->callDetailTextBrowser->setVisible(!selectedCall.isEmpty() && (!hearing.isEmpty() || !heardby.isEmpty())); #endif @@ -7726,6 +7719,23 @@ void MainWindow::on_tableWidgetRXAll_selectionChanged(const QItemSelection &/*se updateTextDisplay(); } +QString MainWindow::generateCallDetail(QString selectedCall){ + if(selectedCall.isEmpty() || selectedCall.contains("@")){ + return ""; + } + + // heard detail + QString hearing = m_heardGraphOutgoing.value(selectedCall).values().join(", "); + QString heardby = m_heardGraphIncoming.value(selectedCall).values().join(", "); + QStringList detail = { + QString("HEARING: %1
").arg(hearing.toHtmlEscaped()), + QString("HEARD BY: %1
").arg(heardby.toHtmlEscaped()), + }; + + return detail.join("\n"); +} + void MainWindow::on_tableWidgetCalls_cellClicked(int /*row*/, int /*col*/){ ui->tableWidgetRXAll->selectionModel()->select( ui->tableWidgetRXAll->selectionModel()->selection(), @@ -10564,6 +10574,7 @@ void MainWindow::displayCallActivity() { auto displayItem = new QTableWidgetItem(displayCall); displayItem->setData(Qt::UserRole, QVariant(d.call)); + displayItem->setToolTip(generateCallDetail(displayCall)); ui->tableWidgetCalls->setItem(row, col++, displayItem); diff --git a/mainwindow.h b/mainwindow.h index aa8750a..13878ed 100644 --- a/mainwindow.h +++ b/mainwindow.h @@ -314,6 +314,7 @@ private slots: void on_tableWidgetRXAll_cellClicked(int row, int col); void on_tableWidgetRXAll_cellDoubleClicked(int row, int col); void on_tableWidgetRXAll_selectionChanged(const QItemSelection &selected, const QItemSelection &deselected); + QString generateCallDetail(QString selectedCall); void on_tableWidgetCalls_cellClicked(int row, int col); void on_tableWidgetCalls_cellDoubleClicked(int row, int col); void on_tableWidgetCalls_selectionChanged(const QItemSelection &selected, const QItemSelection &deselected);