Quantum GIS API Documentation  1.7.5-Wroclaw
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
qgsmessageoutput.cpp
Go to the documentation of this file.
1 /***************************************************************************
2  qgsmessageoutput.h - interface for showing messages
3  ----------------------
4  begin : April 2006
5  copyright : (C) 2006 by Martin Dobias
6  email : wonder.sk at gmail dot com
7  ***************************************************************************
8  * *
9  * This program is free software; you can redistribute it and/or modify *
10  * it under the terms of the GNU General Public License as published by *
11  * the Free Software Foundation; either version 2 of the License, or *
12  * (at your option) any later version. *
13  * *
14  ***************************************************************************/
15 /* $Id$ */
16 
17 #include "qgsmessageoutput.h"
18 #include "qgslogger.h"
19 
21 {
22  return new QgsMessageOutputConsole;
23 }
24 
25 // default output creator - console
27 
28 
30 {
32 }
33 
35 {
36  return mMessageOutputCreator();
37 }
38 
40 {
41 }
42 
44 // QgsMessageOutputConsole
45 
47  : mMessage( "" )
48 {
49 }
50 
51 void QgsMessageOutputConsole::setMessage( const QString& message, MessageType )
52 {
53  mMessage = message;
54 }
55 
56 void QgsMessageOutputConsole::appendMessage( const QString& message )
57 {
58  mMessage += message;
59 }
60 
62 {
63  // show title if provided
64  if ( !mTitle.isNull() )
65  {
66  QgsDebugMsg( QString( "%1:" ).arg( mTitle ) );
67  }
68 
69  // show the message
71  emit destroyed();
72  delete this;
73 }
74 
75 void QgsMessageOutputConsole::setTitle( const QString& title )
76 {
77  mTitle = title;
78 }