summaryrefslogtreecommitdiff
path: root/noncore/net/wellenreiter/gui/logwindow.cpp
Unidiff
Diffstat (limited to 'noncore/net/wellenreiter/gui/logwindow.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/net/wellenreiter/gui/logwindow.cpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/noncore/net/wellenreiter/gui/logwindow.cpp b/noncore/net/wellenreiter/gui/logwindow.cpp
index 1c72cf4..714a9a9 100644
--- a/noncore/net/wellenreiter/gui/logwindow.cpp
+++ b/noncore/net/wellenreiter/gui/logwindow.cpp
@@ -5,49 +5,55 @@
5** 5**
6** This file may be distributed and/or modified under the terms of the 6** This file may be distributed and/or modified under the terms of the
7** GNU General Public License version 2 as published by the Free Software 7** GNU General Public License version 2 as published by the Free Software
8** Foundation and appearing in the file LICENSE.GPL included in the 8** Foundation and appearing in the file LICENSE.GPL included in the
9** packaging of this file. 9** packaging of this file.
10** 10**
11** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE 11** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
12** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. 12** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
13** 13**
14**********************************************************************/ 14**********************************************************************/
15 15
16#include "logwindow.h" 16#include "logwindow.h"
17
18/* OPIE */
19#include <opie2/odebug.h>
20using namespace Opie::Core;
21
22/* QT */
17#include <qmultilineedit.h> 23#include <qmultilineedit.h>
18#include <qdatetime.h> 24#include <qdatetime.h>
19 25
20MLogWindow* MLogWindow::_instance; 26MLogWindow* MLogWindow::_instance;
21 27
22MLogWindow::MLogWindow( QWidget * parent, const char * name, WFlags f ) 28MLogWindow::MLogWindow( QWidget * parent, const char * name, WFlags f )
23 :QVBox( parent, name, f ) 29 :QVBox( parent, name, f )
24{ 30{
25 ledit = new QMultiLineEdit( this ); 31 ledit = new QMultiLineEdit( this );
26 ledit->setReadOnly( true ); 32 ledit->setReadOnly( true );
27 33
28 MLogWindow::_instance = this; 34 MLogWindow::_instance = this;
29} 35}
30 36
31 37
32void MLogWindow::log( QString text ) 38void MLogWindow::log( QString text )
33{ 39{
34 QTime time = QTime::currentTime(); 40 QTime time = QTime::currentTime();
35 QString line; 41 QString line;
36 line.sprintf( "[%s] %s\n", (const char*) time.toString(), (const char*) text ); 42 line.sprintf( "[%s] %s\n", (const char*) time.toString(), (const char*) text );
37 int col; 43 int col;
38 int row; 44 int row;
39 ledit->getCursorPosition( &col, &row ); 45 ledit->getCursorPosition( &col, &row );
40 ledit->insertAt( line, col, row ); 46 ledit->insertAt( line, col, row );
41 qDebug( line ); 47 odebug << line << oendl;
42} 48}
43 49
44 50
45void MLogWindow::clear() 51void MLogWindow::clear()
46{ 52{
47 ledit->clear(); 53 ledit->clear();
48} 54}
49 55
50 56
51const QString MLogWindow::getLog() const 57const QString MLogWindow::getLog() const
52{ 58{
53 return ledit->text(); 59 return ledit->text();