Diffstat (limited to 'noncore/net/wellenreiter/gui/logwindow.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/net/wellenreiter/gui/logwindow.cpp | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/noncore/net/wellenreiter/gui/logwindow.cpp b/noncore/net/wellenreiter/gui/logwindow.cpp index 55e2ccb..12f74fd 100644 --- a/noncore/net/wellenreiter/gui/logwindow.cpp +++ b/noncore/net/wellenreiter/gui/logwindow.cpp | |||
@@ -1,47 +1,50 @@ | |||
1 | /********************************************************************** | 1 | /********************************************************************** |
2 | ** Copyright (C) 2002 Michael 'Mickey' Lauer. All rights reserved. | 2 | ** Copyright (C) 2002 Michael 'Mickey' Lauer. All rights reserved. |
3 | ** | 3 | ** |
4 | ** This file is part of Opie Environment. | 4 | ** This file is part of Opie Environment. |
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 | #include <qmultilineedit.h> | 17 | #include <qmultilineedit.h> |
18 | #include <qdatetime.h> | 18 | #include <qdatetime.h> |
19 | 19 | ||
20 | MLogWindow::MLogWindow( QWidget * parent, const char * name, WFlags f ) | 20 | MLogWindow::MLogWindow( QWidget * parent, const char * name, WFlags f ) |
21 | :QVBox( parent, name, f ) | 21 | :QVBox( parent, name, f ) |
22 | { | 22 | { |
23 | ledit = new QMultiLineEdit( this ); | 23 | ledit = new QMultiLineEdit( this ); |
24 | 24 | ledit->setReadOnly( true ); | |
25 | // FIXME: Set properties( font, read-only, etc...) | ||
26 | |||
27 | } | 25 | } |
28 | 26 | ||
27 | |||
29 | void MLogWindow::log( QString text ) | 28 | void MLogWindow::log( QString text ) |
30 | { | 29 | { |
31 | QTime time = QTime::currentTime(); | 30 | QTime time = QTime::currentTime(); |
32 | QString line; | 31 | QString line; |
33 | line.sprintf( "[%s] %s", (const char*) time.toString(), (const char*) text ); | 32 | line.sprintf( "[%s] %s\n", (const char*) time.toString(), (const char*) text ); |
34 | ledit->append( line ); | 33 | int col; |
34 | int row; | ||
35 | ledit->getCursorPosition( &col, &row ); | ||
36 | ledit->insertAt( line, col, row ); | ||
35 | qDebug( line ); | 37 | qDebug( line ); |
36 | |||
37 | } | 38 | } |
38 | 39 | ||
40 | |||
39 | void MLogWindow::clear() | 41 | void MLogWindow::clear() |
40 | { | 42 | { |
41 | ledit->clear(); | 43 | ledit->clear(); |
42 | } | 44 | } |
43 | 45 | ||
46 | |||
44 | const QString MLogWindow::getLog() const | 47 | const QString MLogWindow::getLog() const |
45 | { | 48 | { |
46 | return ledit->text(); | 49 | return ledit->text(); |
47 | } | 50 | } |