1 |
// qsamplerMessages.h |
// qsamplerMessages.h |
2 |
// |
// |
3 |
/**************************************************************************** |
/**************************************************************************** |
4 |
Copyright (C) 2004-2008, rncbc aka Rui Nuno Capela. All rights reserved. |
Copyright (C) 2004-2021, rncbc aka Rui Nuno Capela. All rights reserved. |
5 |
Copyright (C) 2007, Christian Schoenebeck |
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 |
26 |
#include <QDockWidget> |
#include <QDockWidget> |
27 |
|
|
28 |
class QSocketNotifier; |
class QSocketNotifier; |
29 |
class QTextEdit; |
class QTextBrowser; |
30 |
class QFile; |
class QFile; |
31 |
|
|
32 |
namespace QSampler { |
namespace QSampler { |
52 |
|
|
53 |
// Message font accessors. |
// Message font accessors. |
54 |
QFont messagesFont(); |
QFont messagesFont(); |
55 |
void setMessagesFont(const QFont & font); |
void setMessagesFont(const QFont& font); |
56 |
|
|
57 |
// Maximum number of message lines accessors. |
// Maximum number of message lines accessors. |
58 |
int messagesLimit(); |
int messagesLimit(); |
64 |
|
|
65 |
// The main utility methods. |
// The main utility methods. |
66 |
void appendMessages(const QString& s); |
void appendMessages(const QString& s); |
67 |
void appendMessagesColor(const QString& s, const QString &c); |
void appendMessagesColor(const QString& s, const QColor& rgb); |
68 |
void appendMessagesText(const QString& s); |
void appendMessagesText(const QString& s); |
69 |
|
|
70 |
// Stdout capture functions. |
// Stdout capture functions. |
74 |
// History reset. |
// History reset. |
75 |
void clear(); |
void clear(); |
76 |
|
|
77 |
signals: |
protected: |
|
|
|
|
void visibilityChanged(bool bVisible); |
|
|
|
|
|
protected slots: |
|
78 |
|
|
79 |
// Message executives. |
// Message executives. |
80 |
void appendMessagesLine(const QString& s); |
void appendMessagesLine(const QString& s); |
81 |
void appendMessagesLog(const QString& s); |
void appendMessagesLog(const QString& s); |
82 |
|
|
83 |
// overridden method of QWidget |
// Set stdout/stderr blocking mode. |
84 |
void showEvent(QShowEvent *pEvent); |
bool stdoutBlock(int fd, bool bBlock) const; |
85 |
|
|
86 |
|
// Split stdout/stderr into separate lines... |
87 |
|
void processStdoutBuffer(); |
88 |
|
|
89 |
|
protected slots: |
90 |
|
|
91 |
// Stdout capture slot. |
// Stdout capture slot. |
92 |
void stdoutNotify(int fd); |
void stdoutNotify(int fd); |
99 |
int m_iMessagesHigh; |
int m_iMessagesHigh; |
100 |
|
|
101 |
// The textview main widget. |
// The textview main widget. |
102 |
QTextEdit *m_pMessagesTextView; |
QTextBrowser *m_pMessagesTextView; |
103 |
|
|
104 |
// Stdout capture variables. |
// Stdout capture variables. |
105 |
QSocketNotifier *m_pStdoutNotifier; |
QSocketNotifier *m_pStdoutNotifier; |