1 |
// qsamplerMessages.cpp |
// qsamplerMessages.cpp |
2 |
// |
// |
3 |
/**************************************************************************** |
/**************************************************************************** |
4 |
Copyright (C) 2003-2004, rncbc aka Rui Nuno Capela. All rights reserved. |
Copyright (C) 2003-2005, rncbc aka Rui Nuno Capela. All rights reserved. |
5 |
|
|
6 |
This program is free software; you can redistribute it and/or |
This program is free software; you can redistribute it and/or |
7 |
modify it under the terms of the GNU General Public License |
modify it under the terms of the GNU General Public License |
51 |
qsamplerMessages::qsamplerMessages ( QWidget *pParent, const char *pszName ) |
qsamplerMessages::qsamplerMessages ( QWidget *pParent, const char *pszName ) |
52 |
: QDockWindow(pParent, pszName) |
: QDockWindow(pParent, pszName) |
53 |
{ |
{ |
54 |
|
#if QT_VERSION >= 0x030200 |
55 |
|
m_pTextView->setTextFormat(Qt::LogText); |
56 |
|
#endif |
57 |
// Initialize default message limit. |
// Initialize default message limit. |
58 |
setMessagesLimit(QSAMPLER_MESSAGES_MAXLINES); |
setMessagesLimit(QSAMPLER_MESSAGES_MAXLINES); |
59 |
|
|
198 |
{ |
{ |
199 |
m_iMessagesLimit = iMessagesLimit; |
m_iMessagesLimit = iMessagesLimit; |
200 |
m_iMessagesHigh = iMessagesLimit + (iMessagesLimit / 3); |
m_iMessagesHigh = iMessagesLimit + (iMessagesLimit / 3); |
201 |
|
#if QT_VERSION >= 0x030200 |
202 |
|
m_pTextView->setMaxLogLines(iMessagesLimit); |
203 |
|
#endif |
204 |
} |
} |
205 |
|
|
206 |
|
|
217 |
|
|
218 |
void qsamplerMessages::appendMessagesText ( const QString& s ) |
void qsamplerMessages::appendMessagesText ( const QString& s ) |
219 |
{ |
{ |
220 |
|
#if QT_VERSION < 0x030200 |
221 |
// Check for message line limit... |
// Check for message line limit... |
222 |
if (m_iMessagesLimit > 0) { |
if (m_iMessagesLimit > 0) { |
223 |
int iParagraphs = m_pTextView->paragraphs(); |
int iParagraphs = m_pTextView->paragraphs(); |
231 |
m_pTextView->setUpdatesEnabled(true); |
m_pTextView->setUpdatesEnabled(true); |
232 |
} |
} |
233 |
} |
} |
234 |
|
#endif |
235 |
m_pTextView->append(s); |
m_pTextView->append(s); |
236 |
} |
} |
237 |
|
|