@@ -95,7 +95,12 @@ void CentralWidget::setTabTitle(TabType tabType, RMessage::Type messageType, con
9595 this ->tabWidget ->setTabText (tabPosition,defaultText);
9696}
9797
98- void CentralWidget::onInfoPrinted (const QString &message)
98+ QString CentralWidget::messageToString (const RMessage &message)
99+ {
100+ return QString (" [%1] %2" ).arg (RMessage::aTimeToString (message.getAtime ()),message);
101+ }
102+
103+ void CentralWidget::onInfoPrinted (const RMessage &message)
99104{
100105 QScrollBar *sb = this ->applicationOutputBrowser ->verticalScrollBar ();
101106 int scrollBarValue = sb->value ();
@@ -104,7 +109,7 @@ void CentralWidget::onInfoPrinted(const QString &message)
104109 this ->applicationOutputBrowser ->moveCursor (QTextCursor::End);
105110 this ->applicationOutputBrowser ->setTextBackgroundColor (QApplication::palette ().base ().color ());
106111 this ->applicationOutputBrowser ->setTextColor (QApplication::palette ().text ().color ());
107- this ->applicationOutputBrowser ->insertPlainText (message);
112+ this ->applicationOutputBrowser ->insertPlainText (CentralWidget::messageToString ( message) );
108113 this ->applicationOutputBrowser ->moveCursor (QTextCursor::End);
109114 if (scrollBarAtMax)
110115 {
@@ -114,19 +119,19 @@ void CentralWidget::onInfoPrinted(const QString &message)
114119 this ->setTabTitle (CentralWidget::Output,RMessage::Type::Info);
115120}
116121
117- void CentralWidget::onNoticePrinted (const QString &message)
122+ void CentralWidget::onNoticePrinted (const RMessage &message)
118123{
119- RMessageBox::information (this ,tr (" Notice" ),QString (message).replace (" NOTICE: " ," " ));
124+ RMessageBox::information (this ,tr (" Notice" ),QString (CentralWidget::messageToString ( message) ).replace (" NOTICE: " ," " ));
120125}
121126
122- void CentralWidget::onWarningPrinted (const QString &message)
127+ void CentralWidget::onWarningPrinted (const RMessage &message)
123128{
124129 QTextCharFormat charFormat = this ->applicationOutputBrowser ->currentCharFormat ();
125130
126131 this ->applicationOutputBrowser ->moveCursor (QTextCursor::End);
127132 this ->applicationOutputBrowser ->setTextBackgroundColor (QApplication::palette ().base ().color ());
128133 this ->applicationOutputBrowser ->setTextColor (QColor (170 ,0 ,0 ));
129- this ->applicationOutputBrowser ->insertPlainText (message);
134+ this ->applicationOutputBrowser ->insertPlainText (CentralWidget::messageToString ( message) );
130135 this ->applicationOutputBrowser ->moveCursor (QTextCursor::End);
131136 this ->applicationOutputBrowser ->setTextColor (QApplication::palette ().text ().color ());
132137 this ->applicationOutputBrowser ->setCurrentCharFormat (charFormat);
@@ -135,14 +140,14 @@ void CentralWidget::onWarningPrinted(const QString &message)
135140 this ->setTabTitle (CentralWidget::Output,RMessage::Type::Warning);
136141}
137142
138- void CentralWidget::onErrorPrinted (const QString &message)
143+ void CentralWidget::onErrorPrinted (const RMessage &message)
139144{
140145 QTextCharFormat charFormat = this ->applicationOutputBrowser ->currentCharFormat ();
141146
142147 this ->applicationOutputBrowser ->moveCursor (QTextCursor::End);
143148 this ->applicationOutputBrowser ->setTextBackgroundColor (QColor (170 ,0 ,0 ));
144149 this ->applicationOutputBrowser ->setTextColor (QColor (255 ,255 ,255 ));
145- this ->applicationOutputBrowser ->insertPlainText (message);
150+ this ->applicationOutputBrowser ->insertPlainText (CentralWidget::messageToString ( message) );
146151 this ->applicationOutputBrowser ->moveCursor (QTextCursor::End);
147152 this ->applicationOutputBrowser ->setTextBackgroundColor (QApplication::palette ().base ().color ());
148153 this ->applicationOutputBrowser ->setTextColor (QApplication::palette ().text ().color ());
0 commit comments