summaryrefslogtreecommitdiffstats
path: root/src/logviewer.h
blob: ca210076f54bb555bfafd020cc1fc59d7fc7f54e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113


#ifndef LOGVIEWER_H
#define LOGVIEWER_H

#include <tdelistview.h>
#include <kdialog.h>


class KPushButton;
class Logger;

/**
 * @short The items for the log viewer list
 * @author Daniel Faust <hessijames@gmail.com>
 * @version 0.3
 */
class LogViewerItem : public TDEListViewItem
{
public:
    /**
     * Constructor
     * @param parent The parent list view
     * @param after The item, the new item should be placed after
     * @param label1 The text for the first column
     */
    LogViewerItem( TDEListView* parent, LogViewerItem* after, TQString label1 );

    /**
     * Constructor
     * @param parent The parent list view item
     * @param after The item, the new item should be placed after
     * @param label1 The text for the first column
     */
    LogViewerItem( LogViewerItem* parent, LogViewerItem* after, TQString label1 );

    /**
     * Destructor
     */
    virtual ~LogViewerItem();

    virtual void paintCell( TQPainter* p, const TQColorGroup& cg, int column, int width, int alignment );

    LogViewerItem* nextSibling() const { return static_cast<LogViewerItem*>( TDEListViewItem::nextSibling() ); }
    LogViewerItem* firstChild() const { return static_cast<LogViewerItem*>( TDEListViewItem::firstChild() ); }

    bool converting;
};


/**
 * @short The log viewer list
 * @author Daniel Faust <hessijames@gmail.com>
 * @version 0.3
 */
class LogViewerList : public TDEListView
{
    TQ_OBJECT
  
public:
    /**
     * Constructor
     * @param parent The parent widget
     * @param name The name of the file list
     */
    LogViewerList( TQWidget * parent = 0, const char* name = 0 );

    /**
     * Destructor
     */
    virtual ~LogViewerList();

    LogViewerItem* firstChild() const { return static_cast<LogViewerItem*>( TDEListView::firstChild() ); }
};


/**
 * @short Shows the logs that are collected by the logger
 * @author Daniel Faust <hessijames@gmail.com>
 * @version 0.3
 */
class LogViewer : public KDialog
{
    TQ_OBJECT
  
public:
    /**
     * Default Constructor
     */
    LogViewer( Logger* _logger, TQWidget* parent=0, const char* name = 0, bool modal = true, WFlags f = 0 );

    /**
     * Default Destructor
     */
    virtual ~LogViewer();

private:
    Logger* logger;
    LogViewerList* lLogs;
    KPushButton* pOk;
    KPushButton* pReload;

private slots:
    void refillLogs();
    void updateProcess( int id );

public slots:
    /** get notification when a job has been removed */
    void processRemoved( int id );

};

#endif // LOGVIEWER_H