refs #240, text to status message, used when a text message shall be logged or used in popup windows with status message signature

This commit is contained in:
Klaus Basan
2014-05-19 18:20:28 +02:00
parent 4c952ab782
commit d4d121bed5
2 changed files with 20 additions and 0 deletions

View File

@@ -138,6 +138,15 @@ namespace BlackMisc
return s;
}
/*
* As status message
*/
CStatusMessage CTextMessage::asStatusMessage(bool withSender, bool withRecipient, const QString separator) const
{
QString m = this->asString(withSender, withRecipient, separator);
return CStatusMessage::getInfoMessage(m, CStatusMessage::TypeTrafficNetwork);
}
/*
* Toggle sender / receiver
*/

View File

@@ -12,6 +12,7 @@
#include "pqfrequency.h"
#include "avcallsign.h"
#include "statusmessage.h"
#include "valueobject.h"
#include <QDateTime>
@@ -128,6 +129,16 @@ namespace BlackMisc
*/
QString asString(bool withSender, bool withRecipient, const QString separator = ", ") const;
/*!
* Whole message as BlackMisc::CStatusMessage.
* Used to display message in logs, or any other situation where a CStatusMessage is required.
* \param withSender include sender information in string?
* \param withRecipient include recipient information in string?
* \param separator values separated by given value
* \return
*/
BlackMisc::CStatusMessage asStatusMessage(bool withSender, bool withRecipient, const QString separator = ", ") const;
//! \brief Toggle sender receiver, can be used to ping my own message
void toggleSenderRecipient();