Skip to content

Commit

Permalink
Add single argument constructor to MessageDisplay. Refs #6202
Browse files Browse the repository at this point in the history
Allows it to be used in the designer plugins more easily.
  • Loading branch information
martyngigg committed Apr 15, 2013
1 parent d294b5f commit bd07a65
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 4 deletions.
9 changes: 6 additions & 3 deletions Code/Mantid/MantidQt/API/inc/MantidQtAPI/MessageDisplay.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,8 @@ namespace MantidQt
/** @class MessageDisplay
* Provides a widget for display messages in a text box
* It deals with Message objects which in turn hide whether
* a message is a framework Poco message or a simple string
* a message is a framework Poco message or a simple string.
* It can connect to the Mantid logging framework if required
*/
class MessageDisplay : public QWidget
{
Expand All @@ -44,8 +45,10 @@ namespace MantidQt
DisableLogLevelControl
};

/// Default constructor
MessageDisplay(LogLevelControl logLevelControl=DisableLogLevelControl,
/// Default constructor with optional parent
MessageDisplay(QWidget *parent=NULL);
/// Constructor specifying if whether control over the global log level is allowed
MessageDisplay(LogLevelControl logLevelControl,
QWidget *parent=NULL);
///Destructor
~MessageDisplay();
Expand Down
17 changes: 16 additions & 1 deletion Code/Mantid/MantidQt/API/src/MessageDisplay.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,22 @@ namespace MantidQt
// Public member functions
//-------------------------------------------
/**
* @param loggerControl Controls whether the log-level applies globally or only to this channel (default=MessageDisplay::Global)
* Constructs a widget that does not allow control over the global log level
* @param parent An optional parent widget
*/
MessageDisplay::MessageDisplay(QWidget *parent)
: QWidget(parent), m_logLevelControl(DisableLogLevelControl), m_logChannel(new 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)),
m_debug(new QAction(tr("&Debug"), this))
{
initActions();
setupTextArea();
}

/**
* @param loggerControl Controls whether the log-level applies globally or only to this channel
* @param parent An optional parent widget
*/
MessageDisplay::MessageDisplay(LogLevelControl logLevelControl, QWidget *parent)
Expand Down

0 comments on commit bd07a65

Please sign in to comment.