Fixed self logging

This commit is contained in:
Jordan Sherer 2019-01-09 18:27:33 -05:00
parent 9d575707f0
commit 4541d58cac
2 changed files with 27 additions and 11 deletions

View File

@ -4301,12 +4301,28 @@ void MainWindow::logHeardGraph(CommandDetail d){
return; return;
} }
auto my_callsign = m_config.my_callsign();
// hearing
if(m_heardGraphOutgoing.contains(my_callsign)){
m_heardGraphOutgoing[my_callsign].insert(from);
} else {
m_heardGraphOutgoing[my_callsign].insert(from);
}
if(m_heardGraphOutgoing.contains(from)){ if(m_heardGraphOutgoing.contains(from)){
m_heardGraphOutgoing[from].insert(to); m_heardGraphOutgoing[from].insert(to);
} else { } else {
m_heardGraphOutgoing[from] = { to }; m_heardGraphOutgoing[from] = { to };
} }
// heard by
if(m_heardGraphIncoming.contains(from)){
m_heardGraphIncoming[from].insert(my_callsign);
} else {
m_heardGraphIncoming[from] = { my_callsign };
}
if(m_heardGraphIncoming.contains(to)){ if(m_heardGraphIncoming.contains(to)){
m_heardGraphIncoming[to].insert(from); m_heardGraphIncoming[to].insert(from);
} else { } else {
@ -7692,15 +7708,15 @@ void MainWindow::on_tableWidgetRXAll_selectionChanged(const QItemSelection &/*se
ui->extFreeTextMsgEdit->setPlaceholderText(placeholderText); ui->extFreeTextMsgEdit->setPlaceholderText(placeholderText);
// heard detail // heard detail
auto hearing = m_heardGraphOutgoing.value(selectedCall).values().join(", "); QString hearing = m_heardGraphOutgoing.value(selectedCall).values().join(", ");
auto heardby = m_heardGraphIncoming.value(selectedCall).values().join(", "); QString heardby = m_heardGraphIncoming.value(selectedCall).values().join(", ");
auto html = selectedCall.isEmpty() || selectedCall.contains("@") ? "" : ( auto html = selectedCall.isEmpty() || selectedCall.contains("@") ? "" : (
QString("<h1>%1</h1>").arg(selectedCall) + QString("<h1>%1</h1>").arg(selectedCall.toHtmlEscaped()) +
QString("<p><strong>HEARING</strong>: %1</p>").arg(hearing) + QString("<p><strong>HEARING</strong>: %1</p>").arg(hearing.toHtmlEscaped()) +
QString("<p><strong>HEARD BY</strong>: %1</p>").arg(heardby) QString("<p><strong>HEARD BY</strong>: %1</p>").arg(heardby.toHtmlEscaped())
); );
ui->callDetailTextBrowser->setHtml(html); ui->callDetailTextBrowser->setHtml(html);
ui->callDetailTextBrowser->setMinimumHeight((qreal)50.0 + min(ui->callDetailTextBrowser->document()->size().height(), ui->callsVerticalSplitter->height() * 0.33)); //ui->callDetailTextBrowser->setMinimumHeight((qreal)50.0 + min(ui->callDetailTextBrowser->document()->size().height(), ui->callsVerticalSplitter->height() * 0.33));
// immediately update the display); // immediately update the display);

View File

@ -1116,6 +1116,11 @@ QTextEdit[transmitting=&quot;true&quot;] {
<property name="handleWidth"> <property name="handleWidth">
<number>6</number> <number>6</number>
</property> </property>
<widget class="QTextBrowser" name="callDetailTextBrowser">
<property name="frameShape">
<enum>QFrame::Box</enum>
</property>
</widget>
<widget class="QTableWidget" name="tableWidgetCalls"> <widget class="QTableWidget" name="tableWidgetCalls">
<property name="font"> <property name="font">
<font> <font>
@ -1222,11 +1227,6 @@ QTextEdit[transmitting=&quot;true&quot;] {
</property> </property>
</column> </column>
</widget> </widget>
<widget class="QTextBrowser" name="callDetailTextBrowser">
<property name="frameShape">
<enum>QFrame::Box</enum>
</property>
</widget>
</widget> </widget>
</widget> </widget>
<widget class="QWidget" name="macroHorizonalWidget" native="true"> <widget class="QWidget" name="macroHorizonalWidget" native="true">