Skip to content

Commit

Permalink
static QgsMessageOutput::showMessage()
Browse files Browse the repository at this point in the history
  • Loading branch information
blazek committed May 20, 2015
1 parent 2dfea6a commit b89b6a5
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 2 deletions.
10 changes: 10 additions & 0 deletions src/core/qgsmessageoutput.cpp
Expand Up @@ -42,6 +42,15 @@ QgsMessageOutput::~QgsMessageOutput()
{
}


void QgsMessageOutput::showMessage( const QString& title, const QString& message, MessageType msgType )
{
QgsMessageOutput *output = QgsMessageOutput::createMessageOutput();
output->setTitle( title );
output->setMessage( message, msgType );
output->showMessage();
}

////////////////////////////////
// QgsMessageOutputConsole

Expand Down Expand Up @@ -79,3 +88,4 @@ void QgsMessageOutputConsole::setTitle( const QString& title )
{
mTitle = title;
}

9 changes: 7 additions & 2 deletions src/core/qgsmessageoutput.h
Expand Up @@ -54,16 +54,21 @@ class CORE_EXPORT QgsMessageOutput
//! set title for the messages
virtual void setTitle( const QString& title ) = 0;

//! display the message to the user
//! display the message to the user and deletes itself
virtual void showMessage( bool blocking = true ) = 0;

/** Display the blocking message to the user.
* @note added in 2.10
*/
static void showMessage( const QString& title, const QString& message, MessageType msgType );

//! sets function that will be used to create message output
//! @note not available in python bindings
// TODO: implementation where python class could be passed
static void setMessageOutputCreator( MESSAGE_OUTPUT_CREATOR f );

//! function that returns new class derived from QgsMessageOutput
//! (don't forget to delete it then)
//! (don't forget to delete it then if showMessage(bool) is not used showMessage(bool) deletes the instance)
static QgsMessageOutput* createMessageOutput();

private:
Expand Down

0 comments on commit b89b6a5

Please sign in to comment.