/[svn]/qsampler/trunk/src/qsamplerMessages.h
ViewVC logotype

Diff of /qsampler/trunk/src/qsamplerMessages.h

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 91 by capela, Wed May 26 15:55:36 2004 UTC revision 1465 by capela, Thu Nov 1 17:49:27 2007 UTC
# Line 1  Line 1 
1  // qsamplerMessages.h  // qsamplerMessages.h
2  //  //
3  /****************************************************************************  /****************************************************************************
4     Copyright (C) 2003-2004, rncbc aka Rui Nuno Capela. All rights reserved.     Copyright (C) 2004-2007, rncbc aka Rui Nuno Capela. All rights reserved.
5       Copyright (C) 2007, Christian Schoenebeck
6    
7     This program is free software; you can redistribute it and/or     This program is free software; you can redistribute it and/or
8     modify it under the terms of the GNU General Public License     modify it under the terms of the GNU General Public License
# Line 13  Line 14 
14     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15     GNU General Public License for more details.     GNU General Public License for more details.
16    
17     You should have received a copy of the GNU General Public License     You should have received a copy of the GNU General Public License along
18     along with this program; if not, write to the Free Software     with this program; if not, write to the Free Software Foundation, Inc.,
19     Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.     51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
20    
21  *****************************************************************************/  *****************************************************************************/
22    
23  #ifndef __qsamplerMessages_h  #ifndef __qsamplerMessages_h
24  #define __qsamplerMessages_h  #define __qsamplerMessages_h
25    
26  #include <qdockwindow.h>  #include <QDockWidget>
27    
28  class QSocketNotifier;  class QSocketNotifier;
29  class QTextEdit;  class QTextEdit;
# Line 32  class QTextEdit; Line 33  class QTextEdit;
33  // qsamplerMessages - Messages log dockable window.  // qsamplerMessages - Messages log dockable window.
34  //  //
35    
36  class qsamplerMessages : public QDockWindow  class qsamplerMessages : public QDockWidget
37  {  {
38      Q_OBJECT          Q_OBJECT
39    
40  public:  public:
41    
42      // Constructor.          // Constructor.
43      qsamplerMessages(QWidget *pParent, const char *pszName = 0);          qsamplerMessages(QWidget *pParent);
44      // Destructor.          // Destructor.
45      ~qsamplerMessages();          ~qsamplerMessages();
46    
47      // Stdout/stderr capture accessors.          // Stdout/stderr capture accessors.
48      bool isCaptureEnabled();          bool isCaptureEnabled();
49      void setCaptureEnabled(bool bCapture);          void setCaptureEnabled(bool bCapture);
50    
51      // Message font accessors.          // Message font accessors.
52      QFont messagesFont();          QFont messagesFont();
53      void setMessagesFont(const QFont & font);          void setMessagesFont(const QFont & font);
54    
55      // Maximum number of message lines accessors.          // Maximum number of message lines accessors.
56      int messagesLimit();          int messagesLimit();
57      void setMessagesLimit(int iMessagesLimit);          void setMessagesLimit(int iMessagesLimit);
58        
59      // The main utility methods.          // The main utility methods.
60      void appendMessages(const QString& s);          void appendMessages(const QString& s);
61      void appendMessagesColor(const QString& s, const QString &c);          void appendMessagesColor(const QString& s, const QString &c);
62      void appendMessagesText(const QString& s);          void appendMessagesText(const QString& s);
63    
64      void scrollToBottom();          // Stdout capture functions.
65            void appendStdoutBuffer(const QString& s);
66      // Stdout capture functions.          void flushStdoutBuffer();
67      void appendStdoutBuffer(const QString& s);  
68      void flushStdoutBuffer();          // History reset.
69            void clear();
70            
71  protected slots:  protected slots:
72    
73      // Stdout capture slot.          // Stdout capture slot.
74      void stdoutNotify(int fd);          void stdoutNotify(int fd);
75    
76  private:  private:
77    
78      // The maximum number of message lines.          // The maximum number of message lines.
79      int m_iMessagesLimit;          int m_iMessagesLines;
80                int m_iMessagesLimit;
81      // The textview main widget.          int m_iMessagesHigh;
82      QTextEdit *m_pTextView;  
83                // The textview main widget.
84      // Stdout capture variables.          QTextEdit *m_pTextView;
85      QSocketNotifier *m_pStdoutNotifier;  
86      QString          m_sStdoutBuffer;          // Stdout capture variables.
87      int              m_fdStdout[2];          QSocketNotifier *m_pStdoutNotifier;
88            QString          m_sStdoutBuffer;
89            int              m_fdStdout[2];
90  };  };
91    
92    

Legend:
Removed from v.91  
changed lines
  Added in v.1465

  ViewVC Help
Powered by ViewVC