1 /* 2 SPDX-FileCopyrightText: 2010 Marco Mentasti <marcomentasti@gmail.com> 3 4 SPDX-License-Identifier: LGPL-2.0-only 5 */ 6 7 #ifndef TEXTOUTPUTWIDGET_H 8 #define TEXTOUTPUTWIDGET_H 9 10 class QHBoxLayout; 11 class QTextEdit; 12 13 #include "connection.h" 14 #include <QWidget> 15 16 class TextOutputWidget : public QWidget 17 { 18 Q_OBJECT 19 20 public: 21 TextOutputWidget(QWidget *parent = nullptr); 22 ~TextOutputWidget() override; 23 24 public Q_SLOTS: 25 void showErrorMessage(const QString &message); 26 void showSuccessMessage(const QString &message); 27 28 private: 29 void writeMessage(const QString &msg); 30 31 private: 32 QHBoxLayout *m_layout; 33 QTextEdit *m_output; 34 35 QColor m_succesTextColor; 36 QColor m_succesBackgroundColor; 37 QColor m_errorTextColor; 38 QColor m_errorBackgroundColor; 39 }; 40 41 #endif // TEXTOUTPUTWIDGET_H 42