refs #897, set timestamp for sent message and default "all messages"

This commit is contained in:
Klaus Basan
2017-03-05 19:21:17 +01:00
committed by Mathew Sutcliffe
parent a7393b04e1
commit 8cc683386f
3 changed files with 6 additions and 1 deletions

View File

@@ -82,7 +82,7 @@ namespace BlackGui
BlackMisc::Network::CTextMessageList m_messages; BlackMisc::Network::CTextMessageList m_messages;
QTextDocument *m_textDocument = nullptr; QTextDocument *m_textDocument = nullptr;
int m_keepMaxMessages = 10; int m_keepMaxMessages = -1; //!< max number of messages to keep, or -1 to keep all messages
bool m_withSender = true; bool m_withSender = true;
bool m_withRecipient = false; bool m_withRecipient = false;
bool m_wordWrap = true; bool m_wordWrap = true;

View File

@@ -59,6 +59,10 @@ namespace BlackMisc
void CTextMessage::markAsSent() void CTextMessage::markAsSent()
{ {
m_wasSent = true; m_wasSent = true;
if (!this->hasValidTimestamp())
{
this->setCurrentUtcTime();
}
} }
QString CTextMessage::getRecipientCallsignOrFrequency() const QString CTextMessage::getRecipientCallsignOrFrequency() const

View File

@@ -150,6 +150,7 @@ namespace BlackMisc
bool wasSent() const; bool wasSent() const;
//! Mark as sent //! Mark as sent
//! \remark also sets current timestamp if there is no valid timestamp
void markAsSent(); void markAsSent();
//! Get SELCAL code (if applicable, e.g. ABCD), otherwise "" //! Get SELCAL code (if applicable, e.g. ABCD), otherwise ""