Diffstat (limited to 'noncore/settings/networksettings/ppp/connect.h') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/settings/networksettings/ppp/connect.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/noncore/settings/networksettings/ppp/connect.h b/noncore/settings/networksettings/ppp/connect.h index e7ae5e0..b225ff5 100644 --- a/noncore/settings/networksettings/ppp/connect.h +++ b/noncore/settings/networksettings/ppp/connect.h | |||
@@ -1,152 +1,154 @@ | |||
1 | /* -*- C++ -*- | 1 | /* -*- C++ -*- |
2 | * | 2 | * |
3 | * kPPP: A pppd front end for the KDE project | 3 | * kPPP: A pppd front end for the KDE project |
4 | * | 4 | * |
5 | * $Id$ | 5 | * $Id$ |
6 | * | 6 | * |
7 | * Copyright (C) 1997 Bernd Johannes Wuebben | 7 | * Copyright (C) 1997 Bernd Johannes Wuebben |
8 | * wuebben@math.cornell.edu | 8 | * wuebben@math.cornell.edu |
9 | * | 9 | * |
10 | * based on EzPPP: | 10 | * based on EzPPP: |
11 | * Copyright (C) 1997 Jay Painter | 11 | * Copyright (C) 1997 Jay Painter |
12 | * | 12 | * |
13 | * | 13 | * |
14 | * This program is free software; you can redistribute it and/or | 14 | * This program is free software; you can redistribute it and/or |
15 | * modify it under the terms of the GNU Library General Public | 15 | * modify it under the terms of the GNU Library General Public |
16 | * License as published by the Free Software Foundation; either | 16 | * License as published by the Free Software Foundation; either |
17 | * version 2 of the License, or (at your option) any later version. | 17 | * version 2 of the License, or (at your option) any later version. |
18 | * | 18 | * |
19 | * This program is distributed in the hope that it will be useful, | 19 | * This program is distributed in the hope that it will be useful, |
20 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | 20 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
21 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | 21 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
22 | * Library General Public License for more details. | 22 | * Library General Public License for more details. |
23 | * | 23 | * |
24 | * You should have received a copy of the GNU Library General Public | 24 | * You should have received a copy of the GNU Library General Public |
25 | * License along with this program; if not, write to the Free | 25 | * License along with this program; if not, write to the Free |
26 | * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. | 26 | * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. |
27 | */ | 27 | */ |
28 | 28 | ||
29 | #ifndef _CONNECT_H_ | 29 | #ifndef _CONNECT_H_ |
30 | #define _CONNECT_H_ | 30 | #define _CONNECT_H_ |
31 | 31 | ||
32 | #include <qtimer.h> | 32 | #include <qtimer.h> |
33 | #include <qpushbutton.h> | 33 | #include <qpushbutton.h> |
34 | #include <qlabel.h> | 34 | #include <qlabel.h> |
35 | #include <qevent.h> | 35 | #include <qevent.h> |
36 | 36 | ||
37 | #include "kpppconfig.h" | 37 | #include "kpppconfig.h" |
38 | #include "pwentry.h" | 38 | #include "pwentry.h" |
39 | 39 | ||
40 | 40 | ||
41 | #define MAXLOOPNEST (MAX_SCRIPT_ENTRIES/2) | 41 | #define MAXLOOPNEST (MAX_SCRIPT_ENTRIES/2) |
42 | 42 | ||
43 | class InterfacePPP; | 43 | class InterfacePPP; |
44 | class PPPData; | 44 | class PPPData; |
45 | 45 | ||
46 | class ConnectWidget : public QWidget { | 46 | class ConnectWidget : public QWidget { |
47 | Q_OBJECT | 47 | Q_OBJECT |
48 | public: | 48 | public: |
49 | ConnectWidget(InterfacePPP*, QWidget *parent, const char *name); | 49 | ConnectWidget(InterfacePPP*, QWidget *parent, const char *name); |
50 | ~ConnectWidget(); | 50 | ~ConnectWidget(); |
51 | 51 | ||
52 | public: | 52 | public: |
53 | void set_con_speed_string(); | 53 | void set_con_speed_string(); |
54 | void setMsg(const QString &); | 54 | void setMsg(const QString &); |
55 | void pppdDied(); | 55 | void pppdDied(); |
56 | 56 | ||
57 | protected: | 57 | protected: |
58 | void timerEvent(QTimerEvent *); | 58 | void timerEvent(QTimerEvent *); |
59 | void closeEvent( QCloseEvent *e ); | 59 | void closeEvent( QCloseEvent *e ); |
60 | 60 | ||
61 | private slots: | 61 | private slots: |
62 | void readChar(unsigned char); | 62 | void readChar(unsigned char); |
63 | void pause(); | 63 | void pause(); |
64 | void if_waiting_slot(); | 64 | void if_waiting_slot(); |
65 | void refresh(); | ||
65 | 66 | ||
66 | public slots: | 67 | public slots: |
67 | void init(); | 68 | void init(); |
68 | void preinit(); | 69 | void preinit(); |
69 | void script_timed_out(); | 70 | void script_timed_out(); |
70 | void if_waiting_timed_out(); | 71 | void if_waiting_timed_out(); |
71 | void cancelbutton(); | 72 | void cancelbutton(); |
72 | 73 | ||
73 | signals: | 74 | signals: |
74 | void if_waiting_signal(); | 75 | void if_waiting_signal(); |
75 | void debugMessage(const QString &); | 76 | void debugMessage(const QString &); |
76 | void toggleDebugWindow(); | 77 | void toggleDebugWindow(); |
77 | void closeDebugWindow(); | 78 | void closeDebugWindow(); |
78 | void debugPutChar(unsigned char); | 79 | void debugPutChar(unsigned char); |
79 | void startAccounting(); | 80 | void startAccounting(); |
80 | void stopAccounting(); | 81 | void stopAccounting(); |
81 | 82 | ||
82 | public: | 83 | public: |
83 | QString myreadbuffer; // we want to keep every thing in order to fish for the | 84 | QString myreadbuffer; // we want to keep every thing in order to fish for the |
84 | 85 | ||
85 | // connection speed later on | 86 | // connection speed later on |
86 | QPushButton *debug; | 87 | QPushButton *debug; |
87 | int main_timer_ID; | 88 | int main_timer_ID; |
88 | 89 | ||
89 | private: | 90 | private: |
90 | int vmain; | 91 | int vmain; |
91 | int substate; | 92 | int substate; |
92 | int scriptindex; | 93 | int scriptindex; |
93 | QString scriptCommand, scriptArgument; | 94 | QString scriptCommand, scriptArgument; |
94 | QStringList *comlist, *arglist; | 95 | QStringList *comlist, *arglist; |
95 | 96 | ||
96 | // static const int maxloopnest=(MAX_SCRIPT_ENTRIES/2); | 97 | // static const int maxloopnest=(MAX_SCRIPT_ENTRIES/2); |
97 | int loopnest; | 98 | int loopnest; |
98 | int loopstartindex[MAXLOOPNEST]; | 99 | int loopstartindex[MAXLOOPNEST]; |
99 | bool loopend; | 100 | bool loopend; |
100 | QString loopstr[MAXLOOPNEST]; | 101 | QString loopstr[MAXLOOPNEST]; |
101 | 102 | ||
102 | bool semaphore; | 103 | bool semaphore; |
103 | QTimer *inittimer; | 104 | QTimer *inittimer; |
104 | 105 | ||
105 | QTimer *timeout_timer; | 106 | QTimer *timeout_timer; |
106 | bool execppp(); | 107 | bool execppp(); |
107 | void writeline(const QString &); | 108 | void writeline(const QString &); |
108 | void checkBuffers(); | 109 | void checkBuffers(); |
109 | 110 | ||
110 | void setExpect(const QString &); | 111 | void setExpect(const QString &); |
111 | bool expecting; | 112 | bool expecting; |
112 | QString expectstr; | 113 | QString expectstr; |
113 | 114 | ||
114 | QString readbuffer; | 115 | QString readbuffer; |
115 | 116 | ||
116 | void setScan(const QString &); | 117 | void setScan(const QString &); |
117 | QString scanvar; | 118 | QString scanvar; |
118 | QString scanstr; | 119 | QString scanstr; |
119 | QString scanbuffer; | 120 | QString scanbuffer; |
120 | bool scanning; | 121 | bool scanning; |
121 | 122 | ||
122 | bool pausing; | 123 | bool pausing; |
123 | PWEntry *prompt; | 124 | PWEntry *prompt; |
124 | // LoginTerm *termwindow; | 125 | // LoginTerm *termwindow; |
125 | 126 | ||
126 | int scriptTimeout; | 127 | int scriptTimeout; |
127 | QTimer *pausetimer; | 128 | QTimer *pausetimer; |
128 | QTimer *if_timer; | 129 | QTimer *if_timer; |
129 | QTimer *if_timeout_timer; | 130 | QTimer *if_timeout_timer; |
131 | QTimer *m_refreshTimer; | ||
130 | 132 | ||
131 | QLabel *messg; | 133 | QLabel *messg; |
132 | QPushButton *cancel; | 134 | QPushButton *cancel; |
133 | 135 | ||
134 | bool firstrunID; | 136 | bool firstrunID; |
135 | bool firstrunPW; | 137 | bool firstrunPW; |
136 | 138 | ||
137 | unsigned int dialnumber; // the current number to dial | 139 | unsigned int dialnumber; // the current number to dial |
138 | 140 | ||
139 | InterfacePPP *_ifaceppp; | 141 | InterfacePPP *_ifaceppp; |
140 | }; | 142 | }; |
141 | 143 | ||
142 | 144 | ||
143 | // non-member function to kill&wait on the pppd child process | 145 | // non-member function to kill&wait on the pppd child process |
144 | extern void killppp(PPPData*); | 146 | extern void killppp(PPPData*); |
145 | void adddns(InterfacePPP*); | 147 | void adddns(InterfacePPP*); |
146 | void addpeerdns(InterfacePPP*); | 148 | void addpeerdns(InterfacePPP*); |
147 | void removedns(InterfacePPP*); | 149 | void removedns(InterfacePPP*); |
148 | void add_domain(const QString & newdomain, InterfacePPP*); | 150 | void add_domain(const QString & newdomain, InterfacePPP*); |
149 | void auto_hostname(InterfacePPP*); | 151 | void auto_hostname(InterfacePPP*); |
150 | 152 | ||
151 | #endif | 153 | #endif |
152 | 154 | ||