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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1464 - (hide annotations) (download) (as text)
Thu Nov 1 17:14:21 2007 UTC (16 years, 5 months ago) by capela
File MIME type: text/x-c++hdr
File size: 2605 byte(s)
- Qt4 migration: missing copyright headers update.

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

  ViewVC Help
Powered by ViewVC