diff --git a/Code/Mantid/MantidPlot/src/ApplicationWindow.cpp b/Code/Mantid/MantidPlot/src/ApplicationWindow.cpp index f050f524b6030e846c83d9d32f0a630a3bb6edd8..06e331799c08cb5632085c6f5a4185a558e880ae 100644 --- a/Code/Mantid/MantidPlot/src/ApplicationWindow.cpp +++ b/Code/Mantid/MantidPlot/src/ApplicationWindow.cpp @@ -284,6 +284,7 @@ void ApplicationWindow::init(bool factorySettings, const QStringList& args) qRegisterMetaType<Message>("Message"); // Required to use it in signals-slots resultsLog = new MantidQt::API::MessageDisplay(MessageDisplay::EnableLogLevelControl, logWindow); logWindow->setWidget(resultsLog); + connect(resultsLog, SIGNAL(errorReceived(const QString &)), logWindow, SLOT(show())); // Start Mantid // Set the Paraview path BEFORE libaries are loaded. Doing it here prevents diff --git a/Code/Mantid/MantidQt/API/inc/MantidQtAPI/MessageDisplay.h b/Code/Mantid/MantidQt/API/inc/MantidQtAPI/MessageDisplay.h index 20280d8b972d812c66088fc53bfcdf6a034549ae..e3d154af9006e6ab3b3a3fe43cbc6a4a11a9cfd3 100644 --- a/Code/Mantid/MantidQt/API/inc/MantidQtAPI/MessageDisplay.h +++ b/Code/Mantid/MantidQt/API/inc/MantidQtAPI/MessageDisplay.h @@ -40,7 +40,7 @@ namespace MantidQt /// Controls whether the display is allowed to set the log levels enum LogLevelControl { EnableLogLevelControl = 0, - DisableLogLevelControl = 1 + DisableLogLevelControl }; /// Default constructor @@ -52,6 +52,10 @@ namespace MantidQt // Setup logging framework connections void attachLoggingChannel(); + signals: + /// Indicate that a message of error or higher has been received. + void errorReceived(const QString & text); + public slots: /// Convenience method for appending message at fatal level void appendFatal(const QString & text); diff --git a/Code/Mantid/MantidQt/API/src/MessageDisplay.cpp b/Code/Mantid/MantidQt/API/src/MessageDisplay.cpp index f6f53b0967d2f233dc7750a0df21246068b81ff9..c6cd3ede7c64bda4056e0c65d069113de04af898 100644 --- a/Code/Mantid/MantidQt/API/src/MessageDisplay.cpp +++ b/Code/Mantid/MantidQt/API/src/MessageDisplay.cpp @@ -125,6 +125,7 @@ namespace MantidQt appendText(msg.text()); //set the colour back to the default (black) for historical reasons setTextColor(Message::Priority::PRIO_INFORMATION); + if(msg.priority() <= Message::Priority::PRIO_ERROR ) emit errorReceived(msg.text()); } /** @@ -132,7 +133,8 @@ namespace MantidQt */ void MessageDisplay::replace(const Message & msg) { - m_textDisplay->setText(msg.text()); + clear(); + append(msg.text()); } /**