~ubuntu-branches/ubuntu/trusty/icecc/trusty-proposed

« back to all changes in this revision

Viewing changes to mon/summaryview.h

  • Committer: Bazaar Package Importer
  • Author(s): Fathi Boudra
  • Date: 2006-10-14 19:44:40 UTC
  • mfrom: (3.1.4 edgy)
  • Revision ID: james.westby@ubuntu.com-20061014194440-btpn03ff14c0lxip
Tags: 0.7.14-4
Add czech and french debconf templates translations
(Closes: #389802, #391477)

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/*
2
 
 * (C) 2004 Scott Wheeler <wheeler@kde.org>
3
 
 *
4
 
 * This program is free software; you can redistribute it and/or modify
5
 
 * it under the terms of the GNU General Public License as published by
6
 
 * the Free Software Foundation; either version 2 of the License, or
7
 
 * (at your option) any later version.
8
 
 *
9
 
 */
10
 
 
11
 
#ifndef SUMMARYVIEW_H
12
 
#define SUMMARYVIEW_H
13
 
 
14
 
#include "statusview.h"
15
 
 
16
 
#include <qscrollview.h>
17
 
#include <qvaluevector.h>
18
 
 
19
 
class QLabel;
20
 
class QGridLayout;
21
 
 
22
 
class SummaryView;
23
 
 
24
 
class SummaryViewItem
25
 
{
26
 
public:
27
 
    SummaryViewItem(unsigned int hostid, QWidget *parent, SummaryView *view, QGridLayout *layout);
28
 
    ~SummaryViewItem();
29
 
    void update(const Job &job);
30
 
 
31
 
private:
32
 
    QLabel *addLine(const QString &caption, QWidget *parent, QGridLayout *grid,
33
 
                                int flags = Qt::AlignTop,
34
 
                                const QString &status = QString::null);
35
 
 
36
 
    struct JobHandler
37
 
    {
38
 
        JobHandler() : stateWidget(0), sourceLabel(0), stateLabel(0) {}
39
 
 
40
 
        QFrame *stateWidget;
41
 
        QLabel *sourceLabel;
42
 
        QLabel *stateLabel;
43
 
        QString currentFile;
44
 
    };
45
 
 
46
 
    QFrame *m_stateWidget;
47
 
    QLabel *m_jobsLabel;
48
 
    QLabel *m_sourceLabel;
49
 
 
50
 
    int m_jobCount;
51
 
    SummaryView *m_view;
52
 
 
53
 
    QValueVector<JobHandler> m_jobHandlers;
54
 
    QValueList<QWidget *> m_widgets;
55
 
};
56
 
 
57
 
class SummaryView : public QScrollView, public StatusView
58
 
{
59
 
    Q_OBJECT
60
 
 
61
 
public:
62
 
    SummaryView(HostInfoManager *h, QWidget *parent, const char *name = 0);
63
 
    ~SummaryView();
64
 
 
65
 
    virtual QWidget *widget();
66
 
    virtual void update(const Job &job);
67
 
    virtual void checkNode(unsigned int hostid);
68
 
    virtual QString id() const { return "summary"; }
69
 
 
70
 
protected:
71
 
    virtual void viewportResizeEvent(QResizeEvent *e);
72
 
 
73
 
private:
74
 
    QMap<unsigned int, SummaryViewItem *> m_items;
75
 
    QGridLayout *m_layout;
76
 
    QWidget *m_base;
77
 
};
78
 
 
79
 
#endif