Added heard by tooltip for group callsigns

This commit is contained in:
Jordan Sherer 2019-12-29 14:47:21 -05:00
parent 9afb56bf6f
commit 53853c5be4
2 changed files with 10 additions and 8 deletions

View File

@ -6367,7 +6367,7 @@ void MainWindow::clearActivity(){
resetTimeDeltaAverage(); resetTimeDeltaAverage();
clearTableWidget(ui->tableWidgetCalls); clearTableWidget(ui->tableWidgetCalls);
createAllcallTableRows(ui->tableWidgetCalls, ""); createGroupCallsignTableRows(ui->tableWidgetCalls, "");
clearTableWidget(ui->tableWidgetRXAll); clearTableWidget(ui->tableWidgetRXAll);
@ -6383,7 +6383,7 @@ void MainWindow::clearActivity(){
displayActivity(true); displayActivity(true);
} }
void MainWindow::createAllcallTableRows(QTableWidget *table, QString const &selectedCall){ void MainWindow::createGroupCallsignTableRows(QTableWidget *table, QString const &selectedCall){
int count = 0; int count = 0;
auto now = DriftingDateTime::currentDateTimeUtc(); auto now = DriftingDateTime::currentDateTimeUtc();
int callsignAging = m_config.callsign_aging(); int callsignAging = m_config.callsign_aging();
@ -6427,10 +6427,12 @@ void MainWindow::createAllcallTableRows(QTableWidget *table, QString const &sele
auto emptyItem = new QTableWidgetItem(""); auto emptyItem = new QTableWidgetItem("");
emptyItem->setData(Qt::UserRole, QVariant(group)); emptyItem->setData(Qt::UserRole, QVariant(group));
emptyItem->setToolTip(generateCallDetail(group));
table->setItem(table->rowCount() - 1, 0, emptyItem); table->setItem(table->rowCount() - 1, 0, emptyItem);
auto item = new QTableWidgetItem(group); auto item = new QTableWidgetItem(group);
item->setData(Qt::UserRole, QVariant(group)); item->setData(Qt::UserRole, QVariant(group));
item->setToolTip(generateCallDetail(group));
table->setItem(table->rowCount() - 1, startCol, item); table->setItem(table->rowCount() - 1, startCol, item);
table->setSpan(table->rowCount() - 1, startCol, 1, table->columnCount()); table->setSpan(table->rowCount() - 1, startCol, 1, table->columnCount());
@ -7969,7 +7971,7 @@ void MainWindow::on_clearAction_triggered(QObject * sender){
m_heardGraphIncoming.clear(); m_heardGraphIncoming.clear();
m_heardGraphOutgoing.clear(); m_heardGraphOutgoing.clear();
clearTableWidget((ui->tableWidgetCalls)); clearTableWidget((ui->tableWidgetCalls));
createAllcallTableRows(ui->tableWidgetCalls, ""); createGroupCallsignTableRows(ui->tableWidgetCalls, "");
resetTimeDeltaAverage(); resetTimeDeltaAverage();
displayCallActivity(); displayCallActivity();
} }
@ -9045,7 +9047,7 @@ void MainWindow::on_tableWidgetRXAll_selectionChanged(const QItemSelection &/*se
} }
QString MainWindow::generateCallDetail(QString selectedCall){ QString MainWindow::generateCallDetail(QString selectedCall){
if(selectedCall.isEmpty() || selectedCall.contains("@")){ if(selectedCall.isEmpty()){
return ""; return "";
} }
@ -9054,8 +9056,8 @@ QString MainWindow::generateCallDetail(QString selectedCall){
QString heardby = m_heardGraphIncoming.value(selectedCall).values().join(", "); QString heardby = m_heardGraphIncoming.value(selectedCall).values().join(", ");
QStringList detail = { QStringList detail = {
QString("<h1>%1</h1>").arg(selectedCall.toHtmlEscaped()), QString("<h1>%1</h1>").arg(selectedCall.toHtmlEscaped()),
QString("<p><strong>HEARING</strong>: %1</p>").arg(hearing.toHtmlEscaped()), hearing.isEmpty() ? "" : QString("<p><strong>HEARING</strong>: %1</p>").arg(hearing.toHtmlEscaped()),
QString("<p><strong>HEARD BY</strong>: %1</p>").arg(heardby.toHtmlEscaped()), heardby.isEmpty() ? "" : QString("<p><strong>HEARD BY</strong>: %1</p>").arg(heardby.toHtmlEscaped()),
}; };
return detail.join("\n"); return detail.join("\n");
@ -12110,7 +12112,7 @@ void MainWindow::displayCallActivity() {
{ {
// Clear the table // Clear the table
clearTableWidget(ui->tableWidgetCalls); clearTableWidget(ui->tableWidgetCalls);
createAllcallTableRows(ui->tableWidgetCalls, selectedCall); // isAllCallIncluded(selectedCall)); // || isGroupCallIncluded(selectedCall)); createGroupCallsignTableRows(ui->tableWidgetCalls, selectedCall); // isAllCallIncluded(selectedCall)); // || isGroupCallIncluded(selectedCall));
// Build the table // Build the table
QList < QString > keys = m_callActivity.keys(); QList < QString > keys = m_callActivity.keys();

View File

@ -141,7 +141,7 @@ public slots:
void cacheActivity(QString key); void cacheActivity(QString key);
void restoreActivity(QString key); void restoreActivity(QString key);
void clearActivity(); void clearActivity();
void createAllcallTableRows(QTableWidget *table, const QString &selectedCall); void createGroupCallsignTableRows(QTableWidget *table, const QString &selectedCall);
void displayTextForFreq(QString text, int freq, QDateTime date, bool isTx, bool isNewLine, bool isLast); void displayTextForFreq(QString text, int freq, QDateTime date, bool isTx, bool isNewLine, bool isLast);
void writeNoticeTextToUI(QDateTime date, QString text); void writeNoticeTextToUI(QDateTime date, QString text);
int writeMessageTextToUI(QDateTime date, QString text, int freq, bool isTx, int block=-1); int writeMessageTextToUI(QDateTime date, QString text, int freq, bool isTx, int block=-1);