From ed157132cdc7aa551da6c030a2ba6b728064ad17 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20M=C3=B6bius?= Date: Wed, 2 Jul 2014 13:48:17 +0000 Subject: [PATCH] Status messages git-svn-id: http://www.openflipper.org/svnrepo/OpenFlipper/branches/Free@19071 383ad7c9-94d9-4d36-a494-682f7c89f535 --- BasePlugin/LoggingInterface.hh | 10 +++++----- Core/Core.cc | 2 ++ Core/Logging.cc | 3 +++ widgets/coreWidget/CoreWidgetLogging.cc | 2 +- widgets/loggerWidget/loggerWidget.cc | 7 +++++++ 5 files changed, 18 insertions(+), 6 deletions(-) diff --git a/BasePlugin/LoggingInterface.hh b/BasePlugin/LoggingInterface.hh index 14e04367..09f98998 100644 --- a/BasePlugin/LoggingInterface.hh +++ b/BasePlugin/LoggingInterface.hh @@ -91,11 +91,11 @@ The following code sends a log message * * Use this enum to specify the importance of log messages. */ -enum Logtype { LOGNONE , /*!< Dummy messages. These messages will not appear in the logwidget and are for testing only */ - LOGOUT , /*!< Standard log messages. Will be printed in black in the logwidget */ - LOGINFO , /*!< Info log messages. Will be printed in green in the logwidget */ - LOGWARN , /*!< Warning messages. Will be printed in yellow in the logwidget */ - LOGERR /*!< Error messages. Will be printed in red in the logwidget */ +enum Logtype { LOGSTATUS , /*!< Status log messages. Will be printed in blue in the logwidget */ + LOGOUT , /*!< Standard log messages. Will be printed in black in the logwidget */ + LOGINFO , /*!< Info log messages. Will be printed in green in the logwidget */ + LOGWARN , /*!< Warning messages. Will be printed in yellow in the logwidget */ + LOGERR /*!< Error messages. Will be printed in red in the logwidget */ }; /** \brief Interface for all Plugins which do logging to the logging window of the framework diff --git a/Core/Core.cc b/Core/Core.cc index 1320b9f2..da358fbf 100644 --- a/Core/Core.cc +++ b/Core/Core.cc @@ -1269,6 +1269,8 @@ void Core::slotLogToFile(Logtype _type, QString _message){ (*logStream_) << "WARN:"; break; case LOGERR: (*logStream_) << "ERR :"; break; + case LOGSTATUS: + (*logStream_) << "STAT:"; break; } (*logStream_) << _message << "\n" << flush; diff --git a/Core/Logging.cc b/Core/Logging.cc index cd19b540..7400d097 100644 --- a/Core/Logging.cc +++ b/Core/Logging.cc @@ -108,6 +108,9 @@ slotLog(Logtype _type, QString _message) { case LOGERR: std::cerr << "\33[31m" << output << std::endl; break; + case LOGSTATUS: + std::cerr << "\33[34m" << output << std::endl; + break; } } diff --git a/widgets/coreWidget/CoreWidgetLogging.cc b/widgets/coreWidget/CoreWidgetLogging.cc index 435b6ef2..c1d98b1b 100644 --- a/widgets/coreWidget/CoreWidgetLogging.cc +++ b/widgets/coreWidget/CoreWidgetLogging.cc @@ -86,7 +86,7 @@ slotLog(Logtype _type, QString _message) { case LOGERR: textColor = QColor(250,0,0); break; - case LOGNONE: + case LOGSTATUS: textColor = QColor(0,0,250); break; } diff --git a/widgets/loggerWidget/loggerWidget.cc b/widgets/loggerWidget/loggerWidget.cc index 2d70390d..5f4ee642 100644 --- a/widgets/loggerWidget/loggerWidget.cc +++ b/widgets/loggerWidget/loggerWidget.cc @@ -215,6 +215,13 @@ void LoggerWidget::append(QString _text, Logtype _type){ item->setForeground( QBrush(QColor(Qt::red)) ); item->setBackground( QBrush(QColor(255,225,225),Qt::Dense4Pattern) ); + if ( errorButton_->isChecked() ) + item->setHidden(false); + break; + case LOGSTATUS: + item->setForeground( QBrush(QColor(Qt::blue)) ); + item->setBackground( QBrush(QColor(255,225,225),Qt::Dense4Pattern) ); + if ( errorButton_->isChecked() ) item->setHidden(false); break; -- GitLab