Skip to content

Commit

Permalink
Move MessageDisplay to MantidWidgets where it belongs. Refs #6202
Browse files Browse the repository at this point in the history
  • Loading branch information
martyngigg committed Apr 15, 2013
1 parent bd07a65 commit d3c2712
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 16 deletions.
6 changes: 3 additions & 3 deletions Code/Mantid/MantidPlot/src/ApplicationWindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -189,13 +189,13 @@
#include "MantidQtAPI/UserSubWindow.h"
#include "MantidQtAPI/AlgorithmInputHistory.h"
#include "MantidQtAPI/ManageUserDirectories.h"
#include "MantidQtAPI/MessageDisplay.h"
#include "MantidQtAPI/Message.h"

#include "MantidQtMantidWidgets/ICatSearch.h"
#include "MantidQtMantidWidgets/ICatMyDataSearch.h"
#include "MantidQtMantidWidgets/ICatAdvancedSearch.h"
#include "MantidQtMantidWidgets/FitPropertyBrowser.h"
#include "MantidQtMantidWidgets/MessageDisplay.h"
#include "MantidQtMantidWidgets/MuonFitPropertyBrowser.h"

#include "MantidKernel/ConfigService.h"
Expand Down Expand Up @@ -279,10 +279,10 @@ void ApplicationWindow::init(bool factorySettings, const QStringList& args)
logWindow->setWindowTitle(tr("Results Log"));
addDockWidget( Qt::TopDockWidgetArea, logWindow );

using MantidQt::API::MessageDisplay;
using MantidQt::MantidWidgets::MessageDisplay;
using MantidQt::API::Message;
qRegisterMetaType<Message>("Message"); // Required to use it in signals-slots
resultsLog = new MantidQt::API::MessageDisplay(MessageDisplay::EnableLogLevelControl, logWindow);
resultsLog = new MessageDisplay(MessageDisplay::EnableLogLevelControl, logWindow);
logWindow->setWidget(resultsLog);
connect(resultsLog, SIGNAL(errorReceived(const QString &)), logWindow, SLOT(show()));

Expand Down
4 changes: 2 additions & 2 deletions Code/Mantid/MantidPlot/src/ApplicationWindow.h
Original file line number Diff line number Diff line change
Expand Up @@ -110,11 +110,11 @@ namespace MantidQt
namespace API
{
class Message;
class MessageDisplay;
}
namespace MantidWidgets
{
class FitPropertyBrowser;
class MessageDisplay;
}
}
//Mantid
Expand Down Expand Up @@ -1391,7 +1391,7 @@ public slots:
Script *m_iface_script;
QTranslator *appTranslator, *qtTranslator;
QDockWidget *explorerWindow, *undoStackWindow;
MantidQt::API::MessageDisplay *resultsLog;
MantidQt::MantidWidgets::MessageDisplay *resultsLog;
QDockWidget *m_interpreterDock;
CommandLineInterpreter *m_scriptInterpreter;
QMdiArea *d_workspace;
Expand Down
3 changes: 0 additions & 3 deletions Code/Mantid/MantidQt/API/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ set ( SRC_FILES
src/MantidQwtMatrixWorkspaceData.cpp
src/MantidWidget.cpp
src/Message.cpp
src/MessageDisplay.cpp
src/OptionsPropertyWidget.cpp
src/PropertyWidget.cpp
src/PropertyWidgetFactory.cpp
Expand All @@ -41,7 +40,6 @@ set ( MOC_FILES
inc/MantidQtAPI/ManageUserDirectories.h
inc/MantidQtAPI/MantidDialog.h
inc/MantidQtAPI/MantidWidget.h
inc/MantidQtAPI/MessageDisplay.h
inc/MantidQtAPI/OptionsPropertyWidget.h
inc/MantidQtAPI/PropertyWidget.h
inc/MantidQtAPI/PythonRunner.h
Expand Down Expand Up @@ -118,4 +116,3 @@ install ( TARGETS MantidQtAPI ${SYSTEM_PACKAGE_TARGET} DESTINATION ${LIB_DIR} )
set ( TEST_FILES
ScriptRepositoryViewTest.h
)

2 changes: 2 additions & 0 deletions Code/Mantid/MantidQt/MantidWidgets/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ set ( SRC_FILES
src/ICatSearch.cpp
src/ICatUtils.cpp
src/InstrumentSelector.cpp
src/MessageDisplay.cpp
src/MWDiag.cpp
src/MWRunFiles.cpp
src/MultifitSetupDialog.cpp
Expand Down Expand Up @@ -49,6 +50,7 @@ set ( MOC_FILES
inc/MantidQtMantidWidgets/ICatSearch.h
inc/MantidQtMantidWidgets/ICatUtils.h
inc/MantidQtMantidWidgets/InstrumentSelector.h
inc/MantidQtMantidWidgets/MessageDisplay.h
inc/MantidQtMantidWidgets/MultifitSetupDialog.h
inc/MantidQtMantidWidgets/MuonFitPropertyBrowser.h
inc/MantidQtMantidWidgets/MWDiag.h
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,9 @@ class QTextEdit;

namespace MantidQt
{
namespace API
namespace MantidWidgets
{
using API::Message; // So that the slots work
//----------------------------------------------------------
// Forward declarations
//----------------------------------------------------------
Expand Down Expand Up @@ -99,16 +100,16 @@ namespace MantidQt
/// Set the properties of the text display
void setupTextArea();
/// Sets the text color for the given priority
void setTextColor(const Message::Priority priority);
void setTextColor(const API::Message::Priority priority);
/// Returns the text color for a given priority
QColor textColor(const Message::Priority priority) const;
QColor textColor(const API::Message::Priority priority) const;
/// Appends the given text & makes sure it can be seen
void appendText(const QString & text);

/// Are we allowed to affect the log level
LogLevelControl m_logLevelControl;
/// A reference to the
QtSignalChannel *m_logChannel;
API::QtSignalChannel *m_logChannel;
/// The actual widget holding the text
QTextEdit * m_textDisplay;
/// Mutually exclusive log actions
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
//-------------------------------------------
// Includes
//-------------------------------------------
#include "MantidQtAPI/MessageDisplay.h"
#include "MantidQtMantidWidgets/MessageDisplay.h"

#include "MantidKernel/Logger.h"

Expand All @@ -20,8 +20,9 @@

namespace MantidQt
{
namespace API
namespace MantidWidgets
{
using API::Message;

//-------------------------------------------
// Public member functions
Expand All @@ -31,7 +32,7 @@ namespace MantidQt
* @param parent An optional parent widget
*/
MessageDisplay::MessageDisplay(QWidget *parent)
: QWidget(parent), m_logLevelControl(DisableLogLevelControl), m_logChannel(new QtSignalChannel),
: QWidget(parent), m_logLevelControl(DisableLogLevelControl), m_logChannel(new API::QtSignalChannel),
m_textDisplay(new QTextEdit(this)), m_loglevels(new QActionGroup(this)), m_logLevelMapping(new QSignalMapper(this)),
m_error(new QAction(tr("&Error"), this)), m_warning(new QAction(tr("&Warning"), this)),
m_notice(new QAction(tr("&Notice"), this)), m_information(new QAction(tr("&Information"), this)),
Expand All @@ -46,7 +47,7 @@ namespace MantidQt
* @param parent An optional parent widget
*/
MessageDisplay::MessageDisplay(LogLevelControl logLevelControl, QWidget *parent)
: QWidget(parent), m_logLevelControl(logLevelControl), m_logChannel(new QtSignalChannel),
: QWidget(parent), m_logLevelControl(logLevelControl), m_logChannel(new API::QtSignalChannel),
m_textDisplay(new QTextEdit(this)), m_loglevels(new QActionGroup(this)), m_logLevelMapping(new QSignalMapper(this)),
m_error(new QAction(tr("&Error"), this)), m_warning(new QAction(tr("&Warning"), this)),
m_notice(new QAction(tr("&Notice"), this)), m_information(new QAction(tr("&Information"), this)),
Expand Down

0 comments on commit d3c2712

Please sign in to comment.