Contact cannot be a null ptr, and it is accessed before anyway. Disscussed with kedge.
[kdenetwork.git] / kppp / pppstatdlg.h
blobae51238aa7cc7d49150a8df399762ce1e58c9d76
1 /*
2 * kPPP: A pppd front end for the KDE project
4 * $Id$
6 * Copyright (C) 1997 Bernd Johannes Wuebben
7 * wuebben@math.cornell.edu
10 * This program is free software; you can redistribute it and/or
11 * modify it under the terms of the GNU Library General Public
12 * License as published by the Free Software Foundation; either
13 * version 2 of the License, or (at your option) any later version.
15 * This program is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
18 * Library General Public License for more details.
20 * You should have received a copy of the GNU Library General Public
21 * License along with this program; if not, write to the Free
22 * Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
25 #ifndef PPPSTATDLG_H
26 #define PPPSTATDLG_H
28 #include <qdialog.h>
29 #include <qevent.h>
30 #include <qpixmap.h>
31 //Added by qt3to4:
32 #include <QLabel>
33 #include <QCloseEvent>
35 class QLabel;
36 class Q3GroupBox;
37 class QLineEdit;
38 class QTimer;
39 class QPushButton;
41 const int MAX_GRAPH_WIDTH = 600;
42 const int GRAPH_UPDATE_TIME = 1000;
44 class PPPStats;
46 class PPPStatsDlg : public QWidget {
48 Q_OBJECT
50 public:
52 PPPStatsDlg(QWidget *parent, const char *name,QWidget *main,
53 PPPStats *st);
54 ~PPPStatsDlg();
56 protected:
58 void closeEvent( QCloseEvent *e );
59 bool event( QEvent *e );
61 public slots:
63 void timeclick();
64 void cancel();
65 void take_stats();
66 void stop_stats();
67 void paintIcon(int);
68 void updateGraph();
70 public:
72 void update_data();
73 void toCurrentDesktop();
75 private:
76 void paintGraph();
77 PPPStats *stats;
79 QLabel *pixmap_l;
80 QWidget *main;
81 QPushButton *cancelbutton;
83 QLabel *labela1[5];
84 QLabel *labela2[5];
85 QLabel *labelb1[5];
86 QLabel *labelb2[5];
88 QLabel *ip_address_label1;
89 QLineEdit *ip_address_label2;
90 QLabel *ip_address_label3;
91 QLineEdit *ip_address_label4;
93 QLabel *modem_pic_label;
94 QPixmap modem_pixmap;
95 QPixmap modem_left_pixmap;
96 QPixmap modem_right_pixmap;
97 QPixmap modem_both_pixmap;
98 QPixmap big_modem_both_pixmap;
99 QPixmap big_modem_left_pixmap;
100 QPixmap big_modem_right_pixmap;
101 QPixmap big_modem_none_pixmap;
103 int ibytes_last;
104 int obytes_last;
105 bool need_to_paint;
107 QString ibytes_string;
108 QString ipackets_string;
109 QString compressedin_string;
110 QString uncompressedin_string;
111 QString errorin_string;
112 QString obytes_string;
113 QString opackets_string;
114 QString compressed_string;
115 QString packetsunc_string;
116 QString packetsoutunc_string;
117 Q3GroupBox *box;
119 // graph widget
120 QLabel *graph;
121 int bin[MAX_GRAPH_WIDTH];
122 int bout[MAX_GRAPH_WIDTH];
123 int bin_last;
124 int bout_last;
125 int ringIdx;
126 int max;
127 QTimer *graphTimer;
128 QColor bg, text, in, out;
131 #endif // PPPSTATDLG_H