source/MainGUI.cpp
/**
 * Displays the message at the output area of GProxy.
 *
 * @param coloredMessage The message to be displayed.
 * @param log If the message should be logged. Default: <code>true</code>.
 * @param printTimestamp If the current time should be displayed before the message. Default: <code>true</code>.
 * @param lineBreak If a line break should be appended to the message. Default: <code>true</code>.
 */
Displays the message at the output area of GProxy.
@param coloredMessage The message to be displayed.
@param log If the message should be logged. Default: true.
@param printTimestamp If the current time should be displayed before the message. Default: true.
@param lineBreak If a line break should be appended to the message. Default: true.
Displays the message at the output area of GProxy . @param coloredMessage The message to be displayed . @param log If the message should be logged . Default : true . @param printTimestamp If the current time should be displayed before the message . Default : true . @param lineBreak If a line break should be appended to the message . Default : true .
void MainGUI::addMessage (const ColoredMessage& coloredMessage, bool log, bool printTimestamp, bool lineBreak)
{
    ColoredMessage cm = ColoredMessage(coloredMessage);
    if (log)
    {
        LOG_Print(cm.getMessage(), printTimestamp, lineBreak);
    }
    if (printTimestamp)
    {
        QString dateTimeString = QLocale().toString(QDateTime::currentDateTime(), "[hh:mm:ss] ");
        cm.setMessage(cm.getMessage().prepend(dateTimeString));
    }
    if (lineBreak)
    {
        cm.setMessage(cm.getMessage().append('\n'));
    }
    widget.outputTextArea->appendColoredMessage(cm);
    widget.inputTextArea->setFocus();
}
void MainGUI :: addMessage ( const ColoredMessage & coloredMessage , bool log , bool printTimestamp , bool lineBreak ) { ColoredMessage cm = ColoredMessage ( coloredMessage ) ; if ( log ) { LOG_Print ( cm . getMessage ( ) , printTimestamp , lineBreak ) ; } if ( printTimestamp ) { QString dateTimeString = QLocale ( ) . toString ( QDateTime :: currentDateTime ( ) , " " ) ; cm . setMessage ( cm . getMessage ( ) . prepend ( dateTimeString ) ) ; } if ( lineBreak ) { cm . setMessage ( cm . getMessage ( ) . append ( ' \n ' ) ) ; } widget . outputTextArea -> appendColoredMessage ( cm ) ; widget . inputTextArea -> setFocus ( ) ; }
Displays the message at the output area of GProxy.
Displays the message at the output area of GProxy .