Skip to content

Commit

Permalink
Allow MessageDisplay to clea & replace contents. Refs #6202
Browse files Browse the repository at this point in the history
  • Loading branch information
martyngigg committed Apr 15, 2013
1 parent c7e0fcb commit 07c8220
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 6 deletions.
8 changes: 6 additions & 2 deletions Code/Mantid/MantidQt/API/inc/MantidQtAPI/MessageDisplay.h
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,12 @@ namespace MantidQt
void attachLoggingChannel();

public slots:
/// Write a message
void displayMessage(const QString & msg);
/// Write a message after the current contents
void append(const QString & msg);
/// Replace the display text with the given contents
void replace(const QString & msg);
/// Clear all of the text
void clear();

private slots:
/// Provide a custom context menu
Expand Down
24 changes: 20 additions & 4 deletions Code/Mantid/MantidQt/API/src/MessageDisplay.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -61,18 +61,34 @@ namespace MantidQt
}

connect(m_logChannel, SIGNAL(messageReceived(const QString&)),
this, SLOT(displayMessage(const QString &)));
this, SLOT(append(const QString &)));
}


/**
* @param A message that is echoed to the display
* @param msg A message that is echoed to the display after the
* current text
*/
void MessageDisplay::displayMessage(const QString & msg)
void MessageDisplay::append(const QString & msg)
{
m_textDisplay->append(msg);
}

/**
* @param msg Replace the curren contents with this message
*/
void MessageDisplay::replace(const QString & msg)
{
m_textDisplay->setText(msg);
}

/**
* Clear all of the text
*/
void MessageDisplay::clear()
{
m_textDisplay->clear();
}

/**
*/
MessageDisplay::~MessageDisplay()
Expand Down

0 comments on commit 07c8220

Please sign in to comment.