Skip to content

Commit 3d9a4fe

Browse files
committed
Use native RMessage method
1 parent e3931c8 commit 3d9a4fe

3 files changed

Lines changed: 5 additions & 13 deletions

File tree

src/cloud-client/src/central_widget.cpp

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -95,11 +95,6 @@ void CentralWidget::setTabTitle(TabType tabType, RMessage::Type messageType, con
9595
this->tabWidget->setTabText(tabPosition,defaultText);
9696
}
9797

98-
QString CentralWidget::messageToString(const RMessage &message)
99-
{
100-
return QString("[%1] %2").arg(RMessage::aTimeToString(message.getAtime()),message);
101-
}
102-
10398
void CentralWidget::onInfoPrinted(const RMessage &message)
10499
{
105100
QScrollBar *sb = this->applicationOutputBrowser->verticalScrollBar();
@@ -109,7 +104,7 @@ void CentralWidget::onInfoPrinted(const RMessage &message)
109104
this->applicationOutputBrowser->moveCursor(QTextCursor::End);
110105
this->applicationOutputBrowser->setTextBackgroundColor(QApplication::palette().base().color());
111106
this->applicationOutputBrowser->setTextColor(QApplication::palette().text().color());
112-
this->applicationOutputBrowser->insertPlainText(CentralWidget::messageToString(message));
107+
this->applicationOutputBrowser->insertPlainText(RMessage::messageToLogString(message));
113108
this->applicationOutputBrowser->moveCursor(QTextCursor::End);
114109
if (scrollBarAtMax)
115110
{
@@ -121,7 +116,7 @@ void CentralWidget::onInfoPrinted(const RMessage &message)
121116

122117
void CentralWidget::onNoticePrinted(const RMessage &message)
123118
{
124-
RMessageBox::information(this,tr("Notice"),QString(CentralWidget::messageToString(message)).replace("NOTICE: ",""));
119+
RMessageBox::information(this,tr("Notice"),QString(RMessage::messageToLogString(message)).replace("NOTICE: ",""));
125120
}
126121

127122
void CentralWidget::onWarningPrinted(const RMessage &message)
@@ -131,7 +126,7 @@ void CentralWidget::onWarningPrinted(const RMessage &message)
131126
this->applicationOutputBrowser->moveCursor(QTextCursor::End);
132127
this->applicationOutputBrowser->setTextBackgroundColor(QApplication::palette().base().color());
133128
this->applicationOutputBrowser->setTextColor(QColor(170,0,0));
134-
this->applicationOutputBrowser->insertPlainText(CentralWidget::messageToString(message));
129+
this->applicationOutputBrowser->insertPlainText(RMessage::messageToLogString(message));
135130
this->applicationOutputBrowser->moveCursor(QTextCursor::End);
136131
this->applicationOutputBrowser->setTextColor(QApplication::palette().text().color());
137132
this->applicationOutputBrowser->setCurrentCharFormat(charFormat);
@@ -147,7 +142,7 @@ void CentralWidget::onErrorPrinted(const RMessage &message)
147142
this->applicationOutputBrowser->moveCursor(QTextCursor::End);
148143
this->applicationOutputBrowser->setTextBackgroundColor(QColor(170,0,0));
149144
this->applicationOutputBrowser->setTextColor(QColor(255,255,255));
150-
this->applicationOutputBrowser->insertPlainText(CentralWidget::messageToString(message));
145+
this->applicationOutputBrowser->insertPlainText(RMessage::messageToLogString(message));
151146
this->applicationOutputBrowser->moveCursor(QTextCursor::End);
152147
this->applicationOutputBrowser->setTextBackgroundColor(QApplication::palette().base().color());
153148
this->applicationOutputBrowser->setTextColor(QApplication::palette().text().color());

src/cloud-client/src/central_widget.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,9 +43,6 @@ class CentralWidget : public QWidget
4343
//! Set text and icon for given tab.
4444
void setTabTitle(CentralWidget::TabType tabType, RMessage::Type messageType = RMessage::Type::None, const QString &additionalText = QString());
4545

46-
//! Convert message to string.
47-
static QString messageToString(const RMessage &message);
48-
4946
private slots:
5047

5148
//! Print application info message.

0 commit comments

Comments
 (0)